diff --git a/app/ferroehr/src/storage/slim.rs b/app/ferroehr/src/storage/slim.rs index a9f11f5c06..0d1eef00af 100644 --- a/app/ferroehr/src/storage/slim.rs +++ b/app/ferroehr/src/storage/slim.rs @@ -436,15 +436,14 @@ mod tests { typed * 10 > rows, "only {typed} of {rows} rows hold a typed value" ); - // The CKM examples carry 625 archetype roots below the root, 19 of - // them with an id the recasing does not give back, their own roots, - // and 270 entries. + // The CKM examples move 630 archetype headers below the root and + // carry 267 entries. assert!( - archetyped >= 600, + archetyped >= 630, "only {archetyped} archetype headers moved" ); assert!( - language >= 270 && encoding >= 270, + language >= 267 && encoding >= 267, "{language} languages, {encoding} encodings" ); // Every entry names its subject, and every history and event its time. diff --git a/changelog.d/6663-demo-dataset-every-viewer-surface.added.md b/changelog.d/6663-demo-dataset-every-viewer-surface.added.md new file mode 100644 index 0000000000..1a00b42e85 --- /dev/null +++ b/changelog.d/6663-demo-dataset-every-viewer-surface.added.md @@ -0,0 +1 @@ +- The synthetic demo dataset now fills every viewer page. One seed (`scripts/sandbox/reseed.sh` and its manifest) loads it into the hosted sandbox every night and into the browser journeys' stack, through the public API alone. It writes patient `PERSON`s with their record subjects, the provider organisation, care teams, a system client and the `ROLE`s that grant, representations, care relationships, the access policy in two versions with a justified and an emergency access between them, EHR access settings, a restriction of processing, a research objection, an access delay, retention periods with something due, attested versions, ADL 1.4 archetypes and a cohort query. On the sandbox, two more demo logins join `ferroehr`: `ferroehr-clinician` and `ferroehr-proxy`. In the journeys' lane, versions are signed with ML-DSA-65+Ed25519 under a committed test key, and the access log is sealed into a signed checkpoint that verifies. The sandbox and development postures admit the access-control grants the dataset writes; the production defaults are unchanged. diff --git a/corpus/templates/ckm/eprescription-fhir.example.json b/corpus/templates/ckm/eprescription-fhir.example.json index 0e8a8ce43c..42d96d4713 100644 --- a/corpus/templates/ckm/eprescription-fhir.example.json +++ b/corpus/templates/ckm/eprescription-fhir.example.json @@ -953,7 +953,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0002" + "value": "Tree" } }, "name": { @@ -1014,7 +1014,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0005" + "value": "Dose amount description" } }, "subject": { @@ -1024,6 +1024,28 @@ ], "context": { "_type": "EVENT_CONTEXT", + "other_context": { + "_type": "ITEM_TREE", + "archetype_node_id": "at0001", + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "at0008", + "name": { + "_type": "DV_TEXT", + "value": "Prescription identifier" + }, + "value": { + "_type": "DV_IDENTIFIER", + "id": "example-id" + } + } + ], + "name": { + "_type": "DV_TEXT", + "value": "Tree" + } + }, "setting": { "_type": "DV_CODED_TEXT", "defining_code": { diff --git a/corpus/templates/ckm/ereferral.example.json b/corpus/templates/ckm/ereferral.example.json index 281d3d279b..0e0db42e0b 100644 --- a/corpus/templates/ckm/ereferral.example.json +++ b/corpus/templates/ckm/ereferral.example.json @@ -184,7 +184,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0009" + "value": "Tree" } }, "name": { @@ -1449,7 +1449,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0008" + "value": "Tree" } }, "subject": { @@ -1512,7 +1512,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Tree" } }, "encoding": { @@ -1593,7 +1593,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "structure" } }, "encoding": { @@ -1682,7 +1682,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "structure" } }, "encoding": { @@ -1739,7 +1739,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "List" } }, "encoding": { @@ -1822,7 +1822,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Tree" } }, "encoding": { @@ -1854,7 +1854,7 @@ "activities": [ { "_type": "ACTIVITY", - "action_archetype_id": "/.*/", + "action_archetype_id": "openEHR-EHR-ACTION.medication.v1", "archetype_node_id": "at0001", "description": { "_type": "ITEM_TREE", @@ -1887,7 +1887,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "openEHR-EHR-ITEM_TREE.medication.v1" + "value": "Medication description" } }, "name": { @@ -1963,7 +1963,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "List" } }, "encoding": { @@ -1996,225 +1996,6 @@ "value": "Current Medications" } }, - { - "_type": "SECTION", - "archetype_details": { - "_type": "ARCHETYPED", - "archetype_id": { - "_type": "ARCHETYPE_ID", - "value": "openEHR-EHR-SECTION.adverse_list.v1" - }, - "rm_version": "1.2.0" - }, - "archetype_node_id": "openEHR-EHR-SECTION.adverse_list.v1", - "items": [ - { - "_type": "EVALUATION", - "archetype_details": { - "_type": "ARCHETYPED", - "archetype_id": { - "_type": "ARCHETYPE_ID", - "value": "openEHR-EHR-EVALUATION.exclusion-adverse.v1" - }, - "rm_version": "1.2.0" - }, - "archetype_node_id": "openEHR-EHR-EVALUATION.exclusion-adverse.v1", - "data": { - "_type": "ITEM_TREE", - "archetype_node_id": "at0001", - "items": [ - { - "_type": "ELEMENT", - "archetype_node_id": "at0002.1", - "name": { - "_type": "DV_TEXT", - "value": "Global Statement" - }, - "value": { - "_type": "DV_CODED_TEXT", - "defining_code": { - "_type": "CODE_PHRASE", - "code_string": "at0.3", - "terminology_id": { - "_type": "TERMINOLOGY_ID", - "value": "local" - } - }, - "value": "No known adverse reactions" - } - } - ], - "name": { - "_type": "DV_TEXT", - "value": "at0001" - } - }, - "encoding": { - "_type": "CODE_PHRASE", - "code_string": "UTF-8", - "terminology_id": { - "_type": "TERMINOLOGY_ID", - "value": "IANA_character-sets" - } - }, - "language": { - "_type": "CODE_PHRASE", - "code_string": "en", - "terminology_id": { - "_type": "TERMINOLOGY_ID", - "value": "ISO_639-1" - } - }, - "name": { - "_type": "DV_TEXT", - "value": "Exclusion statement - Adverse Reaction" - }, - "subject": { - "_type": "PARTY_SELF" - } - }, - { - "_type": "EVALUATION", - "archetype_details": { - "_type": "ARCHETYPED", - "archetype_id": { - "_type": "ARCHETYPE_ID", - "value": "openEHR-EHR-EVALUATION.adverse.v1" - }, - "rm_version": "1.2.0" - }, - "archetype_node_id": "openEHR-EHR-EVALUATION.adverse.v1", - "data": { - "_type": "ITEM_TREE", - "archetype_node_id": "at0002", - "items": [ - { - "_type": "ELEMENT", - "archetype_node_id": "at0003", - "name": { - "_type": "DV_TEXT", - "value": "Agent description" - }, - "value": { - "_type": "DV_TEXT", - "value": "Agent description" - } - }, - { - "_type": "CLUSTER", - "archetype_node_id": "at0019", - "items": [ - { - "_type": "ELEMENT", - "archetype_node_id": "at0022", - "name": { - "_type": "DV_TEXT", - "value": "Reaction description" - }, - "value": { - "_type": "DV_TEXT", - "value": "Reaction description" - } - } - ], - "name": { - "_type": "DV_TEXT", - "value": "Exposure and reaction detail" - } - } - ], - "name": { - "_type": "DV_TEXT", - "value": "at0002" - } - }, - "encoding": { - "_type": "CODE_PHRASE", - "code_string": "UTF-8", - "terminology_id": { - "_type": "TERMINOLOGY_ID", - "value": "IANA_character-sets" - } - }, - "language": { - "_type": "CODE_PHRASE", - "code_string": "en", - "terminology_id": { - "_type": "TERMINOLOGY_ID", - "value": "ISO_639-1" - } - }, - "name": { - "_type": "DV_TEXT", - "value": "Adverse reaction" - }, - "subject": { - "_type": "PARTY_SELF" - } - }, - { - "_type": "EVALUATION", - "archetype_details": { - "_type": "ARCHETYPED", - "archetype_id": { - "_type": "ARCHETYPE_ID", - "value": "openEHR-EHR-EVALUATION.clinical_synopsis.v1" - }, - "rm_version": "1.2.0" - }, - "archetype_node_id": "openEHR-EHR-EVALUATION.clinical_synopsis.v1", - "data": { - "_type": "ITEM_TREE", - "archetype_node_id": "at0001", - "items": [ - { - "_type": "ELEMENT", - "archetype_node_id": "at0002", - "name": { - "_type": "DV_TEXT", - "value": "Synopsis" - }, - "value": { - "_type": "DV_TEXT", - "value": "Synopsis" - } - } - ], - "name": { - "_type": "DV_TEXT", - "value": "at0001" - } - }, - "encoding": { - "_type": "CODE_PHRASE", - "code_string": "UTF-8", - "terminology_id": { - "_type": "TERMINOLOGY_ID", - "value": "IANA_character-sets" - } - }, - "language": { - "_type": "CODE_PHRASE", - "code_string": "en", - "terminology_id": { - "_type": "TERMINOLOGY_ID", - "value": "ISO_639-1" - } - }, - "name": { - "_type": "DV_TEXT", - "value": "Allergies/Adverse Reactions overview" - }, - "subject": { - "_type": "PARTY_SELF" - } - } - ], - "name": { - "_type": "DV_TEXT", - "value": "Allergies/Adverse Reactions" - } - }, { "_type": "SECTION", "archetype_details": { @@ -2293,6 +2074,26 @@ "value": "Interim" } }, + { + "_type": "ELEMENT", + "archetype_node_id": "at0078", + "name": { + "_type": "DV_TEXT", + "value": "Result" + }, + "value": { + "_type": "DV_CODED_TEXT", + "defining_code": { + "_type": "CODE_PHRASE", + "code_string": "at0000", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "local" + } + }, + "value": "Example" + } + }, { "_type": "ELEMENT", "archetype_node_id": "at0057", @@ -2332,12 +2133,12 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "name": { "_type": "DV_TEXT", - "value": "at0002" + "value": "Any event" }, "time": { "_type": "DV_DATE_TIME", @@ -2347,7 +2148,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Event Series" }, "origin": { "_type": "DV_DATE_TIME", @@ -2393,7 +2194,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0004" + "value": "Tree" } }, "subject": { @@ -2499,7 +2300,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "name": { @@ -2514,7 +2315,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "history" }, "origin": { "_type": "DV_DATE_TIME", @@ -2575,7 +2376,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "List" } }, "encoding": { @@ -2611,6 +2412,440 @@ ], "context": { "_type": "EVENT_CONTEXT", + "other_context": { + "_type": "ITEM_TREE", + "archetype_node_id": "at0001", + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "at0028", + "name": { + "_type": "DV_TEXT", + "value": "Requestor Identifier" + }, + "value": { + "_type": "DV_TEXT", + "value": "Requestor Identifier" + } + }, + { + "_type": "CLUSTER", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "openEHR-EHR-CLUSTER.individual_personal.v1" + }, + "rm_version": "1.2.0" + }, + "archetype_node_id": "openEHR-EHR-CLUSTER.individual_personal.v1", + "items": [ + { + "_type": "CLUSTER", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "openEHR-EHR-CLUSTER.person_name.v1" + }, + "rm_version": "1.2.0" + }, + "archetype_node_id": "openEHR-EHR-CLUSTER.person_name.v1", + "items": [ + { + "_type": "CLUSTER", + "archetype_node_id": "at0013", + "items": [ + { + "_type": "CLUSTER", + "archetype_node_id": "at0002", + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "at0003", + "name": { + "_type": "DV_TEXT", + "value": "Given name" + }, + "value": { + "_type": "DV_TEXT", + "value": "Given name" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "at0004", + "name": { + "_type": "DV_TEXT", + "value": "Middle name" + }, + "value": { + "_type": "DV_CODED_TEXT", + "defining_code": { + "_type": "CODE_PHRASE", + "code_string": "at0000", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "local" + } + }, + "value": "Example" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "at0005", + "name": { + "_type": "DV_TEXT", + "value": "Family name" + }, + "value": { + "_type": "DV_TEXT", + "value": "Family name" + } + } + ], + "name": { + "_type": "DV_TEXT", + "value": "Structured name" + } + } + ], + "name": { + "_type": "DV_TEXT", + "value": "Personal name" + } + } + ], + "name": { + "_type": "DV_TEXT", + "value": "Personal name" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "at0016", + "name": { + "_type": "DV_TEXT", + "value": "Identifier" + }, + "value": { + "_type": "DV_TEXT", + "value": "Identifier" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "at0007", + "name": { + "_type": "DV_TEXT", + "value": "Date of Birth" + }, + "value": { + "_type": "DV_DATE_TIME", + "value": "2022-02-03T04:05:06Z" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "at0017", + "name": { + "_type": "DV_TEXT", + "value": "Sex" + }, + "value": { + "_type": "DV_CODED_TEXT", + "defining_code": { + "_type": "CODE_PHRASE", + "code_string": "at0020", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "local" + } + }, + "value": "Male" + } + }, + { + "_type": "CLUSTER", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "openEHR-EHR-CLUSTER.address.v1" + }, + "rm_version": "1.2.0" + }, + "archetype_node_id": "openEHR-EHR-CLUSTER.address.v1", + "items": [ + { + "_type": "CLUSTER", + "archetype_node_id": "at0001", + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "at0006", + "name": { + "_type": "DV_TEXT", + "value": "Address Type" + }, + "value": { + "_type": "DV_CODED_TEXT", + "defining_code": { + "_type": "CODE_PHRASE", + "code_string": "at0011", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "local" + } + }, + "value": "Residential" + } + }, + { + "_type": "CLUSTER", + "archetype_node_id": "at0003", + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "at0005", + "name": { + "_type": "DV_TEXT", + "value": "Property number" + }, + "value": { + "_type": "DV_TEXT", + "value": "Property number" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "at0009", + "name": { + "_type": "DV_TEXT", + "value": "Address line" + }, + "value": { + "_type": "DV_TEXT", + "value": "Address line" + } + } + ], + "name": { + "_type": "DV_TEXT", + "value": "Structured address" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "at0004", + "name": { + "_type": "DV_TEXT", + "value": "Post code" + }, + "value": { + "_type": "DV_TEXT", + "value": "Post code" + } + } + ], + "name": { + "_type": "DV_TEXT", + "value": "Address" + } + } + ], + "name": { + "_type": "DV_TEXT", + "value": "Address" + } + }, + { + "_type": "CLUSTER", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "openEHR-EHR-CLUSTER.telecom_details.v1" + }, + "rm_version": "1.2.0" + }, + "archetype_node_id": "openEHR-EHR-CLUSTER.telecom_details.v1", + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "at0010", + "name": { + "_type": "DV_TEXT", + "value": "Mode" + }, + "value": { + "_type": "DV_CODED_TEXT", + "defining_code": { + "_type": "CODE_PHRASE", + "code_string": "at0011", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "local" + } + }, + "value": "Home" + } + }, + { + "_type": "CLUSTER", + "archetype_node_id": "at0001", + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "at0004", + "name": { + "_type": "DV_TEXT", + "value": "Telecoms type" + }, + "value": { + "_type": "DV_CODED_TEXT", + "defining_code": { + "_type": "CODE_PHRASE", + "code_string": "at0013", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "local" + } + }, + "value": "Telephone" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "at0002", + "name": { + "_type": "DV_TEXT", + "value": "Unstuctured telecoms" + }, + "value": { + "_type": "DV_TEXT", + "value": "Unstuctured telecoms" + } + }, + { + "_type": "CLUSTER", + "archetype_node_id": "at0003", + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "at0005", + "name": { + "_type": "DV_TEXT", + "value": "Country code" + }, + "value": { + "_type": "DV_TEXT", + "value": "Country code" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "at0006", + "name": { + "_type": "DV_TEXT", + "value": "Area code" + }, + "value": { + "_type": "DV_TEXT", + "value": "Area code" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "at0007", + "name": { + "_type": "DV_TEXT", + "value": "Number" + }, + "value": { + "_type": "DV_TEXT", + "value": "Number" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "at0019", + "name": { + "_type": "DV_TEXT", + "value": "Extension" + }, + "value": { + "_type": "DV_TEXT", + "value": "Extension" + } + } + ], + "name": { + "_type": "DV_TEXT", + "value": "Structured telecoms" + } + } + ], + "name": { + "_type": "DV_TEXT", + "value": "Telecoms" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "at0009", + "name": { + "_type": "DV_TEXT", + "value": "Email address" + }, + "value": { + "_type": "DV_TEXT", + "value": "Email address" + } + } + ], + "name": { + "_type": "DV_TEXT", + "value": "Telecom details" + } + } + ], + "name": { + "_type": "DV_TEXT", + "value": "Patient" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "at0039", + "name": { + "_type": "DV_TEXT", + "value": "DateTime attested" + }, + "value": { + "_type": "DV_DATE_TIME", + "value": "2022-02-03T04:05:06Z" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "at0040", + "name": { + "_type": "DV_TEXT", + "value": "Document Status" + }, + "value": { + "_type": "DV_TEXT", + "value": "Document Status" + } + } + ], + "name": { + "_type": "DV_TEXT", + "value": "Tree" + } + }, "setting": { "_type": "DV_CODED_TEXT", "defining_code": { diff --git a/corpus/templates/ckm/international-patient-summary.example.json b/corpus/templates/ckm/international-patient-summary.example.json index 125480a58c..32d8e6dd4b 100644 --- a/corpus/templates/ckm/international-patient-summary.example.json +++ b/corpus/templates/ckm/international-patient-summary.example.json @@ -800,7 +800,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0017" + "value": "Tree" } }, "encoding": { @@ -817,25 +817,25 @@ "_type": "DV_CODED_TEXT", "defining_code": { "_type": "CODE_PHRASE", - "code_string": "at0007", + "code_string": "at0109", "terminology_id": { "_type": "TERMINOLOGY_ID", "value": "local" } }, - "value": "Medication course completed" + "value": "Medication recommended" }, "current_state": { "_type": "DV_CODED_TEXT", "defining_code": { "_type": "CODE_PHRASE", - "code_string": "532", + "code_string": "526", "terminology_id": { "_type": "TERMINOLOGY_ID", "value": "openehr" } }, - "value": "completed" + "value": "planned" } }, "language": { @@ -869,7 +869,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0030" + "value": "Tree" } }, "subject": { @@ -918,7 +918,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Tree" } }, "encoding": { @@ -975,7 +975,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Tree" } }, "encoding": { @@ -1017,7 +1017,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "subject": { @@ -1190,7 +1190,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Tree" } }, "encoding": { @@ -1232,7 +1232,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0042" + "value": "Tree" } }, "subject": { @@ -1277,7 +1277,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Tree" } }, "encoding": { @@ -1334,7 +1334,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Tree" } }, "encoding": { @@ -1376,7 +1376,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "subject": { @@ -1605,7 +1605,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "structure" } }, "encoding": { @@ -1647,7 +1647,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0032" + "value": "Tree" } }, "subject": { @@ -1692,7 +1692,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Tree" } }, "encoding": { @@ -1749,7 +1749,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Tree" } }, "encoding": { @@ -1791,7 +1791,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "subject": { @@ -1892,7 +1892,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0017" + "value": "Tree" } }, "encoding": { @@ -1980,7 +1980,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Tree" } }, "encoding": { @@ -2022,7 +2022,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "subject": { @@ -2089,7 +2089,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Tree" } }, "encoding": { @@ -2106,25 +2106,25 @@ "_type": "DV_CODED_TEXT", "defining_code": { "_type": "CODE_PHRASE", - "code_string": "at0043", + "code_string": "at0004", "terminology_id": { "_type": "TERMINOLOGY_ID", "value": "local" } }, - "value": "Procedure completed" + "value": "Procedure planned" }, "current_state": { "_type": "DV_CODED_TEXT", "defining_code": { "_type": "CODE_PHRASE", - "code_string": "532", + "code_string": "526", "terminology_id": { "_type": "TERMINOLOGY_ID", "value": "openehr" } }, - "value": "completed" + "value": "planned" } }, "language": { @@ -2177,7 +2177,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Tree" } }, "encoding": { @@ -2219,7 +2219,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "subject": { @@ -2264,7 +2264,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Tree" } }, "encoding": { @@ -2547,7 +2547,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Tree" } }, "encoding": { @@ -2715,6 +2715,26 @@ "_type": "DV_TEXT", "value": "Analyte name" } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "at0001", + "name": { + "_type": "DV_TEXT", + "value": "Analyte result" + }, + "value": { + "_type": "DV_CODED_TEXT", + "defining_code": { + "_type": "CODE_PHRASE", + "code_string": "at0000", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "local" + } + }, + "value": "Example" + } } ], "name": { @@ -2791,7 +2811,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "name": { @@ -2806,7 +2826,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Event Series" }, "origin": { "_type": "DV_DATE_TIME", @@ -3138,7 +3158,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "name": { @@ -3153,7 +3173,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Event Series" }, "origin": { "_type": "DV_DATE_TIME", @@ -3383,7 +3403,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0025" + "value": "Tree" } }, "subject": { @@ -3446,7 +3466,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Simple" } }, "name": { @@ -3461,7 +3481,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0002" + "value": "history" }, "origin": { "_type": "DV_DATE_TIME", @@ -3530,7 +3550,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Simple" } }, "name": { @@ -3545,7 +3565,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "history" }, "origin": { "_type": "DV_DATE_TIME", @@ -3614,7 +3634,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "List" } }, "name": { @@ -3629,7 +3649,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "history" }, "origin": { "_type": "DV_DATE_TIME", @@ -3698,7 +3718,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "structure" } }, "name": { @@ -3713,7 +3733,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0002" + "value": "history" }, "origin": { "_type": "DV_DATE_TIME", @@ -3782,7 +3802,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Tree" } }, "name": { @@ -3797,7 +3817,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0002" + "value": "History" }, "origin": { "_type": "DV_DATE_TIME", @@ -3866,7 +3886,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "name": { @@ -3881,7 +3901,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Event Series" }, "origin": { "_type": "DV_DATE_TIME", @@ -3951,7 +3971,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "name": { @@ -3966,7 +3986,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Event Series" }, "origin": { "_type": "DV_DATE_TIME", @@ -4035,7 +4055,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Single" } }, "name": { @@ -4050,7 +4070,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "history" }, "origin": { "_type": "DV_DATE_TIME", @@ -4132,7 +4152,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "blood pressure" } }, "name": { @@ -4147,7 +4167,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "History" }, "origin": { "_type": "DV_DATE_TIME", @@ -4400,7 +4420,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "structure" } }, "encoding": { @@ -4442,7 +4462,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0032" + "value": "Tree" } }, "subject": { @@ -4527,7 +4547,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Tree" } }, "encoding": { @@ -4640,7 +4660,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0002" + "value": "Item tree" } }, "encoding": { @@ -4682,7 +4702,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Item tree" } }, "subject": { @@ -4726,7 +4746,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "name": { @@ -4741,7 +4761,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "History" }, "origin": { "_type": "DV_DATE_TIME", @@ -4828,7 +4848,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Tree" } }, "encoding": { @@ -4916,7 +4936,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Tree" } }, "encoding": { @@ -5015,7 +5035,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0019" + "value": "Tree" } }, "encoding": { @@ -5032,25 +5052,25 @@ "_type": "DV_CODED_TEXT", "defining_code": { "_type": "CODE_PHRASE", - "code_string": "at0013", + "code_string": "at0003", "terminology_id": { "_type": "TERMINOLOGY_ID", "value": "local" } }, - "value": "Care Plan Completed" + "value": "Care plan Need Identified" }, "current_state": { "_type": "DV_CODED_TEXT", "defining_code": { "_type": "CODE_PHRASE", - "code_string": "532", + "code_string": "526", "terminology_id": { "_type": "TERMINOLOGY_ID", "value": "openehr" } }, - "value": "completed" + "value": "planned" } }, "language": { @@ -5096,7 +5116,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0015" + "value": "Tree" } }, "subject": { @@ -5309,7 +5329,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0009" + "value": "Tree" } }, "name": { @@ -5394,7 +5414,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0008" + "value": "Tree" } }, "subject": { @@ -5623,7 +5643,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "structure" } }, "encoding": { @@ -5665,7 +5685,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0032" + "value": "Tree" } }, "subject": { @@ -5702,7 +5722,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "List" } }, "encoding": { @@ -5855,7 +5875,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Item tree" } }, "encoding": { @@ -5945,7 +5965,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0010" + "value": "Item tree" } }, "subject": { @@ -6108,7 +6128,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Tree" } }, "encoding": { @@ -6162,7 +6182,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0027" + "value": "Tree" } }, "subject": { diff --git a/corpus/templates/ckm/treat-registry-report.example.json b/corpus/templates/ckm/treat-registry-report.example.json index b865c0d33a..1c4b98ed7c 100644 --- a/corpus/templates/ckm/treat-registry-report.example.json +++ b/corpus/templates/ckm/treat-registry-report.example.json @@ -84,7 +84,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "structure" } }, "encoding": { @@ -152,7 +152,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0032" + "value": "Tree" } }, "subject": { @@ -235,7 +235,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0002" + "value": "Tree" } }, "name": { @@ -320,7 +320,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0031" + "value": "Tree" } }, "subject": { @@ -396,7 +396,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "blood pressure" } }, "name": { @@ -411,7 +411,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "history" }, "origin": { "_type": "DV_DATE_TIME", @@ -492,7 +492,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Simple" } }, "name": { @@ -507,7 +507,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "history" }, "origin": { "_type": "DV_DATE_TIME", @@ -576,7 +576,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Simple" } }, "name": { @@ -591,7 +591,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0002" + "value": "history" }, "origin": { "_type": "DV_DATE_TIME", @@ -659,7 +659,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "name": { @@ -674,7 +674,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Event Series" }, "origin": { "_type": "DV_DATE_TIME", @@ -754,12 +754,12 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "name": { "_type": "DV_TEXT", - "value": "at0002" + "value": "Any event" }, "time": { "_type": "DV_DATE_TIME", @@ -769,7 +769,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Event Series" }, "origin": { "_type": "DV_DATE_TIME", @@ -837,7 +837,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "name": { @@ -852,7 +852,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Event Series" }, "origin": { "_type": "DV_DATE_TIME", @@ -920,7 +920,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "name": { @@ -935,7 +935,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Event Series" }, "origin": { "_type": "DV_DATE_TIME", @@ -1026,7 +1026,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "structure" } }, "encoding": { @@ -1094,7 +1094,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0032" + "value": "Tree" } }, "subject": { @@ -1341,12 +1341,12 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "name": { "_type": "DV_TEXT", - "value": "at0002" + "value": "Any event" }, "time": { "_type": "DV_DATE_TIME", @@ -1356,7 +1356,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Event Series" }, "origin": { "_type": "DV_DATE_TIME", @@ -1611,12 +1611,12 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "name": { "_type": "DV_TEXT", - "value": "at0002" + "value": "Any event" }, "time": { "_type": "DV_DATE_TIME", @@ -1626,7 +1626,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Event Series" }, "origin": { "_type": "DV_DATE_TIME", @@ -1748,12 +1748,12 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "name": { "_type": "DV_TEXT", - "value": "at0002" + "value": "Any event" }, "time": { "_type": "DV_DATE_TIME", @@ -1763,7 +1763,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Event Series" }, "origin": { "_type": "DV_DATE_TIME", @@ -1925,12 +1925,12 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "name": { "_type": "DV_TEXT", - "value": "at0002" + "value": "Any event" }, "time": { "_type": "DV_DATE_TIME", @@ -1940,7 +1940,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Event Series" }, "origin": { "_type": "DV_DATE_TIME", @@ -2219,12 +2219,12 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "name": { "_type": "DV_TEXT", - "value": "at0002" + "value": "Any event" }, "time": { "_type": "DV_DATE_TIME", @@ -2234,7 +2234,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Event Series" }, "origin": { "_type": "DV_DATE_TIME", @@ -2493,12 +2493,12 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "name": { "_type": "DV_TEXT", - "value": "at0002" + "value": "Any event" }, "time": { "_type": "DV_DATE_TIME", @@ -2508,7 +2508,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Event Series" }, "origin": { "_type": "DV_DATE_TIME", @@ -2763,12 +2763,12 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "name": { "_type": "DV_TEXT", - "value": "at0002" + "value": "Any event" }, "time": { "_type": "DV_DATE_TIME", @@ -2778,7 +2778,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Event Series" }, "origin": { "_type": "DV_DATE_TIME", @@ -3037,12 +3037,12 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "name": { "_type": "DV_TEXT", - "value": "at0002" + "value": "Any event" }, "time": { "_type": "DV_DATE_TIME", @@ -3052,7 +3052,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Event Series" }, "origin": { "_type": "DV_DATE_TIME", @@ -3152,12 +3152,12 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "name": { "_type": "DV_TEXT", - "value": "at0002" + "value": "Any event" }, "time": { "_type": "DV_DATE_TIME", @@ -3167,7 +3167,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Event Series" }, "origin": { "_type": "DV_DATE_TIME", @@ -3267,12 +3267,12 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "name": { "_type": "DV_TEXT", - "value": "at0002" + "value": "Any event" }, "time": { "_type": "DV_DATE_TIME", @@ -3282,7 +3282,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Event Series" }, "origin": { "_type": "DV_DATE_TIME", @@ -3407,7 +3407,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Tree" } }, "encoding": { @@ -3553,7 +3553,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0042" + "value": "Tree" } }, "subject": { @@ -3590,7 +3590,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "structure" } }, "encoding": { @@ -3632,7 +3632,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0032" + "value": "Tree" } }, "subject": { @@ -3669,7 +3669,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Tree" } }, "encoding": { @@ -3711,7 +3711,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0006" + "value": "Tree" } }, "subject": { @@ -3748,7 +3748,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Tree" } }, "encoding": { @@ -3790,7 +3790,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0006" + "value": "Tree" } }, "subject": { @@ -3864,12 +3864,12 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "name": { "_type": "DV_TEXT", - "value": "at0002" + "value": "Any event" }, "time": { "_type": "DV_DATE_TIME", @@ -3879,7 +3879,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Event Series" }, "origin": { "_type": "DV_DATE_TIME", @@ -4024,6 +4024,66 @@ "magnitude": 0 } }, + { + "_type": "ELEMENT", + "archetype_node_id": "at0078", + "name": { + "_type": "DV_TEXT", + "value": "Cat dander" + }, + "value": { + "_type": "DV_CODED_TEXT", + "defining_code": { + "_type": "CODE_PHRASE", + "code_string": "at0000", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "local" + } + }, + "value": "Example" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "at0078", + "name": { + "_type": "DV_TEXT", + "value": "Dog dander" + }, + "value": { + "_type": "DV_CODED_TEXT", + "defining_code": { + "_type": "CODE_PHRASE", + "code_string": "at0000", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "local" + } + }, + "value": "Example" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "at0078", + "name": { + "_type": "DV_TEXT", + "value": "Aspergillus" + }, + "value": { + "_type": "DV_CODED_TEXT", + "defining_code": { + "_type": "CODE_PHRASE", + "code_string": "at0000", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "local" + } + }, + "value": "Example" + } + }, { "_type": "ELEMENT", "archetype_node_id": "at0078", @@ -4039,12 +4099,12 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "name": { "_type": "DV_TEXT", - "value": "at0002" + "value": "Any event" }, "time": { "_type": "DV_DATE_TIME", @@ -4054,7 +4114,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Event Series" }, "origin": { "_type": "DV_DATE_TIME", @@ -4134,12 +4194,12 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "name": { "_type": "DV_TEXT", - "value": "at0002" + "value": "Any event" }, "time": { "_type": "DV_DATE_TIME", @@ -4149,7 +4209,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Event Series" }, "origin": { "_type": "DV_DATE_TIME", @@ -4301,12 +4361,12 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "name": { "_type": "DV_TEXT", - "value": "at0002" + "value": "Any event" }, "time": { "_type": "DV_DATE_TIME", @@ -4316,7 +4376,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Event Series" }, "origin": { "_type": "DV_DATE_TIME", @@ -4516,12 +4576,12 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "name": { "_type": "DV_TEXT", - "value": "at0002" + "value": "Any event" }, "time": { "_type": "DV_DATE_TIME", @@ -4531,7 +4591,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Event Series" }, "origin": { "_type": "DV_DATE_TIME", @@ -4630,12 +4690,12 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "name": { "_type": "DV_TEXT", - "value": "at0002" + "value": "Any event" }, "time": { "_type": "DV_DATE_TIME", @@ -4645,7 +4705,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Event Series" }, "origin": { "_type": "DV_DATE_TIME", @@ -4743,12 +4803,12 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "List" } }, "name": { "_type": "DV_TEXT", - "value": "at0002" + "value": "Any event" }, "time": { "_type": "DV_DATE_TIME", @@ -4758,7 +4818,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Event Series" }, "origin": { "_type": "DV_DATE_TIME", @@ -4838,12 +4898,12 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "name": { "_type": "DV_TEXT", - "value": "at0002" + "value": "Any event" }, "time": { "_type": "DV_DATE_TIME", @@ -4853,7 +4913,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Event Series" }, "origin": { "_type": "DV_DATE_TIME", @@ -4975,12 +5035,12 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "name": { "_type": "DV_TEXT", - "value": "at0002" + "value": "Any event" }, "time": { "_type": "DV_DATE_TIME", @@ -4990,7 +5050,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Event Series" }, "origin": { "_type": "DV_DATE_TIME", @@ -5354,12 +5414,12 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "name": { "_type": "DV_TEXT", - "value": "at0002" + "value": "Any event" }, "time": { "_type": "DV_DATE_TIME", @@ -5369,7 +5429,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Event Series" }, "origin": { "_type": "DV_DATE_TIME", @@ -5617,12 +5677,12 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0003" + "value": "Tree" } }, "name": { "_type": "DV_TEXT", - "value": "at0002" + "value": "Any event" }, "time": { "_type": "DV_DATE_TIME", @@ -5632,7 +5692,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Event Series" }, "origin": { "_type": "DV_DATE_TIME", @@ -5787,7 +5847,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "Tree" } }, "encoding": { @@ -5862,7 +5922,7 @@ ], "name": { "_type": "DV_TEXT", - "value": "at0001" + "value": "List" } }, "encoding": { @@ -5898,6 +5958,348 @@ ], "context": { "_type": "EVENT_CONTEXT", + "other_context": { + "_type": "ITEM_TREE", + "archetype_node_id": "at0001", + "items": [ + { + "_type": "CLUSTER", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "openEHR-EHR-CLUSTER.person_identifiable_parent.v1" + }, + "rm_version": "1.2.0" + }, + "archetype_node_id": "openEHR-EHR-CLUSTER.person_identifiable_parent.v1", + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "at0001", + "name": { + "_type": "DV_TEXT", + "value": "Person Identifier" + }, + "value": { + "_type": "DV_IDENTIFIER", + "id": "example-id" + } + }, + { + "_type": "CLUSTER", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "openEHR-EHR-CLUSTER.person_name_isa.v1" + }, + "rm_version": "1.2.0" + }, + "archetype_node_id": "openEHR-EHR-CLUSTER.person_name_isa.v1", + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "at0001", + "name": { + "_type": "DV_TEXT", + "value": "Family Name" + }, + "value": { + "_type": "DV_TEXT", + "value": "Family Name" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "at0002", + "name": { + "_type": "DV_TEXT", + "value": "Given Name" + }, + "value": { + "_type": "DV_TEXT", + "value": "Given Name" + } + } + ], + "name": { + "_type": "DV_TEXT", + "value": "Person name (ISA)" + } + }, + { + "_type": "CLUSTER", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "openEHR-EHR-CLUSTER.person_anonymised_parent.v1" + }, + "rm_version": "1.2.0" + }, + "archetype_node_id": "openEHR-EHR-CLUSTER.person_anonymised_parent.v1", + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "at0001", + "name": { + "_type": "DV_TEXT", + "value": "Administrative Gender" + }, + "value": { + "_type": "DV_CODED_TEXT", + "defining_code": { + "_type": "CODE_PHRASE", + "code_string": "at0009", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "local" + } + }, + "value": "Male" + } + } + ], + "name": { + "_type": "DV_TEXT", + "value": "Anonymised person (PARENT)" + } + }, + { + "_type": "CLUSTER", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "openEHR-EHR-CLUSTER.death_details_parent.v1" + }, + "rm_version": "1.2.0" + }, + "archetype_node_id": "openEHR-EHR-CLUSTER.death_details_parent.v1", + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "at0001", + "name": { + "_type": "DV_TEXT", + "value": "Date of death" + }, + "value": { + "_type": "DV_DATE_TIME", + "value": "2022-02-03T04:05:06Z" + } + } + ], + "name": { + "_type": "DV_TEXT", + "value": "Death details (PARENT)" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "at0008", + "name": { + "_type": "DV_TEXT", + "value": "Date of Birth" + }, + "value": { + "_type": "DV_DATE_TIME", + "value": "2022-02-03T04:05:06Z" + } + } + ], + "name": { + "_type": "DV_TEXT", + "value": "Patient" + } + }, + { + "_type": "CLUSTER", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "openEHR-EHR-CLUSTER.healthcare_professional_parent.v1" + }, + "rm_version": "1.2.0" + }, + "archetype_node_id": "openEHR-EHR-CLUSTER.healthcare_professional_parent.v1", + "items": [ + { + "_type": "CLUSTER", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "openEHR-EHR-CLUSTER.person_name_isa.v1" + }, + "rm_version": "1.2.0" + }, + "archetype_node_id": "openEHR-EHR-CLUSTER.person_name_isa.v1", + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "at0004", + "name": { + "_type": "DV_TEXT", + "value": "Full Name" + }, + "value": { + "_type": "DV_TEXT", + "value": "Full Name" + } + } + ], + "name": { + "_type": "DV_TEXT", + "value": "Person name (ISA)" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "at0002", + "name": { + "_type": "DV_TEXT", + "value": "Professional Identifier" + }, + "value": { + "_type": "DV_IDENTIFIER", + "id": "example-id" + } + }, + { + "_type": "CLUSTER", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "openEHR-EHR-CLUSTER.healthcare_provider_parent.v1" + }, + "rm_version": "1.2.0" + }, + "archetype_node_id": "openEHR-EHR-CLUSTER.healthcare_provider_parent.v1", + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "at0001", + "name": { + "_type": "DV_TEXT", + "value": "Department name" + }, + "value": { + "_type": "DV_TEXT", + "value": "Department name" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "at0002", + "name": { + "_type": "DV_TEXT", + "value": "Hospital identifier" + }, + "value": { + "_type": "DV_IDENTIFIER", + "id": "example-id" + } + }, + { + "_type": "CLUSTER", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "openEHR-EHR-CLUSTER.address_isa.v1" + }, + "rm_version": "1.2.0" + }, + "archetype_node_id": "openEHR-EHR-CLUSTER.address_isa.v1", + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "at0006", + "name": { + "_type": "DV_TEXT", + "value": "Post Name (city)" + }, + "value": { + "_type": "DV_TEXT", + "value": "Post Name (city)" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "at0007", + "name": { + "_type": "DV_TEXT", + "value": "Admin Unit 2 (county/region/state)" + }, + "value": { + "_type": "DV_TEXT", + "value": "Admin Unit 2 (county/region/state)" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "at0008", + "name": { + "_type": "DV_TEXT", + "value": "Admin Unit 1 (country)" + }, + "value": { + "_type": "DV_TEXT", + "value": "Admin Unit 1 (country)" + } + } + ], + "name": { + "_type": "DV_TEXT", + "value": "Address (ISA)" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "at0004", + "name": { + "_type": "DV_TEXT", + "value": "Contact details" + }, + "value": { + "_type": "DV_TEXT", + "value": "Contact details" + } + } + ], + "name": { + "_type": "DV_TEXT", + "value": "Healthcare provider (PARENT)" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "at0004", + "name": { + "_type": "DV_TEXT", + "value": "Contact details" + }, + "value": { + "_type": "DV_TEXT", + "value": "Contact details" + } + } + ], + "name": { + "_type": "DV_TEXT", + "value": "Reporting professional" + } + } + ], + "name": { + "_type": "DV_TEXT", + "value": "Tree" + } + }, "setting": { "_type": "DV_CODED_TEXT", "defining_code": { diff --git a/crates/openehr-sdt/tests/it/snapshots/it__validation_golden__the_validation_passes_report_what_the_record_holds.snap b/crates/openehr-sdt/tests/it/snapshots/it__validation_golden__the_validation_passes_report_what_the_record_holds.snap index 673b280fd0..88aa1c885f 100644 --- a/crates/openehr-sdt/tests/it/snapshots/it__validation_golden__the_validation_passes_report_what_the_record_holds.snap +++ b/crates/openehr-sdt/tests/it/snapshots/it__validation_golden__the_validation_passes_report_what_the_record_holds.snap @@ -96,7 +96,7 @@ corpus/templates/ckm/diphtheria-case-investigation.example.json: 12 6f997b0ec28a corpus/templates/ckm/diphtheria-case-investigation.opt: 12 aec6bf3571724b25 corpus/templates/ckm/eprescription-fhir.example.json: 12 ae2271d0a268381b corpus/templates/ckm/eprescription-fhir.opt: 9 e1d390fa0b28d987 -corpus/templates/ckm/ereferral.example.json: 27 273261f21d01b06a +corpus/templates/ckm/ereferral.example.json: 12 892f357789b79e70 corpus/templates/ckm/ereferral.opt: 12 5e4f10e4a7bc8b48 corpus/templates/ckm/full/2024-master-infectious-disease-case-investigation-form-jm.opt: 12 aec6bf3571724b25 corpus/templates/ckm/full/2025-master-infectious-disease-case-investigation-form-jm.opt: 12 aec6bf3571724b25 diff --git a/deploy/hosted/docker-compose.yml b/deploy/hosted/docker-compose.yml index ea7df7a25e..45daadf4ac 100644 --- a/deploy/hosted/docker-compose.yml +++ b/deploy/hosted/docker-compose.yml @@ -220,7 +220,45 @@ services: security_opt: - no-new-privileges:true - # Provisions the demo user `ferroehr` as a professional PERSON through the + # Grants the PERSON of the demo clinician `ferroehr-clinician` the clinical + # scopes the demo dataset's reads and attestations use, as ferroehr-hold + # does for `ferroehr`. + ferroehr-hold-clinician: + image: ${FERROEHR_IMAGE:-ghcr.io/ferrohealth/ferroehr:latest} + container_name: ferroehr-sandbox-hold-clinician + restart: on-failure + depends_on: + ferroehr-provision: + condition: service_completed_successfully + deploy: + resources: + limits: + memory: 256m + environment: + FERROEHR_CONFIG: /etc/ferroehr/ferroehr.toml + DATABASE_URL: ${DATABASE_URL:?DATABASE_URL must be set in /opt/ferroehr-sandbox/.env} + FERROEHR__USAGE_REPORT__ENABLED: "false" + volumes: + - ./ferroehr.sandbox.toml:/etc/ferroehr/ferroehr.toml:ro + command: + - party-binding + - grant + - --basic-user + - ferroehr-clinician + - --operation + - hold_scopes + - --element + - scope=user/composition-*.cruds + - --element + - scope=user/template-*.rs + - --element + - scope=user/aql-*.cruds + cap_drop: [ALL] + security_opt: + - no-new-privileges:true + + # Provisions the demo users `ferroehr` and `ferroehr-clinician` as + # professional PERSONs through the # CDR's SCIM endpoint (RFC 7644 §3.3), the way an identity provider # provisions people, so the Basic login is bound to the PERSON FerroEHR # issues for its binding key: the `sandbox-scim` client takes a client @@ -254,16 +292,18 @@ services: -d client_secret=sandbox -d scope=ferroehr/scim http://localhost:8180/sandbox/token | sed -n 's/.*"access_token" *: *"\([^"]*\)".*/\1/p'); if [ -z "$$token" ]; then echo 'the issuer answered no access token' >&2; exit 1; fi; + for user in ferroehr ferroehr-clinician; do status=$$(curl -sS -o /tmp/answer -w '%{http_code}' -X POST -H "Authorization: Bearer $$token" -H 'Content-Type: application/scim+json' - --data '{"schemas":["urn:ietf:params:scim:schemas:core:2.0:User","urn:ietf:params:scim:schemas:extension:ferrohealth:2.0:User"],"userName":"ferroehr","urn:ietf:params:scim:schemas:extension:ferrohealth:2.0:User":{"loginIdentifier":"ferroehr"}}' + --data "{\"schemas\":[\"urn:ietf:params:scim:schemas:core:2.0:User\",\"urn:ietf:params:scim:schemas:extension:ferrohealth:2.0:User\"],\"userName\":\"$$user\",\"urn:ietf:params:scim:schemas:extension:ferrohealth:2.0:User\":{\"loginIdentifier\":\"$$user\"}}" http://localhost:8080/scim/v2/Users); - if [ "$$status" = 201 ]; then echo 'provisioned ferroehr'; exit 0; fi; + if [ "$$status" = 201 ]; then echo "provisioned $$user"; continue; fi; if [ "$$status" = 409 ] && grep -q '"uniqueness"' /tmp/answer && curl -fsS -H "Authorization: Bearer $$token" - 'http://localhost:8080/scim/v2/Users?filter=userName%20eq%20%22ferroehr%22' | - grep -q '"totalResults" *: *1[,}]'; then echo 'ferroehr is provisioned already'; exit 0; fi; - echo "provisioning ferroehr answered $$status" >&2; cat /tmp/answer >&2; exit 1 + "http://localhost:8080/scim/v2/Users?filter=userName%20eq%20%22$$user%22" | + grep -q '"totalResults" *: *1[,}]'; then echo "$$user is provisioned already"; continue; fi; + echo "provisioning $$user answered $$status" >&2; cat /tmp/answer >&2; exit 1; + done read_only: true tmpfs: - /tmp diff --git a/deploy/hosted/ferroehr.sandbox.toml b/deploy/hosted/ferroehr.sandbox.toml index a08605305d..dcd9582a79 100644 --- a/deploy/hosted/ferroehr.sandbox.toml +++ b/deploy/hosted/ferroehr.sandbox.toml @@ -57,6 +57,20 @@ group_identifier_issuer = "urn:example:groups" user = "ferroehr" password_hash = "$argon2id$v=19$m=19456,t=2,p=1$ZmVycm9laHJEZXZTYWx0$be5nPwWjfUl1qvSrvkvqvdMOuCgM0VFcN/VN4MFLjT8" +# Two more demo logins, with the same public password, for the demo dataset +# (scripts/sandbox/seed/): ferroehr-clinician, a professional the box's +# compose file provisions and grants clinical scopes, who reads records +# outside a care relationship and attests; and ferroehr-proxy, whose PERSON +# the seed writes as the representative of a demo patient, who reads the +# subject view of that patient's access log. +[[auth.basic.users]] +user = "ferroehr-clinician" +password_hash = "$argon2id$v=19$m=19456,t=2,p=1$ZmVycm9laHJEZXZTYWx0$be5nPwWjfUl1qvSrvkvqvdMOuCgM0VFcN/VN4MFLjT8" + +[[auth.basic.users]] +user = "ferroehr-proxy" +password_hash = "$argon2id$v=19$m=19456,t=2,p=1$ZmVycm9laHJEZXZTYWx0$be5nPwWjfUl1qvSrvkvqvdMOuCgM0VFcN/VN4MFLjT8" + # The healthcare provider the sandbox acts for (an example id under the OID # arc 2.999), and the binding key of the demo user. [authz.party_binding] @@ -67,6 +81,16 @@ user = "ferroehr" key_issuer = "urn:example:basic-user" key = "ferroehr" +[[authz.party_binding.basic_user]] +user = "ferroehr-clinician" +key_issuer = "urn:example:basic-user" +key = "ferroehr-clinician" + +[[authz.party_binding.basic_user]] +user = "ferroehr-proxy" +key_issuer = "urn:example:basic-user" +key = "ferroehr-proxy" + # The SCIM endpoint the demo PERSON is provisioned through (RFC 7644 §3.3), as # an identity provider provisions people: the ferroehr-grant service of the # box's compose file grants the `sandbox-scim` client scim_provision in the @@ -89,10 +113,12 @@ public_base_url = "https://sandbox.ferroehr.eu" [auth.scim] # The operations the party store may grant: beside a system client's commit, -# the scim_provision the ferroehr-grant service grants `sandbox-scim` and the -# demo user's scopes the ferroehr-hold service grants. +# the scim_provision the ferroehr-grant service grants `sandbox-scim`, the +# demo users' scopes the ferroehr-hold services grant, and the access-control +# writes and privileges the demo dataset grants. A sandbox posture only, +# never a production default. [authz.grants] -allowed = ["commit_composition", "scim_provision", "hold_scopes"] +allowed = ["commit_composition", "scim_provision", "hold_scopes", "write_access_policy", "write_care_relationship", "write_representation", "access_service"] # Authentication only, no role gate — the one demo user deliberately reaches # every enabled surface, the admin group included (#2965). It is the first diff --git a/docker/ferroehr.dev.toml b/docker/ferroehr.dev.toml index 201a70f969..f31ed9e5c0 100644 --- a/docker/ferroehr.dev.toml +++ b/docker/ferroehr.dev.toml @@ -131,6 +131,10 @@ password_hash = "$argon2id$v=19$m=19456,t=2,p=1$ZmVycm9laHJEZXZTYWx0$be5nPwWjfUl # The READ-ONLY account for the conformance suite's authorization-separation # cases: authenticated, but every write operation is refused by the RBAC # read-only gate. +[[auth.basic.users]] +user = "ferroehr-proxy" +password_hash = "$argon2id$v=19$m=19456,t=2,p=1$ZmVycm9laHJEZXZTYWx0$be5nPwWjfUl1qvSrvkvqvdMOuCgM0VFcN/VN4MFLjT8" + [[auth.basic.users]] user = "ferroehr-readonly" password_hash = "$argon2id$v=19$m=19456,t=2,p=1$ZmVycm9laHJEZXZTYWx0$be5nPwWjfUl1qvSrvkvqvdMOuCgM0VFcN/VN4MFLjT8" @@ -143,9 +147,16 @@ first_admin = "ferroehr-admin" # The operations the party store may grant: beside a system client's commit, # the SCIM provisioning each lane's client is granted in the CDR before it # provisions (scripts/scim-provision.sh), the scopes and roles of the Basic -# users it provisions, and the change feed a lane may grant a reader. +# users it provisions, the change feed a lane may grant a reader, and the +# access-control writes and privileges the demo dataset grants +# (scripts/sandbox/seed/). A development posture only, never a production default. [authz.grants] -allowed = ["commit_composition", "read_change_feed", "scim_provision", "hold_roles", "hold_scopes"] +allowed = ["commit_composition", "read_change_feed", "scim_provision", "hold_roles", "hold_scopes", "write_access_policy", "write_care_relationship", "write_representation", "access_service"] + +# A cohort may name its patients by identifier, as the demo dataset's cohort +# query does. +[privacy.cohort] +subjects = true # The healthcare provider the dev lanes act for (an example id under the OID # arc 2.999), and the binding key of each Basic user. @@ -162,6 +173,11 @@ user = "ferroehr-admin" key_issuer = "urn:example:basic-user" key = "ferroehr-admin" +[[authz.party_binding.basic_user]] +user = "ferroehr-proxy" +key_issuer = "urn:example:basic-user" +key = "ferroehr-proxy" + [[authz.party_binding.basic_user]] user = "ferroehr-readonly" key_issuer = "urn:example:basic-user" diff --git a/docker/signing/README.md b/docker/signing/README.md new file mode 100644 index 0000000000..5a06fa32ef --- /dev/null +++ b/docker/signing/README.md @@ -0,0 +1,30 @@ +# The development lanes' version-signing key + +## THIS IS COMMITTED TEST KEY MATERIAL. IT IS NOT SECRET AND MUST NEVER BE USED IN PRODUCTION. + +`version-signing-test.key.asc` is a passphrase-less ML-DSA-65+Ed25519 OpenPGP +secret key (RFC 9980 algorithm ID 30) in public version control. Anyone with +a checkout can sign as it. It exists for one purpose: the development lanes +run `[record.signing] mode = "pgp"`, so every version the demo dataset +commits carries a real ML-DSA-65+Ed25519 signature and the access log is +sealed into a signed checkpoint, which the viewer draws. + +Never point a deployment that holds real data at this key, and never list its +public half among the `retired_key_files` of one. A signature made with it +proves nothing. + +## How it was made + +```bash +ferrohealth-sop generate-key --signing-only \ + "FerroEHR development lanes TEST KEY " \ + > docker/signing/version-signing-test.key.asc +``` + +`ferrohealth-sop` is `cargo install ferrohealth-openpgp-pq --version =0.1.0 --locked`. + +## Who uses it + +`docker/viewer/e2e-env.yml` mounts it into the CDR of the browser-journey +lane (`scripts/ui-e2e.sh`) as `/etc/ferroehr/version-signing-test.key.asc` and +sets `FERROEHR__RECORD__SIGNING__MODE=pgp`. diff --git a/docker/signing/version-signing-test.key.asc b/docker/signing/version-signing-test.key.asc new file mode 100644 index 0000000000..8f547b62dc --- /dev/null +++ b/docker/signing/version-signing-test.key.asc @@ -0,0 +1,192 @@ +-----BEGIN PGP PRIVATE KEY BLOCK----- + +xcdLBmsIHKweAAAHwHiwpGV5/ZZQPTHkfq55wpQmJWRJHDPo5l9wVjbiWnvHpMZ4 +iN1yVtTw7q+xQXRXSux1QqrqA4PGrGgC8xhDOPg/v/wQwvUI9+SdZPs1FtZKW9NZ +AGvV61TyJqiNjsGyxfBjyJsEBs/jhUTS0zA3EXQ7u176yj8Zu/r9sawFmasubkCe +fZb8CXFMU5saygTFW2xwkTYOSCXAoBOmWFC8jQC5Ptw65hIQkg6FvZIkttgXSa8b +W0Rxw6astvYeYG4YF0UBbEmHJZPQyRhMJU9hHVf4P+btSTNzQIwwXtsFeW0O1MrL +2mA0/rWsUUlNQ3A3ycmzVj+KcLOoifK2Zdzbf0LlmvGJRgUxeZ03rANmlSCHo3hu +qKNbhIthgryFWqdVm/8bHYQoA1r8lQ0ZF4xKjM8nJoS0q3g1/jVbBYBNnio7WrWo +IQosfsCcQHe0DGNQQQzm3Tx7e64zF6QC2mSA/vC3hbSOP37eUrUcM1O+DRjNOLh9 +yqj3u3QFBFnt1Rp+mGMr0EdtAKFF/lQavq2Ut1UtscyHSqWrhojkdj/Va9gHcANy +fIh5eosq/IyWyCVunRYzeK61fWkRnWKw3ULjnjd8tzObbI/piXr+Pl8hZKCtEDtO +8ZutCeeCnOnV9CPDijAHIhBhamU433yNvmImmFQTSkdhGVl0vzmQxzYKumgmhLt9 +ApQgJJ1Z4pseKJLieUCKUdsWmf8IX3B/zi5tIr5whE2AaHjgJhiaysnKHcKonX7m +q+klr7DxE3b/fu3wX9WuHisEf3pz/pbk1uVblK+IoeWUBQVA6+sFPcFMigFxl82u +/S8YXHf70alpgJAwBJ461wqXVU9uR2co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wOUUWpd3QHrIoeRL06nhwbkR9G8 ++aGrRBTMuhIWwMLCpffzMTz8I6/t9UPQlSILrbtAu4x+joHiRzNMMfrSW43BR5JK +j6A0OnHz05pzX0UzBQ+2rXUDMSoflOsqYbZwWiDwHzK3Olg2jOIZojixgsjbNhLC +5IRtwoSueZ9gDh8Zfdas9CKdaVcXdPOnY/TnEJ9leAwAEIe4/gZ07oqcsqjuV5FA +jTiF1rE5l8QGb8RFZ7V+CczubEnuu/mL59qtb4AKMxDqbcwTq33/ylILAxMxdRXA +HdFAYiDiv9siNSF7zJZLbzAyYF1EMiYYpSVIW1BThJXivbty/LftcMgUxiEBQjQG +e511gJZBZ1ZsgS/5NikKsFly3HNzyjUTN9PcxZOd8CfzYVwS4aTPXk0g+h9mPDHB +58dFfGUj7EB7BxDBanESI5IcsQhm4rEvqdNtPkkQrirrDgne4E94YBtg0jSbn870 +5j8GtM4bKCasRNg3PBpLrZ3+oonUnNDR7sXUlac16NfvpQ4SPk1XY2aRpKsceH2i +4Nje6B6EtR8lS4fz9hVpnqmrssDUAAAAAAAAAAAAAAAAAAAAAAAAAAAKDxIVGyM= +-----END PGP PRIVATE KEY BLOCK----- diff --git a/docker/viewer/e2e-env.yml b/docker/viewer/e2e-env.yml index 9a3ad0cf6c..38435eb44d 100644 --- a/docker/viewer/e2e-env.yml +++ b/docker/viewer/e2e-env.yml @@ -49,8 +49,16 @@ services: FERROEHR__AUTH__ISSUER__KEYCLOAK__PARTY__GROUP_IDENTIFIER_ISSUER: urn:example:keycloak-dev-groups FERROEHR__AUTHZ__RBAC__ROLE_ISSUERS: keycloak FERROEHR__AUTH__TLS__TRUST_ROOTS_FILE: /run/ferroehr-dev-tls/ca/ca.crt + # Versions and access-log checkpoints signed with ML-DSA-65+Ed25519, so + # the viewer draws a real signature: the committed TEST key of + # docker/signing/, never a production key. + FERROEHR__RECORD__SIGNING__MODE: pgp + FERROEHR__RECORD__SIGNING__KEY_FILE: /etc/ferroehr/version-signing-test.key.asc volumes: - keycloak-tls:/run/ferroehr-dev-tls:ro + configs: + - source: ferroehr-version-signing-test-key + target: /etc/ferroehr/version-signing-test.key.asc ferroehr-viewer: environment: @@ -66,3 +74,7 @@ services: FERROEHR_VIEWER__OIDC__TLS__TRUST_ROOTS_FILE: /run/ferroehr-dev-tls/ca/ca.crt volumes: - keycloak-tls:/run/ferroehr-dev-tls:ro + +configs: + ferroehr-version-signing-test-key: + file: ./docker/signing/version-signing-test.key.asc diff --git a/scripts/sandbox/reseed.sh b/scripts/sandbox/reseed.sh index efff83b252..8ab19f3c01 100755 --- a/scripts/sandbox/reseed.sh +++ b/scripts/sandbox/reseed.sh @@ -2,12 +2,14 @@ # SPDX-FileCopyrightText: Cadasto B.V. # SPDX-License-Identifier: BUSL-1.1 # -# Seed the hosted sandbox (#2710, dataset #3045) with demo data through the -# PUBLIC API — the same surface visitors use, so the seed itself proves the -# deployment. This file is a WALKER: what gets loaded is -# scripts/sandbox/seed/manifest.json plus the bodies beside it, so adding -# content is editing data. The manifest's `notes` describe the dataset, its -# measured runtime and the placeholder tokens substituted below. +# The one seed of FerroEHR's synthetic demo dataset (#2710, #3045, #6663): the +# hosted sandbox every night and the browser journeys' stack +# (scripts/ui-e2e.sh). It drives the PUBLIC API only, the same surface +# visitors use, so the seed itself proves the deployment and every write +# leaves the access record a client's does. This file is a WALKER: what gets +# loaded is scripts/sandbox/seed/manifest.json plus the bodies beside it, so +# adding content is editing data. The manifest's `notes` describe the dataset +# and the tokens substituted below. # # Every request retries: right after the nightly wipe, instances booted BEFORE # the wipe can keep serving until they recycle, and a request landing on one @@ -20,9 +22,14 @@ # completion, and a second run sees it and exits without touching anything. # # Environment: SANDBOX_BASE (default https://sandbox.ferroehr.eu), -# SANDBOX_USER / SANDBOX_PASS (default the public demo credentials), and -# SANDBOX_IDENTITIES: the file the box's `identities` verb answered -# (deploy/hosted/ferropix-seed.sh). Under an IHE patient identity source it maps +# SANDBOX_USER / SANDBOX_PASS (the administrator that seeds, default the +# public demo credentials), SANDBOX_CLINICIAN (default ferroehr-clinician, a +# professional who reads outside a care relationship and attests), +# SANDBOX_PROXY (default ferroehr-proxy, whose PERSON the seed writes as a +# patient's representative), each with its `_PASS` (default ferroehr), an +# empty SANDBOX_CLINICIAN skipping the clinician's steps, SANDBOX_IDS_OUT (a +# file the seeded EHR ids and tokens are written to), and SANDBOX_IDENTITIES: +# the file the box's `identities` verb answered (deploy/hosted/ferropix-seed.sh). Under an IHE patient identity source it maps # each manifest subject to the pseudonym FerroPIX minted for it, and every # EHR_STATUS names that pseudonym in the clinical domain (#4242). Unset, or # answering `provider local` (a CDR beside no FerroPIX), the subjects name @@ -54,7 +61,16 @@ esac BASE="${SANDBOX_BASE:-https://sandbox.ferroehr.eu}/ferroehr/rest/openehr/v1" # FerroEHR's own extensions sit beside the openEHR API (#4330). EXT="${SANDBOX_BASE:-https://sandbox.ferroehr.eu}/ferroehr/rest/extensions/v1" -AUTH="${SANDBOX_USER:-ferroehr}:${SANDBOX_PASS:-ferroehr}" +SEED_LOGIN="${SANDBOX_USER:-ferroehr}" +AUTH="$SEED_LOGIN:${SANDBOX_PASS:-ferroehr}" +# The professional who reads outside a care relationship and attests, and the +# representative who reads the subject view of a patient's access log: two +# more logins of the deployment. +CLINICIAN="${SANDBOX_CLINICIAN-ferroehr-clinician}" +CLINICIAN_PASS="${SANDBOX_CLINICIAN_PASS:-ferroehr}" +PROXY="${SANDBOX_PROXY:-ferroehr-proxy}" +PROXY_PASS="${SANDBOX_PROXY_PASS:-ferroehr}" +IDS_OUT="${SANDBOX_IDS_OUT:-}" ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" SEED_DIR="$ROOT_DIR/scripts/sandbox/seed" MANIFEST="$SEED_DIR/manifest.json" @@ -132,7 +148,8 @@ subject_id() { # ── the wire ───────────────────────────────────────────────────────────────── -# One request, retried through stale instances. `$1` = a label, `$2` = the +# One request, retried through stale instances, as the seeding login or as +# the login `REQ_AUTH` names. `$1` = a label, `$2` = the # method, `$3` = the URL; the rest go to curl verbatim. Prints the final status # code; the response headers land in $HDR and the body in $BODY. request() { @@ -141,7 +158,7 @@ request() { local attempt code for attempt in $(seq 1 "$ATTEMPTS"); do # curl prints 000 itself when it reaches no server; appending another would make 000000 and skip the retry. - code=$(curl -sS -m 300 -u "$AUTH" -D "$HDR" -o "$BODY" -w '%{http_code}' \ + code=$(curl -sS -m 300 -u "${REQ_AUTH:-$AUTH}" -D "$HDR" -o "$BODY" -w '%{http_code}' \ -X "$method" "$url" "$@") || code=000 case "$code" in 5?? | 000) @@ -182,6 +199,19 @@ header_value() { # The identifier the weak ETag carries (`W/""` → ``). etag_uid() { header_value etag | sed -e 's|^W/||' -e 's|"||g'; } +# The tokens a world body names, each with its value: `__ID:__` for a +# party or relationship the seed wrote, `__SUBJECT_ID:__` for the n-th +# EHR's subject, `__LOGIN:__` for a login. +TOKENS="$WORK/tokens.json" +echo '{}' > "$TOKENS" +token() { + jq --arg k "$1" --arg v "$2" '.[$k] = $v' "$TOKENS" > "$TOKENS.next" + mv "$TOKENS.next" "$TOKENS" +} +# Midnight UTC of the day the seed runs, from which `__DATE:__` counts. +TODAY=$(( $(date -u +%s) / 86400 * 86400 )) +token "__SUBJECT_NS__" "$SUBJECT_NS" + # ── bodies ─────────────────────────────────────────────────────────────────── # Render `$1` into `$2`, replacing each remaining `TOKEN=VALUE` pair wherever @@ -437,6 +467,7 @@ while read -r entry; do subject=$(printf '%s' "$entry" | jq -r '.subject') subject_ref="$(subject_id "$subject")" status_file="$SEED_DIR/$(printf '%s' "$entry" | jq -r '.status')" + token "__SUBJECT_ID:${index}__" "$subject_ref" code=$(request "ehr lookup $subject" GET \ "$BASE/ehr?subject_id=$subject_ref&subject_namespace=$SUBJECT_NS") case "$code" in @@ -480,6 +511,7 @@ commit_series() { ovid=$(etag_uid) printf '%s\n' "${ovid%%::*}" >> "$WORK/comps.$slot" [[ -n "$first" ]] || first="$ovid" + series_first="${first%%::*}" compositions=$((compositions + 1)) done [[ "$versions" -gt 0 ]] || return 0 @@ -501,6 +533,16 @@ while read -r entry; do copies=$(printf '%s' "$entry" | jq -r '.compositions_per_ehr') versions=$(printf '%s' "$entry" | jq -r '.extra_versions') example=$(printf '%s' "$entry" | jq -r --arg d "$TPL_DIR/$slug.example.json" '.example // $d') + if [[ "$example" == generated ]]; then + # The CDR's own example of the template, as the browser journeys commit it. + template=$(printf '%s' "$entry" | jq -r '.template_id') + code=$(request "example $template" GET \ + "$BASE/definition/template/adl1.4/$(jq -rn --arg t "$template" '$t | @uri')/example" \ + -H 'Accept: application/json') + expect "example $template" "$code" 200 + example="$WORK/$slug.example.json" + cp "$BODY" "$example" + fi [[ "$example" = /* ]] || example="$ROOT_DIR/$example" [[ -f "$example" ]] || { echo "::error::missing example composition $example" >&2 @@ -511,6 +553,7 @@ while read -r entry; do [[ "${created[$slot]}" == yes ]] || continue if [[ "$first_slot" == yes ]]; then commit_series "$slot" "$example" "$copies" "$versions" "composition $slug" + token "__SERIES:${slug}__" "$series_first" first_slot=no else commit_series "$slot" "$example" "$copies" 0 "composition $slug" @@ -533,6 +576,22 @@ while read -r entry; do commit_series "$slot" "$WORK/adl2-example.json" "$copies" 0 "composition $template" done < <(printf '%s' "$entry" | jq -r '.ehrs[]') done < <(jq -c '.adl2.templates[]' "$MANIFEST") + +# Compositions sent in the Simplified Flat format, with the measured values a +# chart draws: the CDR's generated example carries none. +while read -r entry; do + slot=$(printf '%s' "$entry" | jq -r '.ehr') + [[ "${created[$slot]}" == yes ]] || continue + template=$(printf '%s' "$entry" | jq -r '.template_id') + file="$SEED_DIR/$(printf '%s' "$entry" | jq -r '.file')" + code=$(request "flat composition $template" POST "$BASE/ehr/${ehrs[$slot]}/composition" \ + -H 'Content-Type: application/openehr.wt.flat+json' -H "openehr-template-id: $template" \ + -H 'Prefer: return=minimal' --data-binary @"$file") + expect "flat composition $template" "$code" 201 + ovid=$(etag_uid) + printf '%s\n' "${ovid%%::*}" >> "$WORK/comps.$slot" + compositions=$((compositions + 1)) +done < <(jq -c '.flat_compositions[]' "$MANIFEST") echo "==> $compositions compositions committed, $extra further versions" # ── 7. the directory ───────────────────────────────────────────────────────── @@ -593,6 +652,7 @@ while read -r rel; do expect "person $(basename "$rel")" "$code" 201 ovid=$(etag_uid) persons[index]="${ovid%%::*}" + token "__ID:person-$(printf '%02d' $((index + 1)))__" "${persons[index]}" index=$((index + 1)) done < <(mf '.demographics.persons[]') @@ -622,7 +682,277 @@ while read -r entry; do done < <(jq -c '.demographics.relationships[]' "$MANIFEST") echo "==> ${#persons[@]} persons, $roles roles, $relationships party relationships" -# ── 10. stored AQL queries ─────────────────────────────────────────────────── +# ── 10. the world every viewer page reads ──────────────────────────────────── +# +# The provider, its care teams, a system client, the patients with their +# record subjects and the grants of the seeding administrator, then the access +# policy, the care relationships, the EHR access settings, the legal marks, +# the attestations and the reads that fill the access log. Every body is a +# file under world/, access/ or records/ whose `__ID:__`, `__SUBJECT_ID:__`, +# `__LOGIN:__` and `__DATE:__` tokens the walker substitutes. + +# The login whose PERSON the token `__ID:__` names: its container id, read +# from the PERSON whose details carry the login as a `login` identifier. +login_person() { + local key="$1" login="$2" code id + jq -n --arg q "SELECT p/uid/value, p/details FROM PERSON p" '{q: $q}' > "$WORK/q.json" + code=$(request "PERSON of $login" POST "$BASE/query/aql" -H "$CT_JSON" --data-binary @"$WORK/q.json") + expect "PERSON of $login" "$code" 200 + id=$(jq -r --arg l "$login" '[.rows[] | select([.[1].items[]?.value + | select(type == "object" and .type == "login" and .id == $l)] | length > 0) + | .[0] | split("::")[0]] | first // empty' "$BODY") + [[ -n "$id" ]] || { + echo "::error::no PERSON carries the login $login; the seed needs it bound before it runs" >&2 + exit 1 + } + token "__ID:${key}__" "$id" +} + +# Writes the commit of a world body `$1` (a file under the seed directory), +# rendered, to `$2` and fails on a token the walker does not know. +world_body() { + local src="$SEED_DIR/$1" dst="$2" + [[ -f "$src" ]] || { + echo "::error::missing seed body $src" >&2 + exit 1 + } + jq --slurpfile t "$TOKENS" --argjson today "$TODAY" ' + def day($d): ($today + ($d | tonumber) * 86400) | strftime("%Y-%m-%d"); + walk(if type == "string" then + (if $t[0][.] != null then $t[0][.] else . end) + | gsub("__DATE:(?[+-]?[0-9]+)__"; day(.d)) + | gsub("__(?[A-Z_]+:[A-Za-z0-9.-]+)__"; $t[0]["__" + .k + "__"] // ("__" + .k + "__")) + else . end)' "$src" > "$dst" + if grep -qE '__[A-Z_]+(:[A-Za-z0-9.-]+)?__' "$dst"; then + echo "::error::$1 carries a token the walker cannot fill: $(grep -oE '__[A-Z_]+(:[A-Za-z0-9.-]+)?__' "$dst" | sort -u | paste -sd' ' -)" >&2 + exit 1 + fi +} + +# The versioned object id of the n-th (1-based) composition committed into EHR slot `$1`. +composition_of() { + local slot="$1" n="$2" vo + vo=$(sed -n "${n}p" "$WORK/comps.$slot") + [[ -n "$vo" ]] || { + echo "::error::EHR slot $slot holds no composition $n for the world to name" >&2 + exit 1 + } + printf '%s' "$vo" +} + +# The current version uid the `ETag` of a GET of `$2` answers. +current_version() { + local label="$1" url="$2" code + code=$(request "$label" GET "$url") + expect "$label" "$code" 200 + etag_uid +} + +# The provider the deployment acts for (`[authz.party_binding] provider`): the +# demo hospital is that provider, so its care relationships and +# representations are the deployment's own. +code=$(request "deployment provider" GET "$EXT/admin/config") +expect "deployment provider" "$code" 200 +token "__PROVIDER_ISSUER__" "$(jq -r '.authz.party_binding.provider.issuer // empty' "$BODY")" +token "__PROVIDER_ID__" "$(jq -r '.authz.party_binding.provider.id // empty' "$BODY")" +jq -e '.["__PROVIDER_ID__"] != ""' "$TOKENS" > /dev/null || { + echo "::error::the deployment names no [authz.party_binding] provider; the world's care relationships need one" >&2 + exit 1 +} +login_person seed-admin "$SEED_LOGIN" +[[ -n "$CLINICIAN" ]] && login_person clinician "$CLINICIAN" +token "__LOGIN:clinician__" "$CLINICIAN" +token "__LOGIN:proxy__" "$PROXY" + +world_parties=0 +while read -r entry; do + key=$(jq -r '.key' <<< "$entry") + kind=$(jq -r '.kind' <<< "$entry") + world_body "$(jq -r '.file' <<< "$entry")" "$WORK/party.json" + code=$(request "$kind $key" POST "$BASE/demographic/$kind" -H "$CT_JSON" --data-binary @"$WORK/party.json") + expect "$kind $key" "$code" 201 + ovid=$(etag_uid) + token "__ID:${key}__" "${ovid%%::*}" + world_parties=$((world_parties + 1)) +done < <(jq -c '.world.parties[]' "$MANIFEST") + +world_versions=0 +while read -r entry; do + key=$(jq -r '.key' <<< "$entry") + kind=$(jq -r '.kind' <<< "$entry") + id=$(jq -r --arg k "__ID:${key}__" '.[$k]' "$TOKENS") + current=$(current_version "$kind $key read" "$BASE/demographic/$kind/$id") + world_body "$(jq -r '.file' <<< "$entry")" "$WORK/party.json" + code=$(request "$kind $key version" PUT "$BASE/demographic/$kind/$id" -H "$CT_JSON" \ + -H "If-Match: \"$current\"" --data-binary @"$WORK/party.json") + expect "$kind $key version" "$code" 200 204 + world_versions=$((world_versions + 1)) +done < <(jq -c '.world.versions[]' "$MANIFEST") + +while read -r entry; do + key=$(jq -r '.key' <<< "$entry") + world_body "$(jq -r '.file' <<< "$entry")" "$WORK/relationship.json" + code=$(request "relationship $key" POST "$EXT/demographic/party_relationship" -H "$CT_JSON" \ + --data-binary @"$WORK/relationship.json") + expect "relationship $key" "$code" 201 + ovid=$(etag_uid) + token "__ID:${key}__" "${ovid%%::*}" +done < <(jq -c '.world.relationships[]' "$MANIFEST") +echo "==> $world_parties world parties, $world_versions further party versions, the representation" + +# The care relationships, each written on the route of its subject; an +# `ended` body closes one as a second version. +cares=0 +while read -r entry; do + key=$(jq -r '.key' <<< "$entry") + slot=$(jq -r '.ehr' <<< "$entry") + subject="$(subject_id "$(jq -r --argjson s "$slot" '.ehrs[$s].subject' "$MANIFEST")")" + world_body "$(jq -r '.file' <<< "$entry")" "$WORK/care.json" + code=$(request "care relationship $key" POST \ + "$EXT/care_relationship?subject_id=$subject&subject_namespace=$SUBJECT_NS" \ + -H "$CT_JSON" --data-binary @"$WORK/care.json") + expect "care relationship $key" "$code" 201 + ovid=$(etag_uid) + token "__ID:${key}__" "${ovid%%::*}" + ended=$(jq -r '.ended // empty' <<< "$entry") + if [[ -n "$ended" ]]; then + world_body "$ended" "$WORK/care.json" + code=$(request "care relationship $key ended" PUT "$EXT/care_relationship/${ovid%%::*}" \ + -H "$CT_JSON" -H "If-Match: \"$ovid\"" --data-binary @"$WORK/care.json") + expect "care relationship $key ended" "$code" 200 204 + fi + cares=$((cares + 1)) +done < <(jq -c '.world.care_relationships[]' "$MANIFEST") +echo "==> $cares care relationships" + +# The access policy: its first version holds professionals to a care +# relationship, so the clinician's reads of two EHRs outside one rest on a +# justification and an emergency with their reasons; the final version lifts +# that requirement for the visitors who browse every record. +policy_url="$EXT/admin/access_policy" +world_body "$(mf '.world.access_policy.first')" "$WORK/policy.json" +code=$(request "access policy" PUT "$policy_url" -H "$CT_JSON" -H 'If-None-Match: *' \ + --data-binary @"$WORK/policy.json") +expect "access policy" "$code" 201 +policy_version=$(etag_uid) +justified=0 +if [[ -n "$CLINICIAN" ]]; then + while read -r entry; do + slot=$(jq -r '.ehr' <<< "$entry") + purpose=$(jq -r '.purpose' <<< "$entry") + reason=$(jq -r '.reason | @uri' <<< "$entry") + code=$(REQ_AUTH="$CLINICIAN:$CLINICIAN_PASS" request "justified read ($purpose)" GET \ + "$BASE/ehr/${ehrs[$slot]}/ehr_status" -H "x-purpose-of-use: $purpose") + if [[ "$code" != 403 ]] || ! grep -q 'refused-reason-missing' "$BODY"; then + echo "::error::the clinician's read of EHR slot $slot under $purpose without a reason answered $code; the first policy version should ask for the reason" >&2 + head -c 400 "$BODY" >&2 + exit 1 + fi + code=$(REQ_AUTH="$CLINICIAN:$CLINICIAN_PASS" request "justified read ($purpose)" GET \ + "$BASE/ehr/${ehrs[$slot]}/ehr_status" -H "x-purpose-of-use: $purpose" -H "x-access-reason: $reason") + expect "justified read ($purpose)" "$code" 200 + justified=$((justified + 1)) + done < <(jq -c '.world.access_policy.justified[]' "$MANIFEST") +fi +world_body "$(mf '.world.access_policy.final')" "$WORK/policy.json" +code=$(request "access policy version" PUT "$policy_url" -H "$CT_JSON" -H "If-Match: \"$policy_version\"" \ + --data-binary @"$WORK/policy.json") +expect "access policy version" "$code" 200 +echo "==> the access policy in 2 versions, $justified justified and emergency reads" + +# The EHR access settings, each a new EHR_ACCESS version committed on the +# person's instruction over the admin route. +settings=0 +while read -r entry; do + slot=$(jq -r '.ehr' <<< "$entry") + ehr="${ehrs[$slot]}" + current=$(current_version "ehr_access read $ehr" "$EXT/ehr/$ehr/ehr_access") + world_body "$(jq -r '.file' <<< "$entry")" "$WORK/settings.json" + jq --arg e "$ehr" --arg p "$current" '{ehr_id: $e, preceding_version_uid: $p, settings: .}' \ + "$WORK/settings.json" > "$WORK/ehr-access.json" + code=$(request "ehr_access $ehr" POST "$EXT/admin/ehr-access" -H "$CT_JSON" --data-binary @"$WORK/ehr-access.json") + expect "ehr_access $ehr" "$code" 200 + settings=$((settings + 1)) +done < <(jq -c '.world.ehr_access[]' "$MANIFEST") +echo "==> $settings EHR access settings" + +# The legal marks: a restriction of processing, a research objection, the +# access-delay register with one held composition, and the retention register +# with two anchors, a whole-record hold and an object hold. +marks="$WORK/marks.json" +jq '.world.legal_marks' "$MANIFEST" > "$marks" +admin_post() { + local label="$1" path="$2" body="$3" code + shift 3 + code=$(request "$label" POST "$EXT/admin/$path" -H "$CT_JSON" -d "$body") + expect "$label" "$code" "$@" +} +mark_vo() { composition_of "${ehrs[$(jq -r ".$1.ehr" "$marks")]}" "$(jq -r ".$1.composition" "$marks")"; } +restricted_slot=$(jq -r '.restriction.ehr' "$marks") +admin_post "restriction" restriction "$(jq -c --arg e "${ehrs[$restricted_slot]}" \ + --arg v "$(composition_of "$restricted_slot" "$(jq -r '.restriction.composition' "$marks")")" \ + '.restriction | {ehr_id: $e, vo_id: $v, ground, note}' "$marks")" 204 +admin_post "research objection" research-objection "$(jq -c \ + --arg e "${ehrs[$(jq -r '.research_objection.ehr' "$marks")]}" \ + '.research_objection | {ehr_id: $e, objected: true, ground}' "$marks")" 204 +code=$(request "access-delay register" GET "$EXT/admin/registers/access-delay") +expect "access-delay register" "$code" 200 +register_version=$(header_value etag | tr -d '"') +code=$(request "access-delay register" PUT "$EXT/admin/registers/access-delay" -H "$CT_JSON" \ + -H "If-Match: \"$register_version\"" -d "$(jq -c '.access_delay_register' "$marks")") +expect "access-delay register" "$code" 200 +delay_slot=$(jq -r '.access_delay.ehr' "$marks") +admin_post "access delay" access-delay "$(jq -c --arg e "${ehrs[$delay_slot]}" \ + --arg v "$(composition_of "$delay_slot" "$(jq -r '.access_delay.composition' "$marks")")" \ + '.access_delay | {ehr_id: $e, vo_id: $v, note}' "$marks")" 204 +while read -r period; do + code=$(request "retention period" PUT "$EXT/admin/retention/policy" -H "$CT_JSON" -d "$period") + expect "retention period" "$code" 204 +done < <(jq -c '.retention_policies[]' "$marks") +while read -r anchor; do + slot=$(jq -r '.ehr' <<< "$anchor") + code=$(request "retention anchor" PUT "$EXT/admin/retention/anchor" -H "$CT_JSON" \ + -d "$(jq -c --arg e "${ehrs[$slot]}" 'del(.ehr) + {ehr_id: $e}' <<< "$anchor")") + expect "retention anchor" "$code" 204 +done < <(jq -c '.retention_anchors[]' "$marks") +while read -r hold; do + slot=$(jq -r '.ehr' <<< "$hold") + admin_post "retention hold" retention/hold "$(jq -nc \ + --arg v "$(composition_of "$slot" "$(jq -r '.composition' <<< "$hold")")" '{vo_id: $v, held: true}')" 204 +done < <(jq -c '.retention_holds[]' "$marks") +code=$(request "retention due" GET "$EXT/admin/retention/due") +expect "retention due" "$code" 200 +[[ "$(jq '.due | length' "$BODY")" -gt 0 ]] || { + echo "::error::the retention register lists nothing due; the anchors should put two EHRs past their period" >&2 + exit 1 +} +echo "==> the legal marks: a restriction, an objection, an access delay, $(jq '.due | length' "$BODY") retention periods due" + +# The attestations: the clinician commits a signed and a pending one, each +# with the composition it attests, through a CONTRIBUTION. +attested=0 +if [[ -n "$CLINICIAN" ]]; then + while read -r entry; do + slot=$(jq -r '.ehr' <<< "$entry") + world_body "$(jq -r '.file' <<< "$entry")" "$WORK/contribution.json" + code=$(REQ_AUTH="$CLINICIAN:$CLINICIAN_PASS" request "attestation" POST \ + "$BASE/ehr/${ehrs[$slot]}/contribution" -H "$CT_JSON" -H 'x-purpose-of-use: TREAT' \ + --data-binary @"$WORK/contribution.json") + expect "attestation" "$code" 201 + attested=$((attested + 1)) + done < <(jq -c '.world.attestations[]' "$MANIFEST") +fi + +archetypes=0 +while read -r rel; do + code=$(request "archetype $(basename "$rel")" POST "$EXT/definition/archetype/adl1.4" \ + -H "$CT_PLAIN" --data-binary @"$ROOT_DIR/$rel") + expect "archetype $(basename "$rel")" "$code" 201 409 + archetypes=$((archetypes + 1)) +done < <(mf '.world.adl14_archetypes[]') +echo "==> $attested attested versions, $archetypes ADL 1.4 archetypes" + +# ── 11. stored AQL queries ─────────────────────────────────────────────────── # # Each one is executed after it is stored and must answer at least the row count # the manifest pins: a query the demo data cannot feed is a broken demo, not a @@ -654,6 +984,16 @@ while read -r entry; do fi expect "query run $name" "$code" 200 + # A cohort query runs the stored text on the cohort its subjects name + # (FerroEHR's cohort extension), after the stored run above. + subjects=$(printf '%s' "$entry" | jq -c '.cohort_subjects // empty') + if [[ -n "$subjects" ]]; then + jq -n --rawfile q "$aql" --argjson slots "$subjects" --slurpfile t "$TOKENS" --arg ns "$SUBJECT_NS" \ + '{q: $q, purpose: "secondary-use", + subjects: [$slots[] | {id: $t[0]["__SUBJECT_ID:\(.)__"], namespace: $ns}]}' > "$WORK/cohort.json" + code=$(request "cohort run $name" POST "$EXT/query/cohort" -H "$CT_JSON" --data-binary @"$WORK/cohort.json") + expect "cohort run $name" "$code" 200 + fi rows=$(jq '.rows | length' "$BODY") if [[ "$rows" -lt "$min_rows" ]]; then echo "::error::stored query $name returned $rows rows, below the $min_rows the manifest pins — the seeded data no longer feeds it." >&2 @@ -664,7 +1004,66 @@ while read -r entry; do done < <(jq -c '.stored_queries[]' "$MANIFEST") echo "==> $queries stored AQL queries, each answering rows" -# ── 11. the completion marker ──────────────────────────────────────────────── +# ── 12. the logs ───────────────────────────────────────────────────────────── +# +# Every request above wrote its access-log entry and its system record. The +# patient's representative reads the subject view of the patient's access log; the review across EHRs reads the full view; and, where the +# server signs with an OpenPGP key, the log is sealed into a signed checkpoint +# and verified. + +patient_slot=$(mf '.world.logs.patient_ehr') +patient_ehr="${ehrs[$patient_slot]}" +if [[ -n "$PROXY" ]]; then + code=$(REQ_AUTH="$PROXY:$PROXY_PASS" request "the representative's view of the access log" GET \ + "$EXT/ehr/$patient_ehr/access_log") + expect "the representative's view of the access log" "$code" 200 + [[ "$(jq '.entries | length' "$BODY")" -gt 0 ]] || { + echo "::error::the subject view of EHR $patient_ehr's access log lists no entry" >&2 + exit 1 + } + echo "==> the subject view of a patient's access log lists $(jq '.entries | length' "$BODY") entries" +fi + +min_review=$(mf '.world.logs.min_review_ehrs') +code=$(request "access-log review" GET "$EXT/admin/access-log?fetch=1000") +expect "access-log review" "$code" 200 +reviewed=$(jq '[.entries[].ehr_id.value? // empty] | unique | length' "$BODY") +[[ "$reviewed" -ge "$min_review" ]] || { + echo "::error::the access-log review names $reviewed EHRs, below the $min_review the manifest pins" >&2 + exit 1 +} + +# The system records (IHE ATNA, read over ITI-81) of the day the seed ran. +FHIR="${SANDBOX_BASE:-https://sandbox.ferroehr.eu}/ferroehr/rest/fhir/r4" +code=$(request "system records" GET "$FHIR/AuditEvent?date=ge$(date -u -r "$TODAY" +%Y-%m-%d 2>/dev/null || date -u -d "@$TODAY" +%Y-%m-%d)&_count=10") +expect "system records" "$code" 200 +[[ "$(jq '.entry | length' "$BODY")" -gt 0 ]] || { + echo "::error::ITI-81 answers no system record for the day the seed ran" >&2 + exit 1 +} + +# The kind of signature the server writes, read off the seeding admin's +# role version: an OpenPGP signature names a key the checkpoint is signed with. +role_id=$(jq -r '.["__ID:role-privacy-officer__"]' "$TOKENS") +code=$(request "signature kind" GET "$BASE/demographic/versioned_party/$role_id/version") +expect "signature kind" "$code" 200 +if jq -e '.signature // "" | startswith("-----BEGIN PGP SIGNATURE-----")' "$BODY" > /dev/null; then + code=$(request "access-log checkpoint" POST "$EXT/admin/access-log/checkpoint") + expect "access-log checkpoint" "$code" 200 201 + code=$(request "access-log verification" POST "$EXT/admin/access-log/verify") + expect "access-log verification" "$code" 200 + echo "==> the access log of $reviewed EHRs, sealed into a signed checkpoint that verifies" +else + echo "==> the access log of $reviewed EHRs; the server signs versions by digest, so no checkpoint is signed" +fi + +# The ids a harness needs to address the seeded records, when asked for. +if [[ -n "$IDS_OUT" ]]; then + printf '%s\n' "${ehrs[@]}" | jq -R . | jq -s --slurpfile t "$TOKENS" '{ehrs: ., tokens: $t[0]}' > "$IDS_OUT" + echo "==> the seeded ids are in $IDS_OUT" +fi + +# ── 13. the completion marker ──────────────────────────────────────────────── render "$SEED_DIR/$(mf '.marker.status')" "$WORK/marker.json" \ "__SUBJECT_ID__=$MARKER_ID" "__SUBJECT_NS__=$SUBJECT_NS" diff --git a/scripts/sandbox/seed/access/ehr-access-opt-out.json b/scripts/sandbox/seed/access/ehr-access-opt-out.json new file mode 100644 index 0000000000..90dcfe36a1 --- /dev/null +++ b/scripts/sandbox/seed/access/ehr-access-opt-out.json @@ -0,0 +1,50 @@ +{ + "_type": "ACCESS_DIRECTIVE_SETTINGS", + "default_access": { + "_type": "DV_CODED_TEXT", + "value": "open", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "open" + } + }, + "directives": [ + { + "_type": "ACCESS_DIRECTIVE", + "name": { + "_type": "DV_TEXT", + "value": "Opt-out from the access services (EHDS Art. 10)" + }, + "archetype_node_id": "at0001", + "kind": { + "_type": "DV_CODED_TEXT", + "value": "opt_out", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "opt_out" + } + }, + "effect": { + "_type": "DV_CODED_TEXT", + "value": "deny", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "HL7_ConsentProvisionType" + }, + "code_string": "deny" + } + }, + "emergency_override": false + } + ] +} diff --git a/scripts/sandbox/seed/access/ehr-access-restriction.json b/scripts/sandbox/seed/access/ehr-access-restriction.json new file mode 100644 index 0000000000..4c13b94718 --- /dev/null +++ b/scripts/sandbox/seed/access/ehr-access-restriction.json @@ -0,0 +1,140 @@ +{ + "_type": "ACCESS_DIRECTIVE_SETTINGS", + "default_access": { + "_type": "DV_CODED_TEXT", + "value": "open", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "open" + } + }, + "directives": [ + { + "_type": "ACCESS_DIRECTIVE", + "name": { + "_type": "DV_TEXT", + "value": "No access for a named professional" + }, + "archetype_node_id": "at0001", + "kind": { + "_type": "DV_CODED_TEXT", + "value": "restriction", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "restriction" + } + }, + "effect": { + "_type": "DV_CODED_TEXT", + "value": "deny", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "HL7_ConsentProvisionType" + }, + "code_string": "deny" + } + }, + "emergency_override": true, + "applies_to": [ + { + "_type": "ACCESS_ACTOR_SCOPE", + "party": { + "_type": "PARTY_REF", + "namespace": "demographic", + "type": "PERSON", + "id": { + "_type": "HIER_OBJECT_ID", + "value": "__ID:person-02__" + } + } + } + ] + }, + { + "_type": "ACCESS_DIRECTIVE", + "name": { + "_type": "DV_TEXT", + "value": "Consent for the cardiology ward" + }, + "archetype_node_id": "at0001", + "kind": { + "_type": "DV_CODED_TEXT", + "value": "consent", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "consent" + } + }, + "effect": { + "_type": "DV_CODED_TEXT", + "value": "permit", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "HL7_ConsentProvisionType" + }, + "code_string": "permit" + } + }, + "emergency_override": false, + "applies_to": [ + { + "_type": "ACCESS_ACTOR_SCOPE", + "party": { + "_type": "PARTY_REF", + "namespace": "demographic", + "type": "GROUP", + "id": { + "_type": "HIER_OBJECT_ID", + "value": "__ID:group-cardiology__" + } + } + } + ], + "purposes": [ + { + "_type": "DV_CODED_TEXT", + "value": "treatment", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "HL7_ActReason" + }, + "code_string": "TREAT" + } + } + ], + "time_validity": { + "_type": "DV_INTERVAL", + "lower": { + "_type": "DV_DATE_TIME", + "value": "__DATE:-1__T00:00:00Z" + }, + "upper": { + "_type": "DV_DATE_TIME", + "value": "__DATE:+365__T00:00:00Z" + }, + "lower_unbounded": false, + "upper_unbounded": false, + "lower_included": true, + "upper_included": true + } + } + ] +} diff --git a/scripts/sandbox/seed/access/policy.v1.json b/scripts/sandbox/seed/access/policy.v1.json new file mode 100644 index 0000000000..8cc408dc3f --- /dev/null +++ b/scripts/sandbox/seed/access/policy.v1.json @@ -0,0 +1,69 @@ +{ + "_type": "ACCESS_POLICY", + "name": { + "_type": "DV_TEXT", + "value": "FerroEHR Demo Hospital access policy" + }, + "archetype_node_id": "openEHR-EHR-ACCESS_POLICY.controller.v1", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "openEHR-EHR-ACCESS_POLICY.controller.v1" + }, + "rm_version": "1.2.0" + }, + "controller": { + "_type": "PARTY_REF", + "namespace": "demographic", + "type": "ORGANISATION", + "id": { + "_type": "HIER_OBJECT_ID", + "value": "__ID:organisation-hospital__" + } + }, + "justifications": [ + { + "_type": "ACCESS_JUSTIFICATION", + "emergency": false, + "purposes": [ + { + "_type": "DV_CODED_TEXT", + "value": "treatment", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "HL7_ActReason" + }, + "code_string": "TREAT" + } + } + ] + }, + { + "_type": "ACCESS_JUSTIFICATION", + "emergency": true, + "purposes": [ + { + "_type": "DV_CODED_TEXT", + "value": "emergency treatment", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "HL7_ActReason" + }, + "code_string": "ETREAT" + } + } + ] + } + ], + "care_relationship_required": true, + "relationship_grace": { + "_type": "DV_DURATION", + "value": "P14D" + }, + "purpose_required": false +} diff --git a/scripts/sandbox/seed/access/policy.v2.json b/scripts/sandbox/seed/access/policy.v2.json new file mode 100644 index 0000000000..a55d38729c --- /dev/null +++ b/scripts/sandbox/seed/access/policy.v2.json @@ -0,0 +1,154 @@ +{ + "_type": "ACCESS_POLICY", + "name": { + "_type": "DV_TEXT", + "value": "FerroEHR Demo Hospital access policy" + }, + "archetype_node_id": "openEHR-EHR-ACCESS_POLICY.controller.v1", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "openEHR-EHR-ACCESS_POLICY.controller.v1" + }, + "rm_version": "1.2.0" + }, + "controller": { + "_type": "PARTY_REF", + "namespace": "demographic", + "type": "ORGANISATION", + "id": { + "_type": "HIER_OBJECT_ID", + "value": "__ID:organisation-hospital__" + } + }, + "justifications": [ + { + "_type": "ACCESS_JUSTIFICATION", + "emergency": false, + "purposes": [ + { + "_type": "DV_CODED_TEXT", + "value": "treatment", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "HL7_ActReason" + }, + "code_string": "TREAT" + } + } + ] + }, + { + "_type": "ACCESS_JUSTIFICATION", + "emergency": true, + "purposes": [ + { + "_type": "DV_CODED_TEXT", + "value": "emergency treatment", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "HL7_ActReason" + }, + "code_string": "ETREAT" + } + } + ] + } + ], + "care_relationship_required": false, + "relationship_grace": { + "_type": "DV_DURATION", + "value": "P14D" + }, + "purpose_required": false, + "classifications": [ + { + "_type": "ACCESS_CLASSIFICATION", + "name": { + "_type": "DV_TEXT", + "value": "Mental health notes" + }, + "archetype_node_id": "at0002", + "data": { + "_type": "ACCESS_DATA_SCOPE", + "archetypes": [ + { + "_type": "ARCHETYPE_ID", + "value": "openEHR-EHR-COMPOSITION.mental_health_note.v1" + } + ] + }, + "sensitivities": [ + { + "_type": "DV_CODED_TEXT", + "value": "very restricted", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "2.16.840.1.113883.5.25" + }, + "code_string": "V" + } + } + ] + } + ], + "log_restrictions": [ + { + "_type": "ACCESS_LOG_RESTRICTION", + "name": { + "_type": "DV_TEXT", + "value": "Accessor roles withheld" + }, + "archetype_node_id": "id11", + "accessor_kinds": [ + { + "_type": "DV_CODED_TEXT", + "value": "person", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "person" + } + } + ], + "withheld": [ + { + "_type": "DV_CODED_TEXT", + "value": "accessor_roles", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "accessor_roles" + } + } + ], + "legal_grounds": [ + { + "_type": "DV_CODED_TEXT", + "value": "national provision under EHDS Art. 9(3) (synthetic)", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "urn:example:national-law" + }, + "code_string": "art-9-3" + } + } + ] + } + ] +} diff --git a/scripts/sandbox/seed/flat/minimal-14.json b/scripts/sandbox/seed/flat/minimal-14.json new file mode 100644 index 0000000000..41fb8c1022 --- /dev/null +++ b/scripts/sandbox/seed/flat/minimal-14.json @@ -0,0 +1,8 @@ +{ + "ctx/language": "en", + "ctx/territory": "US", + "ctx/composer_name": "Demo composer (synthetic)", + "ctx/time": "2026-07-14T08:00:00Z", + "minimal/minimal/quantity|magnitude": 36.5, + "minimal/minimal/quantity|unit": "kg" +} diff --git a/scripts/sandbox/seed/flat/minimal-15.json b/scripts/sandbox/seed/flat/minimal-15.json new file mode 100644 index 0000000000..c6913af203 --- /dev/null +++ b/scripts/sandbox/seed/flat/minimal-15.json @@ -0,0 +1,8 @@ +{ + "ctx/language": "en", + "ctx/territory": "US", + "ctx/composer_name": "Demo composer (synthetic)", + "ctx/time": "2026-07-15T08:00:00Z", + "minimal/minimal/quantity|magnitude": 37.8, + "minimal/minimal/quantity|unit": "kg" +} diff --git a/scripts/sandbox/seed/flat/minimal-16.json b/scripts/sandbox/seed/flat/minimal-16.json new file mode 100644 index 0000000000..a5ded62825 --- /dev/null +++ b/scripts/sandbox/seed/flat/minimal-16.json @@ -0,0 +1,8 @@ +{ + "ctx/language": "en", + "ctx/territory": "US", + "ctx/composer_name": "Demo composer (synthetic)", + "ctx/time": "2026-07-16T08:00:00Z", + "minimal/minimal/quantity|magnitude": 39.1, + "minimal/minimal/quantity|unit": "kg" +} diff --git a/scripts/sandbox/seed/manifest.json b/scripts/sandbox/seed/manifest.json index d19458799f..583e75638f 100644 --- a/scripts/sandbox/seed/manifest.json +++ b/scripts/sandbox/seed/manifest.json @@ -1,17 +1,27 @@ { "notes": [ - "The hosted sandbox demo dataset (issue #3045). scripts/sandbox/reseed.sh walks", - "this file and drives the PUBLIC REST API only, so a green seed run is itself", - "evidence that the deployment serves what it claims. Adding content means", - "editing this file plus a body under scripts/sandbox/seed/, never the walker.", + "The demo dataset of FerroEHR (#3045, #6663): every record, party, policy and log entry in", + "it is synthetic, made up for the demo, and names no real person. scripts/sandbox/reseed.sh", + "walks this file and drives the PUBLIC REST API only, as an administrator, a clinician and", + "a patient's representative, so every write passes the same authorization and leaves the", + "same access record a client's does. It seeds the hosted sandbox every night and the", + "browser journeys' stack (scripts/ui-e2e.sh). Adding content means editing this file plus", + "a body under scripts/sandbox/seed/, never the walker.", "", - "What one run loads, in about 592 requests: 17 ADL 1.4 operational templates", - "(the curated CKM pack plus one terminology-binding template), 231 artefacts out of the 322-file vendored ADL 2", - "archetype corpus, 8 ADL 2 artefacts of this repository's own, 8 EHRs carrying", - "167 ADL 1.4 + 16 ADL 2 compositions, 6 further COMPOSITION versions, 2", - "further EHR_STATUS versions, 11 demographic parties, a directory in every", - "EHR, and 5 stored AQL queries. One marker EHR records completion, so a second", - "run exits immediately and the instance data is never doubled.", + "What one run loads: 18 ADL 1.4 operational templates (the curated CKM pack, one", + "terminology-binding template and the viewer's minimal evaluation template), the vendored", + "ADL 2 archetype library as pinned below, 6 ADL 2 artefacts of this repository's own, 5", + "ADL 1.4 CKM archetypes, 8 EHRs with their compositions, further COMPOSITION and EHR_STATUS", + "versions, 3 Simplified Flat compositions with measured values, a directory in every EHR,", + "the demographic parties (persons, the patients with their record subjects, the provider", + "organisation, care teams, a system client and the roles that grant), a representation,", + "3 care relationships, the controller's access policy in 2 versions with a justified and", + "an emergency read between them, 2 EHR access settings, the legal marks (a restriction of", + "processing, a research objection, an access delay, retention periods with something due", + "and holds), 2 attested versions, 6 stored AQL queries (one run as a cohort), the subject", + "view of a patient's access log and, where the server signs with an OpenPGP key, a signed", + "access-log checkpoint that verifies. One marker EHR records completion, so a second run", + "exits immediately and the instance data is never doubled.", "", "The archetype-library pin (231 accepted / 91 refused) holds for the sandbox's", "terminology posture: FerroTERM beside the CDR serving the SNOMED CT", @@ -29,17 +39,15 @@ "local run without LOINC sets SANDBOX_TERMINOLOGY=without-loinc and expects", "234 / 88. The same test file checks both splits against this pin.", "", - "Measured 2026-09-02 against the composed quickstart stack on an 8-CPU/8 GB", - "Docker VM: 39-45 s from an empty schema, under a second on a second run. The", - "loaded data is ~9 MB of canonical composition JSON and leaves a 24 MB", - "database (17 373 node rows, 227 versions).", - "", - "Placeholders in the body files are substituted by the walker: __SUBJECT_ID__", - "(an EHR subject, or under an IHE identity source the pseudonym FerroPIX minted", - "for it), __SUBJECT_NS__ (subject_namespace, or the pseudonym domain), __PERFORMER__ / __SOURCE__ / __TARGET__ (a seeded party's", - "VERSIONED_OBJECT uid), __COMPOSITION_n__ (the n-th composition committed into", - "the EHR the folder is written to), and __EHR_n__ (the n-th seeded EHR id) in", - "stored-query verification parameters." + "Tokens in the body files are substituted by the walker: __SUBJECT_ID__ (an EHR subject,", + "or under an IHE identity source the pseudonym FerroPIX minted for it), __SUBJECT_NS__", + "(subject_namespace, or the pseudonym domain), __PERFORMER__ / __SOURCE__ / __TARGET__ (a", + "seeded party's VERSIONED_OBJECT uid), __COMPOSITION_n__ (the n-th composition committed", + "into the EHR the folder is written to), __EHR_n__ (the n-th seeded EHR id) in stored-query", + "verification parameters, and in the world/, access/ and records/ bodies __ID:__ (the", + "party, relationship or login PERSON of that key), __SUBJECT_ID:__ (the n-th EHR's", + "subject), __LOGIN:__ (a login), __PROVIDER_ISSUER__ / __PROVIDER_ID__ (the provider the", + "deployment acts for) and __DATE:__ (the UTC date that many days from the run)." ], "subject_namespace": "ferroehr-sandbox", @@ -84,7 +92,14 @@ { "slug": "sars-event-notification", "ehrs": [2, 3, 6, 7], "compositions_per_ehr": 1, "extra_versions": 0 }, { "slug": "diphtheria-case-investigation", "ehrs": [1, 5], "compositions_per_ehr": 1, "extra_versions": 0 }, { "slug": "poisoning-case-investigation", "ehrs": [2, 6], "compositions_per_ehr": 1, "extra_versions": 0 }, - { "slug": "congenital-syphilis-case-investigation", "ehrs": [3, 7], "compositions_per_ehr": 1, "extra_versions": 0 } + { "slug": "congenital-syphilis-case-investigation", "ehrs": [3, 7], "compositions_per_ehr": 1, "extra_versions": 0 }, + { "slug": "minimal-evaluation", "file": "app/ferroehr-viewer/tests/fixtures/minimal_evaluation.opt", "template_id": "minimal_evaluation.en.v1", "example": "generated", "ehrs": [0], "compositions_per_ehr": 1, "extra_versions": 1 } + ], + + "flat_compositions": [ + { "template_id": "minimal_evaluation.en.v1", "ehr": 1, "file": "flat/minimal-14.json" }, + { "template_id": "minimal_evaluation.en.v1", "ehr": 2, "file": "flat/minimal-15.json" }, + { "template_id": "minimal_evaluation.en.v1", "ehr": 3, "file": "flat/minimal-16.json" } ], "adl2": { @@ -114,18 +129,6 @@ "ehrs": [0, 1, 2, 3, 4, 5, 6, 7], "compositions_per_ehr": 1 }, - { - "file": "corpus/fixtures/adl2/opt/versioned.v1_0_0.adls", - "id": "openEHR-EHR-COMPOSITION.cnf_adl2_versioned.v1.0.0", - "ehrs": [], - "compositions_per_ehr": 0 - }, - { - "file": "corpus/fixtures/adl2/opt/versioned.v1_1_0.adls", - "id": "openEHR-EHR-COMPOSITION.cnf_adl2_versioned.v1.1.0", - "ehrs": [0, 1, 2, 3], - "compositions_per_ehr": 1 - }, { "file": "corpus/fixtures/adl2/opt/flat_parity_a.adls", "id": "openEHR-EHR-COMPOSITION.cnf_adl2_flat_a.v1.0.0", @@ -161,6 +164,84 @@ ] }, + "world": { + "parties": [ + { "key": "organisation-hospital", "kind": "organisation", "file": "world/organisation-hospital.json" }, + { "key": "organisation-lab", "kind": "organisation", "file": "world/organisation-lab.json" }, + { "key": "group-cardiology", "kind": "group", "file": "world/group-cardiology.json" }, + { "key": "group-emergency", "kind": "group", "file": "world/group-emergency.json" }, + { "key": "agent-lab-engine", "kind": "agent", "file": "world/agent-lab-engine.json" }, + { "key": "role-lab-feed", "kind": "role", "file": "world/role-lab-feed.json" }, + { "key": "role-privacy-officer", "kind": "role", "file": "world/role-privacy-officer.json" }, + { "key": "patient-01", "kind": "person", "file": "world/patient-01.json" }, + { "key": "patient-02", "kind": "person", "file": "world/patient-02.json" }, + { "key": "patient-03", "kind": "person", "file": "world/patient-03.json" }, + { "key": "patient-04", "kind": "person", "file": "world/patient-04.json" }, + { "key": "patient-05", "kind": "person", "file": "world/patient-05.json" }, + { "key": "patient-06", "kind": "person", "file": "world/patient-06.json" }, + { "key": "proxy-01", "kind": "person", "file": "world/proxy-01.json" } + ], + "versions": [ + { "key": "organisation-hospital", "kind": "organisation", "file": "world/organisation-hospital.v2.json" } + ], + "relationships": [ + { "key": "representation-guardian", "file": "world/representation-guardian.json" }, + { "key": "representation-proxy", "file": "world/representation-proxy.json" } + ], + "care_relationships": [ + { "key": "care-patient-01", "ehr": 0, "file": "world/care-patient-01-cardiology.json" }, + { "key": "care-patient-02", "ehr": 1, "file": "world/care-patient-02-cardiology.json", "ended": "world/care-patient-02-cardiology.ended.json" }, + { "key": "care-patient-03", "ehr": 2, "file": "world/care-patient-03-emergency.json" } + ], + "access_policy": { + "first": "access/policy.v1.json", + "justified": [ + { "ehr": 3, "purpose": "TREAT", "reason": "Second opinion requested by the ward (synthetic)" }, + { "ehr": 4, "purpose": "ETREAT", "reason": "Unconscious on arrival at the emergency department (synthetic)" } + ], + "final": "access/policy.v2.json" + }, + "ehr_access": [ + { "ehr": 4, "file": "access/ehr-access-restriction.json" }, + { "ehr": 5, "file": "access/ehr-access-opt-out.json" } + ], + "legal_marks": { + "restriction": { "ehr": 7, "composition": 1, "ground": "gdpr-18-1-a", "note": "accuracy contested by the person (synthetic)" }, + "research_objection": { "ehr": 1, "ground": "GDPR Art. 21(6) (synthetic)" }, + "access_delay_register": { "enabled": true, "categories": ["Laboratory-Reports"], "max_delay": "72h" }, + "access_delay": { "ehr": 0, "composition": 1, "note": "held until the cardiologist has discussed the result (synthetic)" }, + "retention_policies": [ + { "kind": "EHR", "jurisdiction": "NL", "period": "P20Y", "anchor": "last_commit", "source": "WGBO art. 7:454 lid 3 (synthetic demo period)" }, + { "kind": "COMPOSITION", "jurisdiction": "NL", "period": "P20Y", "anchor": "last_commit", "source": "WGBO art. 7:454 lid 3 (synthetic demo period)" } + ], + "retention_anchors": [ + { "ehr": 2, "jurisdiction": "NL", "anchored_at": "1999-01-01T00:00:00Z" }, + { + "ehr": 3, + "jurisdiction": "NL", + "anchored_at": "2001-01-01T00:00:00Z", + "hold_at": "2026-01-15T00:00:00Z", + "hold_ground": "litigation hold (synthetic)" + } + ], + "retention_holds": [ + { "ehr": 2, "composition": 1} + ] + }, + "attestations": [ + { "ehr": 0, "file": "records/attested-signed.json" }, + { "ehr": 1, "file": "records/attested-pending.json" } + ], + "adl14_archetypes": [ + "corpus/archetypes/ckm/adl14/openEHR-EHR-OBSERVATION.blood_pressure.v2.adl", + "corpus/archetypes/ckm/adl14/openEHR-EHR-OBSERVATION.body_temperature.v2.adl", + "corpus/archetypes/ckm/adl14/openEHR-EHR-OBSERVATION.pulse.v2.adl", + "corpus/archetypes/ckm/adl14/openEHR-EHR-OBSERVATION.respiration.v2.adl", + "corpus/archetypes/ckm/adl14/openEHR-EHR-OBSERVATION.body_weight.v2.adl" + ], + "logs": { "patient_ehr": 0, "min_review_ehrs": 6} + }, + "directory": { "folder": "folders/episodes.json", "ehrs": [0, 1, 2, 3, 4, 5, 6, 7] @@ -197,6 +278,13 @@ "file": "queries/patient_record.aql", "min_rows": 20, "parameters": { "ehr_id": "__EHR_0__" } + }, + { + "name": "eu.ferroehr.sandbox::cohort_compositions", + "version": "1.0.0", + "file": "queries/cohort_compositions.aql", + "min_rows": 20, + "cohort_subjects": [0, 1, 2, 3, 4, 5] } ] } diff --git a/scripts/sandbox/seed/queries/cohort_compositions.aql b/scripts/sandbox/seed/queries/cohort_compositions.aql new file mode 100644 index 0000000000..a1fc25d11c --- /dev/null +++ b/scripts/sandbox/seed/queries/cohort_compositions.aql @@ -0,0 +1,8 @@ +SELECT + c/archetype_details/template_id/value AS template_id, + c/name/value AS title, + c/context/start_time/value AS start_time +FROM EHR e + CONTAINS COMPOSITION c +ORDER BY c/archetype_details/template_id/value ASC +LIMIT 200 diff --git a/scripts/sandbox/seed/records/attested-pending.json b/scripts/sandbox/seed/records/attested-pending.json new file mode 100644 index 0000000000..c59fddf9d5 --- /dev/null +++ b/scripts/sandbox/seed/records/attested-pending.json @@ -0,0 +1,161 @@ +{ + "versions": [ + { + "_type": "ORIGINAL_VERSION", + "commit_audit": { + "change_type": { + "_type": "DV_CODED_TEXT", + "value": "creation", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr" + }, + "code_string": "249" + } + }, + "committer": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "demographic", + "type": "PERSON", + "id": { + "_type": "HIER_OBJECT_ID", + "value": "__ID:clinician__" + } + } + } + }, + "lifecycle_state": { + "_type": "DV_CODED_TEXT", + "value": "complete", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr" + }, + "code_string": "532" + } + }, + "attestations": [ + { + "_type": "UPDATE_ATTESTATION", + "change_type": { + "_type": "DV_CODED_TEXT", + "value": "attestation", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr" + }, + "code_string": "666" + } + }, + "reason": { + "_type": "DV_TEXT", + "value": "awaiting co-signature" + }, + "is_pending": true, + "committer": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "demographic", + "type": "PERSON", + "id": { + "_type": "HIER_OBJECT_ID", + "value": "__ID:clinician__" + } + } + } + } + ], + "data": { + "_type": "COMPOSITION", + "archetype_node_id": "openEHR-EHR-COMPOSITION.encounter.v1", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "openEHR-EHR-COMPOSITION.encounter.v1" + }, + "rm_version": "1.2.0" + }, + "name": { + "_type": "DV_TEXT", + "value": "Cardiology discharge letter (draft)" + }, + "language": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "ISO_639-1" + }, + "code_string": "en" + }, + "territory": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "ISO_3166-1" + }, + "code_string": "NL" + }, + "category": { + "_type": "DV_CODED_TEXT", + "value": "event", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr" + }, + "code_string": "433" + } + }, + "composer": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "demographic", + "type": "PERSON", + "id": { + "_type": "HIER_OBJECT_ID", + "value": "__ID:clinician__" + } + } + } + } + } + ], + "audit": { + "change_type": { + "_type": "DV_CODED_TEXT", + "value": "creation", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr" + }, + "code_string": "249" + } + }, + "committer": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "demographic", + "type": "PERSON", + "id": { + "_type": "HIER_OBJECT_ID", + "value": "__ID:clinician__" + } + } + } + } +} diff --git a/scripts/sandbox/seed/records/attested-signed.json b/scripts/sandbox/seed/records/attested-signed.json new file mode 100644 index 0000000000..fc53b22446 --- /dev/null +++ b/scripts/sandbox/seed/records/attested-signed.json @@ -0,0 +1,161 @@ +{ + "versions": [ + { + "_type": "ORIGINAL_VERSION", + "commit_audit": { + "change_type": { + "_type": "DV_CODED_TEXT", + "value": "creation", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr" + }, + "code_string": "249" + } + }, + "committer": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "demographic", + "type": "PERSON", + "id": { + "_type": "HIER_OBJECT_ID", + "value": "__ID:clinician__" + } + } + } + }, + "lifecycle_state": { + "_type": "DV_CODED_TEXT", + "value": "complete", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr" + }, + "code_string": "532" + } + }, + "attestations": [ + { + "_type": "UPDATE_ATTESTATION", + "change_type": { + "_type": "DV_CODED_TEXT", + "value": "attestation", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr" + }, + "code_string": "666" + } + }, + "reason": { + "_type": "DV_TEXT", + "value": "signed by the treating cardiologist" + }, + "is_pending": false, + "committer": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "demographic", + "type": "PERSON", + "id": { + "_type": "HIER_OBJECT_ID", + "value": "__ID:clinician__" + } + } + } + } + ], + "data": { + "_type": "COMPOSITION", + "archetype_node_id": "openEHR-EHR-COMPOSITION.encounter.v1", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "openEHR-EHR-COMPOSITION.encounter.v1" + }, + "rm_version": "1.2.0" + }, + "name": { + "_type": "DV_TEXT", + "value": "Cardiology outpatient letter" + }, + "language": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "ISO_639-1" + }, + "code_string": "en" + }, + "territory": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "ISO_3166-1" + }, + "code_string": "NL" + }, + "category": { + "_type": "DV_CODED_TEXT", + "value": "event", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr" + }, + "code_string": "433" + } + }, + "composer": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "demographic", + "type": "PERSON", + "id": { + "_type": "HIER_OBJECT_ID", + "value": "__ID:clinician__" + } + } + } + } + } + ], + "audit": { + "change_type": { + "_type": "DV_CODED_TEXT", + "value": "creation", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr" + }, + "code_string": "249" + } + }, + "committer": { + "_type": "PARTY_IDENTIFIED", + "external_ref": { + "_type": "PARTY_REF", + "namespace": "demographic", + "type": "PERSON", + "id": { + "_type": "HIER_OBJECT_ID", + "value": "__ID:clinician__" + } + } + } + } +} diff --git a/scripts/sandbox/seed/world/agent-lab-engine.json b/scripts/sandbox/seed/world/agent-lab-engine.json new file mode 100644 index 0000000000..a9f31f7d3c --- /dev/null +++ b/scripts/sandbox/seed/world/agent-lab-engine.json @@ -0,0 +1,80 @@ +{ + "_type": "AGENT", + "archetype_node_id": "eu.ferroehr.sandbox::openEHR-DEMOGRAPHIC-AGENT.integration_engine.v1", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "eu.ferroehr.sandbox::openEHR-DEMOGRAPHIC-AGENT.integration_engine.v1" + }, + "rm_version": "1.2.0" + }, + "name": { + "_type": "DV_TEXT", + "value": "Laboratory interface engine" + }, + "details": { + "_type": "ITEM_TREE", + "archetype_node_id": "at0010", + "name": { + "_type": "DV_TEXT", + "value": "details" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "at0012", + "name": { + "_type": "DV_CODED_TEXT", + "value": "client_id", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "client_id" + } + }, + "value": { + "_type": "DV_IDENTIFIER", + "issuer": "https://machines.ferroehr.invalid", + "id": "demo-lab-engine", + "type": "client_id" + } + } + ] + }, + "identities": [ + { + "_type": "PARTY_IDENTITY", + "archetype_node_id": "at0001", + "name": { + "_type": "DV_TEXT", + "value": "name" + }, + "details": { + "_type": "ITEM_TREE", + "archetype_node_id": "at0002", + "name": { + "_type": "DV_TEXT", + "value": "details" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "at0003", + "name": { + "_type": "DV_TEXT", + "value": "name" + }, + "value": { + "_type": "DV_TEXT", + "value": "Laboratory interface engine" + } + } + ] + } + } + ] +} diff --git a/scripts/sandbox/seed/world/care-patient-01-cardiology.json b/scripts/sandbox/seed/world/care-patient-01-cardiology.json new file mode 100644 index 0000000000..098fd56637 --- /dev/null +++ b/scripts/sandbox/seed/world/care-patient-01-cardiology.json @@ -0,0 +1,121 @@ +{ + "_type": "PARTY_RELATIONSHIP", + "archetype_node_id": "openEHR-DEMOGRAPHIC-PARTY_RELATIONSHIP.under_care_of.v2", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "openEHR-DEMOGRAPHIC-PARTY_RELATIONSHIP.under_care_of.v2" + }, + "rm_version": "1.1.0", + "template_id": { + "_type": "TEMPLATE_ID", + "value": "openEHR-DEMOGRAPHIC-PARTY_RELATIONSHIP.under_care_of.v2.0.0" + } + }, + "name": { + "_type": "DV_CODED_TEXT", + "value": "under_care_of", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "under_care_of" + } + }, + "details": { + "_type": "ITEM_TREE", + "archetype_node_id": "id2", + "name": { + "_type": "DV_TEXT", + "value": "details" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "id3", + "name": { + "_type": "DV_CODED_TEXT", + "value": "care_role", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "care_role" + } + }, + "value": { + "_type": "DV_CODED_TEXT", + "value": "primary performer", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "HL7_ParticipationType" + }, + "code_string": "PPRF" + } + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id5", + "name": { + "_type": "DV_CODED_TEXT", + "value": "provider", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "provider" + } + }, + "value": { + "_type": "DV_IDENTIFIER", + "issuer": "__PROVIDER_ISSUER__", + "id": "__PROVIDER_ID__", + "type": "ORGANISATION" + } + } + ] + }, + "time_validity": { + "_type": "DV_INTERVAL", + "lower": { + "_type": "DV_DATE", + "value": "__DATE:-30__" + }, + "upper": { + "_type": "DV_DATE", + "value": "__DATE:+150__" + }, + "lower_unbounded": false, + "upper_unbounded": false, + "lower_included": true, + "upper_included": true + }, + "source": { + "_type": "PARTY_REF", + "namespace": "demographic", + "type": "PERSON", + "id": { + "_type": "HIER_OBJECT_ID", + "value": "__ID:patient-01__" + } + }, + "target": { + "_type": "PARTY_REF", + "namespace": "demographic", + "type": "GROUP", + "id": { + "_type": "HIER_OBJECT_ID", + "value": "__ID:group-cardiology__" + } + } +} diff --git a/scripts/sandbox/seed/world/care-patient-02-cardiology.ended.json b/scripts/sandbox/seed/world/care-patient-02-cardiology.ended.json new file mode 100644 index 0000000000..82dd8d3bbb --- /dev/null +++ b/scripts/sandbox/seed/world/care-patient-02-cardiology.ended.json @@ -0,0 +1,121 @@ +{ + "_type": "PARTY_RELATIONSHIP", + "archetype_node_id": "openEHR-DEMOGRAPHIC-PARTY_RELATIONSHIP.under_care_of.v2", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "openEHR-DEMOGRAPHIC-PARTY_RELATIONSHIP.under_care_of.v2" + }, + "rm_version": "1.1.0", + "template_id": { + "_type": "TEMPLATE_ID", + "value": "openEHR-DEMOGRAPHIC-PARTY_RELATIONSHIP.under_care_of.v2.0.0" + } + }, + "name": { + "_type": "DV_CODED_TEXT", + "value": "under_care_of", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "under_care_of" + } + }, + "details": { + "_type": "ITEM_TREE", + "archetype_node_id": "id2", + "name": { + "_type": "DV_TEXT", + "value": "details" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "id3", + "name": { + "_type": "DV_CODED_TEXT", + "value": "care_role", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "care_role" + } + }, + "value": { + "_type": "DV_CODED_TEXT", + "value": "primary performer", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "HL7_ParticipationType" + }, + "code_string": "PPRF" + } + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id5", + "name": { + "_type": "DV_CODED_TEXT", + "value": "provider", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "provider" + } + }, + "value": { + "_type": "DV_IDENTIFIER", + "issuer": "__PROVIDER_ISSUER__", + "id": "__PROVIDER_ID__", + "type": "ORGANISATION" + } + } + ] + }, + "time_validity": { + "_type": "DV_INTERVAL", + "lower": { + "_type": "DV_DATE", + "value": "__DATE:-60__" + }, + "upper": { + "_type": "DV_DATE", + "value": "__DATE:-1__" + }, + "lower_unbounded": false, + "upper_unbounded": false, + "lower_included": true, + "upper_included": true + }, + "source": { + "_type": "PARTY_REF", + "namespace": "demographic", + "type": "PERSON", + "id": { + "_type": "HIER_OBJECT_ID", + "value": "__ID:patient-02__" + } + }, + "target": { + "_type": "PARTY_REF", + "namespace": "demographic", + "type": "GROUP", + "id": { + "_type": "HIER_OBJECT_ID", + "value": "__ID:group-cardiology__" + } + } +} diff --git a/scripts/sandbox/seed/world/care-patient-02-cardiology.json b/scripts/sandbox/seed/world/care-patient-02-cardiology.json new file mode 100644 index 0000000000..5cd9c02bb7 --- /dev/null +++ b/scripts/sandbox/seed/world/care-patient-02-cardiology.json @@ -0,0 +1,121 @@ +{ + "_type": "PARTY_RELATIONSHIP", + "archetype_node_id": "openEHR-DEMOGRAPHIC-PARTY_RELATIONSHIP.under_care_of.v2", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "openEHR-DEMOGRAPHIC-PARTY_RELATIONSHIP.under_care_of.v2" + }, + "rm_version": "1.1.0", + "template_id": { + "_type": "TEMPLATE_ID", + "value": "openEHR-DEMOGRAPHIC-PARTY_RELATIONSHIP.under_care_of.v2.0.0" + } + }, + "name": { + "_type": "DV_CODED_TEXT", + "value": "under_care_of", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "under_care_of" + } + }, + "details": { + "_type": "ITEM_TREE", + "archetype_node_id": "id2", + "name": { + "_type": "DV_TEXT", + "value": "details" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "id3", + "name": { + "_type": "DV_CODED_TEXT", + "value": "care_role", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "care_role" + } + }, + "value": { + "_type": "DV_CODED_TEXT", + "value": "primary performer", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "HL7_ParticipationType" + }, + "code_string": "PPRF" + } + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id5", + "name": { + "_type": "DV_CODED_TEXT", + "value": "provider", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "provider" + } + }, + "value": { + "_type": "DV_IDENTIFIER", + "issuer": "__PROVIDER_ISSUER__", + "id": "__PROVIDER_ID__", + "type": "ORGANISATION" + } + } + ] + }, + "time_validity": { + "_type": "DV_INTERVAL", + "lower": { + "_type": "DV_DATE", + "value": "__DATE:-60__" + }, + "upper": { + "_type": "DV_DATE", + "value": "__DATE:+120__" + }, + "lower_unbounded": false, + "upper_unbounded": false, + "lower_included": true, + "upper_included": true + }, + "source": { + "_type": "PARTY_REF", + "namespace": "demographic", + "type": "PERSON", + "id": { + "_type": "HIER_OBJECT_ID", + "value": "__ID:patient-02__" + } + }, + "target": { + "_type": "PARTY_REF", + "namespace": "demographic", + "type": "GROUP", + "id": { + "_type": "HIER_OBJECT_ID", + "value": "__ID:group-cardiology__" + } + } +} diff --git a/scripts/sandbox/seed/world/care-patient-03-emergency.json b/scripts/sandbox/seed/world/care-patient-03-emergency.json new file mode 100644 index 0000000000..494b1b912b --- /dev/null +++ b/scripts/sandbox/seed/world/care-patient-03-emergency.json @@ -0,0 +1,121 @@ +{ + "_type": "PARTY_RELATIONSHIP", + "archetype_node_id": "openEHR-DEMOGRAPHIC-PARTY_RELATIONSHIP.under_care_of.v2", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "openEHR-DEMOGRAPHIC-PARTY_RELATIONSHIP.under_care_of.v2" + }, + "rm_version": "1.1.0", + "template_id": { + "_type": "TEMPLATE_ID", + "value": "openEHR-DEMOGRAPHIC-PARTY_RELATIONSHIP.under_care_of.v2.0.0" + } + }, + "name": { + "_type": "DV_CODED_TEXT", + "value": "under_care_of", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "under_care_of" + } + }, + "details": { + "_type": "ITEM_TREE", + "archetype_node_id": "id2", + "name": { + "_type": "DV_TEXT", + "value": "details" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "id3", + "name": { + "_type": "DV_CODED_TEXT", + "value": "care_role", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "care_role" + } + }, + "value": { + "_type": "DV_CODED_TEXT", + "value": "secondary performer", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "HL7_ParticipationType" + }, + "code_string": "SPRF" + } + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id5", + "name": { + "_type": "DV_CODED_TEXT", + "value": "provider", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "provider" + } + }, + "value": { + "_type": "DV_IDENTIFIER", + "issuer": "__PROVIDER_ISSUER__", + "id": "__PROVIDER_ID__", + "type": "ORGANISATION" + } + } + ] + }, + "time_validity": { + "_type": "DV_INTERVAL", + "lower": { + "_type": "DV_DATE", + "value": "__DATE:-2__" + }, + "upper": { + "_type": "DV_DATE", + "value": "__DATE:+28__" + }, + "lower_unbounded": false, + "upper_unbounded": false, + "lower_included": true, + "upper_included": true + }, + "source": { + "_type": "PARTY_REF", + "namespace": "demographic", + "type": "PERSON", + "id": { + "_type": "HIER_OBJECT_ID", + "value": "__ID:patient-03__" + } + }, + "target": { + "_type": "PARTY_REF", + "namespace": "demographic", + "type": "GROUP", + "id": { + "_type": "HIER_OBJECT_ID", + "value": "__ID:group-emergency__" + } + } +} diff --git a/scripts/sandbox/seed/world/group-cardiology.json b/scripts/sandbox/seed/world/group-cardiology.json new file mode 100644 index 0000000000..b58cb3fe96 --- /dev/null +++ b/scripts/sandbox/seed/world/group-cardiology.json @@ -0,0 +1,80 @@ +{ + "_type": "GROUP", + "archetype_node_id": "eu.ferroehr.sandbox::openEHR-DEMOGRAPHIC-GROUP.care_team.v1", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "eu.ferroehr.sandbox::openEHR-DEMOGRAPHIC-GROUP.care_team.v1" + }, + "rm_version": "1.2.0" + }, + "name": { + "_type": "DV_CODED_TEXT", + "value": "care_team", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "care_team" + } + }, + "details": { + "_type": "ITEM_TREE", + "archetype_node_id": "at0001", + "name": { + "_type": "DV_TEXT", + "value": "details" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "at0002", + "name": { + "_type": "DV_TEXT", + "value": "provider" + }, + "value": { + "_type": "DV_IDENTIFIER", + "issuer": "__PROVIDER_ISSUER__", + "id": "__PROVIDER_ID__", + "type": "ORGANISATION" + } + } + ] + }, + "identities": [ + { + "_type": "PARTY_IDENTITY", + "archetype_node_id": "at0001", + "name": { + "_type": "DV_TEXT", + "value": "name" + }, + "details": { + "_type": "ITEM_TREE", + "archetype_node_id": "at0002", + "name": { + "_type": "DV_TEXT", + "value": "details" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "at0003", + "name": { + "_type": "DV_TEXT", + "value": "name" + }, + "value": { + "_type": "DV_TEXT", + "value": "Cardiology ward" + } + } + ] + } + } + ] +} diff --git a/scripts/sandbox/seed/world/group-emergency.json b/scripts/sandbox/seed/world/group-emergency.json new file mode 100644 index 0000000000..ff81cea1f3 --- /dev/null +++ b/scripts/sandbox/seed/world/group-emergency.json @@ -0,0 +1,80 @@ +{ + "_type": "GROUP", + "archetype_node_id": "eu.ferroehr.sandbox::openEHR-DEMOGRAPHIC-GROUP.care_team.v1", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "eu.ferroehr.sandbox::openEHR-DEMOGRAPHIC-GROUP.care_team.v1" + }, + "rm_version": "1.2.0" + }, + "name": { + "_type": "DV_CODED_TEXT", + "value": "care_team", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "care_team" + } + }, + "details": { + "_type": "ITEM_TREE", + "archetype_node_id": "at0001", + "name": { + "_type": "DV_TEXT", + "value": "details" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "at0002", + "name": { + "_type": "DV_TEXT", + "value": "provider" + }, + "value": { + "_type": "DV_IDENTIFIER", + "issuer": "__PROVIDER_ISSUER__", + "id": "__PROVIDER_ID__", + "type": "ORGANISATION" + } + } + ] + }, + "identities": [ + { + "_type": "PARTY_IDENTITY", + "archetype_node_id": "at0001", + "name": { + "_type": "DV_TEXT", + "value": "name" + }, + "details": { + "_type": "ITEM_TREE", + "archetype_node_id": "at0002", + "name": { + "_type": "DV_TEXT", + "value": "details" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "at0003", + "name": { + "_type": "DV_TEXT", + "value": "name" + }, + "value": { + "_type": "DV_TEXT", + "value": "Emergency department" + } + } + ] + } + } + ] +} diff --git a/scripts/sandbox/seed/world/organisation-hospital.json b/scripts/sandbox/seed/world/organisation-hospital.json new file mode 100644 index 0000000000..af6ae7ffa8 --- /dev/null +++ b/scripts/sandbox/seed/world/organisation-hospital.json @@ -0,0 +1,72 @@ +{ + "_type": "ORGANISATION", + "archetype_node_id": "eu.ferroehr.sandbox::openEHR-DEMOGRAPHIC-ORGANISATION.provider.v1", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "eu.ferroehr.sandbox::openEHR-DEMOGRAPHIC-ORGANISATION.provider.v1" + }, + "rm_version": "1.2.0" + }, + "name": { + "_type": "DV_TEXT", + "value": "FerroEHR Demo Hospital" + }, + "details": { + "_type": "ITEM_TREE", + "archetype_node_id": "at0001", + "name": { + "_type": "DV_TEXT", + "value": "details" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "at0002", + "name": { + "_type": "DV_TEXT", + "value": "provider identifier" + }, + "value": { + "_type": "DV_IDENTIFIER", + "issuer": "__PROVIDER_ISSUER__", + "id": "__PROVIDER_ID__", + "type": "healthcare-provider" + } + } + ] + }, + "identities": [ + { + "_type": "PARTY_IDENTITY", + "archetype_node_id": "at0001", + "name": { + "_type": "DV_TEXT", + "value": "name" + }, + "details": { + "_type": "ITEM_TREE", + "archetype_node_id": "at0002", + "name": { + "_type": "DV_TEXT", + "value": "details" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "at0003", + "name": { + "_type": "DV_TEXT", + "value": "name" + }, + "value": { + "_type": "DV_TEXT", + "value": "FerroEHR Demo Hospital" + } + } + ] + } + } + ] +} diff --git a/scripts/sandbox/seed/world/organisation-hospital.v2.json b/scripts/sandbox/seed/world/organisation-hospital.v2.json new file mode 100644 index 0000000000..ac599e6fc9 --- /dev/null +++ b/scripts/sandbox/seed/world/organisation-hospital.v2.json @@ -0,0 +1,84 @@ +{ + "_type": "ORGANISATION", + "archetype_node_id": "eu.ferroehr.sandbox::openEHR-DEMOGRAPHIC-ORGANISATION.provider.v1", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "eu.ferroehr.sandbox::openEHR-DEMOGRAPHIC-ORGANISATION.provider.v1" + }, + "rm_version": "1.2.0" + }, + "name": { + "_type": "DV_TEXT", + "value": "FerroEHR Demo Hospital" + }, + "details": { + "_type": "ITEM_TREE", + "archetype_node_id": "at0001", + "name": { + "_type": "DV_TEXT", + "value": "details" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "at0002", + "name": { + "_type": "DV_TEXT", + "value": "provider identifier" + }, + "value": { + "_type": "DV_IDENTIFIER", + "issuer": "__PROVIDER_ISSUER__", + "id": "__PROVIDER_ID__", + "type": "healthcare-provider" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "at0004", + "name": { + "_type": "DV_TEXT", + "value": "department" + }, + "value": { + "_type": "DV_TEXT", + "value": "Cardiology, Emergency medicine" + } + } + ] + }, + "identities": [ + { + "_type": "PARTY_IDENTITY", + "archetype_node_id": "at0001", + "name": { + "_type": "DV_TEXT", + "value": "name" + }, + "details": { + "_type": "ITEM_TREE", + "archetype_node_id": "at0002", + "name": { + "_type": "DV_TEXT", + "value": "details" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "at0003", + "name": { + "_type": "DV_TEXT", + "value": "name" + }, + "value": { + "_type": "DV_TEXT", + "value": "FerroEHR Demo Hospital" + } + } + ] + } + } + ] +} diff --git a/scripts/sandbox/seed/world/organisation-lab.json b/scripts/sandbox/seed/world/organisation-lab.json new file mode 100644 index 0000000000..bc460511d7 --- /dev/null +++ b/scripts/sandbox/seed/world/organisation-lab.json @@ -0,0 +1,72 @@ +{ + "_type": "ORGANISATION", + "archetype_node_id": "eu.ferroehr.sandbox::openEHR-DEMOGRAPHIC-ORGANISATION.provider.v1", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "eu.ferroehr.sandbox::openEHR-DEMOGRAPHIC-ORGANISATION.provider.v1" + }, + "rm_version": "1.2.0" + }, + "name": { + "_type": "DV_TEXT", + "value": "Demo Regional Laboratory" + }, + "details": { + "_type": "ITEM_TREE", + "archetype_node_id": "at0001", + "name": { + "_type": "DV_TEXT", + "value": "details" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "at0002", + "name": { + "_type": "DV_TEXT", + "value": "provider identifier" + }, + "value": { + "_type": "DV_IDENTIFIER", + "issuer": "urn:oid:2.999.7", + "id": "demo-lab", + "type": "healthcare-provider" + } + } + ] + }, + "identities": [ + { + "_type": "PARTY_IDENTITY", + "archetype_node_id": "at0001", + "name": { + "_type": "DV_TEXT", + "value": "name" + }, + "details": { + "_type": "ITEM_TREE", + "archetype_node_id": "at0002", + "name": { + "_type": "DV_TEXT", + "value": "details" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "at0003", + "name": { + "_type": "DV_TEXT", + "value": "name" + }, + "value": { + "_type": "DV_TEXT", + "value": "Demo Regional Laboratory" + } + } + ] + } + } + ] +} diff --git a/scripts/sandbox/seed/world/patient-01.json b/scripts/sandbox/seed/world/patient-01.json new file mode 100644 index 0000000000..1dc5de1406 --- /dev/null +++ b/scripts/sandbox/seed/world/patient-01.json @@ -0,0 +1,153 @@ +{ + "_type": "PERSON", + "archetype_node_id": "openEHR-DEMOGRAPHIC-PERSON.patient.v3", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "openEHR-DEMOGRAPHIC-PERSON.patient.v3" + }, + "template_id": { + "_type": "TEMPLATE_ID", + "value": "openEHR-DEMOGRAPHIC-PERSON.patient.v3.0.0" + }, + "rm_version": "1.1.0" + }, + "name": { + "_type": "DV_TEXT", + "value": "Isa de Vries" + }, + "details": { + "_type": "ITEM_TREE", + "archetype_node_id": "id2", + "name": { + "_type": "DV_TEXT", + "value": "Details" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "id3", + "name": { + "_type": "DV_TEXT", + "value": "Patient identifier" + }, + "value": { + "_type": "DV_IDENTIFIER", + "issuer": "urn:oid:2.999.7.3", + "id": "DEMO-000001", + "type": "MRN" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id4", + "name": { + "_type": "DV_TEXT", + "value": "Date of birth" + }, + "value": { + "_type": "DV_DATE", + "value": "1984-03-12" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id5", + "name": { + "_type": "DV_TEXT", + "value": "Sex" + }, + "value": { + "_type": "DV_CODED_TEXT", + "value": "Female", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "local" + }, + "code_string": "at11" + } + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id36", + "name": { + "_type": "DV_CODED_TEXT", + "value": "record_subject", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "record_subject" + } + }, + "value": { + "_type": "DV_IDENTIFIER", + "issuer": "__SUBJECT_NS__", + "id": "__SUBJECT_ID:0__" + } + } + ] + }, + "identities": [ + { + "_type": "PARTY_IDENTITY", + "archetype_node_id": "id6", + "name": { + "_type": "DV_TEXT", + "value": "Name" + }, + "details": { + "_type": "ITEM_TREE", + "archetype_node_id": "id7", + "name": { + "_type": "DV_TEXT", + "value": "Name structure" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "id8", + "name": { + "_type": "DV_TEXT", + "value": "Full name" + }, + "value": { + "_type": "DV_TEXT", + "value": "Isa de Vries" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id9", + "name": { + "_type": "DV_TEXT", + "value": "Given name" + }, + "value": { + "_type": "DV_TEXT", + "value": "Isa" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id10", + "name": { + "_type": "DV_TEXT", + "value": "Family name" + }, + "value": { + "_type": "DV_TEXT", + "value": "de Vries" + } + } + ] + } + } + ] +} diff --git a/scripts/sandbox/seed/world/patient-02.json b/scripts/sandbox/seed/world/patient-02.json new file mode 100644 index 0000000000..52eb9769de --- /dev/null +++ b/scripts/sandbox/seed/world/patient-02.json @@ -0,0 +1,153 @@ +{ + "_type": "PERSON", + "archetype_node_id": "openEHR-DEMOGRAPHIC-PERSON.patient.v3", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "openEHR-DEMOGRAPHIC-PERSON.patient.v3" + }, + "template_id": { + "_type": "TEMPLATE_ID", + "value": "openEHR-DEMOGRAPHIC-PERSON.patient.v3.0.0" + }, + "rm_version": "1.1.0" + }, + "name": { + "_type": "DV_TEXT", + "value": "Jonas Bakker" + }, + "details": { + "_type": "ITEM_TREE", + "archetype_node_id": "id2", + "name": { + "_type": "DV_TEXT", + "value": "Details" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "id3", + "name": { + "_type": "DV_TEXT", + "value": "Patient identifier" + }, + "value": { + "_type": "DV_IDENTIFIER", + "issuer": "urn:oid:2.999.7.3", + "id": "DEMO-000002", + "type": "MRN" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id4", + "name": { + "_type": "DV_TEXT", + "value": "Date of birth" + }, + "value": { + "_type": "DV_DATE", + "value": "1957-11-02" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id5", + "name": { + "_type": "DV_TEXT", + "value": "Sex" + }, + "value": { + "_type": "DV_CODED_TEXT", + "value": "Male", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "local" + }, + "code_string": "at10" + } + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id36", + "name": { + "_type": "DV_CODED_TEXT", + "value": "record_subject", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "record_subject" + } + }, + "value": { + "_type": "DV_IDENTIFIER", + "issuer": "__SUBJECT_NS__", + "id": "__SUBJECT_ID:1__" + } + } + ] + }, + "identities": [ + { + "_type": "PARTY_IDENTITY", + "archetype_node_id": "id6", + "name": { + "_type": "DV_TEXT", + "value": "Name" + }, + "details": { + "_type": "ITEM_TREE", + "archetype_node_id": "id7", + "name": { + "_type": "DV_TEXT", + "value": "Name structure" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "id8", + "name": { + "_type": "DV_TEXT", + "value": "Full name" + }, + "value": { + "_type": "DV_TEXT", + "value": "Jonas Bakker" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id9", + "name": { + "_type": "DV_TEXT", + "value": "Given name" + }, + "value": { + "_type": "DV_TEXT", + "value": "Jonas" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id10", + "name": { + "_type": "DV_TEXT", + "value": "Family name" + }, + "value": { + "_type": "DV_TEXT", + "value": "Bakker" + } + } + ] + } + } + ] +} diff --git a/scripts/sandbox/seed/world/patient-03.json b/scripts/sandbox/seed/world/patient-03.json new file mode 100644 index 0000000000..4df20a0189 --- /dev/null +++ b/scripts/sandbox/seed/world/patient-03.json @@ -0,0 +1,153 @@ +{ + "_type": "PERSON", + "archetype_node_id": "openEHR-DEMOGRAPHIC-PERSON.patient.v3", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "openEHR-DEMOGRAPHIC-PERSON.patient.v3" + }, + "template_id": { + "_type": "TEMPLATE_ID", + "value": "openEHR-DEMOGRAPHIC-PERSON.patient.v3.0.0" + }, + "rm_version": "1.1.0" + }, + "name": { + "_type": "DV_TEXT", + "value": "Lotte Visser" + }, + "details": { + "_type": "ITEM_TREE", + "archetype_node_id": "id2", + "name": { + "_type": "DV_TEXT", + "value": "Details" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "id3", + "name": { + "_type": "DV_TEXT", + "value": "Patient identifier" + }, + "value": { + "_type": "DV_IDENTIFIER", + "issuer": "urn:oid:2.999.7.3", + "id": "DEMO-000003", + "type": "MRN" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id4", + "name": { + "_type": "DV_TEXT", + "value": "Date of birth" + }, + "value": { + "_type": "DV_DATE", + "value": "1999-06-21" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id5", + "name": { + "_type": "DV_TEXT", + "value": "Sex" + }, + "value": { + "_type": "DV_CODED_TEXT", + "value": "Female", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "local" + }, + "code_string": "at11" + } + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id36", + "name": { + "_type": "DV_CODED_TEXT", + "value": "record_subject", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "record_subject" + } + }, + "value": { + "_type": "DV_IDENTIFIER", + "issuer": "__SUBJECT_NS__", + "id": "__SUBJECT_ID:2__" + } + } + ] + }, + "identities": [ + { + "_type": "PARTY_IDENTITY", + "archetype_node_id": "id6", + "name": { + "_type": "DV_TEXT", + "value": "Name" + }, + "details": { + "_type": "ITEM_TREE", + "archetype_node_id": "id7", + "name": { + "_type": "DV_TEXT", + "value": "Name structure" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "id8", + "name": { + "_type": "DV_TEXT", + "value": "Full name" + }, + "value": { + "_type": "DV_TEXT", + "value": "Lotte Visser" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id9", + "name": { + "_type": "DV_TEXT", + "value": "Given name" + }, + "value": { + "_type": "DV_TEXT", + "value": "Lotte" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id10", + "name": { + "_type": "DV_TEXT", + "value": "Family name" + }, + "value": { + "_type": "DV_TEXT", + "value": "Visser" + } + } + ] + } + } + ] +} diff --git a/scripts/sandbox/seed/world/patient-04.json b/scripts/sandbox/seed/world/patient-04.json new file mode 100644 index 0000000000..756ba34cad --- /dev/null +++ b/scripts/sandbox/seed/world/patient-04.json @@ -0,0 +1,153 @@ +{ + "_type": "PERSON", + "archetype_node_id": "openEHR-DEMOGRAPHIC-PERSON.patient.v3", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "openEHR-DEMOGRAPHIC-PERSON.patient.v3" + }, + "template_id": { + "_type": "TEMPLATE_ID", + "value": "openEHR-DEMOGRAPHIC-PERSON.patient.v3.0.0" + }, + "rm_version": "1.1.0" + }, + "name": { + "_type": "DV_TEXT", + "value": "Milan Smit" + }, + "details": { + "_type": "ITEM_TREE", + "archetype_node_id": "id2", + "name": { + "_type": "DV_TEXT", + "value": "Details" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "id3", + "name": { + "_type": "DV_TEXT", + "value": "Patient identifier" + }, + "value": { + "_type": "DV_IDENTIFIER", + "issuer": "urn:oid:2.999.7.3", + "id": "DEMO-000004", + "type": "MRN" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id4", + "name": { + "_type": "DV_TEXT", + "value": "Date of birth" + }, + "value": { + "_type": "DV_DATE", + "value": "1972-01-30" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id5", + "name": { + "_type": "DV_TEXT", + "value": "Sex" + }, + "value": { + "_type": "DV_CODED_TEXT", + "value": "Male", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "local" + }, + "code_string": "at10" + } + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id36", + "name": { + "_type": "DV_CODED_TEXT", + "value": "record_subject", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "record_subject" + } + }, + "value": { + "_type": "DV_IDENTIFIER", + "issuer": "__SUBJECT_NS__", + "id": "__SUBJECT_ID:3__" + } + } + ] + }, + "identities": [ + { + "_type": "PARTY_IDENTITY", + "archetype_node_id": "id6", + "name": { + "_type": "DV_TEXT", + "value": "Name" + }, + "details": { + "_type": "ITEM_TREE", + "archetype_node_id": "id7", + "name": { + "_type": "DV_TEXT", + "value": "Name structure" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "id8", + "name": { + "_type": "DV_TEXT", + "value": "Full name" + }, + "value": { + "_type": "DV_TEXT", + "value": "Milan Smit" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id9", + "name": { + "_type": "DV_TEXT", + "value": "Given name" + }, + "value": { + "_type": "DV_TEXT", + "value": "Milan" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id10", + "name": { + "_type": "DV_TEXT", + "value": "Family name" + }, + "value": { + "_type": "DV_TEXT", + "value": "Smit" + } + } + ] + } + } + ] +} diff --git a/scripts/sandbox/seed/world/patient-05.json b/scripts/sandbox/seed/world/patient-05.json new file mode 100644 index 0000000000..d8b596f0d0 --- /dev/null +++ b/scripts/sandbox/seed/world/patient-05.json @@ -0,0 +1,153 @@ +{ + "_type": "PERSON", + "archetype_node_id": "openEHR-DEMOGRAPHIC-PERSON.patient.v3", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "openEHR-DEMOGRAPHIC-PERSON.patient.v3" + }, + "template_id": { + "_type": "TEMPLATE_ID", + "value": "openEHR-DEMOGRAPHIC-PERSON.patient.v3.0.0" + }, + "rm_version": "1.1.0" + }, + "name": { + "_type": "DV_TEXT", + "value": "Noor Mulder" + }, + "details": { + "_type": "ITEM_TREE", + "archetype_node_id": "id2", + "name": { + "_type": "DV_TEXT", + "value": "Details" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "id3", + "name": { + "_type": "DV_TEXT", + "value": "Patient identifier" + }, + "value": { + "_type": "DV_IDENTIFIER", + "issuer": "urn:oid:2.999.7.3", + "id": "DEMO-000005", + "type": "MRN" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id4", + "name": { + "_type": "DV_TEXT", + "value": "Date of birth" + }, + "value": { + "_type": "DV_DATE", + "value": "2010-09-08" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id5", + "name": { + "_type": "DV_TEXT", + "value": "Sex" + }, + "value": { + "_type": "DV_CODED_TEXT", + "value": "Female", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "local" + }, + "code_string": "at11" + } + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id36", + "name": { + "_type": "DV_CODED_TEXT", + "value": "record_subject", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "record_subject" + } + }, + "value": { + "_type": "DV_IDENTIFIER", + "issuer": "__SUBJECT_NS__", + "id": "__SUBJECT_ID:4__" + } + } + ] + }, + "identities": [ + { + "_type": "PARTY_IDENTITY", + "archetype_node_id": "id6", + "name": { + "_type": "DV_TEXT", + "value": "Name" + }, + "details": { + "_type": "ITEM_TREE", + "archetype_node_id": "id7", + "name": { + "_type": "DV_TEXT", + "value": "Name structure" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "id8", + "name": { + "_type": "DV_TEXT", + "value": "Full name" + }, + "value": { + "_type": "DV_TEXT", + "value": "Noor Mulder" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id9", + "name": { + "_type": "DV_TEXT", + "value": "Given name" + }, + "value": { + "_type": "DV_TEXT", + "value": "Noor" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id10", + "name": { + "_type": "DV_TEXT", + "value": "Family name" + }, + "value": { + "_type": "DV_TEXT", + "value": "Mulder" + } + } + ] + } + } + ] +} diff --git a/scripts/sandbox/seed/world/patient-06.json b/scripts/sandbox/seed/world/patient-06.json new file mode 100644 index 0000000000..fbbcad45cc --- /dev/null +++ b/scripts/sandbox/seed/world/patient-06.json @@ -0,0 +1,153 @@ +{ + "_type": "PERSON", + "archetype_node_id": "openEHR-DEMOGRAPHIC-PERSON.patient.v3", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "openEHR-DEMOGRAPHIC-PERSON.patient.v3" + }, + "template_id": { + "_type": "TEMPLATE_ID", + "value": "openEHR-DEMOGRAPHIC-PERSON.patient.v3.0.0" + }, + "rm_version": "1.1.0" + }, + "name": { + "_type": "DV_TEXT", + "value": "Sem de Boer" + }, + "details": { + "_type": "ITEM_TREE", + "archetype_node_id": "id2", + "name": { + "_type": "DV_TEXT", + "value": "Details" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "id3", + "name": { + "_type": "DV_TEXT", + "value": "Patient identifier" + }, + "value": { + "_type": "DV_IDENTIFIER", + "issuer": "urn:oid:2.999.7.3", + "id": "DEMO-000006", + "type": "MRN" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id4", + "name": { + "_type": "DV_TEXT", + "value": "Date of birth" + }, + "value": { + "_type": "DV_DATE", + "value": "1946-04-17" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id5", + "name": { + "_type": "DV_TEXT", + "value": "Sex" + }, + "value": { + "_type": "DV_CODED_TEXT", + "value": "Male", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "local" + }, + "code_string": "at10" + } + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id36", + "name": { + "_type": "DV_CODED_TEXT", + "value": "record_subject", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "record_subject" + } + }, + "value": { + "_type": "DV_IDENTIFIER", + "issuer": "__SUBJECT_NS__", + "id": "__SUBJECT_ID:5__" + } + } + ] + }, + "identities": [ + { + "_type": "PARTY_IDENTITY", + "archetype_node_id": "id6", + "name": { + "_type": "DV_TEXT", + "value": "Name" + }, + "details": { + "_type": "ITEM_TREE", + "archetype_node_id": "id7", + "name": { + "_type": "DV_TEXT", + "value": "Name structure" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "id8", + "name": { + "_type": "DV_TEXT", + "value": "Full name" + }, + "value": { + "_type": "DV_TEXT", + "value": "Sem de Boer" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id9", + "name": { + "_type": "DV_TEXT", + "value": "Given name" + }, + "value": { + "_type": "DV_TEXT", + "value": "Sem" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id10", + "name": { + "_type": "DV_TEXT", + "value": "Family name" + }, + "value": { + "_type": "DV_TEXT", + "value": "de Boer" + } + } + ] + } + } + ] +} diff --git a/scripts/sandbox/seed/world/proxy-01.json b/scripts/sandbox/seed/world/proxy-01.json new file mode 100644 index 0000000000..3da041bc0d --- /dev/null +++ b/scripts/sandbox/seed/world/proxy-01.json @@ -0,0 +1,114 @@ +{ + "_type": "PERSON", + "archetype_node_id": "openEHR-DEMOGRAPHIC-PERSON.patient.v3", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "openEHR-DEMOGRAPHIC-PERSON.patient.v3" + }, + "template_id": { + "_type": "TEMPLATE_ID", + "value": "openEHR-DEMOGRAPHIC-PERSON.patient.v3.0.0" + }, + "rm_version": "1.1.0" + }, + "name": { + "_type": "DV_TEXT", + "value": "Ruud de Vries" + }, + "details": { + "_type": "ITEM_TREE", + "archetype_node_id": "id2", + "name": { + "_type": "DV_TEXT", + "value": "Details" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "id3", + "name": { + "_type": "DV_TEXT", + "value": "Patient identifier" + }, + "value": { + "_type": "DV_IDENTIFIER", + "issuer": "urn:oid:2.999.7.3", + "id": "DEMO-000901", + "type": "MRN" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id3", + "name": { + "_type": "DV_TEXT", + "value": "Patient identifier" + }, + "value": { + "_type": "DV_IDENTIFIER", + "issuer": "urn:example:basic-user", + "id": "__LOGIN:proxy__", + "type": "login" + } + } + ] + }, + "identities": [ + { + "_type": "PARTY_IDENTITY", + "archetype_node_id": "id6", + "name": { + "_type": "DV_TEXT", + "value": "Name" + }, + "details": { + "_type": "ITEM_TREE", + "archetype_node_id": "id7", + "name": { + "_type": "DV_TEXT", + "value": "Name structure" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "id8", + "name": { + "_type": "DV_TEXT", + "value": "Full name" + }, + "value": { + "_type": "DV_TEXT", + "value": "Ruud de Vries" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id9", + "name": { + "_type": "DV_TEXT", + "value": "Given name" + }, + "value": { + "_type": "DV_TEXT", + "value": "Ruud" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id10", + "name": { + "_type": "DV_TEXT", + "value": "Family name" + }, + "value": { + "_type": "DV_TEXT", + "value": "de Vries" + } + } + ] + } + } + ] +} diff --git a/scripts/sandbox/seed/world/representation-guardian.json b/scripts/sandbox/seed/world/representation-guardian.json new file mode 100644 index 0000000000..ef69fb2c49 --- /dev/null +++ b/scripts/sandbox/seed/world/representation-guardian.json @@ -0,0 +1,117 @@ +{ + "_type": "PARTY_RELATIONSHIP", + "archetype_node_id": "openEHR-DEMOGRAPHIC-PARTY_RELATIONSHIP.representation.v2", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "openEHR-DEMOGRAPHIC-PARTY_RELATIONSHIP.representation.v2" + }, + "rm_version": "1.1.0" + }, + "name": { + "_type": "DV_CODED_TEXT", + "value": "represents", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "represents" + } + }, + "details": { + "_type": "ITEM_TREE", + "archetype_node_id": "id2", + "name": { + "_type": "DV_TEXT", + "value": "Details" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "id3", + "name": { + "_type": "DV_CODED_TEXT", + "value": "basis", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "basis" + } + }, + "value": { + "_type": "DV_CODED_TEXT", + "value": "guardian", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "HL7_RoleCode" + }, + "code_string": "GUARD" + } + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id5", + "name": { + "_type": "DV_CODED_TEXT", + "value": "provider", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "provider" + } + }, + "value": { + "_type": "DV_IDENTIFIER", + "issuer": "__PROVIDER_ISSUER__", + "id": "__PROVIDER_ID__", + "type": "ORGANISATION" + } + } + ] + }, + "time_validity": { + "_type": "DV_INTERVAL", + "lower": { + "_type": "DV_DATE", + "value": "2010-09-08" + }, + "upper": { + "_type": "DV_DATE", + "value": "2028-09-08" + }, + "lower_unbounded": false, + "upper_unbounded": false, + "lower_included": true, + "upper_included": false + }, + "source": { + "_type": "PARTY_REF", + "namespace": "demographic", + "type": "PERSON", + "id": { + "_type": "HIER_OBJECT_ID", + "value": "__ID:person-05__" + } + }, + "target": { + "_type": "PARTY_REF", + "namespace": "demographic", + "type": "PERSON", + "id": { + "_type": "HIER_OBJECT_ID", + "value": "__ID:patient-05__" + } + } +} diff --git a/scripts/sandbox/seed/world/representation-proxy.json b/scripts/sandbox/seed/world/representation-proxy.json new file mode 100644 index 0000000000..7759978228 --- /dev/null +++ b/scripts/sandbox/seed/world/representation-proxy.json @@ -0,0 +1,117 @@ +{ + "_type": "PARTY_RELATIONSHIP", + "archetype_node_id": "openEHR-DEMOGRAPHIC-PARTY_RELATIONSHIP.representation.v2", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "openEHR-DEMOGRAPHIC-PARTY_RELATIONSHIP.representation.v2" + }, + "rm_version": "1.1.0" + }, + "name": { + "_type": "DV_CODED_TEXT", + "value": "represents", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "represents" + } + }, + "details": { + "_type": "ITEM_TREE", + "archetype_node_id": "id2", + "name": { + "_type": "DV_TEXT", + "value": "Details" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "id3", + "name": { + "_type": "DV_CODED_TEXT", + "value": "basis", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "basis" + } + }, + "value": { + "_type": "DV_CODED_TEXT", + "value": "delegatee", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "HL7_RoleCode" + }, + "code_string": "DELEGATEE" + } + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "id5", + "name": { + "_type": "DV_CODED_TEXT", + "value": "provider", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "provider" + } + }, + "value": { + "_type": "DV_IDENTIFIER", + "issuer": "__PROVIDER_ISSUER__", + "id": "__PROVIDER_ID__", + "type": "ORGANISATION" + } + } + ] + }, + "time_validity": { + "_type": "DV_INTERVAL", + "lower": { + "_type": "DV_DATE", + "value": "__DATE:-90__" + }, + "upper": { + "_type": "DV_DATE", + "value": "__DATE:+275__" + }, + "lower_unbounded": false, + "upper_unbounded": false, + "lower_included": true, + "upper_included": false + }, + "source": { + "_type": "PARTY_REF", + "namespace": "demographic", + "type": "PERSON", + "id": { + "_type": "HIER_OBJECT_ID", + "value": "__ID:proxy-01__" + } + }, + "target": { + "_type": "PARTY_REF", + "namespace": "demographic", + "type": "PERSON", + "id": { + "_type": "HIER_OBJECT_ID", + "value": "__ID:patient-01__" + } + } +} diff --git a/scripts/sandbox/seed/world/role-lab-feed.json b/scripts/sandbox/seed/world/role-lab-feed.json new file mode 100644 index 0000000000..6d39b8481a --- /dev/null +++ b/scripts/sandbox/seed/world/role-lab-feed.json @@ -0,0 +1,145 @@ +{ + "_type": "ROLE", + "archetype_node_id": "eu.ferroehr.sandbox::openEHR-DEMOGRAPHIC-ROLE.integration.v1", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "eu.ferroehr.sandbox::openEHR-DEMOGRAPHIC-ROLE.integration.v1" + }, + "rm_version": "1.2.0" + }, + "name": { + "_type": "DV_TEXT", + "value": "Laboratory result feed" + }, + "identities": [ + { + "_type": "PARTY_IDENTITY", + "archetype_node_id": "at0001", + "name": { + "_type": "DV_TEXT", + "value": "name" + }, + "details": { + "_type": "ITEM_TREE", + "archetype_node_id": "at0002", + "name": { + "_type": "DV_TEXT", + "value": "details" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "at0003", + "name": { + "_type": "DV_TEXT", + "value": "name" + }, + "value": { + "_type": "DV_TEXT", + "value": "Laboratory result feed" + } + } + ] + } + } + ], + "performer": { + "_type": "PARTY_REF", + "namespace": "demographic", + "type": "AGENT", + "id": { + "_type": "HIER_OBJECT_ID", + "value": "__ID:agent-lab-engine__" + } + }, + "capabilities": [ + { + "_type": "CAPABILITY", + "archetype_node_id": "at0020", + "name": { + "_type": "DV_TEXT", + "value": "grant" + }, + "credentials": { + "_type": "ITEM_TREE", + "archetype_node_id": "at0022", + "name": { + "_type": "DV_TEXT", + "value": "terms" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "at0021", + "name": { + "_type": "DV_TEXT", + "value": "operation" + }, + "value": { + "_type": "DV_CODED_TEXT", + "value": "commit_composition", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "commit_composition" + } + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "at0030", + "name": { + "_type": "DV_CODED_TEXT", + "value": "template", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "template" + } + }, + "value": { + "_type": "DV_TEXT", + "value": "Generic lab test result example simple" + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "at0031", + "name": { + "_type": "DV_CODED_TEXT", + "value": "origin", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "origin" + } + }, + "value": { + "_type": "DV_CODED_TEXT", + "value": "relay", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "relay" + } + } + } + ] + } + } + ] +} diff --git a/scripts/sandbox/seed/world/role-privacy-officer.json b/scripts/sandbox/seed/world/role-privacy-officer.json new file mode 100644 index 0000000000..7b8dc7ace3 --- /dev/null +++ b/scripts/sandbox/seed/world/role-privacy-officer.json @@ -0,0 +1,217 @@ +{ + "_type": "ROLE", + "archetype_node_id": "eu.ferroehr.sandbox::openEHR-DEMOGRAPHIC-ROLE.privacy_officer.v1", + "archetype_details": { + "_type": "ARCHETYPED", + "archetype_id": { + "_type": "ARCHETYPE_ID", + "value": "eu.ferroehr.sandbox::openEHR-DEMOGRAPHIC-ROLE.privacy_officer.v1" + }, + "rm_version": "1.2.0" + }, + "name": { + "_type": "DV_TEXT", + "value": "Privacy officer" + }, + "identities": [ + { + "_type": "PARTY_IDENTITY", + "archetype_node_id": "at0001", + "name": { + "_type": "DV_TEXT", + "value": "name" + }, + "details": { + "_type": "ITEM_TREE", + "archetype_node_id": "at0002", + "name": { + "_type": "DV_TEXT", + "value": "details" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "at0003", + "name": { + "_type": "DV_TEXT", + "value": "name" + }, + "value": { + "_type": "DV_TEXT", + "value": "Privacy officer" + } + } + ] + } + } + ], + "performer": { + "_type": "PARTY_REF", + "namespace": "demographic", + "type": "PERSON", + "id": { + "_type": "HIER_OBJECT_ID", + "value": "__ID:seed-admin__" + } + }, + "capabilities": [ + { + "_type": "CAPABILITY", + "archetype_node_id": "at0020", + "name": { + "_type": "DV_TEXT", + "value": "grant" + }, + "credentials": { + "_type": "ITEM_TREE", + "archetype_node_id": "at0022", + "name": { + "_type": "DV_TEXT", + "value": "terms" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "at0021", + "name": { + "_type": "DV_TEXT", + "value": "operation" + }, + "value": { + "_type": "DV_CODED_TEXT", + "value": "write_access_policy", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "write_access_policy" + } + } + } + ] + } + }, + { + "_type": "CAPABILITY", + "archetype_node_id": "at0020", + "name": { + "_type": "DV_TEXT", + "value": "grant" + }, + "credentials": { + "_type": "ITEM_TREE", + "archetype_node_id": "at0022", + "name": { + "_type": "DV_TEXT", + "value": "terms" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "at0021", + "name": { + "_type": "DV_TEXT", + "value": "operation" + }, + "value": { + "_type": "DV_CODED_TEXT", + "value": "write_care_relationship", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "write_care_relationship" + } + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "at0030", + "name": { + "_type": "DV_CODED_TEXT", + "value": "provider", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "provider" + } + }, + "value": { + "_type": "DV_IDENTIFIER", + "issuer": "__PROVIDER_ISSUER__", + "id": "__PROVIDER_ID__", + "type": "ORGANISATION" + } + } + ] + } + }, + { + "_type": "CAPABILITY", + "archetype_node_id": "at0020", + "name": { + "_type": "DV_TEXT", + "value": "grant" + }, + "credentials": { + "_type": "ITEM_TREE", + "archetype_node_id": "at0022", + "name": { + "_type": "DV_TEXT", + "value": "terms" + }, + "items": [ + { + "_type": "ELEMENT", + "archetype_node_id": "at0021", + "name": { + "_type": "DV_TEXT", + "value": "operation" + }, + "value": { + "_type": "DV_CODED_TEXT", + "value": "write_representation", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "write_representation" + } + } + }, + { + "_type": "ELEMENT", + "archetype_node_id": "at0030", + "name": { + "_type": "DV_CODED_TEXT", + "value": "provider", + "defining_code": { + "_type": "CODE_PHRASE", + "terminology_id": { + "_type": "TERMINOLOGY_ID", + "value": "openehr_access" + }, + "code_string": "provider" + } + }, + "value": { + "_type": "DV_IDENTIFIER", + "issuer": "__PROVIDER_ISSUER__", + "id": "__PROVIDER_ID__", + "type": "ORGANISATION" + } + } + ] + } + } + ] +} diff --git a/scripts/ui-e2e.sh b/scripts/ui-e2e.sh index 9f43d9457b..6682cde44a 100755 --- a/scripts/ui-e2e.sh +++ b/scripts/ui-e2e.sh @@ -98,7 +98,6 @@ DB_URL="${UI_E2E_DB_URL:-postgres://${PG_INIT_USER:-ferroehr}:${PG_INIT_PASSWORD COMPOSE_FILES=(-f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.db-publish.yml -f docker/viewer/e2e-env.yml) KEYCLOAK_URL="http://localhost:8081" -ACCEPT_JSON="Accept: application/json" CT_JSON="Content-Type: application/json" DRIVER_PORT=9515 SHOTS_DIR="$ROOT/target/ui-e2e/screenshots" @@ -231,58 +230,23 @@ curl -sf -X PUT -H "Authorization: Bearer $KC_TOKEN" -H "$CT_JSON" \ -d @"$E2E_TMP/kc-client.json" \ "$KC_REALM_ADMIN/clients/$CLIENT_ID" -# ── 2b. Seed clinical data over REST (never the database): one template, one -# EHR, one composition committed then updated (two versions) — powers -# the composition-viewer journey and the data-bearing doc screenshots. -# The composition body is the CDR's OWN generated example (spec-valid -# by construction; no hand-built fixture). -echo "── seeding an EHR + a two-version composition" -CDR_V1="$CDR_URL/ferroehr/rest/openehr/v1" -SEED_OPT="app/ferroehr-viewer/tests/fixtures/minimal_evaluation.opt" -SEED_TEMPLATE="minimal_evaluation.en.v1" -# Template upload is idempotent for the harness: 201 (created) or 409 (there). -opt_status=$(curl -s -o /dev/null -w "%{http_code}" -u ferroehr:ferroehr -X POST \ - "$CDR_V1/definition/template/adl1.4" -H "Content-Type: application/xml" \ - --data-binary @"$SEED_OPT") -case "$opt_status" in 201|409) ;; *) echo "FATAL: template upload -> $opt_status" >&2; exit 1;; esac -SEEDED_EHR_ID=$(curl -sf -u ferroehr:ferroehr -X POST "$CDR_V1/ehr" \ - -H "Prefer: return=representation" -H "$ACCEPT_JSON" \ - | jq -r '.ehr_id.value') -curl -sf -u ferroehr:ferroehr "$CDR_V1/definition/template/adl1.4/$SEED_TEMPLATE/example" \ - -H "$ACCEPT_JSON" > "$E2E_TMP/example.json" -SEED_VUID=$(curl -sf -D - -o /dev/null -u ferroehr:ferroehr -X POST \ - "$CDR_V1/ehr/$SEEDED_EHR_ID/composition" \ - -H "$CT_JSON" -H "$ACCEPT_JSON" -H "Prefer: return=minimal" \ - --data-binary @"$E2E_TMP/example.json" \ - | tr -d '\r' | sed -n 's/^[Ee][Tt]ag: W\/"\(.*\)"$/\1/p') -SEEDED_VO_ID="${SEED_VUID%%::*}" -curl -sf -o /dev/null -u ferroehr:ferroehr -X PUT \ - "$CDR_V1/ehr/$SEEDED_EHR_ID/composition/$SEEDED_VO_ID" \ - -H "$CT_JSON" -H "$ACCEPT_JSON" \ - -H "If-Match: \"$SEED_VUID\"" --data-binary @"$E2E_TMP/example.json" +# ── 2b. The demo dataset, seeded over REST (never the database) by the one +# seed the hosted sandbox runs (scripts/sandbox/reseed.sh): the +# records, the parties, the access policy, the care relationships, +# the legal marks, the signatures and the logs every viewer page draws. +# The administrator seeds, the clinician ferroehr reads outside a care +# relationship and attests, and ferroehr-proxy reads a patient's log +# as their representative. The CDR here serves no LOINC. +echo "── seeding the demo dataset" +SEED_IDS="$E2E_TMP/seed-ids.json" +SANDBOX_BASE="$CDR_URL" SANDBOX_USER=ferroehr-admin SANDBOX_CLINICIAN=ferroehr \ + SANDBOX_TERMINOLOGY=without-loinc SANDBOX_IDS_OUT="$SEED_IDS" \ + bash scripts/sandbox/reseed.sh +# The first demo EHR holds the two-version composition the composition +# journeys open. +SEEDED_EHR_ID=$(jq -r '.ehrs[0]' "$SEED_IDS") +SEEDED_VO_ID=$(jq -r '.tokens["__SERIES:minimal-evaluation__"]' "$SEED_IDS") echo " seeded EHR $SEEDED_EHR_ID / composition $SEEDED_VO_ID (2 versions)" -# Three more single-composition EHRs committed as FLAT with real quantity -# magnitudes (the example generator emits only the skeleton — issue #94 — -# so charts/tables need explicitly valued data points). -day=14 -for magnitude in 36.5 37.8 39.1; do - extra_ehr=$(curl -sf -u ferroehr:ferroehr -X POST "$CDR_V1/ehr" \ - -H "Prefer: return=representation" -H "$ACCEPT_JSON" \ - | jq -r '.ehr_id.value') - curl -sf -o /dev/null -u ferroehr:ferroehr -X POST \ - "$CDR_V1/ehr/$extra_ehr/composition" \ - -H "Content-Type: application/openehr.wt.flat+json" -H "$ACCEPT_JSON" \ - -H "openehr-template-id: $SEED_TEMPLATE" -H "Prefer: return=minimal" \ - -d "{ - \"ctx/language\": \"en\", \"ctx/territory\": \"US\", - \"ctx/composer_name\": \"Seed composer\", - \"ctx/time\": \"2026-07-${day}T08:00:00Z\", - \"minimal/minimal/quantity|magnitude\": $magnitude, - \"minimal/minimal/quantity|unit\": \"kg\" - }" - day=$((day + 1)) -done -echo " seeded 3 extra FLAT compositions with quantity magnitudes" # ── 3. The viewer under test ───────────────────────────────────────────────── if [[ -n "${UI_E2E_IMAGE:-}" ]]; then diff --git a/website/book/src/getting-started.md b/website/book/src/getting-started.md index 95b08fb5ce..5cc9707036 100644 --- a/website/book/src/getting-started.md +++ b/website/book/src/getting-started.md @@ -72,7 +72,18 @@ expect it to slow down under heavy use. ### What is already in the sandbox The nightly reset reloads a fixed demo dataset, so the server always answers -with something to look at: +with something to look at. Every record, party, policy and log entry in it is +synthetic: it was made up for the demo and names no real person. The seed +writes it through the public API alone (`scripts/sandbox/reseed.sh`), as the +three demo logins, each with the password `ferroehr`: + +| Login | Who it is | +|---|---| +| `ferroehr` | the administrator, who reaches every surface, the admin API included | +| `ferroehr-clinician` | a professional, who reads two records outside a care relationship (a justified and an emergency access, each with its reason) and attests two versions | +| `ferroehr-proxy` | Ruud de Vries, the representative of the demo patient Isa de Vries, who reads the subject view of her access log | + +The dataset holds: - **8 EHRs**, each with a mixed record and its own patient. The sandbox resolves patients through FerroPIX, the FerroHEALTH patient identity @@ -84,24 +95,50 @@ with something to look at: their EHRs through FerroPIX. Two of them carry a second `EHR_STATUS` version: patient 07 is not queryable and so never appears in AQL results, patient 08 is not modifiable and refuses writes with a `409`. -- **183 compositions** across **17 ADL 1.4 templates**: sixteen from the - openEHR CKM (vital signs, problem and medicines lists, lab results, - referrals, an International Patient Summary, several statutory case-report - forms) and one terminology-binding template whose coded text resolves - against the terminology server running beside the CDR. Six compositions - have more than one version, so `LATEST_VERSION` and `ALL_VERSIONS` differ on - real data. -- **233 ADL 2 archetypes and 5 ADL 2 templates**, browsable under +- **Compositions across 18 ADL 1.4 templates**: sixteen from the openEHR CKM + (vital signs, problem and medicines lists, lab results, referrals, an + International Patient Summary, several statutory case-report forms), one + terminology-binding template whose coded text resolves against the + terminology server running beside the CDR, and the viewer's minimal + evaluation template, three of whose compositions were sent in the + Simplified Flat format with measured values. Seven compositions have more + than one version, so `LATEST_VERSION` and `ALL_VERSIONS` differ on real + data, and two carry an attestation, one signed and one pending. +- **233 ADL 2 archetypes and 3 ADL 2 templates**, browsable under `extensions/v1/definition/archetype/adl2` and `openehr/v1/definition/template/adl2`. Two of the templates are ADL 2 source templates whose slots the server flattens against that archetype library, and the compositions committed from them came out of the server's own `…/example` generator. -- **11 demographic parties** (persons, roles, party relationships) and a - **FOLDER directory** in every EHR whose items reference real compositions. -- **5 stored AQL queries** under `eu.ferroehr.sandbox`, all of which return +- **Five ADL 1.4 archetypes** from the openEHR CKM under + `extensions/v1/definition/archetype/adl1.4`. +- **Demographic parties**: persons, a patient `PERSON` for six of the EHRs + with its identifiers and the record subject it stands for, the healthcare + provider `ORGANISATION` the sandbox acts for (in two versions), a second + organisation, two care-team `GROUP`s, a system client's `AGENT`, the + `ROLE`s that grant (a privacy officer's access-control writes, the lab + feed's commits), party relationships and two representations. The parties + list and search find them all. +- **Access control**: the controller's access policy in two versions (the + first requires a care relationship and admits a justified and an emergency + access, the second lifts that requirement and withholds the accessor's + roles from the subject view of the access log), three care relationships + (one ended in its second version), and the EHR access settings of two + EHRs: a restriction of a named professional with a consent, and an opt-out + from the access services. +- **Legal marks**: a restriction of processing on one composition, a research + objection, the access-delay register with one composition held from the + person, and retention periods, two of whose EHRs are past their period, + with a whole-record hold and an object hold. +- **Logs**: an access-log entry for every request the seed made, across all + eight EHRs, the system records ITI-81 reads, and the access log's sealed + windows. +- A **FOLDER directory** in every EHR whose items reference real compositions. +- **6 stored AQL queries** under `eu.ferroehr.sandbox`, all of which return rows: `composition_index`, `blood_pressure`, `case_reports`, - `composition_versions`, and `patient_record` (takes an `$ehr_id` parameter). + `composition_versions`, `patient_record` (takes an `$ehr_id` parameter) and + `cohort_compositions`, which the seed also runs through + `POST /query/cohort` over six patients named by identifier. Run one with `GET /query/eu.ferroehr.sandbox::composition_index`, or open the viewer's query screen.