From 9c58aad00aeabfd0cf29c01786ca50144e0bfcfc Mon Sep 17 00:00:00 2001 From: Carl Leitner Date: Mon, 29 Jul 2024 14:49:52 +0200 Subject: [PATCH] moved .map files into maps/*fml and got rid of some pre-generated resources --- .../ddcc-transaction-test-examples.fsh | 17 - input/fsh.old/example-arabic.fsh | 59 - input/fsh.old/example-chinese.fsh | 59 - input/fsh.old/example-english.fsh | 59 - input/fsh.old/example-french.fsh | 59 - input/fsh.old/example-russian.fsh | 59 - input/fsh.old/example-spanish.fsh | 59 - input/fsh.old/shc-binary.fsh | 42 - input/fsh.old/shc-bundle.fsh | 55 - input/fsh.old/shc-composition.fsh | 62 - input/fsh.old/shc-documentreference.fsh | 53 - input/fsh.old/shc-generate-operation.fsh | 38 - input/fsh.old/shc-organization.fsh | 8 - input/fsh.old/shc-patient.fsh | 27 - input/fsh.old/shc-practitioner.fsh | 31 - input/fsh.old/shc-provenance.fsh | 35 - input/fsh.old/shc-questionnaire.fsh | 26 - input/fsh.old/shf-composition.fsh | 53 - input/fsh.old/svc-bundle.fsh | 35 - input/fsh.old/svc-composition.fsh | 39 - input/fsh.old/svc-core-data-set.fsh | 247 -- input/fsh.old/svc-graphdefinition.fsh | 32 - input/fsh.old/svc-immunization.fsh | 45 - input/fsh.old/svc-qrcodes.fsh | 67 - input/fsh.old/svc-questionnaire.fsh | 139 - .../fsh.old/svc-transaction-test-examples.fsh | 54 - input/fsh.old/svc-valuesets.fsh | 194 -- .../BundleVSToAddBundle.fml} | 0 .../CertDCCtoCoreDataSet.fml} | 10 +- .../CertDCCtoDDCC.fml} | 0 .../CertDIVOCtoCoreDataSet.fml} | 10 +- .../CertDIVOCtoDDCC.fml} | 0 .../CertICAOtoCoreDataSet.fml} | 10 +- .../CertICAOtoDDCC.fml} | 0 .../CertSHCtoCoreDataSet.fml} | 6 +- .../CertSHCtoDDCC.fml} | 0 .../CoreDataSetLibrary.fml} | 8 +- .../CoreDataSetVSLibrary.fml} | 12 +- .../CoreDataSetVSToAddBundle.fml} | 2 +- .../CoreDataSetVSToSHC.fml} | 6 +- .../DDCCtoCoredataset.fml} | 5 +- .../DDCCtoEUdcc.map => maps/DDCCtoEUdcc.fml} | 0 .../DDCCtoSHC.map => maps/DDCCtoSHC.fml} | 4 +- .../IPSToCoreDataSetVS.fml} | 2 +- .../QRespToVSCoreDataSet.fml} | 2 +- .../ResourcesToVSCoreDataSet.fml} | 4 +- .../SHCToCoreDataSetTR.fml} | 6 +- .../SHCToCoreDataSetVS.fml} | 6 +- .../SHCtoDDCC.map => maps/SHCtoDDCC.fml} | 14 +- .../pre-generated/svc-map-qr-uvci-bundle.map | 158 - input/pre-generated/svc-qr-uvci-example.fsh | 17 - .../StructureMap-BundleVSToAddBundle.json | 99 - .../StructureMap-CertDCCtoCoreDataSet.json | 1138 ------- .../StructureMap-CertDIVOCtoCoreDataSet.json | 1127 ------- .../StructureMap-CertICAOtoCoreDataSet.json | 1247 -------- .../StructureMap-CertSHCtoCoreDataSet.json | 483 --- .../StructureMap-CoreDataSetLibrary.json | 543 ---- .../StructureMap-CoreDataSetVSLibrary.json | 2720 ----------------- ...StructureMap-CoreDataSetVSToAddBundle.json | 96 - .../StructureMap-CoreDataSetVSToSHC.json | 506 --- .../StructureMap-DDCCtoCoredataset.json | 434 --- input/resources/StructureMap-DDCCtoEUdcc.json | 466 --- .../StructureMap-IPSToCoreDataSetVS.json | 658 ---- .../StructureMap-QRespToVSCoreDataSet.json | 796 ----- .../StructureMap-ResourcesToCoreDataSet.json | 968 ------ ...StructureMap-ResourcesToVSCoreDataSet.json | 968 ------ .../StructureMap-SHCToCoreDataSetTR.json | 470 --- .../StructureMap-SHCToCoreDataSetVS.json | 539 ---- ...StructureMap-coredataset-to-addbundle.json | 1278 -------- ...tructureMap-ddcc-qresp-to-coredataset.json | 797 ----- ...tureMap-ddcc-resources-to-coredataset.json | 140 - .../resources/svc-map-qr-uvci-bundle.xml.old | 671 ---- 72 files changed, 54 insertions(+), 18025 deletions(-) delete mode 100644 input/fsh.old/ddcc-transaction-test-examples.fsh delete mode 100644 input/fsh.old/example-arabic.fsh delete mode 100644 input/fsh.old/example-chinese.fsh delete mode 100644 input/fsh.old/example-english.fsh delete mode 100644 input/fsh.old/example-french.fsh delete mode 100644 input/fsh.old/example-russian.fsh delete mode 100644 input/fsh.old/example-spanish.fsh delete mode 100644 input/fsh.old/shc-binary.fsh delete mode 100644 input/fsh.old/shc-bundle.fsh delete mode 100644 input/fsh.old/shc-composition.fsh delete mode 100644 input/fsh.old/shc-documentreference.fsh delete mode 100644 input/fsh.old/shc-generate-operation.fsh delete mode 100644 input/fsh.old/shc-organization.fsh delete mode 100644 input/fsh.old/shc-patient.fsh delete mode 100644 input/fsh.old/shc-practitioner.fsh delete mode 100644 input/fsh.old/shc-provenance.fsh delete mode 100644 input/fsh.old/shc-questionnaire.fsh delete mode 100644 input/fsh.old/shf-composition.fsh delete mode 100644 input/fsh.old/svc-bundle.fsh delete mode 100644 input/fsh.old/svc-composition.fsh delete mode 100644 input/fsh.old/svc-core-data-set.fsh delete mode 100644 input/fsh.old/svc-graphdefinition.fsh delete mode 100644 input/fsh.old/svc-immunization.fsh delete mode 100644 input/fsh.old/svc-qrcodes.fsh delete mode 100644 input/fsh.old/svc-questionnaire.fsh delete mode 100644 input/fsh.old/svc-transaction-test-examples.fsh delete mode 100644 input/fsh.old/svc-valuesets.fsh rename input/{maps-src/BundleVSToAddBundle.map => maps/BundleVSToAddBundle.fml} (100%) rename input/{maps-src/CertDCCtoCoreDataSet.map => maps/CertDCCtoCoreDataSet.fml} (96%) rename input/{maps-src/CertDCCtoDDCC.map => maps/CertDCCtoDDCC.fml} (100%) rename input/{maps-src/CertDIVOCtoCoreDataSet.map => maps/CertDIVOCtoCoreDataSet.fml} (98%) rename input/{maps-src/CertDIVOCtoDDCC.map => maps/CertDIVOCtoDDCC.fml} (100%) rename input/{maps-src/CertICAOtoCoreDataSet.map => maps/CertICAOtoCoreDataSet.fml} (97%) rename input/{maps-src/CertICAOtoDDCC.map => maps/CertICAOtoDDCC.fml} (100%) rename input/{maps-src/CertSHCtoCoreDataSet.map => maps/CertSHCtoCoreDataSet.fml} (96%) rename input/{maps-src/CertSHCtoDDCC.map => maps/CertSHCtoDDCC.fml} (100%) rename input/{maps-src/CoreDataSetLibrary.map => maps/CoreDataSetLibrary.fml} (95%) rename input/{maps-src/CoreDataSetVSLibrary.map => maps/CoreDataSetVSLibrary.fml} (97%) rename input/{maps-src/CoreDataSetVSToAddBundle.map => maps/CoreDataSetVSToAddBundle.fml} (93%) rename input/{maps-src/CoreDataSetVSToSHC.map => maps/CoreDataSetVSToSHC.fml} (95%) rename input/{maps-src/DDCCtoCoredataset.map => maps/DDCCtoCoredataset.fml} (94%) rename input/{maps-src/DDCCtoEUdcc.map => maps/DDCCtoEUdcc.fml} (100%) rename input/{maps-src/DDCCtoSHC.map => maps/DDCCtoSHC.fml} (98%) rename input/{maps-src/IPSToCoreDataSetVS.map => maps/IPSToCoreDataSetVS.fml} (99%) rename input/{maps-src/QRespToVSCoreDataSet.map => maps/QRespToVSCoreDataSet.fml} (96%) rename input/{maps-src/ResourcesToVSCoreDataSet.map => maps/ResourcesToVSCoreDataSet.fml} (97%) rename input/{maps-src/SHCToCoreDataSetTR.map => maps/SHCToCoreDataSetTR.fml} (97%) rename input/{maps-src/SHCToCoreDataSetVS.map => maps/SHCToCoreDataSetVS.fml} (97%) rename input/{maps-src/SHCtoDDCC.map => maps/SHCtoDDCC.fml} (93%) delete mode 100644 input/pre-generated/svc-map-qr-uvci-bundle.map delete mode 100644 input/pre-generated/svc-qr-uvci-example.fsh delete mode 100644 input/resources/StructureMap-BundleVSToAddBundle.json delete mode 100644 input/resources/StructureMap-CertDCCtoCoreDataSet.json delete mode 100644 input/resources/StructureMap-CertDIVOCtoCoreDataSet.json delete mode 100644 input/resources/StructureMap-CertICAOtoCoreDataSet.json delete mode 100644 input/resources/StructureMap-CertSHCtoCoreDataSet.json delete mode 100644 input/resources/StructureMap-CoreDataSetLibrary.json delete mode 100644 input/resources/StructureMap-CoreDataSetVSLibrary.json delete mode 100644 input/resources/StructureMap-CoreDataSetVSToAddBundle.json delete mode 100644 input/resources/StructureMap-CoreDataSetVSToSHC.json delete mode 100644 input/resources/StructureMap-DDCCtoCoredataset.json delete mode 100644 input/resources/StructureMap-DDCCtoEUdcc.json delete mode 100644 input/resources/StructureMap-IPSToCoreDataSetVS.json delete mode 100644 input/resources/StructureMap-QRespToVSCoreDataSet.json delete mode 100644 input/resources/StructureMap-ResourcesToCoreDataSet.json delete mode 100644 input/resources/StructureMap-ResourcesToVSCoreDataSet.json delete mode 100644 input/resources/StructureMap-SHCToCoreDataSetTR.json delete mode 100644 input/resources/StructureMap-SHCToCoreDataSetVS.json delete mode 100644 input/resources/StructureMap-coredataset-to-addbundle.json delete mode 100644 input/resources/StructureMap-ddcc-qresp-to-coredataset.json delete mode 100644 input/resources/StructureMap-ddcc-resources-to-coredataset.json delete mode 100644 input/resources/svc-map-qr-uvci-bundle.xml.old diff --git a/input/fsh.old/ddcc-transaction-test-examples.fsh b/input/fsh.old/ddcc-transaction-test-examples.fsh deleted file mode 100644 index e3afde112b..0000000000 --- a/input/fsh.old/ddcc-transaction-test-examples.fsh +++ /dev/null @@ -1,17 +0,0 @@ -Instance: DDCCVSTXSHEParameters1 -InstanceOf: DDCCGenerateHealthCertificateParameters -Usage: #inline - -* parameter[+].name = "response" -* parameter[=].resource = DDCCVSQuestionnaireResponseExample - - -Instance: DDCCTXSHEbundleexample1 -InstanceOf: DDCCSubmitHealthEventRequest -Usage: #example - -* type = #batch -* entry[+].fullUrl = "http://www.example.org/fhir/Parameters/DDCCVSTXSHEParameters1" -* entry[=].resource = DDCCVSTXSHEParameters1 -* entry[=].request.method = #POST -* entry[=].request.url = "QuestionnaireResponse/$generateHealthCertificate" diff --git a/input/fsh.old/example-arabic.fsh b/input/fsh.old/example-arabic.fsh deleted file mode 100644 index 9f7f106500..0000000000 --- a/input/fsh.old/example-arabic.fsh +++ /dev/null @@ -1,59 +0,0 @@ -Alias: $ICD11 = http://id.who.int/icd11/mms - -Instance: SHC-Patient-Arabic -InstanceOf: SHC_Patient -Usage: #example -// Title: "" -// Description: "" -* name[+].text = "فيليكس القط" -* birthDate = "2000-01-02" - -Instance: SHC-Organization-Arabic -InstanceOf: SHC_Organization -Usage: #example -// Title: "" -// Description: "" -* name = "مستشفى حكومي" - -Instance: SVC-Immunization-Arabic -InstanceOf: SVC_Immunization -Usage: #example -// Title: "" -// Description: "" -* status = #completed -// -* identifier[SVC_Identifier].system = "https://who-int.github.io/svc/refs/heads/rc2/test_system" -* identifier[SVC_Identifier].value = "123" -* vaccineCode.coding[svcVaccine].system = "urn:EXAMPLE-who-:smart:vaccine-certificate:RC1:coding" -* vaccineCode.coding[svcVaccine].code = #XM0CX4 -// -* expirationDate = "2021-06-30" -* lotNumber = "123" -* patient = Reference(SHC-Patient-Arabic) -* occurrenceDateTime = "2021-02-02" -* performer.actor = Reference(SHC-Organization-Arabic) -// -* protocolApplied[protocolAppliedAuthority].authority = Reference(SHC-Organization-Arabic) -* protocolApplied[protocolAppliedAuthority].targetDisease = $ICD11#RA01.0 -* protocolApplied[protocolAppliedAuthority].doseNumberPositiveInt = 1 -* protocolApplied[protocolAppliedAuthority].seriesDosesPositiveInt = 2 - -Instance: Example-Arabic -InstanceOf: Bundle -Usage: #example - -* type = #transaction -* entry[+].fullUrl = "http://www.example.org/fhir/Patient/SHC-Patient-Arabic" -* entry[=].request.url = "Patient" -* entry[=].request.method = #PUT -* entry[=].resource = SHC-Patient-Arabic - -* entry[+].fullUrl = "http://www.example.org/fhir/Patient/SHC-Organization-Arabic" -* entry[=].request.url = "Organization" -* entry[=].request.method = #PUT -* entry[=].resource = SHC-Organization-Arabic - -* entry[+].fullUrl = "http://www.example.org/fhir/Patient/SVC-Immunization-Arabic" -* entry[=].request.url = "Immunization" -* entry[=].request.method = #PUT -* entry[=].resource = SVC-Immunization-Arabic diff --git a/input/fsh.old/example-chinese.fsh b/input/fsh.old/example-chinese.fsh deleted file mode 100644 index ce4c5ee7b7..0000000000 --- a/input/fsh.old/example-chinese.fsh +++ /dev/null @@ -1,59 +0,0 @@ -Alias: $ICD11 = http://id.who.int/icd11/mms - -Instance: SHC-Patient-Chinese -InstanceOf: SHC_Patient -Usage: #example -// Title: "" -// Description: "" -* name[+].text = "猫菲利克斯" -* birthDate = "2000-01-02" - -Instance: SHC-Organization-Chinese -InstanceOf: SHC_Organization -Usage: #example -// Title: "" -// Description: "" -* name = "政府医院" - -Instance: SVC-Immunization-Chinese -InstanceOf: SVC_Immunization -Usage: #example -// Title: "" -// Description: "" -* status = #completed -// -* identifier[SVC_Identifier].system = "https://who-int.github.io/svc/refs/heads/rc2/test_system" -* identifier[SVC_Identifier].value = "123" -* vaccineCode.coding[svcVaccine].system = "urn:EXAMPLE-who-:smart:vaccine-certificate:RC1:coding" -* vaccineCode.coding[svcVaccine].code = $ICD11#XM0CX4 -// -* expirationDate = "2021-06-30" -* lotNumber = "123" -* patient = Reference(SHC-Patient-Chinese) -* occurrenceDateTime = "2021-02-02" -* performer.actor = Reference(SHC-Organization-Chinese) -// -* protocolApplied[protocolAppliedAuthority].authority = Reference(SHC-Organization-Chinese) -* protocolApplied[protocolAppliedAuthority].targetDisease = $ICD11#RA01.0 -* protocolApplied[protocolAppliedAuthority].doseNumberPositiveInt = 1 -* protocolApplied[protocolAppliedAuthority].seriesDosesPositiveInt = 2 - -Instance: Example-Chinese -InstanceOf: Bundle -Usage: #example - -* type = #transaction -* entry[+].fullUrl = "http://www.example.org/fhir/Patient/SHC-Patient-Chinese" -* entry[=].request.url = "Patient" -* entry[=].request.method = #PUT -* entry[=].resource = SHC-Patient-Chinese - -* entry[+].fullUrl = "http://www.example.org/fhir/Patient/SHC-Organization-Chinese" -* entry[=].request.url = "Organization" -* entry[=].request.method = #PUT -* entry[=].resource = SHC-Organization-Chinese - -* entry[+].fullUrl = "http://www.example.org/fhir/Patient/SVC-Immunization-Chinese" -* entry[=].request.url = "Immunization" -* entry[=].request.method = #PUT -* entry[=].resource = SVC-Immunization-Chinese diff --git a/input/fsh.old/example-english.fsh b/input/fsh.old/example-english.fsh deleted file mode 100644 index c31e76a57f..0000000000 --- a/input/fsh.old/example-english.fsh +++ /dev/null @@ -1,59 +0,0 @@ -Alias: $ICD11 = http://id.who.int/icd11/mms - -Instance: SHC-Patient-English -InstanceOf: SHC_Patient -Usage: #example -// Title: "" -// Description: "" -* name[+].text = "Felix Cat" -* birthDate = "2000-01-02" - -Instance: SHC-Organization-English -InstanceOf: SHC_Organization -Usage: #example -// Title: "" -// Description: "" -* name = "Government Hospital" - -Instance: SVC-Immunization-English -InstanceOf: SVC_Immunization -Usage: #example -// Title: "" -// Description: "" -* status = #completed -// -* identifier[SVC_Identifier].system = "https://who-int.github.io/svc/refs/heads/rc2/test_system" -* identifier[SVC_Identifier].value = "123" -* vaccineCode.coding[svcVaccine].system = "urn:EXAMPLE-who-:smart:vaccine-certificate:RC1:coding" -* vaccineCode.coding[svcVaccine].code = $ICD11#XM0CX4 -// -* expirationDate = "2021-06-30" -* lotNumber = "123" -* patient = Reference(SHC-Patient-English) -* occurrenceDateTime = "2021-02-02" -* performer.actor = Reference(SHC-Organization-English) -// -* protocolApplied[protocolAppliedAuthority].authority = Reference(SHC-Organization-English) -* protocolApplied[protocolAppliedAuthority].targetDisease = $ICD11#RA01.0 -* protocolApplied[protocolAppliedAuthority].doseNumberPositiveInt = 1 -* protocolApplied[protocolAppliedAuthority].seriesDosesPositiveInt = 2 - -Instance: Example-English -InstanceOf: Bundle -Usage: #example - -* type = #transaction -* entry[+].fullUrl = "http://www.example.org/fhir/Patient/SHC-Patient-English" -* entry[=].request.url = "Patient" -* entry[=].request.method = #PUT -* entry[=].resource = SHC-Patient-English - -* entry[+].fullUrl = "http://www.example.org/fhir/Patient/SHC-Organization-English" -* entry[=].request.url = "Organization" -* entry[=].request.method = #PUT -* entry[=].resource = SHC-Organization-English - -* entry[+].fullUrl = "http://www.example.org/fhir/Patient/SVC-Immunization-English" -* entry[=].request.url = "Immunization" -* entry[=].request.method = #PUT -* entry[=].resource = SVC-Immunization-English diff --git a/input/fsh.old/example-french.fsh b/input/fsh.old/example-french.fsh deleted file mode 100644 index 1bc94ad3e8..0000000000 --- a/input/fsh.old/example-french.fsh +++ /dev/null @@ -1,59 +0,0 @@ -Alias: $ICD11 = http://id.who.int/icd11/mms - -Instance: SHC-Patient-French -InstanceOf: SHC_Patient -Usage: #example -// Title: "" -// Description: "" -* name[+].text = "Félix le chat" -* birthDate = "2000-01-02" - -Instance: SHC-Organization-French -InstanceOf: SHC_Organization -Usage: #example -// Title: "" -// Description: "" -* name = "Hôpital du gouvernement" - -Instance: SVC-Immunization-French -InstanceOf: SVC_Immunization -Usage: #example -// Title: "" -// Description: "" -* status = #completed -// -* identifier[SVC_Identifier].system = "https://who-int.github.io/svc/refs/heads/rc2/test_system" -* identifier[SVC_Identifier].value = "123" -* vaccineCode.coding[svcVaccine].system = "urn:EXAMPLE-who-:smart:vaccine-certificate:RC1:coding" -* vaccineCode.coding[svcVaccine].code = $ICD11#XM0CX4 -// -* expirationDate = "2021-06-30" -* lotNumber = "123" -* patient = Reference(SHC-Patient-Example-French) -* occurrenceDateTime = "2021-02-02" -* performer.actor = Reference(SHC-Organization-French) -// -* protocolApplied[protocolAppliedAuthority].authority = Reference(SHC-Organization-French) -* protocolApplied[protocolAppliedAuthority].targetDisease = $ICD11#RA01.0 -* protocolApplied[protocolAppliedAuthority].doseNumberPositiveInt = 1 -* protocolApplied[protocolAppliedAuthority].seriesDosesPositiveInt = 2 - -Instance: Example-French -InstanceOf: Bundle -Usage: #example - -* type = #transaction -* entry[+].fullUrl = "http://www.example.org/fhir/Patient/SHC-Patient-French" -* entry[=].request.url = "Patient" -* entry[=].request.method = #PUT -* entry[=].resource = SHC-Patient-French - -* entry[+].fullUrl = "http://www.example.org/fhir/Patient/SHC-Organization-French" -* entry[=].request.url = "Organization" -* entry[=].request.method = #PUT -* entry[=].resource = SHC-Organization-French - -* entry[+].fullUrl = "http://www.example.org/fhir/Patient/SVC-Immunization-French" -* entry[=].request.url = "Immunization" -* entry[=].request.method = #PUT -* entry[=].resource = SVC-Immunization-French diff --git a/input/fsh.old/example-russian.fsh b/input/fsh.old/example-russian.fsh deleted file mode 100644 index 4028d66d09..0000000000 --- a/input/fsh.old/example-russian.fsh +++ /dev/null @@ -1,59 +0,0 @@ -Alias: $ICD11 = http://id.who.int/icd11/mms - -Instance: SHC-Patient-Russian -InstanceOf: SHC_Patient -Usage: #example -// Title: "" -// Description: "" -* name[+].text = "кот феликс" -* birthDate = "2000-01-02" - -Instance: SHC-Organization-Russian -InstanceOf: SHC_Organization -Usage: #example -// Title: "" -// Description: "" -* name = "Государственная больница" - -Instance: SVC-Immunization-Russian -InstanceOf: SVC_Immunization -Usage: #example -// Title: "" -// Description: "" -* status = #completed -// -* identifier[SVC_Identifier].system = "https://who-int.github.io/svc/refs/heads/rc2/test_system" -* identifier[SVC_Identifier].value = "123" -* vaccineCode.coding[svcVaccine].system = "urn:EXAMPLE-who-:smart:vaccine-certificate:RC1:coding" -* vaccineCode.coding[svcVaccine].code = $ICD11#XM0CX4 -// -* expirationDate = "2021-06-30" -* lotNumber = "123" -* patient = Reference(SHC-Patient-Example-Russian) -* occurrenceDateTime = "2021-02-02" -* performer.actor = Reference(SHC-Organization-Russian) -// -* protocolApplied[protocolAppliedAuthority].authority = Reference(SHC-Organization-Russian) -* protocolApplied[protocolAppliedAuthority].targetDisease = $ICD11#RA01.0 -* protocolApplied[protocolAppliedAuthority].doseNumberPositiveInt = 1 -* protocolApplied[protocolAppliedAuthority].seriesDosesPositiveInt = 2 - -Instance: Example-Russian -InstanceOf: Bundle -Usage: #example - -* type = #transaction -* entry[+].fullUrl = "http://www.example.org/fhir/Patient/SHC-Patient-Russian" -* entry[=].request.url = "Patient" -* entry[=].request.method = #PUT -* entry[=].resource = SHC-Patient-Russian - -* entry[+].fullUrl = "http://www.example.org/fhir/Patient/SHC-Organization-Russian" -* entry[=].request.url = "Organization" -* entry[=].request.method = #PUT -* entry[=].resource = SHC-Organization-Russian - -* entry[+].fullUrl = "http://www.example.org/fhir/Patient/SVC-Immunization-Russian" -* entry[=].request.url = "Immunization" -* entry[=].request.method = #PUT -* entry[=].resource = SVC-Immunization-Russian diff --git a/input/fsh.old/example-spanish.fsh b/input/fsh.old/example-spanish.fsh deleted file mode 100644 index 40091a0abe..0000000000 --- a/input/fsh.old/example-spanish.fsh +++ /dev/null @@ -1,59 +0,0 @@ -Alias: $ICD11 = http://id.who.int/icd11/mms - -Instance: SHC-Patient-Spanish -InstanceOf: SHC_Patient -Usage: #example -// Title: "" -// Description: "" -* name[+].text = "El gato Félix" -* birthDate = "2000-01-02" - -Instance: SHC-Organization-Spanish -InstanceOf: SHC_Organization -Usage: #example -// Title: "" -// Description: "" -* name = "Hospital del Gobierno" - -Instance: SVC-Immunization-Spanish -InstanceOf: SVC_Immunization -Usage: #example -// Title: "" -// Description: "" -* status = #completed -// -* identifier[SVC_Identifier].system = "https://who-int.github.io/svc/refs/heads/rc2/test_system" -* identifier[SVC_Identifier].value = "123" -* vaccineCode.coding[svcVaccine].system = "urn:EXAMPLE-who-:smart:vaccine-certificate:RC1:coding" -* vaccineCode.coding[svcVaccine].code = $ICD11#XM0CX4 -// -* expirationDate = "2021-06-30" -* lotNumber = "123" -* patient = Reference(SHC-Patient-Example-Spanish) -* occurrenceDateTime = "2021-02-02" -* performer.actor = Reference(SHC-Organization-Spanish) -// -* protocolApplied[protocolAppliedAuthority].authority = Reference(SHC-Organization-Spanish) -* protocolApplied[protocolAppliedAuthority].targetDisease = $ICD11#RA01.0 -* protocolApplied[protocolAppliedAuthority].doseNumberPositiveInt = 1 -* protocolApplied[protocolAppliedAuthority].seriesDosesPositiveInt = 2 - -Instance: Example-Spanish -InstanceOf: Bundle -Usage: #example - -* type = #transaction -* entry[+].fullUrl = "http://www.example.org/fhir/Patient/SHC-Patient-Spanish" -* entry[=].request.url = "Patient" -* entry[=].request.method = #PUT -* entry[=].resource = SHC-Patient-Spanish - -* entry[+].fullUrl = "http://www.example.org/fhir/Patient/SHC-Organization-Spanish" -* entry[=].request.url = "Organization" -* entry[=].request.method = #PUT -* entry[=].resource = SHC-Organization-Spanish - -* entry[+].fullUrl = "http://www.example.org/fhir/Patient/SVC-Immunization-Spanish" -* entry[=].request.url = "Immunization" -* entry[=].request.method = #PUT -* entry[=].resource = SVC-Immunization-Spanish diff --git a/input/fsh.old/shc-binary.fsh b/input/fsh.old/shc-binary.fsh deleted file mode 100644 index d673aa562e..0000000000 --- a/input/fsh.old/shc-binary.fsh +++ /dev/null @@ -1,42 +0,0 @@ -Alias: $certificateUsage = http://who-int.github.io/svc/StructureDefinition/shc-binary-qr-certificateUsage - -/* -Extension: SHCCertificateUsage -Id: SHC-CertificateUsage -Title: "SHC Certificate Usage Extension" -Description: "SHC Certificate Usage Extension" -* ^context.type = #element -* ^context.expression = "SHC_Binary_QR" -* extension contains usage 0..1 MS -* extension[usage].value[x] only code -* extension[usage].valueCode 1..1 MS -*/ - - -Profile: SHC_Binary_QR -Parent: Binary -Id: shc-binary-qr -Title: "SHC Binary return for QR" -* ^abstract = true -* data 1..1 MS -//* extension contains SHCCertificateUsage named usage 1..1 MS - -Profile: SHC_Binary_QRPNG -Parent: SHC_Binary_QR -Id: shc-binary-qrpng -Title: "SHC Binary for QR (PNG representation)" -Description: """ -PNG representation of the QR code returned under the [Register Health Certificate](transactions.html#register-health-certificate-message-semantics-response) -""" -* contentType = #image/png - - -Profile: SHC_Binary_QRContent -Parent: SHC_Binary_QR -Id: shc-binary-qrcontent -Title: "SHC Binary for QR Content" -Description: """ -PNG representation of the QR code returned under the [Register Health Certificate](transactions.html#register-health-certificate-message-semantics-response) -""" -* contentType = #application/octet-stream -* data 1..1 MS diff --git a/input/fsh.old/shc-bundle.fsh b/input/fsh.old/shc-bundle.fsh deleted file mode 100644 index c6eab2f525..0000000000 --- a/input/fsh.old/shc-bundle.fsh +++ /dev/null @@ -1,55 +0,0 @@ -Profile: SHC_Submit_Health_Event_Request -Parent: Bundle -Id: shc-submit-health-event-request -Title: "SHC Submit Health Event Request" -Description: """ -An [SHC Submit Health Event Request](StructureDefinition-shc-submit-health-event-request.html) is a transaction bundle containing the content of health events which are being submitted under the [Submit Health Event](transactions.html#submit-health-event) transaction. -""" -* ^publisher = "World Health Organization (WHO)" -* . MS -* . ^short = "SHC Submit Health Event Request" -* type MS -* type = #batch -* timestamp MS -* entry 0.. MS - - - - -Profile: SHC_Submit_Health_Event_Response -Parent: Bundle -Id: shc-submit-health-event-response -Title: "SHC Submit Health Event Response" -Description: """ -An [SHC Submit Health Event Response](StructureDefinition-shc-submit-health-event-respose.html) is a transaction reponse bundle containing the operation outcomes for the submission of one or more health certificates under the [Submit Health Event](transactions.html#submit-health-event) transaction. - -""" -* ^publisher = "World Health Organization (WHO)" -* . MS -* . ^short = "SHC Submit Health Event Response" -* identifier 1.. MS -* type MS -* type = #batch-response -* timestamp MS -* entry 0.. MS - - - -Profile: SHC_Bundle -Parent: Bundle -Id: shc-bundle -Title: "SHC Bundle" -Description: """ -An [SHC Bundle](StructureDefinition-shc-bundle.html) is a document bundle containing the Smart Health Certificate (SHCs). - -""" -* ^publisher = "World Health Organization (WHO)" -* . MS -* . ^short = "Smart Vaccination Certificate Bundle" -* ^abstract = true -* identifier 1.. MS -* type MS -* type = #document -* timestamp MS - - diff --git a/input/fsh.old/shc-composition.fsh b/input/fsh.old/shc-composition.fsh deleted file mode 100644 index b28af54e6f..0000000000 --- a/input/fsh.old/shc-composition.fsh +++ /dev/null @@ -1,62 +0,0 @@ -Profile: SHC_Composition -Parent: Composition -Id: shc-composition -Title: "SHC Composition" -Description: """ -Describes the logical structure for a Smart Health Certificate. -""" -* ^publisher = "World Health Organization (WHO)" -* . ^short = "SHC Composition" -* title 1.. MS -* ^abstract = true -* author MS -* author only Reference(SHC_Organization) -* subject 1..1 MS -* subject.reference 1.. MS -* subject only Reference(SHC_Patient) -* status MS -* identifier 1.. MS -* identifier.system 1.. MS -* identifier.value 1.. MS -* category 1..1 MS -* category from SHC_Category_ValueSet (extensible) -* section ^slicing.discriminator.type = #pattern -* section ^slicing.discriminator.path = "code" -* section contains - qrCode 1..* MS and - uri 0..* MS -* section[qrCode].entry only Reference(SHC_DocumentReference_QR) -* section[qrCode].code = SHC_SectionCode_CodeSystem#qrdoc -* section[uri].entry only Reference(Endpoint) -* section[uri].code = SHC_SectionCode_CodeSystem#uri - - - -CodeSystem: SHC_Category_CodeSystem -Id: SHC-Category-CodeSystem -Title: "SHC QR Category Usage Codes" -Description: "Categorization of Smart Health Certificates" -* #svc-covid19 "Smart Vaccination Certificate - COVID19" - -ValueSet: SHC_Category_ValueSet -Id: SHC-Category-ValueSet -Description: """ -Content categorization of Smart Health Certificates (SHC) -""" -* include codes from system SHC_Category_CodeSystem - - -CodeSystem: SHC_SectionCode_CodeSystem -Id: SHC-SectionCode-CodeSystem -Title: "SHC QR SectionCode Usage Codes" -Description: "Section Codes for Smart Health Certificates" -* #qrdoc "QR Code Document" -* #uri "Smart Health Certificate URI" - -ValueSet: SHC_SectionCode_ValueSet -Id: SHC-SectionCode-ValueSet -Description: """ -Content section codes for Smart Health Certificates (SHC) -""" -* include codes from system SHC_SectionCode_CodeSystem - diff --git a/input/fsh.old/shc-documentreference.fsh b/input/fsh.old/shc-documentreference.fsh deleted file mode 100644 index 1e2ea56fc4..0000000000 --- a/input/fsh.old/shc-documentreference.fsh +++ /dev/null @@ -1,53 +0,0 @@ - - - -Profile: SHC_DocumentReference_QR -Parent: DocumentReference -Id: shc-documentreference-qr -Title: "SHC DocumentReference return for QR" -* category 1.. MS -* category from SHC_QR_Category_Usage_ValueSet (extensible) -* subject only Reference(SHC_Patient) -* authenticator 1.. MS -* authenticator only Reference(SHC_Organization) -* content ^slicing.discriminator.type = #value -* content ^slicing.discriminator.path = "format" -* content ^slicing.rules = #closed -* content ^slicing.ordered = true -* content.format 1.. MS -* content.format from SHC_QR_Format_ValueSet (extensible) -* content contains qrImage 1..1 MS and qrContent 1..1 MS -* content[qrImage].attachment.data 1..1 MS -* content[qrImage].attachment.contentType 1..1 MS -* content[qrImage].format = SHC_QR_Format_CodeSystem#image -* content[qrContent].attachment.data 1..1 MS -* content[qrContent].attachment.contentType 1..1 MS -* content[qrContent].format = SHC_QR_Format_CodeSystem#serialized - - -CodeSystem: SHC_QR_Category_Usage_CodeSystem -Id: SHC-QR-Category-Usage-CodeSystem -Title: "SHC QR Category Usage Codes" -Description: "Possible formats available for QR usage." -* #who "WHO SVC" -* #dgc "EU DGC" -* #icao "ICAO" -* #au "AU" - -ValueSet: SHC_QR_Category_Usage_ValueSet -Id: SHC-QR-Category-Usage-ValueSet -Description: "Categorization of QR codes by their business usage" -* include codes from system SHC_QR_Category_Usage_CodeSystem - - -CodeSystem: SHC_QR_Format_CodeSystem -Id: SHC-QR-Format-CodeSystem -Title: "SHC QR Format Codes" -Description: "Possible formats available for QR data." -* #image "Image" -* #serialized "Serialized QR Content" - -ValueSet: SHC_QR_Format_ValueSet -Id: SHC-QR-Format-ValueSet -Description: "Format of the representation of QR code" -* include codes from system SHC_QR_Format_CodeSystem diff --git a/input/fsh.old/shc-generate-operation.fsh b/input/fsh.old/shc-generate-operation.fsh deleted file mode 100644 index 9cd1d13606..0000000000 --- a/input/fsh.old/shc-generate-operation.fsh +++ /dev/null @@ -1,38 +0,0 @@ -Instance: SHC_GenerateHealthCertificate -InstanceOf: OperationDefinition -Title: "OperationDefinition for generating a health certificate QR code that is signed." -Usage: #definition -* id = "SHC-QuestionnaireReponse-generateHealthCertificate" -* name = "QuestionnaireReponse Generate Health Certificate" -* status = #draft -* kind = #operation -* experimental = true -* date = "2021-05-07" -* description = """ -Generate one or more signed QR Codes based on a [SHC QuestionnaireResponse](StructureDefinition-shc-questionnaireresponse.html) -""" -* code = #generateHealthCertificate -* resource = #QuestionnaireResponse -* system = false -* type = true -* instance = true -* parameter[+].name = #response -* parameter[=].use = #in -* parameter[=].min = 0 -* parameter[=].max = "1" -* parameter[=].documentation = "The questionnaire response resource used to generate the QR code." -* parameter[=].type = #QuestionnaireResponse - -* parameter[+].name = #id -* parameter[=].use = #in -* parameter[=].min = 0 -* parameter[=].max = "1" -* parameter[=].documentation = "The questionnaire response resource id used to generate the QR code." -* parameter[=].type = #id - -* parameter[+].name = #shc -* parameter[=].use = #out -* parameter[=].min = 0 -* parameter[=].max = "1" -* parameter[=].documentation = """The Smart Health Certificate, including any QR codes, that was created under the [Generate Health Certificate](transactions.html#submit-health-event-expected-actions) expected actions""" -* parameter[=].type = #Bundle diff --git a/input/fsh.old/shc-organization.fsh b/input/fsh.old/shc-organization.fsh deleted file mode 100644 index 0efe5dd5e0..0000000000 --- a/input/fsh.old/shc-organization.fsh +++ /dev/null @@ -1,8 +0,0 @@ -Profile: SHC_Organization -Parent: Organization -Id: shc-organization -Title: "SHC Organization" -Description: """ -Abstraction for an SHC Organization. There should be an SHC Organization associated to each public health authortiy (PHA) in the [WHO Public Key Directory](actors.html#who-pkd) - -""" diff --git a/input/fsh.old/shc-patient.fsh b/input/fsh.old/shc-patient.fsh deleted file mode 100644 index 8cf6291547..0000000000 --- a/input/fsh.old/shc-patient.fsh +++ /dev/null @@ -1,27 +0,0 @@ -Profile: SHC_Patient -Parent: Patient -//Parent: Patient-uv-ips //this forces gender. not good. -Id: shc-patient -Title: "SHC Patient" -Description: """ -An SHC_Patient should: -* if the [identifier.assigner](StructureDefinition-shc-patient-definitions.html#Patient.identifier] is set then the value of [identifier.assigner](StructureDefinition-shc-patient-definitions.html#Patient.identifier.assigner) should be set to reference the [SHC Organization](StructureDefinition-shc-organization.html) resource associated to the PHA via the [WHO Public Key Directory](actors.html#who-pkd) -* obeys who-shc-patient-1 - -""" -* identifier 0.. MS -* identifier ^slicing.discriminator.type = #value -* identifier ^slicing.discriminator.path = "system" -* identifier ^slicing.rules = #open -* identifier ^slicing.ordered = true -* identifier contains shcIdentifier 0.. MS -* identifier[shcIdentifier].system 1.. MS -* identifier[shcIdentifier].value 1.. MS -* identifier[shcIdentifier].assigner 1.. MS -* identifier[shcIdentifier].assigner only Reference(SHC_Organization) - - -Invariant: who-shc-patient-1 -Description: "Patient.identifier OR (Patient.name AND Patient.birthDate) SHALL be present" -Expression: "identifier.exists() or ( name.exists() and birthDate.exists() )" -Severity: #error \ No newline at end of file diff --git a/input/fsh.old/shc-practitioner.fsh b/input/fsh.old/shc-practitioner.fsh deleted file mode 100644 index 85433fd16e..0000000000 --- a/input/fsh.old/shc-practitioner.fsh +++ /dev/null @@ -1,31 +0,0 @@ -Profile: SHC_Practitioner -Parent: Practitioner -Id: shc-practitioner -Title: "SHC Practitioner" -Description: """ -Container for an SHC Practitioner, which is a Practitioner authorized by the PHA to vaccinate an [SHC Patient](StructureDefinition-shc-patient.html). - -""" -* identifier 1.. -* identifier ^slicing.discriminator.type = #value -* identifier ^slicing.discriminator.path = "system" -* identifier ^slicing.rules = #open -* identifier ^slicing.ordered = true -* identifier contains shcIdentifier 1.. -* identifier[shcIdentifier].system 1.. MS -* identifier[shcIdentifier].value 1.. MS -* identifier[shcIdentifier].assigner 1.. MS -* identifier[shcIdentifier].assigner only Reference(SHC_Organization) - - - -Profile: SHC_PractitionerRole -Parent: PractitionerRole -Id: shc-practitioner-role -Title: "SHC Practitioner Role" -Description: """ -Association of an [SHC Practitioner](StructureDefinition-shc-practitioner-role.html) to a managing [SHC Organization](StructureDefinition-shc-orgaznization.html), indicating that an SHC Practitioner is authorized by the public health authority (PHA) to vaccinate an [SHC Patient](StructureDefinition-shc-patient.html). - -""" -* practitioner only Reference(SHC_Practitioner) -* organization only Reference(SHC_Organization) diff --git a/input/fsh.old/shc-provenance.fsh b/input/fsh.old/shc-provenance.fsh deleted file mode 100644 index c08a5ea9da..0000000000 --- a/input/fsh.old/shc-provenance.fsh +++ /dev/null @@ -1,35 +0,0 @@ -Profile: SHC_Provenance -Parent: Provenance -Id: shc-provenance -Title: "Provenance of SHC" -Description: """ -Used to assert the provenance of a public health authority (PHA) over either a Paper or a Digital Smart Vaccination Certificate (SHC). - -""" -* policy = "urn:EXAMPLE-who:smart:vaccine-certificate:RC1" -* target 1..1 MS -* entity 1.. MS -* entity ^slicing.discriminator.type = #type -* entity ^slicing.discriminator.path = "what" -* entity ^slicing.rules = #open -* entity ^slicing.ordered = true -* entity contains Provenance_Entity 1.. MS -* entity[Provenance_Entity].what only Reference(SHC_Bundle) -* agent 1.. MS -* agent ^slicing.discriminator.type = #type -* agent ^slicing.discriminator.path = "who" -* agent ^slicing.rules = #open -* agent ^slicing.ordered = true -* agent contains provenanceAgent 1.. MS -* agent[provenanceAgent].who 1..1 -* agent[provenanceAgent].who only Reference(SHC_Organization) -* agent[provenanceAgent].onBehalfOf 1..1 -* agent[provenanceAgent].onBehalfOf only Reference(SHC_Patient) -* signature 1.. MS -* signature ^slicing.discriminator.type = #type -* signature ^slicing.discriminator.path = "who" -* signature ^slicing.rules = #open -* signature ^slicing.ordered = true -* signature contains provenanceSignature 1.. MS -* signature[provenanceSignature].who 1..1 MS -* signature[provenanceSignature].who only Reference(SHC_Organization or SHC_PractitionerRole or SHC_Practitioner) diff --git a/input/fsh.old/shc-questionnaire.fsh b/input/fsh.old/shc-questionnaire.fsh deleted file mode 100644 index 21d9c7af66..0000000000 --- a/input/fsh.old/shc-questionnaire.fsh +++ /dev/null @@ -1,26 +0,0 @@ -Alias: $targetStructureMap = http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-targetStructureMap - -Profile: SHC_Questionnaire -Parent: sdc-questionnaire-extr-smap -Id: shc-questionnaire -Title: "SHC Questionniare" -Description: """ -Describes the logical structure for a questionnaire associacted to a Smart Health Certificate which includes a Structure Map to generate the relevant SHC from a given [SHC QuestionnaireResponse](StructureDefintion-shc-questionnaire-response.html) which responds to the SHC Questionnaire. -""" -* ^abstract = true -* extension[$targetStructureMap] 1.. MS -// * extension[$targetStructureMap].valueCanonical = "http://who-int.github.io/svc/StructureMap/shc-bundle" - -Profile: SHC_QuestionnaireResponse -Parent: sdc-questionnaireresponse -Id: shc-questionnaireresponse -Title: "SHC Questionnaire Response" -Description: """ -Describes the logical structure for a questionnaire response associacted to a [SHC Questionaire](StructureDefinition-shc-questionnaire.html). -""" -* ^abstract = true - - - - - diff --git a/input/fsh.old/shf-composition.fsh b/input/fsh.old/shf-composition.fsh deleted file mode 100644 index 3815a49c17..0000000000 --- a/input/fsh.old/shf-composition.fsh +++ /dev/null @@ -1,53 +0,0 @@ -Alias: $LOINC = http://loinc.org - - -Profile: SHF_Composition -Parent: Composition -Id: shf-composition -Title: "SHF Composition" -Description: """ -Describes the logical structure for the Smart Health Folder which contains the Smart Health Certificates (SHCs). An [SHF Composition](StructureDefinition-shf-composition.html) should: - * be accessible from a [SHC Registry Service](StructureDefintion-shc-registry.html) as located via the [WHO Public Key Directory](actors.html#who-pkd) for the PHA referenced in the [author](StructureDefinition-shf-composition-definitions.html#Composition.agent). -""" -* ^publisher = "World Health Organization (WHO)" -* . ^short = "SHF Composition" -* title = "International Certificate of Vaccination or Prophylaxis" -* author MS -* author only Reference(SHC_Organization) -* subject 1..1 MS -* subject.reference 1.. MS -* subject only Reference(SHC_Patient) -* status MS -* identifier 1.. MS -* identifier.system MS -* identifier.value MS -* type = $LOINC#80563-0 -* type ^short = "Kind of composition (\"Smart Health Folder\")" -* type ^definition = "Specifies that this composition refers to a Smart Health Folder" -* title MS -* title ^short = "Smart Health Folder" -* section 1.. -* section ^extension[0].url = "http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name" -* section ^extension[0].valueString = "Section" -* section ^slicing.discriminator[0].type = #pattern -* section ^slicing.discriminator[0].path = "code" -* section ^slicing.rules = #open -* section ^slicing.ordered = false -* section ^short = "Sections composing the SHF" -* section ^definition = "The root of the sections that make up the SHF Composition." - -* section contains sectionHealthCertificates 1..1 MS -* section[sectionHealthCertificates] ^short = "Certificates Section" -* section[sectionHealthCertificates] ^definition = "Certiciates Section lists the relvant Smart Health Certificates received by the patient" -* section[sectionHealthCertificates].code 1.. MS -* section[sectionHealthCertificates].code = $LOINC#80571-3 -* section[sectionHealthCertificates].entry 1.. MS -* section[sectionHealthCertificates].entry ^slicing.discriminator[0].type = #type -* section[sectionHealthCertificates].entry ^slicing.discriminator[0].path = "$this" -* section[sectionHealthCertificates].entry ^slicing.rules = #open -* section[sectionHealthCertificates].entry ^short = "Patient's Smarth Health Certificates" -* section[sectionHealthCertificates].entry ^definition = "It contains the patient's current Smart Health Certifactes." -* section[sectionHealthCertificates].entry contains shcEntry 0.. MS -* section[sectionHealthCertificates].entry[shcEntry] only Reference(SHC_Composition) - - diff --git a/input/fsh.old/svc-bundle.fsh b/input/fsh.old/svc-bundle.fsh deleted file mode 100644 index f561a1c218..0000000000 --- a/input/fsh.old/svc-bundle.fsh +++ /dev/null @@ -1,35 +0,0 @@ -Profile: SVC_Bundle -Parent: SHC_Bundle -Id: svc-bundle -Title: "SVC Bundle" -Description: """ -An [SVC Bundle](StructureDefinition-svc-bundle.html) is a document bundle containing the Smart Vaccination Certificate (SVC) content. - -""" -* ^publisher = "World Health Organization (WHO)" -* . MS -* . ^short = "Smart Vaccination Certificate Bundle" -* entry 3.. MS -* entry ^slicing.discriminator[0].type = #value -* entry ^slicing.discriminator[0].path = "resource" -* entry ^slicing.rules = #closed -* entry ^slicing.ordered = true - -* entry contains - svcCompositionEntry 1..1 MS and - svcPatientEntry 1..1 MS and - svcAuthorEntry 1..1 MS and - svcImmunizationEntry 1..1 MS and - svcOtherEntry 0.. and - svcProvenanceEntry 0.. MS -* entry[svcCompositionEntry].resource 1..1 MS -* entry[svcCompositionEntry].resource only SVC_Composition -* entry[svcPatientEntry].resource 1..1 MS -* entry[svcPatientEntry].resource only SHC_Patient -* entry[svcAuthorEntry].resource 1..1 MS -* entry[svcAuthorEntry].resource only SHC_Organization -* entry[svcImmunizationEntry].resource 1..1 MS -* entry[svcImmunizationEntry].resource only SVC_Immunization -* entry[svcOtherEntry].resource 1..1 MS -* entry[svcProvenanceEntry].resource 1..1 MS -* entry[svcProvenanceEntry].resource only SHC_Provenance diff --git a/input/fsh.old/svc-composition.fsh b/input/fsh.old/svc-composition.fsh deleted file mode 100644 index ea2a9e5ad8..0000000000 --- a/input/fsh.old/svc-composition.fsh +++ /dev/null @@ -1,39 +0,0 @@ -Profile: SVC_Composition -Parent: SHC_Composition -Id: svc-composition -Title: "SVC Composition" -Description: """ -Describes the logical structure for the health content contained in a Smart Vaccination Certificate (SVC). -""" -* ^publisher = "World Health Organization (WHO)" -* . ^short = "SVC Composition" -* title = "International Certificate of Vaccination or Prophylaxis" -* type = $LOINC#82593-5 -* type ^short = "Kind of composition (\"Smart Vaccination Certificate\")" -* type ^definition = "Specifies that this composition refers to a Smart Vaccination Certificate" -* title MS -* title ^short = "Smart Vaccination Certificate" -* category = #svc-covid19 -* section 1.. -* section ^extension[0].url = "http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name" -* section ^extension[0].valueString = "Section" -* section ^slicing.discriminator.type = #pattern -* section ^slicing.discriminator.path = "code" -* section ^slicing.rules = #open -* section ^slicing.ordered = false -* section ^short = "Sections composing the SVC" -* section ^definition = "The root of the sections that make up the SVC Composition." - -* section contains sectionVaccinations 1..1 MS -* section[sectionVaccinations] ^short = "Vaccinations Section" -* section[sectionVaccinations] ^definition = "Vaccination Section lists the relvant vaccinations received by the patient" -* section[sectionVaccinations].code 1.. MS -* section[sectionVaccinations].code = $LOINC#11369-6 -* section[sectionVaccinations].entry 1.. MS -* section[sectionVaccinations].entry ^slicing.discriminator[0].type = #type -* section[sectionVaccinations].entry ^slicing.discriminator[0].path = "$this" -* section[sectionVaccinations].entry ^slicing.rules = #open -* section[sectionVaccinations].entry ^short = "Patient's vaccination history." -* section[sectionVaccinations].entry ^definition = "It contains the patient's current vaccination history.\r\nThe primary use case for the Vaccination Section is to enable communication of a patient's vaccination status.\r\nIt may contain the entire vaccination history that is relevant to the period of time being summarized. This entry shall be used to document that no information about vaccination is available, or that no vaccinations are known." -* section[sectionVaccinations].entry contains sectionVaccinationsEntry 0.. MS -* section[sectionVaccinations].entry[sectionVaccinationsEntry] only Reference(SVC_Immunization) diff --git a/input/fsh.old/svc-core-data-set.fsh b/input/fsh.old/svc-core-data-set.fsh deleted file mode 100644 index cc2f2906f1..0000000000 --- a/input/fsh.old/svc-core-data-set.fsh +++ /dev/null @@ -1,247 +0,0 @@ -Instance: SVC_Core_Data_Set -InstanceOf: StructureDefinition -Description: "Data elements for the SVC Core Data Set." -Title: "SVC Core Data Set Logical Model" -Usage: #definition - -* id = "SVC-Core-Data-Set" -* name = "SVC-Core-Data-Set" -* description = "SVC Core Data elements." -* url = "http://who-int.github.io/svc/refs/heads/rc2/SVC-Core-Data-Set" -* version = "RC2" -* kind = #logical -* abstract = false -* status = #draft -* type = "SVC-Core-Data-Set" -* baseDefinition = "http://hl7.org/fhir/StructureDefinition/Element" -* derivation = #specialization - -* differential.element[+].id = "SVC-Core-Data-Set" -* differential.element[=].path = "SVC-Core-Data-Set" -* differential.element[=].definition = "SVC Core Data Set" -* differential.element[=].min = 0 -* differential.element[=].max = "*" - -* differential.element[+].id = "SVC-Core-Data-Set.name" -* differential.element[=].path = "SVC-Core-Data-Set.name" -* differential.element[=].short = "Name" -* differential.element[=].definition = "The full name of the vaccinated person" -* differential.element[=].min = 1 -* differential.element[=].max = "1" -* differential.element[=].type[+].code = #string - -* differential.element[+].id = "SVC-Core-Data-Set.birthDate" -* differential.element[=].path = "SVC-Core-Data-Set.birthDate" -* differential.element[=].short = "Date of birth" -* differential.element[=].definition = "The vaccinated person's date of birth (DOB) if known. If unknown, use given DOB for administrative purposes." -* differential.element[=].min = 0 -* differential.element[=].max = "1" -* differential.element[=].type[+].code = #date - -* differential.element[+].id = "SVC-Core-Data-Set.identifier" -* differential.element[=].path = "SVC-Core-Data-Set.identifier" -* differential.element[=].short = "Unique identifier" -* differential.element[=].definition = "Unique identifier for the vaccinated person, according to the policies applicable to each country. There can be more than one unique identifier used to link records. (e.g. national ID, health ID, immunization information system ID, medical record ID)." -* differential.element[=].min = 0 -* differential.element[=].max = "1" -* differential.element[=].type[+].code = #Identifier - -* differential.element[+].id = "SVC-Core-Data-Set.sex" -* differential.element[=].path = "SVC-Core-Data-Set.sex" -* differential.element[=].short = "Sex" -* differential.element[=].definition = "Documentation of a specific instance of sex information for the vaccinated person." -* differential.element[=].min = 0 -* differential.element[=].max = "1" -* differential.element[=].type[+].code = #Coding -* differential.element[=].binding.strength = #required -* differential.element[=].binding.valueSet = "http://hl7.org/fhir/ValueSet/administrative-gender" - -* differential.element[+].id = "SVC-Core-Data-Set.vaccination" -* differential.element[=].path = "SVC-Core-Data-Set.vaccination" -* differential.element[=].short = "Vaccination Event" -* differential.element[=].definition = "A vaccination event" -* differential.element[=].min = 0 -* differential.element[=].max = "*" -* differential.element[=].type[+].code = #BackboneElement -* differential.element[=].constraint[+].key = "who-svc-data-1" -* differential.element[=].constraint[=].severity = #error -* differential.element[=].constraint[=].human = "Manufacturer or Marketer SHALL be present" -* differential.element[=].constraint[=].expression = "manufacturer.exists() or marketer.exists()" - - -* differential.element[+].id = "SVC-Core-Data-Set.vaccination.vaccine" -* differential.element[=].path = "SVC-Core-Data-Set.vaccination.vaccine" -* differential.element[=].short = "Vaccine or prophylaxis" -* differential.element[=].definition = "Generic description of the vaccine or vaccine sub-type. e.g. COVID-19 mRNA vaccine, HPV vaccine." -* differential.element[=].min = 1 -* differential.element[=].max = "1" -* differential.element[=].type[+].code = #Coding -* differential.element[=].binding.strength = #preferred -* differential.element[=].binding.valueSet = "https://who-int.github.io/svc/refs/heads/rc2/ValueSet/who-svc-vaccines" - -* differential.element[+].id = "SVC-Core-Data-Set.vaccination.brand" -* differential.element[=].path = "SVC-Core-Data-Set.vaccination.brand" -* differential.element[=].short = "Vaccine brand" -* differential.element[=].definition = "The brand or trade name used to refer to the vaccine received." -* differential.element[=].min = 1 -* differential.element[=].max = "1" -* differential.element[=].type[+].code = #Coding - -* differential.element[+].id = "SVC-Core-Data-Set.vaccination.manufacturer" -* differential.element[=].path = "SVC-Core-Data-Set.vaccination.manufacturer" -* differential.element[=].short = "Vaccine manufacturer" -* differential.element[=].definition = "Name of the manufacturer of the vaccine received. e.g. Serum institute of India, AstraZeneca. If vaccine manufacturer is unknown, market authorization holder is REQUIRED." -* differential.element[=].min = 0 -* differential.element[=].max = "1" -* differential.element[=].type[+].code = #Coding - -* differential.element[+].id = "SVC-Core-Data-Set.vaccination.marketer" -* differential.element[=].path = "SVC-Core-Data-Set.vaccination.marketer" -* differential.element[=].short = "Vaccine market authorization holder" -* differential.element[=].definition = "Name of the market authorization holder of the vaccine received. If market authorization holder is unknown, vaccine manufacturer is REQUIRED." -* differential.element[=].min = 0 -* differential.element[=].max = "1" -* differential.element[=].type[+].code = #Coding - -* differential.element[+].id = "SVC-Core-Data-Set.vaccination.batch" -* differential.element[=].path = "SVC-Core-Data-Set.vaccination.batch" -* differential.element[=].short = "Vaccine batch number" -* differential.element[=].definition = "Batch number or lot number of vaccination." -* differential.element[=].min = 1 -* differential.element[=].max = "1" -* differential.element[=].type[+].code = #string - -* differential.element[+].id = "SVC-Core-Data-Set.vaccination.date" -* differential.element[=].path = "SVC-Core-Data-Set.vaccination.date" -* differential.element[=].short = "Date of vaccination" -* differential.element[=].definition = "Date in which the vaccine was provided." -* differential.element[=].min = 1 -* differential.element[=].max = "1" -* differential.element[=].type[+].code = #date - -* differential.element[+].id = "SVC-Core-Data-Set.vaccination.doseNumber" -* differential.element[=].path = "SVC-Core-Data-Set.vaccination.doseNumber" -* differential.element[=].short = "Dose number" -* differential.element[=].definition = "Vaccine dose number." -* differential.element[=].min = 1 -* differential.element[=].max = "1" -* differential.element[=].type[+].code = #positiveInt - -* differential.element[+].id = "SVC-Core-Data-Set.vaccination.seriesDoses" -* differential.element[=].path = "SVC-Core-Data-Set.vaccination.seriesDoses" -* differential.element[=].short = "Total doses" -* differential.element[=].definition = "Total expected doses as defined by Member State care plan and immunization programme policies." -* differential.element[=].min = 0 -* differential.element[=].max = "1" -* differential.element[=].type[+].code = #positiveInt - -* differential.element[+].id = "SVC-Core-Data-Set.vaccination.country" -* differential.element[=].path = "SVC-Core-Data-Set.vaccination.country" -* differential.element[=].short = "Country of vaccination" -* differential.element[=].definition = "The country in which the individual has been vaccinated." -* differential.element[=].min = 1 -* differential.element[=].max = "1" -* differential.element[=].type[+].code = #Coding -* differential.element[=].binding.strength = #preferred -* differential.element[=].binding.valueSet = "http://hl7.org/fhir/ValueSet/iso3166-1-3" - -* differential.element[+].id = "SVC-Core-Data-Set.vaccination.centre" -* differential.element[=].path = "SVC-Core-Data-Set.vaccination.centre" -* differential.element[=].short = "Administering centre" -* differential.element[=].definition = "The name or identifier of the vaccination facility responsible for providing the vaccination." -* differential.element[=].min = 1 -* differential.element[=].max = "1" -* differential.element[=].type[+].code = #string - -* differential.element[+].id = "SVC-Core-Data-Set.vaccination.signature" -* differential.element[=].path = "SVC-Core-Data-Set.vaccination.signature" -* differential.element[=].short = "Signature of health worker" -* differential.element[=].definition = "REQUIRED for PAPER vaccination certificates ONLY. The health worker who provided the vaccination or the supervising clinician's hand-written signature." -* differential.element[=].min = 0 -* differential.element[=].max = "1" -* differential.element[=].type[+].code = #Signature - -* differential.element[+].id = "SVC-Core-Data-Set.vaccination.practitioner" -* differential.element[=].path = "SVC-Core-Data-Set.vaccination.practitioner" -* differential.element[=].short = "Health worker identifier" -* differential.element[=].definition = "OPTIONAL for DIGITAL and PAPER vaccination certificates. The unique identifier for the health worker as determined by the member state. There can be more than one unique identifier used. (e.g. system generated ID, health profession number, cryptographic signature, or any other form of health worker unique identifier). This can be used in lieu of a paper-based signature." -* differential.element[=].min = 0 -* differential.element[=].max = "1" -* differential.element[=].type[+].code = #Identifier - -* differential.element[+].id = "SVC-Core-Data-Set.vaccination.disease" -* differential.element[=].path = "SVC-Core-Data-Set.vaccination.disease" -* differential.element[=].short = "Disease or agent targeted" -* differential.element[=].definition = "Name of disease vaccinated against (such as COVID-19)." -* differential.element[=].min = 0 -* differential.element[=].max = "1" -* differential.element[=].type[+].code = #Coding -* differential.element[=].binding.strength = #preferred -* differential.element[=].binding.valueSet = $ICD11 - -* differential.element[+].id = "SVC-Core-Data-Set.vaccination.nextDose" -* differential.element[=].path = "SVC-Core-Data-Set.vaccination.nextDose" -* differential.element[=].short = "Due date of next dose" -* differential.element[=].definition = "Date on which the next vaccination should be administered, if a next dose is REQUIRED." -* differential.element[=].min = 0 -* differential.element[=].max = "1" -* differential.element[=].type[+].code = #date - -* differential.element[+].id = "SVC-Core-Data-Set.certificate" -* differential.element[=].path = "SVC-Core-Data-Set.certificate" -* differential.element[=].short = "Certificate Metadata" -* differential.element[=].definition = "Metadata associated with the certificate." -* differential.element[=].min = 0 -* differential.element[=].max = "1" -* differential.element[=].type[+].code = #BackboneElement - -* differential.element[+].id = "SVC-Core-Data-Set.certificate.issuer" -* differential.element[=].path = "SVC-Core-Data-Set.certificate.issuer" -* differential.element[=].short = "Certificate issuer" -* differential.element[=].definition = "" -* differential.element[=].min = 1 -* differential.element[=].max = "1" -* differential.element[=].type[+].code = #Reference -* differential.element[=].type[=].targetProfile = "https://who-int.github.io/svc/refs/heads/rc2/StructureDefinition/shc-organization" - -* differential.element[+].id = "SVC-Core-Data-Set.certificate.identifier" -* differential.element[=].path = "SVC-Core-Data-Set.certificate.identifier" -* differential.element[=].short = "Certificate identifier" -* differential.element[=].definition = "" -* differential.element[=].min = 1 -* differential.element[=].max = "1" -* differential.element[=].type[+].code = #Identifier - -* differential.element[+].id = "SVC-Core-Data-Set.certificate.period" -* differential.element[=].path = "SVC-Core-Data-Set.certificate.period" -* differential.element[=].short = "Certificate Validity Period" -* differential.element[=].definition = "" -* differential.element[=].min = 0 -* differential.element[=].max = "1" -* differential.element[=].type[+].code = #Period - -* differential.element[+].id = "SVC-Core-Data-Set.certificate.period.start" -* differential.element[=].path = "SVC-Core-Data-Set.certificate.period.start" -* differential.element[=].short = "Certificate valid from" -* differential.element[=].definition = "" -* differential.element[=].min = 0 -* differential.element[=].max = "1" -* differential.element[=].type[+].code = #date - -* differential.element[+].id = "SVC-Core-Data-Set.certificate.period.end" -* differential.element[=].path = "SVC-Core-Data-Set.certificate.period.end" -* differential.element[=].short = "Certificate valid until" -* differential.element[=].definition = "" -* differential.element[=].min = 0 -* differential.element[=].max = "1" -* differential.element[=].type[+].code = #date - -* differential.element[+].id = "SVC-Core-Data-Set.certificate.version" -* differential.element[=].path = "SVC-Core-Data-Set.certificate.version" -* differential.element[=].short = "Certificate schema version" -* differential.element[=].definition = "" -* differential.element[=].min = 1 -* differential.element[=].max = "1" -* differential.element[=].type[+].code = #string - - diff --git a/input/fsh.old/svc-graphdefinition.fsh b/input/fsh.old/svc-graphdefinition.fsh deleted file mode 100644 index 58ad6003b2..0000000000 --- a/input/fsh.old/svc-graphdefinition.fsh +++ /dev/null @@ -1,32 +0,0 @@ - -Profile: SHF_GraphDefinition -Parent: GraphDefinition -Id: shf-graphdefinition -Title: "SHF Graph Defintion" -Description: """ -Abstract Graph Definition for Smart Health Folder to describe information retrieved under a [Retrieve Smart Health Folder](transactions.html#retrieve-health-folder) transaction. -""" -* ^publisher = "World Health Organization (WHO)" -* . ^short = "SHF Composition" -* ^abstract = true -* start = #Composition - - -Instance: SVC_Graph -InstanceOf: SHF_GraphDefinition -Title: "GraphDefintion for retrieving a Smart Vaccination Certificate from the Smart Health Folder" -Usage: #definition -* id = "svc-graph" -* name = "GraphDefintion for retrieving a Smart Vaccination Certificate from the Smart Health Folder" -* status = #draft -* experimental = true -* date = "2021-05-06" -* description = """ -SHF Graph Definition for retrieving Smart Vaccination Certificates under a [Retrieve Smart Health Folder](transactions.html#retrieve-health-folder) transaction. -""" -* link[+].path = "SHF_Composition.section[Section_Health_Certificates].entry[SVC]" -* link[=].description = "SVC Composition Entry" -* link[=].target[+].type = #Immunization - - - diff --git a/input/fsh.old/svc-immunization.fsh b/input/fsh.old/svc-immunization.fsh deleted file mode 100644 index bed6f93e3c..0000000000 --- a/input/fsh.old/svc-immunization.fsh +++ /dev/null @@ -1,45 +0,0 @@ -Profile: SVC_Immunization -//Parent: http://hl7.org/fhir/uv/ips/StructureDefinition/Immunization-uv-ips -Parent: Immunization -Id: svc-immunization -Title: "SVC Immunization" -Description: """ -An SVC Immunization contains the content corresponding to a row in the Vaccination Events section of a Paper SVC. While this is not a further profile of the International Patient Summary (IPS) Immunization resouce, this is intended to map into an IPS Immunization resource. -""" -* identifier 1.. -* identifier ^slicing.discriminator.type = #value -* identifier ^slicing.discriminator.path = "system" -* identifier ^slicing.rules = #open -* identifier ^slicing.ordered = true -* identifier contains SVC_Identifier 1..1 -* identifier[SVC_Identifier].system 1..1 -* identifier[SVC_Identifier].value 1..1 - -* vaccineCode.coding ^slicing.discriminator.type = #value -* vaccineCode.coding ^slicing.discriminator.path = "system" -* vaccineCode.coding ^slicing.rules = #open -* vaccineCode.coding ^slicing.ordered = true -* vaccineCode.coding contains svcVaccine 1..1 -* vaccineCode.coding[svcVaccine].system 1..1 MS -* vaccineCode.coding[svcVaccine].code 1..1 MS -* vaccineCode.coding[svcVaccine].system = "urn:EXAMPLE-who-:smart:vaccine-certificate:RC1:coding" -* vaccineCode.coding[svcVaccine].code from who-svc-vaccines (required) - -* expirationDate MS -* lotNumber MS -* patient only Reference(SHC_Patient) -* occurrence[x] only dateTime -* performer 1.. MS -* performer.actor only Reference(SHC_Practitioner or SHC_Organization) -* protocolApplied 1.. MS -* protocolApplied ^slicing.discriminator.type = #type -* protocolApplied ^slicing.discriminator.path = "authority" -* protocolApplied ^slicing.rules = #open -* protocolApplied ^slicing.ordered = true -* protocolApplied contains protocolAppliedAuthority 1.. MS -* protocolApplied[protocolAppliedAuthority].authority only Reference(SHC_Organization) -* protocolApplied[protocolAppliedAuthority].targetDisease from WHO_SVC_Vaccinable_Conditions (required) -* protocolApplied[protocolAppliedAuthority].doseNumber[x] 1..1 MS -* protocolApplied[protocolAppliedAuthority].doseNumber[x] only positiveInt -* protocolApplied[protocolAppliedAuthority].seriesDoses[x] 0..1 MS -* protocolApplied[protocolAppliedAuthority].seriesDoses[x] only positiveInt diff --git a/input/fsh.old/svc-qrcodes.fsh b/input/fsh.old/svc-qrcodes.fsh deleted file mode 100644 index ce4d506ddf..0000000000 --- a/input/fsh.old/svc-qrcodes.fsh +++ /dev/null @@ -1,67 +0,0 @@ -Profile: SVCBasicQRCode -Parent: Basic -Id: SVC-Basic-QRCode -Title: "SVC Basic QR Code resource" -Description: "SVC Profile of Basic resource for QR Code." -* code = #adminact -* extension contains SVCQRCode named qrcode 1..1 MS - -Extension: SVCQRCode -Id: SVC-QRCode -Title: "SVC QRCode Extension" -Description: "SVC QRCode Extension" -* ^context.type = #element -* ^context.expression = "SVCBasicQRCode" -* extension contains - version 0..1 MS and - name 0..1 MS and - birthDate 0..1 MS and - patientid 0..1 MS and - paperid 0..1 MS and - digitalid 0..1 MS and - signature 0..1 MS - -* extension[version].value[x] only string -* extension[version].valueString 1..1 MS -* extension[version].valueString ^label = "Version of the [SVC Bundle](StructureDefinition-svc-bundle.html) " - -* extension[name].value[x] only string -* extension[name].valueString 1..1 MS -* extension[name].valueString ^label = "Name of Subject of Care" - -* extension[birthDate].value[x] only date -* extension[birthDate].valueDate 1..1 MS -* extension[birthDate].valueDate ^label = "Date of birth of Subject of Care" - -* extension[patientid].value[x] only string -* extension[patientid].valueString 1..1 MS -* extension[patientid].valueString ^label = "Paper SVC Patient Identifier" - -* extension[paperid].value[x] only string -* extension[paperid].valueString 1..1 MS -* extension[paperid].valueString ^label = "Identifier of the [SVC Composition](StructureDefinition-svc-composition.html) that represents the Paper SVC Card" - -* extension[digitalid].value[x] only string -* extension[digitalid].valueString 1..1 MS -* extension[digitalid].valueString ^label = "Identifier of the [SVC Composition](StructureDefinition-svc-composition.html) that represents the Digital SVC Card" - -* extension[signature].value[x] only string -* extension[signature].valueString 1..1 MS -* extension[signature].valueString ^label = "Signature of the [SVC Bundle](StructureDefinition-svc-bundle.html) using a PHA's DSC" - - -Instance: svc-basic-qrcode-example -InstanceOf: SVCBasicQRCode -Description: "Example of data elements from SVC Bundle identified to be QR encoded" -Title: "SVC QR Example" // user-friendly name -Usage: #example - -* code = #adminact -* extension[qrcode].extension[version].valueString = "RC-2-draft" -* extension[qrcode].extension[name].valueString = "Felix Cat" -* extension[qrcode].extension[birthDate].valueDate = "2003-01-02" -* extension[qrcode].extension[patientid].valueString = "NMCZ8B1KwsMgVo64bDn2" -* extension[qrcode].extension[digitalid].valueString = "h1dZ75FMdY9EQQjE64O4" -* extension[qrcode].extension[paperid].valueString = "bMlJkAt0V92RYhhG3fNt" -* extension[qrcode].extension[signature].valueString = "SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" - diff --git a/input/fsh.old/svc-questionnaire.fsh b/input/fsh.old/svc-questionnaire.fsh deleted file mode 100644 index 26c696eb2b..0000000000 --- a/input/fsh.old/svc-questionnaire.fsh +++ /dev/null @@ -1,139 +0,0 @@ -Alias: $ICD11 = http://id.who.int/icd11/mms -Alias: $QRCodeQuestionnaireURL = http://who-int.github.io/svc/refs/heads/rc2/SVC-Questionnaire -Alias: $targetStructureMap = http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-targetStructureMap -Alias: $QRMapURL = http://who-int.github.io/svc/StructureMap/svc-map-qr-bundle - -Instance: SVC_Questionnaire -InstanceOf: SHC_Questionnaire -Usage: #definition - -* id = "SVC-Questionnaire" -* url = $QRCodeQuestionnaireURL -* name = "SVC-QR-Questionnaire" // computer ready name -* title = "SVC Questionnaire " -* description = "SVC QR Code Questionnaire for an Immunization event." -* version = "0.1.0" -* status = #draft -* experimental = true -* date = "2021-04-21" -* extension[$targetStructureMap].valueCanonical = $QRMapURL - -* item[+].linkId = "version" -* item[=].text = "Version/type of the SVC" -* item[=].type = #string -* item[=].required = false - -* item[+].linkId = "name" -* item[=].text = "Patient Name" -* item[=].type = #string -* item[=].required = true - -* item[+].linkId = "birthDate" -* item[=].text = "Patient Birth Date" -* item[=].type = #date -* item[=].required = true - -* item[+].linkId = "vaccinecode" -* item[=].text = "Vaccine Code" -* item[=].type = #choice -* item[=].required = false - -* item[+].linkId = "status" -* item[=].text = "Status of course of vacccination" -* item[=].type = #choice -* item[=].required = true - -* item[+].linkId = "protocol" -* item[=].text = "Vaccination Protocol" -* item[=].type = #choice -* item[=].required = true - -* item[+].linkId = "lot" -* item[=].text = "Lot number of the adminstered vaccine" -* item[=].type = #string -* item[=].required = true - -* item[+].linkId = "expiry" -* item[=].text = "Expiration Date of the vaccine" -* item[=].type = #date -* item[=].required = true - -* item[+].linkId = "paperid" -* item[=].text = "Identifier of the [SVC Bundle](StructureDefinition-svc-bunclde.html) that represents the Paper SVC Card" -* item[=].type = #string -* item[=].required = false - -* item[+].linkId = "pha" -* item[=].text = "ID of the Public Health Authority" -* item[=].type = #string -* item[=].required = false - -* item[+].linkId = "hw" -* item[=].text = "ID of the Health Worker" -* item[=].type = #string -* item[=].required = false - - -// * item[+].linkId = "signature" -// * item[=].text = "Signature of the [SVC Bundle](StructureDefinition-svc-bundle.html) using a PHA's DSC" -// * item[=].type = #string -// * item[=].required = false - - - - -Profile: SVC_QuestionnaireResponse -Parent: shc-questionnaireresponse -Id: svc-questionnaireresponse -Title: "SVC Questionnaire Response" -Description: """ -Describes the logical structure for a questionnaire response associacted to a [SVC Questionaire](StructureDefinition-svc-questionnaire.html). -""" -* ^abstract = false -// * questionnaire = Canonical(SVC_Questionnaire) - - - -Instance: SVC-QR-QuestionnaireResponse-Example -InstanceOf: SVC_QuestionnaireResponse -Usage: #example - -* questionnaire = $QRCodeQuestionnaireURL -* status = #completed - -* subject = Reference(SHC-Patient-English) -* authored = "2021-04-01" - -* item[+].linkId = "version" -* item[=].answer.valueString = "RC-2-draft" - -* item[+].linkId = "name" -* item[=].answer.valueString = "Felix Cat" - -* item[+].linkId = "birthDate" -* item[=].answer.valueDate = "2003-03-03" - -* item[+].linkId = "vaccinecode" -* item[=].answer.valueCoding = $ICD11#XM1NL1 - -* item[+].linkId = "lot" -* item[=].answer.valueString = "ER8732" - -* item[+].linkId = "expiry" -* item[=].answer.valueDate = "2021-06-30" - -* item[+].linkId = "paperid" -* item[=].answer.valueString = "bMlJkAt0V92RYhhG3fNt" - -* item[+].linkId = "pha" -* item[=].answer.valueString = "dPD2PfwzBQyphcjeUiAdRP" - -* item[+].linkId = "hw" -* item[=].answer.valueString = "dPD2PfwzBQyphcjeUiAdRP" - - - -// * item[+].linkId = "signature" -// * item[=].answer.valueString = "SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" - - diff --git a/input/fsh.old/svc-transaction-test-examples.fsh b/input/fsh.old/svc-transaction-test-examples.fsh deleted file mode 100644 index 2af791f498..0000000000 --- a/input/fsh.old/svc-transaction-test-examples.fsh +++ /dev/null @@ -1,54 +0,0 @@ -Instance: SVC-TX-SHE-QuestionnaireResponse-1 -InstanceOf: SVC_QuestionnaireResponse -Usage: #inline - -* questionnaire = $QRCodeQuestionnaireURL -* status = #completed - -* subject = Reference(SVC_Patient_Example) -* authored = "2021-04-01" - -* item[+].linkId = "version" -* item[=].answer.valueString = "RC-2-draft" - -* item[+].linkId = "name" -* item[=].answer.valueString = "Felix Cat" - -* item[+].linkId = "birthDate" -* item[=].answer.valueDate = "2003-03-03" - -* item[+].linkId = "vaccinecode" -* item[=].answer.valueCoding = $ICD11#XM1NL1 - -* item[+].linkId = "lot" -* item[=].answer.valueString = "ER8732" - -* item[+].linkId = "expiry" -* item[=].answer.valueDate = "2021-06-30" - -* item[+].linkId = "shfid" -* item[=].answer.valueString = "bMlJkAt0V92RYhhG3fNt" - -* item[+].linkId = "pha" -* item[=].answer.valueString = "dPD2PfwzBQyphcjeUiAdRP" - -* item[+].linkId = "hw" -* item[=].answer.valueString = "dPD2PfwzBQyphcjeUiAdRP" - - -Instance: SVC-TX-SHE-Parameters-1 -InstanceOf: Parameters -Usage: #example - -* parameter[+].name = "response" -* parameter[=].resource = SVC-TX-SHE-QuestionnaireResponse-1 - - -Instance: SVC-TX-SHE-bundle-example-1 -InstanceOf: Bundle -Usage: #example - -* type = #batch -* entry[+].resource = SVC-TX-SHE-Parameters-1 -* entry[=].request.method = #POST -* entry[=].request.url = "QuestionnaireResponse/$generateHealthCertificate" diff --git a/input/fsh.old/svc-valuesets.fsh b/input/fsh.old/svc-valuesets.fsh deleted file mode 100644 index 19472c98df..0000000000 --- a/input/fsh.old/svc-valuesets.fsh +++ /dev/null @@ -1,194 +0,0 @@ -Alias: $ICD9CM = http://hl7.org/fhir/sid/icd-9-cm -Alias: $ICD11 = http://id.who.int/icd11/mms -Alias: SCT = http://snomed.info/sct - - -ValueSet: WHO_SVC_Vaccinable_Conditions -Id: who-svc-vaccinable-conditions -Title: "WHO List of Vaccinable Conditions" -Description: """ -The WHO Vaccinable Conditions List from [ICD 11](https://icd.who.int/browse11) is used by: - * the [SVC Immunization](StructureDefinition-svc-immunization.html) - -""" -* ^status = #draft -* include $ICD11#RA01.0 "COVID-19, virus identified" -* include $ICD11#RA01.1 "COVID-19, virus not identified" - -ValueSet: WHO_SVC_Vaccines -Id: who-svc-vaccines -Title: "WHO Vaccine List" -Description: """ -The WHO Vaccine List from [ICD 11](https://icd.who.int/browse11) is used by: - * the [SVC Immunization](StructureDefinition-svc-immunization.html) - -""" -* ^status = #draft -* include $ICD11#XM68M6 "COVID-19 vaccine" -* include $ICD11#XM1NL1 "COVID-19 vaccine, inactivated virus" -* include $ICD11#XM5DF6 "COVID-19 vaccine, live attenuated virus" -* include $ICD11#XM9QW8 "COVID-19 vaccine, non-replicating viral vector" -* include $ICD11#XM0CX4 "COVID-19 vaccine, replicating viral vector" -* include $ICD11#XM5JC5 "COVID-19 vaccine, virus protein subunit" -* include $ICD11#XM1J92 "COVID-19 vaccine, virus like particle (VLP)" -* include $ICD11#XM6AT1 "COVID-19 vaccine, DNA based" -* include $ICD11#XM0GQ8 "COVID-19 vaccine, RNA based" -* include $ICD11#XM3KV2 "Bacterial vaccines" -* include $ICD11#XM29K4 "Cholera vaccines" -* include $ICD11#XM11V3 "Haemophilus influenzae B vaccines" -* include $ICD11#XM2WV4 "Meningococcal vaccines" -* include $ICD11#XM18Y8 "Meningococcal conjugate (Strain C) vaccine" -* include $ICD11#XM2280 "Menningovax (-AC) (-C)" -* include $ICD11#XM43M9 "Pertussis vaccines" -* include $ICD11#XM9EM7 "Pneumococcal vaccines" -* include $ICD11#XM9G97 "Pneumococcal conjugate (13-valent) vaccine" -* include $ICD11#XM2249 "Pneumococcal polysaccharide 23-valent vaccine" -* include $ICD11#XM5L44 "Tetanus vaccines" -* include $ICD11#XM29H5 "Tetanus toxoid" -* include $ICD11#XM1G86 "Tetanus toxoid, combinations with diphtheria toxoid" -* include $ICD11#XM8BU8 "Typhoid vaccines" -* include $ICD11#XM86V7 "Diphtheria toxoid" -* include $ICD11#XM8AW3 "Diphtheria vaccine" -* include $ICD11#XM8142 "BCG vaccine" -* include $ICD11#XM8ZX8 "Plague vaccine" -* include $ICD11#XM9SW5 "Vaccine bacterial with other bacterial component" -* include $ICD11#XM9UB1 "Typhoid-paratyphoid vaccine" -* include $ICD11#XM3VD2 "Vaccine TAB" -* include $ICD11#XM95H3 "Paratyphoid vaccine" -* include $ICD11#XM2ZE3 "Vaccine bacterial with pertussis component" -* include $ICD11#XM91J8 "Vaccine rickettsial" -* include $ICD11#XM3JJ2 "Typhus vaccine" -* include $ICD11#XM4F19 "Vaccine rickettsial with bacterial component" -* include $ICD11#XM0E84 "Rocky Mountain spotted fever vaccine" -* include $ICD11#XM5926 "Vaccine bacterial mixed, not elsewhere classified" -* include $ICD11#XM61M7 "Viral vaccines" -* include $ICD11#XM0RC1 "Encephalitis vaccines" -* include $ICD11#XM1LR5 "Influenza vaccines" -* include $ICD11#XM8858 "Influenza vaccine, inactivated, whole virus" -* include $ICD11#XM5V65 "Influenza vaccine, live attenuated" -* include $ICD11#XM8MP3 "Influenza vaccine, inactivated, split virus or surface antigen" -* include $ICD11#XM9E17 "Influenza vaccine, virus like particle" -* include $ICD11#XM6LL6 "Hepatitis vaccine" -* include $ICD11#XM9V38 "Hepatitis B vaccine" -* include $ICD11#XM2A14 "Hepatitis A vaccine, inactivated whole virus" -* include $ICD11#XM28X5 "Measles vaccines" -* include $ICD11#XM8L15 "Measles, live attenuated" -* include $ICD11#XM2KH7 "Diplovax" -* include $ICD11#XM0N50 "Poliomyelitis vaccines" -* include $ICD11#XM4KG4 "Orimune" -* include $ICD11#XM1Y59 "Vaccine sabin oral" -* include $ICD11#XM1CE0 "Rotavirus diarrhoea vaccines" -* include $ICD11#XM7PP1 "Rubella vaccine" -* include $ICD11#XM9PS9 "Meruvax" -* include $ICD11#XM8DG3 "Varicella zoster vaccines" -* include $ICD11#XM9QP0 "Human Papillomarvirus vaccine" -* include $ICD11#XM0GW0 "Herpes zoster (Shingles) vaccine" -* include $ICD11#XM1131 "Mumps vaccine" -* include $ICD11#XM2340 "Mumpsvax" -* include $ICD11#XM95R0 "Smallpox vaccine" -* include $ICD11#XM6T09 "Rabies vaccine" -* include $ICD11#XM02Y0 "Vaccine respiratory syncytial virus" -* include $ICD11#XM69P6 "Synagis" -* include $ICD11#XM0N24 "Yellow fever vaccine" -* include $ICD11#XM4W25 "Combination vaccines" -* include $ICD11#XM21E6 "Diptheria, Tetanus, acellular Pertussis, Inactivated Polio Virus, Haemophilus Influenzae type B" -* include $ICD11#XM84S1 "Diptheria, Hepatitis B,Tetanus, acellular Pertussis, Inactivated Polio Virus, Haemophilus Influenzae type B" -* include $ICD11#XM9JP8 "Diptheria, Tetanus, acellular Pertussis, Inactivated Polio Virus" -* include $ICD11#XM44M4 "Tetanus, diphtheria, acellular Pertussis, Inactivated Polio Virus" -* include $ICD11#XM31Q8 "Tetanus, diptheria, acellular pertussis" -* include $ICD11#XM1PB8 "Triple vaccine DPT" -* include $ICD11#XM9ZL9 "Pertussis vaccine (with diphtheria toxoid) (with tetanus toxoid)" -* include $ICD11#XM9YH9 "Diphtheria toxoid with tetanus toxoid with pertussis component" -* include $ICD11#XM32Q5 "Tetanus and diphtheria" -* include $ICD11#XM4039 "Vaccine diphtheria with tetanus" -* include $ICD11#XM8XH5 "Tetanus toxoid or vaccine toxoid with diphtheria toxoid" -* include $ICD11#XM8TF3 "Measles, mumps rubella" -* include $ICD11#XM46V1 "Diphtheria vaccine combination including pertussis" -* include $ICD11#XM39K8 "Diphtheria vaccine combination without pertussis" -* include $ICD11#XM8YP9 "Diphtheria vaccine combination" -* include $ICD11#XM3JG2 "Toxoid combined" -* include $ICD11#XM25U9 "Vaccine pertussis with other component" -* include $ICD11#XM2CV8 "Vaccine pertussis with diphtheria" -* include $ICD11#XM7C66 "Bacterial and viral vaccines, combined" -* include $ICD11#XM5KN5 "Vaccine bacterial with viral-rickettsial component" - - -ValueSet: WHO_SVC_Vaccines_COVID_19 -Id: who-svc-vaccines-covid-19 -Title: "WHO Vaccine List (COVID-19)" -Description: """ -WHO Vaccine List (COVID-19) from [ICD 11](https://icd.who.int/browse11) -""" -* ^status = #draft -* include $ICD11#XM1NL1 "COVID-19 vaccine, inactivated virus" -* include $ICD11#XM5DF6 "COVID-19 vaccine, live attenuated virus" -* include $ICD11#XM9QW8 "COVID-19 vaccine, non-replicating viral vector" -* include $ICD11#XM0CX4 "COVID-19 vaccine, replicating viral vector" -* include $ICD11#XM5JC5 "COVID-19 vaccine, virus protein subunit" -* include $ICD11#XM1J92 "COVID-19 vaccine, virus like particle (VLP)" -* include $ICD11#XM6AT1 "COVID-19 vaccine, DNA based" - -ValueSet: WHO_SVC_Disease_Targeted_COVID_19 -Id: who-svc-disease-targeted-covid-19 -Title: "WHO Disease or Agent Targeted (COVID-19)" -Description: """ -WHO Disease or Agent Targeted List (COVID-19) from [ICD 11](https://icd.who.int/browse11) -""" -* ^status = #draft -* include $ICD11#RA01.0 "COVID-19, virus identified" -* include $ICD11#RA01.1 "COVID-19, virus not identified" - - -Instance: WHO_SVC_Map_ICD11_to_SCT_Vaccines -InstanceOf: ConceptMap -Title: "ConceptMap from ICD-11 to SNOMED CT for Vaccines" -Usage: #definition - -* id = "who-svc-map-icd11-sct-vaccines" -* name = "ICD-11 to SNOMED CT mappings for COVID-19 vaccines" -* status = #draft -* experimental = true -* date = "2021-04-23" -* description = "Rule-based mappings between ICD-11 and SNOMED CT for COVID-19 Vaccines" -* sourceCanonical = $ICD11 -* targetCanonical = SCT - -* group[+].source = $ICD11 -* group[=].target = SCT - -* group[=].element[+].code = #XM68M6 -* group[=].element[=].target[+].code = #111930505 -* group[=].element[=].target[=].equivalence = #equivalent - -* group[=].element[+].code = #XM0GQ8 -* group[=].element[=].target[+].code = #1119349007 -* group[=].element[=].target[=].equivalence = #equivalent - - - -Instance: WHO_SVC_Map_ICD11_to_SCT_Disease_Targeted -InstanceOf: ConceptMap -Title: "ConceptMap from ICD-11 to SNOMED CT for Disease or Agent Targeted" -Usage: #definition - -* id = "who-svc-map-icd11-sct-disease-targeted" -* name = "ICD-11 to SNOMED CT mappings for COVID-19 Disease or Agent Targeted" -* status = #draft -* experimental = true -* date = "2021-04-23" -* description = "Rule-based mappings between ICD-11 and SNOMED CT for COVID-19 Disease or Agent Targeted" -* sourceCanonical = $ICD11 -* targetCanonical = SCT - -* group[+].source = $ICD11 -* group[=].target = SCT - -* group[=].element[+].code = #RA01.0 -* group[=].element[=].target[+].code = #840539006 -* group[=].element[=].target[=].equivalence = #equivalent -* group[=].element[=].target[+].code = #1119302008 -* group[=].element[=].target[=].equivalence = #equivalent - -* group[=].element[+].code = #RA01.1 -* group[=].element[=].target[+].code = #840544004 -* group[=].element[=].target[=].equivalence = #equivalent diff --git a/input/maps-src/BundleVSToAddBundle.map b/input/maps/BundleVSToAddBundle.fml similarity index 100% rename from input/maps-src/BundleVSToAddBundle.map rename to input/maps/BundleVSToAddBundle.fml diff --git a/input/maps-src/CertDCCtoCoreDataSet.map b/input/maps/CertDCCtoCoreDataSet.fml similarity index 96% rename from input/maps-src/CertDCCtoCoreDataSet.map rename to input/maps/CertDCCtoCoreDataSet.fml index 248cc60a1d..904924db8d 100644 --- a/input/maps-src/CertDCCtoCoreDataSet.map +++ b/input/maps/CertDCCtoCoreDataSet.fml @@ -4,9 +4,9 @@ map "http://smart.who.int/ddcc/StructureMap/CertDCCtoCoreDataSet" = "CertDCCtoCo uses "http://smart.who.int/ddcc/StructureDefinition/CertDCC" alias CWTPayload as source uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias DDCCBundle as target -uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet" alias DDCC as produced -uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS" alias DDCCVS as produced -uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-TR" alias DDCCTR as produced +uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet" alias DDCC as target +uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetVS" alias DDCCVS as target +uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetTR" alias DDCCTR as target group CertDCCtoCoreDataSet( source src: CWTPayload, @@ -14,13 +14,13 @@ group CertDCCtoCoreDataSet( { src."-260" as hcert then { hcert."1" as dcc then { - dcc.v as v -> ddccBundle.entry as outentry, create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS') as ddcc then { + dcc.v as v -> ddccBundle.entry as outentry, create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetVS') as ddcc then { v then DCCtoCoreDataSet(dcc, ddcc) "set DDCC"; v -> ddcc.certificate as certificate then CertDCCtoCoreDataSetCertificate(src, dcc, v, certificate) "set certificate"; v -> ddcc.vaccination as vaccination then VtoCoreDataSetVS(v, vaccination) "set vaccination"; v -> outentry.resource = ddcc "set outentry"; } "v"; - dcc.t as t -> ddccBundle.entry as outentry, create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-TR') as ddcc then { + dcc.t as t -> ddccBundle.entry as outentry, create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetTR') as ddcc then { t then DCCtoCoreDataSet(dcc, ddcc) "set DDCC"; t -> ddcc.certificate as certificate then CertDCCtoCoreDataSetCertificate(src, dcc, t, certificate) "set certificate"; t -> ddcc.test as test then TtoCoreDataSetTR(t, test) "set test"; diff --git a/input/maps-src/CertDCCtoDDCC.map b/input/maps/CertDCCtoDDCC.fml similarity index 100% rename from input/maps-src/CertDCCtoDDCC.map rename to input/maps/CertDCCtoDDCC.fml diff --git a/input/maps-src/CertDIVOCtoCoreDataSet.map b/input/maps/CertDIVOCtoCoreDataSet.fml similarity index 98% rename from input/maps-src/CertDIVOCtoCoreDataSet.map rename to input/maps/CertDIVOCtoCoreDataSet.fml index 54e0659ff8..99c7096085 100644 --- a/input/maps-src/CertDIVOCtoCoreDataSet.map +++ b/input/maps/CertDIVOCtoCoreDataSet.fml @@ -4,9 +4,9 @@ map "http://smart.who.int/ddcc/StructureMap/CertDIVOCtoCoreDataSet" = "CertDIVOC uses "http://smart.who.int/ddcc/StructureDefinition/CertDIVOC" alias DIVOC as source uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias DDCCBundle as target -uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet" alias DDCC as produced -uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS" alias DDCCVS as produced -uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-TR" alias DDCCTR as produced +uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet" alias DDCC as target +uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetVS" alias DDCCVS as target +uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetTR" alias DDCCTR as target group CertDIVOCtoCoreDataSetBundle( source src: DIVOC, @@ -14,7 +14,7 @@ group CertDIVOCtoCoreDataSetBundle( { src.type as type then { type where type = 'ProofOfVaccinationCredential' then { - src.evidence as evidence -> ddccBundle.entry as outentry, create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS') as ddcc then { + src.evidence as evidence -> ddccBundle.entry as outentry, create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetVS') as ddcc then { src.credentialSubject as credentialSubject then CredentialSubjecttoCoreDataSet(credentialSubject, ddcc) "set patient"; src -> ddcc.certificate as certificate then CertDIVOCtoCoreDataSetCertificate(src, evidence, certificate) "set certificate"; evidence -> ddcc.vaccination as vaccination then EvidencetoCoreDataSetVS(evidence, vaccination) "set vaccination"; @@ -22,7 +22,7 @@ group CertDIVOCtoCoreDataSetBundle( } "evidence"; } "ProofOfVaccinationCredential"; type where type = 'ProofOfTestCertificateCredential' then { - src.evidence as evidence -> ddccBundle.entry as outentry, create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-TR') as ddcc then { + src.evidence as evidence -> ddccBundle.entry as outentry, create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetTR') as ddcc then { src.credentialSubject as credentialSubject then CredentialSubjecttoCoreDataSet(credentialSubject, ddcc) "set patient"; src -> ddcc.certificate as certificate then CertDIVOCtoCoreDataSetCertificate(src, evidence, certificate) "set certificate"; evidence -> ddcc.test as test then EvidencetoCoreDataSetTR(evidence, test) "set test"; diff --git a/input/maps-src/CertDIVOCtoDDCC.map b/input/maps/CertDIVOCtoDDCC.fml similarity index 100% rename from input/maps-src/CertDIVOCtoDDCC.map rename to input/maps/CertDIVOCtoDDCC.fml diff --git a/input/maps-src/CertICAOtoCoreDataSet.map b/input/maps/CertICAOtoCoreDataSet.fml similarity index 97% rename from input/maps-src/CertICAOtoCoreDataSet.map rename to input/maps/CertICAOtoCoreDataSet.fml index 92387e90d2..80353a975d 100644 --- a/input/maps-src/CertICAOtoCoreDataSet.map +++ b/input/maps/CertICAOtoCoreDataSet.fml @@ -4,9 +4,9 @@ map "http://smart.who.int/ddcc/StructureMap/CertICAOtoCoreDataSet" = "CertICAOto uses "http://smart.who.int/ddcc/StructureDefinition/CertICAOVDS" alias VDS as source uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias DDCCBundle as target -uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet" alias DDCC as produced -uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS" alias DDCCVS as produced -uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-TR" alias DDCCTR as produced +uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet" alias DDCC as target +uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetVS" alias DDCCVS as target +uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetTR" alias DDCCTR as target group CertICAOtoCoreDataSet( source src: VDS, @@ -15,14 +15,14 @@ group CertICAOtoCoreDataSet( src.data as data then { data.msg as msg then { msg.ve as ve then { - ve.vd as vd -> ddccBundle.entry as outentry, create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS') as ddcc then { + ve.vd as vd -> ddccBundle.entry as outentry, create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetVS') as ddcc then { data.hdr as hdr -> ddcc.certificate as certificate then VDStoCoreDataSetCertificate(hdr, msg, certificate) "set certificate"; msg.pid as pid then ExtractPatient(pid, ddcc) "set patient"; vd -> ddcc.vaccination as vaccination then ExtractVaccine(ve, vd, vaccination) "set vaccination"; vd -> outentry.resource = ddcc "set outentry"; } "vd"; } "ve"; - msg.tr as tr -> ddccBundle.entry as outentry, create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-TR') as ddcc then { + msg.tr as tr -> ddccBundle.entry as outentry, create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetTR') as ddcc then { data.hdr as hdr -> ddcc.certificate as certificate then VDStoCoreDataSetCertificate(hdr, msg, certificate) "set certificate"; msg.pid as pid then ExtractPatient(pid, ddcc) "set patient"; msg.sp as sp then { diff --git a/input/maps-src/CertICAOtoDDCC.map b/input/maps/CertICAOtoDDCC.fml similarity index 100% rename from input/maps-src/CertICAOtoDDCC.map rename to input/maps/CertICAOtoDDCC.fml diff --git a/input/maps-src/CertSHCtoCoreDataSet.map b/input/maps/CertSHCtoCoreDataSet.fml similarity index 96% rename from input/maps-src/CertSHCtoCoreDataSet.map rename to input/maps/CertSHCtoCoreDataSet.fml index 004a4114d3..4c3c0a38e4 100644 --- a/input/maps-src/CertSHCtoCoreDataSet.map +++ b/input/maps/CertSHCtoCoreDataSet.fml @@ -4,8 +4,8 @@ map "http://smart.who.int/ddcc/StructureMap/CertSHCtoCoreDataSet" = "CertSHCtoCo uses "http://smart.who.int/ddcc/StructureDefinition/CertSHC" alias JWTPayload as source uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias DDCCBundle as target -uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet" alias DDCC as produced -uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS" alias DDCCVS as produced +uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet" alias DDCC as target +uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetVS" alias DDCCVS as target imports "http://smart.who.int/ddcc/StructureMap/SHCToCoreDataSetVS" imports "http://smart.who.int/ddcc/StructureMap/SHCToCoreDataSetTR" @@ -20,7 +20,7 @@ group CertSHCtoCoreDataSetBundle( fhirBundle.entry as patientEntrySHC then { patientEntrySHC.resource : Patient first as patient then { fhirBundle.entry as entry then { - entry.resource : Immunization as immunization -> ddccBundle.entry as outentry, create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS') as ddcc then { + entry.resource : Immunization as immunization -> ddccBundle.entry as outentry, create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetVS') as ddcc then { immunization then PatientToDDCCVS(patient, ddcc) "set patient"; immunization -> ddcc.vaccination as vaccination then ImmunizationToDDCC(immunization, vaccination) "set vaccination"; immunization then CertSHCtoCoreDataSet(src, ddcc) "set ddcc"; diff --git a/input/maps-src/CertSHCtoDDCC.map b/input/maps/CertSHCtoDDCC.fml similarity index 100% rename from input/maps-src/CertSHCtoDDCC.map rename to input/maps/CertSHCtoDDCC.fml diff --git a/input/maps-src/CoreDataSetLibrary.map b/input/maps/CoreDataSetLibrary.fml similarity index 95% rename from input/maps-src/CoreDataSetLibrary.map rename to input/maps/CoreDataSetLibrary.fml index 4f306c8378..686be3f4f3 100644 --- a/input/maps-src/CoreDataSetLibrary.map +++ b/input/maps/CoreDataSetLibrary.fml @@ -1,11 +1,11 @@ map "http://smart.who.int/ddcc/StructureMap/CoreDataSetLibrary" = "CoreDataSetLibrary" -uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS" alias DDCCVS as source +uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetVS" alias DDCCVS as source uses "http://hl7.org/fhir/StructureDefinition/Patient" alias Patient as target -uses "http://smart.who.int/ddcc/StructureDefinition/DDCCPatient" alias DDCCPatient as produced -uses "http://smart.who.int/ddcc/StructureDefinition/DDCCDocumentReferenceQR" alias DDCCDocRefQR as produced -uses "http://smart.who.int/ddcc/StructureDefinition/DDCCComposition" alias DDCCComposition as produced +uses "http://smart.who.int/ddcc/StructureDefinition/DDCCPatient" alias DDCCPatient as target +uses "http://smart.who.int/ddcc/StructureDefinition/DDCCDocumentReferenceQR" alias DDCCDocRefQR as target +uses "http://smart.who.int/ddcc/StructureDefinition/DDCCComposition" alias DDCCComposition as target group DDCCToPatient( diff --git a/input/maps-src/CoreDataSetVSLibrary.map b/input/maps/CoreDataSetVSLibrary.fml similarity index 97% rename from input/maps-src/CoreDataSetVSLibrary.map rename to input/maps/CoreDataSetVSLibrary.fml index fc16d82ae6..6eb021d325 100644 --- a/input/maps-src/CoreDataSetVSLibrary.map +++ b/input/maps/CoreDataSetVSLibrary.fml @@ -1,15 +1,15 @@ map "http://smart.who.int/ddcc/StructureMap/CoreDataSetVSLibrary" = "CoreDataSetVSLibrary" -uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS" alias DDCCVS as source +uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetVS" alias DDCCVS as source uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias AddBundle as target uses "http://hl7.org/fhir/StructureDefinition/Patient" alias Patient as target -uses "http://smart.who.int/ddcc/StructureDefinition/DDCCPatient" alias DDCCPatient as produced -uses "http://smart.who.int/ddcc/StructureDefinition/DDCCDocumentReferenceQR" alias DDCCDocRefQR as produced -uses "http://smart.who.int/ddcc/StructureDefinition/DDCCVSComposition" alias DDCCVSComposition as produced +uses "http://smart.who.int/ddcc/StructureDefinition/DDCCPatient" alias DDCCPatient as target +uses "http://smart.who.int/ddcc/StructureDefinition/DDCCDocumentReferenceQR" alias DDCCDocRefQR as target +uses "http://smart.who.int/ddcc/StructureDefinition/DDCCVSComposition" alias DDCCVSComposition as target -uses "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunization" alias DDCCImmunization as produced -uses "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunizationRecommendation" alias DDCCImmRec as produced +uses "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunization" alias DDCCImmunization as target +uses "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunizationRecommendation" alias DDCCImmRec as target imports "http://smart.who.int/ddcc/StructureMap/CoreDataSetLibrary" diff --git a/input/maps-src/CoreDataSetVSToAddBundle.map b/input/maps/CoreDataSetVSToAddBundle.fml similarity index 93% rename from input/maps-src/CoreDataSetVSToAddBundle.map rename to input/maps/CoreDataSetVSToAddBundle.fml index d9d463f91f..f5825ee14b 100644 --- a/input/maps-src/CoreDataSetVSToAddBundle.map +++ b/input/maps/CoreDataSetVSToAddBundle.fml @@ -1,6 +1,6 @@ map "http://smart.who.int/ddcc/StructureMap/CoreDataSetVSToAddBundle" = "CoreDataSetVSToAddBundle" -uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS" alias DDCCVS as source +uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetVS" alias DDCCVS as source uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias AddBundle as target imports "http://smart.who.int/ddcc/StructureMap/CoreDataSetVSLibrary" diff --git a/input/maps-src/CoreDataSetVSToSHC.map b/input/maps/CoreDataSetVSToSHC.fml similarity index 95% rename from input/maps-src/CoreDataSetVSToSHC.map rename to input/maps/CoreDataSetVSToSHC.fml index 1b05bd2fba..18d75b7e49 100644 --- a/input/maps-src/CoreDataSetVSToSHC.map +++ b/input/maps/CoreDataSetVSToSHC.fml @@ -1,10 +1,10 @@ map "http://smart.who.int/ddcc/StructureMap/CoreDataSetVSToSHC" = "CoreDataSetVSToSHC" -uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS" alias DDCCVS as source +uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetVS" alias DDCCVS as source uses "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-vaccination-bundle-dm" alias SHCVaccinationBundleDM as target -uses "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-patient-general-dm" alias SHCPatientDM as produced -uses "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-vaccination-dm" alias SHCImmunizationDM as produced +uses "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-patient-general-dm" alias SHCPatientDM as target +uses "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-vaccination-dm" alias SHCImmunizationDM as target group VSToSHC ( source ddcc : DDCCVS, diff --git a/input/maps-src/DDCCtoCoredataset.map b/input/maps/DDCCtoCoredataset.fml similarity index 94% rename from input/maps-src/DDCCtoCoredataset.map rename to input/maps/DDCCtoCoredataset.fml index d8c30e493c..250b1d4be2 100644 --- a/input/maps-src/DDCCtoCoredataset.map +++ b/input/maps/DDCCtoCoredataset.fml @@ -8,7 +8,7 @@ uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCountryOfVaccination" al uses "http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineBrand" alias DDCCVaccineBrand as source uses "http://smart.who.int/ddcc/StructureDefinition/DDCCOrganization" alias DDCCOrganization as source uses "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunization" alias DDCCImmunization as source -uses "http://smart.who.int/ddcc/DDCCCoreDataSet-VS-PoV" alias DDCCCoreDataSetPoV as target +uses "http://smart.who.int/ddcc/DDCCCoreDataSetVSPoV" alias DDCCCoreDataSetPoV as target group DecodeDDCCtoQR ( @@ -26,7 +26,8 @@ group DecodeDDCCtoQR ( ddcc.entry as entry then { - entry.resource : Immunization as immunization log immunization + entry.resource : Immunization as immunization +// entry.resource : Immunization as immunization log immunization // entry.resource : Immunization as immunization where entry.resource.ofType(DDCCImmunization) // entry.resource : DDCCImmunization as immunization log immunization then DecodeImmunizationToQR(ddcc,immunization,qr) "Immunization"; diff --git a/input/maps-src/DDCCtoEUdcc.map b/input/maps/DDCCtoEUdcc.fml similarity index 100% rename from input/maps-src/DDCCtoEUdcc.map rename to input/maps/DDCCtoEUdcc.fml diff --git a/input/maps-src/DDCCtoSHC.map b/input/maps/DDCCtoSHC.fml similarity index 98% rename from input/maps-src/DDCCtoSHC.map rename to input/maps/DDCCtoSHC.fml index c152685f69..710c1a4555 100644 --- a/input/maps-src/DDCCtoSHC.map +++ b/input/maps/DDCCtoSHC.fml @@ -9,8 +9,8 @@ uses "http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineBrand" alias DDCC uses "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunization" alias DDCCImmunization as source uses "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-vaccination-bundle-dm" alias SHCVaccinationBundleDM as target -uses "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-patient-general-dm" alias SHCPatientDM as produced -uses "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-vaccination-dm" alias SHCImmunizationDM as produced +uses "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-patient-general-dm" alias SHCPatientDM as target +uses "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-vaccination-dm" alias SHCImmunizationDM as target group DDCCtoSHC ( diff --git a/input/maps-src/IPSToCoreDataSetVS.map b/input/maps/IPSToCoreDataSetVS.fml similarity index 99% rename from input/maps-src/IPSToCoreDataSetVS.map rename to input/maps/IPSToCoreDataSetVS.fml index 60f79bc663..096d5eea13 100644 --- a/input/maps-src/IPSToCoreDataSetVS.map +++ b/input/maps/IPSToCoreDataSetVS.fml @@ -3,7 +3,7 @@ map "http://smart.who.int/ddcc/StructureMap/IPSToCoreDataSetVS" = "IPSToCoreData uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias IPS as source uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias DDCCBundle as target -uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS-PoV" alias DDCC as produced +uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetVSPoV" alias DDCC as target group IPSToCoreDataSetVS ( diff --git a/input/maps-src/QRespToVSCoreDataSet.map b/input/maps/QRespToVSCoreDataSet.fml similarity index 96% rename from input/maps-src/QRespToVSCoreDataSet.map rename to input/maps/QRespToVSCoreDataSet.fml index 06a094fe02..4b256a4355 100644 --- a/input/maps-src/QRespToVSCoreDataSet.map +++ b/input/maps/QRespToVSCoreDataSet.fml @@ -2,7 +2,7 @@ map "http://smart.who.int/ddcc/StructureMap/QRespToVSCoreDataSet" = "QRespToVSCoreDataSet" uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QResp as source -uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS-CoC" alias DDCC as target +uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetVSCoC" alias DDCC as target group QRespToCoreDataSet ( diff --git a/input/maps-src/ResourcesToVSCoreDataSet.map b/input/maps/ResourcesToVSCoreDataSet.fml similarity index 97% rename from input/maps-src/ResourcesToVSCoreDataSet.map rename to input/maps/ResourcesToVSCoreDataSet.fml index 812258856e..05dd324994 100644 --- a/input/maps-src/ResourcesToVSCoreDataSet.map +++ b/input/maps/ResourcesToVSCoreDataSet.fml @@ -2,14 +2,14 @@ map "http://smart.who.int/ddcc/StructureMap/ResourcesToVSCoreDataSet" = "ResourcesToVSCoreDataSet" uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias Bundle as source -uses "http://hl7.org/fhir/StructureDefinition/HumanName" alias HumanName as produced +uses "http://hl7.org/fhir/StructureDefinition/HumanName" alias HumanName as target uses "http://smart.who.int/ddcc/StructureDefinition/DDCCPatient" alias DDCCPatient as source uses "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunization" alias DDCCImmunization as source uses "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunizationRecommendation" alias DDCCImmunizationRecommendation as source uses "http://smart.who.int/ddcc/StructureDefinition/DDCCVSComposition" alias DDCCVSComposition as source -uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS-PoV" alias DDCCPoV as target +uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetVSPoV" alias DDCCPoV as target group ResourcesToCoreDataSet ( diff --git a/input/maps-src/SHCToCoreDataSetTR.map b/input/maps/SHCToCoreDataSetTR.fml similarity index 97% rename from input/maps-src/SHCToCoreDataSetTR.map rename to input/maps/SHCToCoreDataSetTR.fml index 0a0990ab57..d6a2a1ae61 100644 --- a/input/maps-src/SHCToCoreDataSetTR.map +++ b/input/maps/SHCToCoreDataSetTR.fml @@ -5,7 +5,7 @@ uses "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-patient-gen uses "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-infectious-disease-laboratory-result-observation-dm" alias SHCLabDM as source uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias DDCCBundle as target -uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-TR" alias DDCCTR as produced +uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetTR" alias DDCCTR as target group SHCToTR ( source shc : SHCLabBundleDM @@ -14,8 +14,8 @@ group SHCToTR ( shc.entry as patientEntrySHC then { patientEntrySHC.resource : Patient first as patient then { shc.entry as entry then { - //entry.resource : Immunization as immunization where vaccineCode.memberOf('http://smart.who.int/ddcc/ValueSet/who-ddcc-allowed-vaccines-covid-19') -> ddccBundle.entry as outentry, create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS') as ddcc then { - entry.resource : Observation as lab -> ddccBundle.entry as outentry, create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-TR') as ddcc then { + //entry.resource : Immunization as immunization where vaccineCode.memberOf('http://smart.who.int/ddcc/ValueSet/who-ddcc-allowed-vaccines-covid-19') -> ddccBundle.entry as outentry, create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetVS') as ddcc then { + entry.resource : Observation as lab -> ddccBundle.entry as outentry, create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetTR') as ddcc then { lab then PatientToDDCCTR(patient, ddcc) "set patient"; lab -> ddcc.test as test then LabToDDCC(lab, test) "set test"; lab -> outentry.resource = ddcc "set outentry"; diff --git a/input/maps-src/SHCToCoreDataSetVS.map b/input/maps/SHCToCoreDataSetVS.fml similarity index 97% rename from input/maps-src/SHCToCoreDataSetVS.map rename to input/maps/SHCToCoreDataSetVS.fml index 44ac4f40df..79103925d0 100644 --- a/input/maps-src/SHCToCoreDataSetVS.map +++ b/input/maps/SHCToCoreDataSetVS.fml @@ -5,7 +5,7 @@ uses "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-patient-gen uses "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-vaccination-dm" alias SHCImmunizationDM as source uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias DDCCBundle as target -uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS" alias DDCCVS as produced +uses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetVS" alias DDCCVS as target group SHCToVS ( source shc : SHCVaccinationBundleDM @@ -14,8 +14,8 @@ group SHCToVS ( shc.entry as patientEntrySHC then { patientEntrySHC.resource : Patient first as patient then { shc.entry as entry then { - //entry.resource : Immunization as immunization where vaccineCode.memberOf('http://smart.who.int/ddcc/ValueSet/who-ddcc-allowed-vaccines-covid-19') -> ddccBundle.entry as outentry, create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS') as ddcc then { - entry.resource : Immunization as immunization -> ddccBundle.entry as outentry, create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS') as ddcc then { + //entry.resource : Immunization as immunization where vaccineCode.memberOf('http://smart.who.int/ddcc/ValueSet/who-ddcc-allowed-vaccines-covid-19') -> ddccBundle.entry as outentry, create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetVS') as ddcc then { + entry.resource : Immunization as immunization -> ddccBundle.entry as outentry, create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetVS') as ddcc then { immunization then PatientToDDCCVS(patient, ddcc) "set patient"; immunization -> ddcc.vaccination as vaccination then ImmunizationToDDCC(immunization, vaccination) "set vaccination"; immunization -> outentry.resource = ddcc "set outentry"; diff --git a/input/maps-src/SHCtoDDCC.map b/input/maps/SHCtoDDCC.fml similarity index 93% rename from input/maps-src/SHCtoDDCC.map rename to input/maps/SHCtoDDCC.fml index 0163237a85..c3023a7a4d 100644 --- a/input/maps-src/SHCtoDDCC.map +++ b/input/maps/SHCtoDDCC.fml @@ -7,13 +7,13 @@ uses "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-patient-gen uses "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-vaccination-dm" alias SHCImmunizationDM as source uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias Bundle as target -uses "http://smart.who.int/ddcc/StructureDefinition/DDCCDocument" alias DDCCDocument as produced -uses "http://smart.who.int/ddcc/StructureDefinition/DDCCPatient" alias DDCCPatient as produced -uses "http://smart.who.int/ddcc/StructureDefinition/DDCCComposition" alias DDCCComposition as produced -uses "http://smart.who.int/ddcc/StructureDefinition/DDCCOrganization" alias DDCCOrganization as produced -uses 'http://smart.who.int/ddcc/StructureDefinition/DDCCCountryOfVaccination' alias DDCCCountryOfVaccination as produced -uses "http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineBrand" alias DDCCVaccineBrand as produced -uses "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunization" alias DDCCImmunization as produced +uses "http://smart.who.int/ddcc/StructureDefinition/DDCCDocument" alias DDCCDocument as target +uses "http://smart.who.int/ddcc/StructureDefinition/DDCCPatient" alias DDCCPatient as target +uses "http://smart.who.int/ddcc/StructureDefinition/DDCCComposition" alias DDCCComposition as target +uses "http://smart.who.int/ddcc/StructureDefinition/DDCCOrganization" alias DDCCOrganization as target +uses 'http://smart.who.int/ddcc/StructureDefinition/DDCCCountryOfVaccination' alias DDCCCountryOfVaccination as target +uses "http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineBrand" alias DDCCVaccineBrand as target +uses "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunization" alias DDCCImmunization as target group SHCtoDDCC ( diff --git a/input/pre-generated/svc-map-qr-uvci-bundle.map b/input/pre-generated/svc-map-qr-uvci-bundle.map deleted file mode 100644 index 7bd878fed2..0000000000 --- a/input/pre-generated/svc-map-qr-uvci-bundle.map +++ /dev/null @@ -1,158 +0,0 @@ -map "http://who-int.github.io/svc/StructureMap/svc-map-qr-uvci-bundle" = "svc-map-qr-uvci-bundle" - -uses "http://who-int.github.io/svc/refs/heads/qr-encoding/StructureDefinition/svc-qr-uvci" alias QR as source -uses "http://who-int.github.io/svc/StructureDefinition/svc-bundle" alias SVC_Bundle as target -uses "http://who-int.github.io/svc/StructureDefinition/svc-composition" alias SVC_Composition as produced -uses "http://who-int.github.io/svc/StructureDefinition/svc-patient" alias SVC_Patient as produced -uses "http://who-int.github.io/svc/StructureDefinition/svc-organization" alias SVC_Organization as produced -uses "http://who-int.github.io/svc/StructureDefinition/svc-provenance" alias SVC_Provenance as produced - - -group Decode_QR( - source qr: QR, - target bundle - ){ - - qr -> create("SVC_Patient") as patient, - create("SVC_Organization") as organization - then - Decode_QR_Patient(qr,patient), - Decode_QR_Organization(qr,organization), - Decode_QR_Bundle(qr,patient,organzation,bundle) - "Create resources and process bundle"; - -} - - - -group Decode_QR_Patient( - source qr: QR, - target patient : SVC_Patient - ) { - - - qr.name as qrname, - patient.name as pname -> - pname.text = qrname, - pname.use = "official" - "Load Name"; - - qr.pid as pid -> - patient.identifier = id("XXXXXurn:uetf:rfc:3986",pid) - "Load Patient Identifer"; - - qr.birthDate as birthDate-> - patient.birthDate = birthDate - "Load Birth Date"; - - -} - - -group Decode_QR_Organization( - source qr : QR , - target organization : SVC_Organization - ){ - - qr.phaid as phaid -> - organization.identifier = id("XXXXXurn:ietf:rfc:3986",phaid) - "Load PHA ID"; -} - - -group Decode_QR_Bundle( - source qr : QR, - target patient : SVC_Patient, - target bundle : SVC_Bundle - ) { - - qr -> bundle.status = "final", - bundle.type = "document" - "Set Bundle Metadata"; - - - - qr.paperid as paperid -> - bundle.identifier = id("XXXXXurn:ietf:rfc:3986",paperid) - "Load Paper SVC ID"; - - qr.signature as qrsig, - bundle.signature as bsig -> - bsig.data = qrsig, - bsig.type = "1.2.840.10065.1.12.1.14", //Source Signature https://www.hl7.org/fhir/valueset-signature-type.html - bsig.format = "XXXXXXX TBD", - bsig.who = reference(organization) - "Load Signature"; - - - - qr -> bundle.entry as e, - e.resource = create("SVC_Composition") as compostion - then Decode_QR_Composition(qr,bundle,composition) - "Process Composition Entry"; - -} - - -group Decode_QR_Composition( - source qr : QR source, - target bundle : SVC_Bundle, - target patient : SVC_Patient, - target organization : SVC_Organization, - target composition : SVC_Composition, - ){ - - qr -> composition.subject = reference(patient), - composition.author = reference(organization) - "Set Composition Meta"; - - - qr.digitalid as digitalid -> - composition.identifier = id("XXXXXurn:ietf:rfc:3986",digitalid) - "Load Digital SVC ID"; - -} - - -group Decode_QR_Provenance( - source qr : QR, - target bundle : SVC_Bundle, - target patient : SVC_Patient, - target organization : SVC_Organization, - target paper : SVC_Composition, - target digital : SVC_Composition, - target provenance : SVC_Provenance - ){ - - qr , - provenance.entity as e_digital, - provenance.agent as agent, - provenance.signature as psig - -> - provenance.reason = "PUBHLTH" , - provenance.policy = "XXXXXXX urn:example:who:smart:vaccine-certificate:RC1" , - provenance.target = reference(bundle), - - e_digital.role = "source" , - e_digital.what = reference(composition) , - e_digital.agent = reference(organization) , - - e_paper.role = "source" , - e_paper.what = reference(bundle) , - e_paper.agent = reference(organization) , - - psig.format = "XXXXX TBD" , - psig.who = reference(organization) , - psg.type = "1.2.840.10065.1.12.1.14", //Source Signature https://www.hl7.org/fhir/valueset-signature-type.html - psig.data = signature - - then { - agent.who as who -> - who.reference = reference(organization), - who.onBehalfOf = reference(patient) as "Set who"; - } - "Set provenance"; - -} - - diff --git a/input/pre-generated/svc-qr-uvci-example.fsh b/input/pre-generated/svc-qr-uvci-example.fsh deleted file mode 100644 index a32e9620e4..0000000000 --- a/input/pre-generated/svc-qr-uvci-example.fsh +++ /dev/null @@ -1,17 +0,0 @@ -Instance: example -InstanceOf: svc-qr-uvci -Description: "Example of data elements from SVC Bundle identified by the UVCI to be QR encoded" -Title: "SVC UVCI QR Example" // user-friendly name -Usage: #definition - -* version = "RC-2-draft" -* id = "example" -* name = "Felix Cat" -* birthDate = "2005-10-04" -* patientid = "NMCZ8B1KwsMgVo64bDn2" -* digitalid = "h1dZ75FMdY9EQQjE64O4" -* paperid = "bMlJkAt0V92RYhhG3fNt" -* signature = "SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" - - - diff --git a/input/resources/StructureMap-BundleVSToAddBundle.json b/input/resources/StructureMap-BundleVSToAddBundle.json deleted file mode 100644 index c2fa84b4bb..0000000000 --- a/input/resources/StructureMap-BundleVSToAddBundle.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "resourceType": "StructureMap", - "id": "BundleVSToAddBundle", - "meta": { - "versionId": "1", - "lastUpdated": "2022-06-01T12:55:43.592+00:00" - }, - "text": { - "status": "generated", - "div": "
map "http://smart.who.int/ddcc/StructureMap/BundleVSToAddBundle" = "BundleVSToAddBundle"\r\n\r\n\r\nuses "http://hl7.org/fhir/StructureDefinition/Bundle" alias DDCCBundle as source\r\nuses "http://hl7.org/fhir/StructureDefinition/Bundle" alias AddBundle as target\r\n\r\nimports "http://smart.who.int/ddcc/StructureMap/CoreDataSetVSToAddBundle"\r\n\r\ngroup BundleVSToAddBundle(source ddccbundle : DDCCBundle, target bundle : AddBundle) {\r\n  ddccbundle.entry first as ddcc -> bundle then CoreDataSetVSToAddBundle(ddcc, bundle) "get first entry from bundle";\r\n}\r\n\r\n
" - }, - "url": "http://smart.who.int/ddcc/StructureMap/BundleVSToAddBundle", - "name": "BundleVSToAddBundle", - "structure": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/Bundle", - "mode": "source", - "alias": "DDCCBundle" - }, - { - "url": "http://hl7.org/fhir/StructureDefinition/Bundle", - "mode": "target", - "alias": "AddBundle" - } - ], - "import": [ - "http://smart.who.int/ddcc/StructureMap/CoreDataSetVSToAddBundle" - ], - "group": [ - { - "name": "BundleVSToAddBundle", - "typeMode": "none", - "input": [ - { - "name": "ddccbundle", - "type": "DDCCBundle", - "mode": "source" - }, - { - "name": "bundle", - "type": "AddBundle", - "mode": "target" - } - ], - "rule": [ - { - "name": "get first entry from bundle", - "source": [ - { - "context": "ddccbundle", - "element": "entry", - "listMode": "first", - "variable": "ddcc" - } - ], - "target": [ - { - "contextType": "variable", - "transform": "copy", - "parameter": [ - { - "valueId": "bundle" - } - ] - } - ], - "dependent": [ - { - "name": "CoreDataSetVSToAddBundle", - "variable": [ - "ddcc", - "bundle" - ], - "_variable": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } - ] - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } - ] - } - ] - } - ] - } - ] - } - ] -} - diff --git a/input/resources/StructureMap-CertDCCtoCoreDataSet.json b/input/resources/StructureMap-CertDCCtoCoreDataSet.json deleted file mode 100644 index 60780265c4..0000000000 --- a/input/resources/StructureMap-CertDCCtoCoreDataSet.json +++ /dev/null @@ -1,1138 +0,0 @@ -{ - "resourceType": "StructureMap", - "id": "CertDCCtoCoreDataSet", - "meta": { - "versionId": "35", - "lastUpdated": "2023-02-15T22:34:19.164+00:00" - }, - "text": { - "status": "generated", - "div": "
map "http://smart.who.int/ddcc/StructureMap/CertDCCtoCoreDataSet" = "CertDCCtoCoreDataSet"\r\n\r\n// Structure map transforming CertDCC logical model to bundle of Core Data Set logical model\r\n\r\nuses "http://smart.who.int/ddcc/StructureDefinition/CertDCC" alias CWTPayload as source\r\nuses "http://hl7.org/fhir/StructureDefinition/Bundle" alias DDCCBundle as target\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet" alias DDCC as produced\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS" alias DDCCVS as produced\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-TR" alias DDCCTR as produced\r\n\r\ngroup CertDCCtoCoreDataSet(source src : CWTPayload, target ddccBundle : DDCCBundle) {\r\n  src."-260" as hcert then {\r\n    hcert."1" as dcc then {\r\n      dcc.v as v ->  ddccBundle.entry as outentry,  create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS') as ddcc then {\r\n        v then DCCtoCoreDataSet(dcc, ddcc) "set DDCC";\r\n        v -> ddcc.certificate as certificate then CertDCCtoCoreDataSetCertificate(src, dcc, v, certificate) "set certificate";\r\n        v -> ddcc.vaccination as vaccination then VtoCoreDataSetVS(v, vaccination) "set vaccination";\r\n        v -> outentry.resource = ddcc "set outentry";\r\n      };\r\n      dcc.t as t ->  ddccBundle.entry as outentry,  create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-TR') as ddcc then {\r\n        t then DCCtoCoreDataSet(dcc, ddcc) "set DDCC";\r\n        t -> ddcc.certificate as certificate then CertDCCtoCoreDataSetCertificate(src, dcc, t, certificate) "set certificate";\r\n        t -> ddcc.test as test then TtoCoreDataSetTR(t, test) "set test";\r\n        t -> outentry.resource = ddcc "set outentry";\r\n      };\r\n    } "eu_DCC_v1";\r\n  } "hcert";\r\n}\r\n\r\ngroup DCCtoCoreDataSet(source dcc, target ddcc : DDCC) {\r\n  dcc.dob as birthDate -> ddcc.birthDate = birthDate "set birthDate";\r\n  dcc.nam as nam then {\r\n    nam.gn as given -> ddcc.name = (given.replaceMatches('$', ' ')) "set given name";\r\n    nam.fn as family ->  ddcc.name as tName,  ddcc.name = append(tName, family) "add family name";\r\n  };\r\n}\r\n\r\ngroup CertDCCtoCoreDataSetCertificate(source src : CWTPayload, source dcc, source g, target certificate) {\r\n  src -> certificate.period = create('Period') as period then CwtToPeriod(src, period) "set period";\r\n  dcc.ver as ver -> certificate.version = ver "set version";\r\n  g.ci as ci ->  certificate.hcid as hcid,  hcid.value = ci "set hcid";\r\n  g.is as is ->  certificate.issuer = create('Reference') as issuer,  issuer.display = is "set issuer";\r\n}\r\n\r\ngroup CwtToPeriod(source src : CWTPayload, target tgt : Period) {\r\n  src."6" as iat ->  append(iat, ' seconds') as epoch,  tgt.start = (@1970-01-01T00:00:00.000+00:00 + epoch.toQuantity()) "set period start";\r\n  src."4" as exp ->  append(exp, ' seconds') as epoch,  tgt.end = (@1970-01-01T00:00:00.000+00:00 + epoch.toQuantity()) "set period end";\r\n}\r\n\r\ngroup VtoCoreDataSetVS(source v, target vaccination) {\r\n  v.tg as tg ->  vaccination.disease as coding,  coding.system = 'http://snomed.info/sct',  coding.code = tg "set target disease";\r\n  v.vp as vp ->  vaccination.vaccine as coding,  coding.system = 'https://ec.europa.eu/health/documents/community-register/html/',  coding.code = vp "set vaccine";\r\n  v.mp as mp then {\r\n    mp ->  vaccination.brand as coding,  coding.system = 'https://id.uvci.eu/valuesets/vaccine-medicinal-product.json',  coding.code = mp "set default brand";\r\n    mp -> c('https://ec.europa.eu/health/documents/community-register/html/', mp) as coded then {\r\n      mp where coded.memberOf('http://smart.who.int/ddcc/ValueSet/vaccine-covid19-euur') -> vaccination.brand = translate(coded, 'http://smart.who.int/ddcc/ConceptMap/vaccine-covid19-euur-to-icd11', 'Coding') "translate COVID19 brand";\r\n    } "coding";\r\n  };\r\n  v.ma as ma ->  vaccination.maholder as coding,  coding.system = 'https://id.uvci.eu/valuesets/vaccine-mah-manf.json',  coding.code = ma "set maholder";\r\n  v.dt as date -> vaccination.date = date "set date";\r\n  v.dn as dose -> vaccination.dose = dose "set dose";\r\n  v.sd as totalDoses -> vaccination.totalDoses = totalDoses "set totalDoses";\r\n  v.co as co ->  vaccination.country as coding,  coding.code = co,  coding.system = 'urn:iso:std:iso:3166' "set country";\r\n}\r\n\r\ngroup TtoCoreDataSetTR(source t, target test) {\r\n  t.tg as tg then {\r\n    tg ->  test.pathogen as coding,  coding.system = 'http://snomed.info/sct',  coding.code = tg "set default pathogen";\r\n    tg -> c('http://snomed.info/sct', tg) as coded then {\r\n      tg where coded.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-pathogen-covid19-snomed') -> test.pathogen = translate(coded, 'http://smart.who.int/ddcc/ConceptMap/lab-test-pathogen-snomed-to-icd11', 'Coding') "translate COVID19 pathogen";\r\n    } "coding";\r\n  };\r\n  t.tt as tt then {\r\n    tt ->  test.type as coding,  coding.system = 'http://loinc.org',  coding.code = tt "set default type";\r\n    tt -> c('http://loinc.org', tt) as coded then {\r\n      tt where coded.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-type-covid19-loinc') -> test.type = translate(coded, 'http://smart.who.int/ddcc/ConceptMap/lab-test-type-covid19-loinc-to-icd11', 'Coding') "translate COVID19 type";\r\n    } "coding";\r\n  };\r\n  t.nm as nm ->  test.brand as coding,  coding.system = 'https://id.uvci.eu/valuesets/test-manf.json',  coding.code = nm "set brand";\r\n  t.ma as ma ->  test.manufacturer as coding,  coding.system = 'https://covid-19-diagnostics.jrc.ec.europa.eu/devices',  coding.code = ma "set manufacturer";\r\n  t.sc as date -> test.date = date "set date";\r\n  t.tr as tr then {\r\n    tr ->  test.result as coding,  coding.system = 'http://snomed.info/sct',  coding.code = tr "set default result";\r\n    tr -> c('http://snomed.info/sct', tr) as coded then {\r\n      tr where coded.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-qual-result-snomed') -> test.result = translate(coded, 'http://smart.who.int/ddcc/ConceptMap/lab-test-qual-result-snomed-to-icd11', 'Coding') "translate COVID19 result";\r\n    } "coding";\r\n  };\r\n  t.tc as tc ->  test.centre as coding,  coding.code = tc "set centre";\r\n  t.co as co ->  test.country as coding,  coding.code = co,  coding.system = 'urn:iso:std:iso:3166' "set country";\r\n}\r\n\r\n
" - }, - "url": "http://smart.who.int/ddcc/StructureMap/CertDCCtoCoreDataSet", - "name": "CertDCCtoCoreDataSet", - "description": "Structure map transforming CertDCC logical model to bundle of Core Data Set logical model", - "structure": [ { - "url": "http://smart.who.int/ddcc/StructureDefinition/CertDCC", - "mode": "source", - "alias": "CWTPayload" - }, { - "url": "http://hl7.org/fhir/StructureDefinition/Bundle", - "mode": "target", - "alias": "DDCCBundle" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet", - "mode": "produced", - "alias": "DDCC" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS", - "mode": "produced", - "alias": "DDCCVS" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-TR", - "mode": "produced", - "alias": "DDCCTR" - } ], - "group": [ { - "name": "CertDCCtoCoreDataSet", - "typeMode": "none", - "input": [ { - "name": "src", - "type": "CWTPayload", - "mode": "source" - }, { - "name": "ddccBundle", - "type": "DDCCBundle", - "mode": "target" - } ], - "rule": [ { - "name": "hcert", - "source": [ { - "context": "src", - "element": "-260", - "variable": "hcert" - } ], - "rule": [ { - "name": "eu_DCC_v1", - "source": [ { - "context": "hcert", - "element": "1", - "variable": "dcc" - } ], - "rule": [ { - "name": "v", - "source": [ { - "context": "dcc", - "element": "v", - "variable": "v" - } ], - "target": [ { - "context": "ddccBundle", - "contextType": "variable", - "element": "entry", - "variable": "outentry" - }, { - "contextType": "variable", - "variable": "ddcc", - "transform": "create", - "parameter": [ { - "valueString": "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS" - } ] - } ], - "rule": [ { - "name": "set DDCC", - "source": [ { - "context": "v" - } ], - "dependent": [ { - "name": "DCCtoCoreDataSet", - "variable": [ "dcc", "ddcc" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - }, { - "name": "set certificate", - "source": [ { - "context": "v" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "certificate", - "variable": "certificate" - } ], - "dependent": [ { - "name": "CertDCCtoCoreDataSetCertificate", - "variable": [ "src", "dcc", "v", "certificate" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - }, { - "name": "set vaccination", - "source": [ { - "context": "v" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "vaccination", - "variable": "vaccination" - } ], - "dependent": [ { - "name": "VtoCoreDataSetVS", - "variable": [ "v", "vaccination" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - }, { - "name": "set outentry", - "source": [ { - "context": "v" - } ], - "target": [ { - "context": "outentry", - "contextType": "variable", - "element": "resource", - "transform": "copy", - "parameter": [ { - "valueId": "ddcc" - } ] - } ] - } ] - }, { - "name": "t", - "source": [ { - "context": "dcc", - "element": "t", - "variable": "t" - } ], - "target": [ { - "context": "ddccBundle", - "contextType": "variable", - "element": "entry", - "variable": "outentry" - }, { - "contextType": "variable", - "variable": "ddcc", - "transform": "create", - "parameter": [ { - "valueString": "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-TR" - } ] - } ], - "rule": [ { - "name": "set DDCC", - "source": [ { - "context": "t" - } ], - "dependent": [ { - "name": "DCCtoCoreDataSet", - "variable": [ "dcc", "ddcc" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - }, { - "name": "set certificate", - "source": [ { - "context": "t" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "certificate", - "variable": "certificate" - } ], - "dependent": [ { - "name": "CertDCCtoCoreDataSetCertificate", - "variable": [ "src", "dcc", "t", "certificate" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - }, { - "name": "set test", - "source": [ { - "context": "t" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "test", - "variable": "test" - } ], - "dependent": [ { - "name": "TtoCoreDataSetTR", - "variable": [ "t", "test" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - }, { - "name": "set outentry", - "source": [ { - "context": "t" - } ], - "target": [ { - "context": "outentry", - "contextType": "variable", - "element": "resource", - "transform": "copy", - "parameter": [ { - "valueId": "ddcc" - } ] - } ] - } ] - } ] - } ] - } ] - }, { - "name": "DCCtoCoreDataSet", - "typeMode": "none", - "input": [ { - "name": "dcc", - "mode": "source" - }, { - "name": "ddcc", - "type": "DDCC", - "mode": "target" - } ], - "rule": [ { - "name": "set birthDate", - "source": [ { - "context": "dcc", - "element": "dob", - "variable": "birthDate" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "birthDate", - "transform": "copy", - "parameter": [ { - "valueId": "birthDate" - } ] - } ] - }, { - "name": "nam", - "source": [ { - "context": "dcc", - "element": "nam", - "variable": "nam" - } ], - "rule": [ { - "name": "set given name", - "source": [ { - "context": "nam", - "element": "gn", - "variable": "given" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "transform": "evaluate", - "parameter": [ { - "valueString": "given.replaceMatches('$', ' ')" - } ] - } ] - }, { - "name": "add family name", - "source": [ { - "context": "nam", - "element": "fn", - "variable": "family" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "variable": "tName" - }, { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "transform": "append", - "parameter": [ { - "valueId": "tName" - }, { - "valueId": "family" - } ] - } ] - } ] - } ] - }, { - "name": "CertDCCtoCoreDataSetCertificate", - "typeMode": "none", - "input": [ { - "name": "src", - "type": "CWTPayload", - "mode": "source" - }, { - "name": "dcc", - "mode": "source" - }, { - "name": "g", - "mode": "source" - }, { - "name": "certificate", - "mode": "target" - } ], - "rule": [ { - "name": "set period", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "certificate", - "contextType": "variable", - "element": "period", - "variable": "period", - "transform": "create", - "parameter": [ { - "valueString": "Period" - } ] - } ], - "dependent": [ { - "name": "CwtToPeriod", - "variable": [ "src", "period" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - }, { - "name": "set version", - "source": [ { - "context": "dcc", - "element": "ver", - "variable": "ver" - } ], - "target": [ { - "context": "certificate", - "contextType": "variable", - "element": "version", - "transform": "copy", - "parameter": [ { - "valueId": "ver" - } ] - } ] - }, { - "name": "set hcid", - "source": [ { - "context": "g", - "element": "ci", - "variable": "ci" - } ], - "target": [ { - "context": "certificate", - "contextType": "variable", - "element": "hcid", - "variable": "hcid" - }, { - "context": "hcid", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "ci" - } ] - } ] - }, { - "name": "set issuer", - "source": [ { - "context": "g", - "element": "is", - "variable": "is" - } ], - "target": [ { - "context": "certificate", - "contextType": "variable", - "element": "issuer", - "variable": "issuer", - "transform": "create", - "parameter": [ { - "valueString": "Reference" - } ] - }, { - "context": "issuer", - "contextType": "variable", - "element": "display", - "transform": "copy", - "parameter": [ { - "valueId": "is" - } ] - } ] - } ] - }, { - "name": "CwtToPeriod", - "typeMode": "none", - "input": [ { - "name": "src", - "type": "CWTPayload", - "mode": "source" - }, { - "name": "tgt", - "type": "Period", - "mode": "target" - } ], - "rule": [ { - "name": "set period start", - "source": [ { - "context": "src", - "element": "6", - "variable": "iat" - } ], - "target": [ { - "contextType": "variable", - "variable": "epoch", - "transform": "append", - "parameter": [ { - "valueId": "iat" - }, { - "valueString": " seconds" - } ] - }, { - "context": "tgt", - "contextType": "variable", - "element": "start", - "transform": "evaluate", - "parameter": [ { - "valueString": "@1970-01-01T00:00:00.000+00:00 + epoch.toQuantity()" - } ] - } ] - }, { - "name": "set period end", - "source": [ { - "context": "src", - "element": "4", - "variable": "exp" - } ], - "target": [ { - "contextType": "variable", - "variable": "epoch", - "transform": "append", - "parameter": [ { - "valueId": "exp" - }, { - "valueString": " seconds" - } ] - }, { - "context": "tgt", - "contextType": "variable", - "element": "end", - "transform": "evaluate", - "parameter": [ { - "valueString": "@1970-01-01T00:00:00.000+00:00 + epoch.toQuantity()" - } ] - } ] - } ] - }, { - "name": "VtoCoreDataSetVS", - "typeMode": "none", - "input": [ { - "name": "v", - "mode": "source" - }, { - "name": "vaccination", - "mode": "target" - } ], - "rule": [ { - "name": "set target disease", - "source": [ { - "context": "v", - "element": "tg", - "variable": "tg" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "disease", - "variable": "coding" - }, { - "context": "coding", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueString": "http://snomed.info/sct" - } ] - }, { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "tg" - } ] - } ] - }, { - "name": "set vaccine", - "source": [ { - "context": "v", - "element": "vp", - "variable": "vp" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "vaccine", - "variable": "coding" - }, { - "context": "coding", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueString": "https://ec.europa.eu/health/documents/community-register/html/" - } ] - }, { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "vp" - } ] - } ] - }, { - "name": "mp", - "source": [ { - "context": "v", - "element": "mp", - "variable": "mp" - } ], - "rule": [ { - "name": "set default brand", - "source": [ { - "context": "mp" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "brand", - "variable": "coding" - }, { - "context": "coding", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueString": "https://id.uvci.eu/valuesets/vaccine-medicinal-product.json" - } ] - }, { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "mp" - } ] - } ] - }, { - "name": "coding", - "source": [ { - "context": "mp" - } ], - "target": [ { - "contextType": "variable", - "variable": "coded", - "transform": "c", - "parameter": [ { - "valueString": "https://ec.europa.eu/health/documents/community-register/html/" - }, { - "valueId": "mp" - } ] - } ], - "rule": [ { - "name": "translate COVID19 brand", - "source": [ { - "context": "mp", - "condition": "coded.memberOf('http://smart.who.int/ddcc/ValueSet/vaccine-covid19-euur')" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "brand", - "transform": "translate", - "parameter": [ { - "valueId": "coded" - }, { - "valueString": "http://smart.who.int/ddcc/ConceptMap/vaccine-covid19-euur-to-icd11" - }, { - "valueString": "Coding" - } ] - } ] - } ] - } ] - }, { - "name": "set maholder", - "source": [ { - "context": "v", - "element": "ma", - "variable": "ma" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "maholder", - "variable": "coding" - }, { - "context": "coding", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueString": "https://id.uvci.eu/valuesets/vaccine-mah-manf.json" - } ] - }, { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "ma" - } ] - } ] - }, { - "name": "set date", - "source": [ { - "context": "v", - "element": "dt", - "variable": "date" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "date", - "transform": "copy", - "parameter": [ { - "valueId": "date" - } ] - } ] - }, { - "name": "set dose", - "source": [ { - "context": "v", - "element": "dn", - "variable": "dose" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "dose", - "transform": "copy", - "parameter": [ { - "valueId": "dose" - } ] - } ] - }, { - "name": "set totalDoses", - "source": [ { - "context": "v", - "element": "sd", - "variable": "totalDoses" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "totalDoses", - "transform": "copy", - "parameter": [ { - "valueId": "totalDoses" - } ] - } ] - }, { - "name": "set country", - "source": [ { - "context": "v", - "element": "co", - "variable": "co" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "country", - "variable": "coding" - }, { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "co" - } ] - }, { - "context": "coding", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueString": "urn:iso:std:iso:3166" - } ] - } ] - } ] - }, { - "name": "TtoCoreDataSetTR", - "typeMode": "none", - "input": [ { - "name": "t", - "mode": "source" - }, { - "name": "test", - "mode": "target" - } ], - "rule": [ { - "name": "tg", - "source": [ { - "context": "t", - "element": "tg", - "variable": "tg" - } ], - "rule": [ { - "name": "set default pathogen", - "source": [ { - "context": "tg" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "pathogen", - "variable": "coding" - }, { - "context": "coding", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueString": "http://snomed.info/sct" - } ] - }, { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "tg" - } ] - } ] - }, { - "name": "coding", - "source": [ { - "context": "tg" - } ], - "target": [ { - "contextType": "variable", - "variable": "coded", - "transform": "c", - "parameter": [ { - "valueString": "http://snomed.info/sct" - }, { - "valueId": "tg" - } ] - } ], - "rule": [ { - "name": "translate COVID19 pathogen", - "source": [ { - "context": "tg", - "condition": "coded.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-pathogen-covid19-snomed')" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "pathogen", - "transform": "translate", - "parameter": [ { - "valueId": "coded" - }, { - "valueString": "http://smart.who.int/ddcc/ConceptMap/lab-test-pathogen-snomed-to-icd11" - }, { - "valueString": "Coding" - } ] - } ] - } ] - } ] - }, { - "name": "tt", - "source": [ { - "context": "t", - "element": "tt", - "variable": "tt" - } ], - "rule": [ { - "name": "set default type", - "source": [ { - "context": "tt" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "type", - "variable": "coding" - }, { - "context": "coding", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueString": "http://loinc.org" - } ] - }, { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "tt" - } ] - } ] - }, { - "name": "coding", - "source": [ { - "context": "tt" - } ], - "target": [ { - "contextType": "variable", - "variable": "coded", - "transform": "c", - "parameter": [ { - "valueString": "http://loinc.org" - }, { - "valueId": "tt" - } ] - } ], - "rule": [ { - "name": "translate COVID19 type", - "source": [ { - "context": "tt", - "condition": "coded.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-type-covid19-loinc')" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "type", - "transform": "translate", - "parameter": [ { - "valueId": "coded" - }, { - "valueString": "http://smart.who.int/ddcc/ConceptMap/lab-test-type-covid19-loinc-to-icd11" - }, { - "valueString": "Coding" - } ] - } ] - } ] - } ] - }, { - "name": "set brand", - "source": [ { - "context": "t", - "element": "nm", - "variable": "nm" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "brand", - "variable": "coding" - }, { - "context": "coding", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueString": "https://id.uvci.eu/valuesets/test-manf.json" - } ] - }, { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "nm" - } ] - } ] - }, { - "name": "set manufacturer", - "source": [ { - "context": "t", - "element": "ma", - "variable": "ma" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "manufacturer", - "variable": "coding" - }, { - "context": "coding", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueString": "https://covid-19-diagnostics.jrc.ec.europa.eu/devices" - } ] - }, { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "ma" - } ] - } ] - }, { - "name": "set date", - "source": [ { - "context": "t", - "element": "sc", - "variable": "date" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "date", - "transform": "copy", - "parameter": [ { - "valueId": "date" - } ] - } ] - }, { - "name": "tr", - "source": [ { - "context": "t", - "element": "tr", - "variable": "tr" - } ], - "rule": [ { - "name": "set default result", - "source": [ { - "context": "tr" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "result", - "variable": "coding" - }, { - "context": "coding", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueString": "http://snomed.info/sct" - } ] - }, { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "tr" - } ] - } ] - }, { - "name": "coding", - "source": [ { - "context": "tr" - } ], - "target": [ { - "contextType": "variable", - "variable": "coded", - "transform": "c", - "parameter": [ { - "valueString": "http://snomed.info/sct" - }, { - "valueId": "tr" - } ] - } ], - "rule": [ { - "name": "translate COVID19 result", - "source": [ { - "context": "tr", - "condition": "coded.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-qual-result-snomed')" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "result", - "transform": "translate", - "parameter": [ { - "valueId": "coded" - }, { - "valueString": "http://smart.who.int/ddcc/ConceptMap/lab-test-qual-result-snomed-to-icd11" - }, { - "valueString": "Coding" - } ] - } ] - } ] - } ] - }, { - "name": "set centre", - "source": [ { - "context": "t", - "element": "tc", - "variable": "tc" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "centre", - "variable": "coding" - }, { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "tc" - } ] - } ] - }, { - "name": "set country", - "source": [ { - "context": "t", - "element": "co", - "variable": "co" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "country", - "variable": "coding" - }, { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "co" - } ] - }, { - "context": "coding", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueString": "urn:iso:std:iso:3166" - } ] - } ] - } ] - } ] -} diff --git a/input/resources/StructureMap-CertDIVOCtoCoreDataSet.json b/input/resources/StructureMap-CertDIVOCtoCoreDataSet.json deleted file mode 100644 index 1f0acddc02..0000000000 --- a/input/resources/StructureMap-CertDIVOCtoCoreDataSet.json +++ /dev/null @@ -1,1127 +0,0 @@ -{ - "resourceType": "StructureMap", - "id": "CertDIVOCtoCoreDataSet", - "meta": { - "versionId": "17", - "lastUpdated": "2023-02-20T23:12:28.356+00:00" - }, - "text": { - "status": "generated", - "div": "
map "http://smart.who.int/ddcc/StructureMap/CertDIVOCtoCoreDataSet" = "CertDIVOCtoCoreDataSet"\r\n\r\n// Structure map transforming CertDIVOC logical model to bundle of Core Data Set logical model\r\n\r\nuses "http://smart.who.int/ddcc/StructureDefinition/CertDIVOC" alias DIVOC as source\r\nuses "http://hl7.org/fhir/StructureDefinition/Bundle" alias DDCCBundle as target\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet" alias DDCC as produced\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS" alias DDCCVS as produced\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-TR" alias DDCCTR as produced\r\n\r\ngroup CertDIVOCtoCoreDataSetBundle(source src : DIVOC, target ddccBundle : DDCCBundle) {\r\n  src.type as type then {\r\n    type where type = 'ProofOfVaccinationCredential' then {\r\n      src.evidence as evidence ->  ddccBundle.entry as outentry,  create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS') as ddcc then {\r\n        src.credentialSubject as credentialSubject then CredentialSubjecttoCoreDataSet(credentialSubject, ddcc) "set patient";\r\n        src -> ddcc.certificate as certificate then CertDIVOCtoCoreDataSetCertificate(src, evidence, certificate) "set certificate";\r\n        evidence -> ddcc.vaccination as vaccination then EvidencetoCoreDataSetVS(evidence, vaccination) "set vaccination";\r\n        evidence -> outentry.resource = ddcc "set outentry";\r\n      };\r\n    } "ProofOfVaccinationCredential";\r\n    type where type = 'ProofOfTestCertificateCredential' then {\r\n      src.evidence as evidence ->  ddccBundle.entry as outentry,  create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-TR') as ddcc then {\r\n        src.credentialSubject as credentialSubject then CredentialSubjecttoCoreDataSet(credentialSubject, ddcc) "set patient";\r\n        src -> ddcc.certificate as certificate then CertDIVOCtoCoreDataSetCertificate(src, evidence, certificate) "set certificate";\r\n        evidence -> ddcc.test as test then EvidencetoCoreDataSetTR(evidence, test) "set test";\r\n        evidence -> outentry.resource = ddcc "set outentry";\r\n      };\r\n    } "ProofOfTestCertificateCredential";\r\n  };\r\n}\r\n\r\ngroup CredentialSubjecttoCoreDataSet(source credentialSubject, target ddcc : DDCC) {\r\n  credentialSubject.name as name -> ddcc.name = name "set name";\r\n  credentialSubject.dob as birthDate -> ddcc.birthDate = birthDate "set birthDate";\r\n  credentialSubject.id as id ->  create('Identifier') as identifier,  identifier.value = id then {\r\n    id -> ddcc.identifier = identifier "set identifier";\r\n  } "identifier";\r\n}\r\n\r\ngroup CertDIVOCtoCoreDataSetCertificate(source src : DIVOC, source evidence, target certificate) {\r\n  evidence.certificateId as certificateId ->  certificate.hcid as hcid,  hcid.value = certificateId "set hcid";\r\n  src.context as context then {\r\n    context where (context.contains('cowin.gov.in')) -> certificate.version = context "set version";\r\n  };\r\n  evidence -> certificate.period = create('Period') as period then {\r\n    evidence.effectiveStart as effectiveStart -> period.start = effectiveStart "set period start";\r\n    evidence.effectiveUntil as effectiveUntil -> period.end = effectiveUntil "set period end";\r\n  } "period";\r\n  src.issuer as issuer ->  certificate.issuer = create('Reference') as issuer,  issuer.display = issuer "set issuer";\r\n}\r\n\r\ngroup EvidencetoCoreDataSetVS(source evidence, target vaccination) {\r\n  evidence.icd11Code as icd11Code ->  vaccination.vaccine as coding,  coding.system = 'http://id.who.int/icd11/mms',  coding.code = icd11Code "set vaccine";\r\n  evidence.vaccine as vaccine ->  vaccination.brand as coding,  coding.code = vaccine "set brand";\r\n  evidence.manufacturer as manufacturer ->  vaccination.manufacturer as coding,  coding.code = manufacturer "set manufacturer";\r\n  evidence.batch as batch -> vaccination.lot = batch "set lot";\r\n  evidence.date as date -> vaccination.date = date "set date";\r\n  evidence.dose as dose -> vaccination.dose = dose "set dose";\r\n  evidence.totalDoses as totalDoses -> vaccination.totalDoses = totalDoses "set totalDoses";\r\n  evidence.facility as facility then {\r\n    facility.address as address then {\r\n      address.addressCountry as addressCountry ->  vaccination.country as coding,  coding.system = 'urn:iso:std:iso:3166',  coding.code = addressCountry "set country";\r\n    };\r\n    facility.name as name -> vaccination.centre = name "set centre";\r\n  };\r\n  evidence.verifier as verifier then {\r\n    verifier.name as name ->  vaccination.practitioner as practitioner,  practitioner.value = name "set practitioner";\r\n  };\r\n}\r\n\r\ngroup EvidencetoCoreDataSetTR(source evidence, target test) {\r\n  evidence.disease as disease then {\r\n    disease where disease = 'COVID-19' ->  test.pathogen as coding,  coding.system = 'http://id.who.int/icd11/mms',  coding.code = 'XN109' "set COVID-19 pathogen";\r\n    disease where (disease = 'COVID-19').not() ->  test.pathogen as coding,  coding.code = disease "set other pathogen";\r\n  };\r\n  evidence.testType as testType then {\r\n    testType ->  test.type as coding,  coding.code = testType "set default type";\r\n    testType -> c('http://smart.who.int/ddcc/CodeSystem/lab-test-type-divoc', testType) as coded then {\r\n      testType where coded.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-type-divoc') -> test.type = translate(coded, 'http://smart.who.int/ddcc/ConceptMap/lab-test-type-divoc-to-icd11', 'Coding') "translate DIVOC type";\r\n    } "coding";\r\n  };\r\n  evidence.sampleOrigin as sampleOrigin then {\r\n    sampleOrigin ->  test.origin as coding,  coding.code = sampleOrigin "set default origin";\r\n    sampleOrigin -> c('http://smart.who.int/ddcc/CodeSystem/lab-test-sample-origin-divoc', sampleOrigin) as coded then {\r\n      sampleOrigin where coded.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-sample-origin-divoc') -> test.origin = translate(coded, 'http://smart.who.int/ddcc/ConceptMap/lab-test-sample-origin-divoc-to-icd11', 'Coding') "translate DIVOC origin";\r\n    } "coding";\r\n  };\r\n  evidence.result as result then {\r\n    result ->  test.result as coding,  coding.code = result "set default result";\r\n    result -> c('http://smart.who.int/ddcc/CodeSystem/lab-test-qual-result-divoc', result) as coded then {\r\n      result where coded.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-qual-result-divoc') -> test.result = translate(coded, 'http://smart.who.int/ddcc/ConceptMap/lab-test-qual-result-divoc-to-icd11', 'Coding') "translate DIVOC result";\r\n    } "coded";\r\n  };\r\n  evidence.sampleCollectionTimestamp as date -> test.date = date "set date";\r\n  evidence.testName as testName ->  test.brand as coding,  coding.code = testName "set brand";\r\n  evidence.manufacturer as manufacturer ->  test.manufacturer as coding,  coding.code = manufacturer "set manufacturer";\r\n  evidence.facility as facility then {\r\n    facility.address as address then {\r\n      address.addressCountry as addressCountry ->  test.country as coding,  coding.system = 'urn:iso:std:iso:3166',  coding.code = addressCountry "set country";\r\n    };\r\n    facility.name as name ->  test.centre as coding,  coding.code = name "set centre";\r\n  };\r\n}\r\n\r\n
" - }, - "url": "http://smart.who.int/ddcc/StructureMap/CertDIVOCtoCoreDataSet", - "name": "CertDIVOCtoCoreDataSet", - "description": "Structure map transforming CertDIVOC logical model to bundle of Core Data Set logical model", - "structure": [ { - "url": "http://smart.who.int/ddcc/StructureDefinition/CertDIVOC", - "mode": "source", - "alias": "DIVOC" - }, { - "url": "http://hl7.org/fhir/StructureDefinition/Bundle", - "mode": "target", - "alias": "DDCCBundle" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet", - "mode": "produced", - "alias": "DDCC" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS", - "mode": "produced", - "alias": "DDCCVS" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-TR", - "mode": "produced", - "alias": "DDCCTR" - } ], - "group": [ { - "name": "CertDIVOCtoCoreDataSetBundle", - "typeMode": "none", - "input": [ { - "name": "src", - "type": "DIVOC", - "mode": "source" - }, { - "name": "ddccBundle", - "type": "DDCCBundle", - "mode": "target" - } ], - "rule": [ { - "name": "type", - "source": [ { - "context": "src", - "element": "type", - "variable": "type" - } ], - "rule": [ { - "name": "ProofOfVaccinationCredential", - "source": [ { - "context": "type", - "condition": "type = 'ProofOfVaccinationCredential'" - } ], - "rule": [ { - "name": "evidence", - "source": [ { - "context": "src", - "element": "evidence", - "variable": "evidence" - } ], - "target": [ { - "context": "ddccBundle", - "contextType": "variable", - "element": "entry", - "variable": "outentry" - }, { - "contextType": "variable", - "variable": "ddcc", - "transform": "create", - "parameter": [ { - "valueString": "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS" - } ] - } ], - "rule": [ { - "name": "set patient", - "source": [ { - "context": "src", - "element": "credentialSubject", - "variable": "credentialSubject" - } ], - "dependent": [ { - "name": "CredentialSubjecttoCoreDataSet", - "variable": [ "credentialSubject", "ddcc" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - }, { - "name": "set certificate", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "certificate", - "variable": "certificate" - } ], - "dependent": [ { - "name": "CertDIVOCtoCoreDataSetCertificate", - "variable": [ "src", "evidence", "certificate" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - }, { - "name": "set vaccination", - "source": [ { - "context": "evidence" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "vaccination", - "variable": "vaccination" - } ], - "dependent": [ { - "name": "EvidencetoCoreDataSetVS", - "variable": [ "evidence", "vaccination" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - }, { - "name": "set outentry", - "source": [ { - "context": "evidence" - } ], - "target": [ { - "context": "outentry", - "contextType": "variable", - "element": "resource", - "transform": "copy", - "parameter": [ { - "valueId": "ddcc" - } ] - } ] - } ] - } ] - }, { - "name": "ProofOfTestCertificateCredential", - "source": [ { - "context": "type", - "condition": "type = 'ProofOfTestCertificateCredential'" - } ], - "rule": [ { - "name": "evidence", - "source": [ { - "context": "src", - "element": "evidence", - "variable": "evidence" - } ], - "target": [ { - "context": "ddccBundle", - "contextType": "variable", - "element": "entry", - "variable": "outentry" - }, { - "contextType": "variable", - "variable": "ddcc", - "transform": "create", - "parameter": [ { - "valueString": "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-TR" - } ] - } ], - "rule": [ { - "name": "set patient", - "source": [ { - "context": "src", - "element": "credentialSubject", - "variable": "credentialSubject" - } ], - "dependent": [ { - "name": "CredentialSubjecttoCoreDataSet", - "variable": [ "credentialSubject", "ddcc" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - }, { - "name": "set certificate", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "certificate", - "variable": "certificate" - } ], - "dependent": [ { - "name": "CertDIVOCtoCoreDataSetCertificate", - "variable": [ "src", "evidence", "certificate" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - }, { - "name": "set test", - "source": [ { - "context": "evidence" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "test", - "variable": "test" - } ], - "dependent": [ { - "name": "EvidencetoCoreDataSetTR", - "variable": [ "evidence", "test" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - }, { - "name": "set outentry", - "source": [ { - "context": "evidence" - } ], - "target": [ { - "context": "outentry", - "contextType": "variable", - "element": "resource", - "transform": "copy", - "parameter": [ { - "valueId": "ddcc" - } ] - } ] - } ] - } ] - } ] - } ] - }, { - "name": "CredentialSubjecttoCoreDataSet", - "typeMode": "none", - "input": [ { - "name": "credentialSubject", - "mode": "source" - }, { - "name": "ddcc", - "type": "DDCC", - "mode": "target" - } ], - "rule": [ { - "name": "set name", - "source": [ { - "context": "credentialSubject", - "element": "name", - "variable": "name" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "transform": "copy", - "parameter": [ { - "valueId": "name" - } ] - } ] - }, { - "name": "set birthDate", - "source": [ { - "context": "credentialSubject", - "element": "dob", - "variable": "birthDate" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "birthDate", - "transform": "copy", - "parameter": [ { - "valueId": "birthDate" - } ] - } ] - }, { - "name": "identifier", - "source": [ { - "context": "credentialSubject", - "element": "id", - "variable": "id" - } ], - "target": [ { - "contextType": "variable", - "variable": "identifier", - "transform": "create", - "parameter": [ { - "valueString": "Identifier" - } ] - }, { - "context": "identifier", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "id" - } ] - } ], - "rule": [ { - "name": "set identifier", - "source": [ { - "context": "id" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "identifier", - "transform": "copy", - "parameter": [ { - "valueId": "identifier" - } ] - } ] - } ] - } ] - }, { - "name": "CertDIVOCtoCoreDataSetCertificate", - "typeMode": "none", - "input": [ { - "name": "src", - "type": "DIVOC", - "mode": "source" - }, { - "name": "evidence", - "mode": "source" - }, { - "name": "certificate", - "mode": "target" - } ], - "rule": [ { - "name": "set hcid", - "source": [ { - "context": "evidence", - "element": "certificateId", - "variable": "certificateId" - } ], - "target": [ { - "context": "certificate", - "contextType": "variable", - "element": "hcid", - "variable": "hcid" - }, { - "context": "hcid", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "certificateId" - } ] - } ] - }, { - "name": "context", - "source": [ { - "context": "src", - "element": "context", - "variable": "context" - } ], - "rule": [ { - "name": "set version", - "source": [ { - "context": "context", - "condition": "(context.contains('cowin.gov.in'))" - } ], - "target": [ { - "context": "certificate", - "contextType": "variable", - "element": "version", - "transform": "copy", - "parameter": [ { - "valueId": "context" - } ] - } ] - } ] - }, { - "name": "period", - "source": [ { - "context": "evidence" - } ], - "target": [ { - "context": "certificate", - "contextType": "variable", - "element": "period", - "variable": "period", - "transform": "create", - "parameter": [ { - "valueString": "Period" - } ] - } ], - "rule": [ { - "name": "set period start", - "source": [ { - "context": "evidence", - "element": "effectiveStart", - "variable": "effectiveStart" - } ], - "target": [ { - "context": "period", - "contextType": "variable", - "element": "start", - "transform": "copy", - "parameter": [ { - "valueId": "effectiveStart" - } ] - } ] - }, { - "name": "set period end", - "source": [ { - "context": "evidence", - "element": "effectiveUntil", - "variable": "effectiveUntil" - } ], - "target": [ { - "context": "period", - "contextType": "variable", - "element": "end", - "transform": "copy", - "parameter": [ { - "valueId": "effectiveUntil" - } ] - } ] - } ] - }, { - "name": "set issuer", - "source": [ { - "context": "src", - "element": "issuer", - "variable": "issuer" - } ], - "target": [ { - "context": "certificate", - "contextType": "variable", - "element": "issuer", - "variable": "issuer", - "transform": "create", - "parameter": [ { - "valueString": "Reference" - } ] - }, { - "context": "issuer", - "contextType": "variable", - "element": "display", - "transform": "copy", - "parameter": [ { - "valueId": "issuer" - } ] - } ] - } ] - }, { - "name": "EvidencetoCoreDataSetVS", - "typeMode": "none", - "input": [ { - "name": "evidence", - "mode": "source" - }, { - "name": "vaccination", - "mode": "target" - } ], - "rule": [ { - "name": "set vaccine", - "source": [ { - "context": "evidence", - "element": "icd11Code", - "variable": "icd11Code" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "vaccine", - "variable": "coding" - }, { - "context": "coding", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueString": "http://id.who.int/icd11/mms" - } ] - }, { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "icd11Code" - } ] - } ] - }, { - "name": "set brand", - "source": [ { - "context": "evidence", - "element": "vaccine", - "variable": "vaccine" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "brand", - "variable": "coding" - }, { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "vaccine" - } ] - } ] - }, { - "name": "set manufacturer", - "source": [ { - "context": "evidence", - "element": "manufacturer", - "variable": "manufacturer" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "manufacturer", - "variable": "coding" - }, { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "manufacturer" - } ] - } ] - }, { - "name": "set lot", - "source": [ { - "context": "evidence", - "element": "batch", - "variable": "batch" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "lot", - "transform": "copy", - "parameter": [ { - "valueId": "batch" - } ] - } ] - }, { - "name": "set date", - "source": [ { - "context": "evidence", - "element": "date", - "variable": "date" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "date", - "transform": "copy", - "parameter": [ { - "valueId": "date" - } ] - } ] - }, { - "name": "set dose", - "source": [ { - "context": "evidence", - "element": "dose", - "variable": "dose" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "dose", - "transform": "copy", - "parameter": [ { - "valueId": "dose" - } ] - } ] - }, { - "name": "set totalDoses", - "source": [ { - "context": "evidence", - "element": "totalDoses", - "variable": "totalDoses" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "totalDoses", - "transform": "copy", - "parameter": [ { - "valueId": "totalDoses" - } ] - } ] - }, { - "name": "facility", - "source": [ { - "context": "evidence", - "element": "facility", - "variable": "facility" - } ], - "rule": [ { - "name": "address", - "source": [ { - "context": "facility", - "element": "address", - "variable": "address" - } ], - "rule": [ { - "name": "set country", - "source": [ { - "context": "address", - "element": "addressCountry", - "variable": "addressCountry" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "country", - "variable": "coding" - }, { - "context": "coding", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueString": "urn:iso:std:iso:3166" - } ] - }, { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "addressCountry" - } ] - } ] - } ] - }, { - "name": "set centre", - "source": [ { - "context": "facility", - "element": "name", - "variable": "name" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "centre", - "transform": "copy", - "parameter": [ { - "valueId": "name" - } ] - } ] - } ] - }, { - "name": "verifier", - "source": [ { - "context": "evidence", - "element": "verifier", - "variable": "verifier" - } ], - "rule": [ { - "name": "set practitioner", - "source": [ { - "context": "verifier", - "element": "name", - "variable": "name" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "practitioner", - "variable": "practitioner" - }, { - "context": "practitioner", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "name" - } ] - } ] - } ] - } ] - }, { - "name": "EvidencetoCoreDataSetTR", - "typeMode": "none", - "input": [ { - "name": "evidence", - "mode": "source" - }, { - "name": "test", - "mode": "target" - } ], - "rule": [ { - "name": "disease", - "source": [ { - "context": "evidence", - "element": "disease", - "variable": "disease" - } ], - "rule": [ { - "name": "set COVID-19 pathogen", - "source": [ { - "context": "disease", - "condition": "disease = 'COVID-19'" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "pathogen", - "variable": "coding" - }, { - "context": "coding", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueString": "http://id.who.int/icd11/mms" - } ] - }, { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueString": "XN109" - } ] - } ] - }, { - "name": "set other pathogen", - "source": [ { - "context": "disease", - "condition": "(disease = 'COVID-19').not()" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "pathogen", - "variable": "coding" - }, { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "disease" - } ] - } ] - } ] - }, { - "name": "testType", - "source": [ { - "context": "evidence", - "element": "testType", - "variable": "testType" - } ], - "rule": [ { - "name": "set default type", - "source": [ { - "context": "testType" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "type", - "variable": "coding" - }, { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "testType" - } ] - } ] - }, { - "name": "coding", - "source": [ { - "context": "testType" - } ], - "target": [ { - "contextType": "variable", - "variable": "coded", - "transform": "c", - "parameter": [ { - "valueString": "http://smart.who.int/ddcc/CodeSystem/lab-test-type-divoc" - }, { - "valueId": "testType" - } ] - } ], - "rule": [ { - "name": "translate DIVOC type", - "source": [ { - "context": "testType", - "condition": "coded.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-type-divoc')" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "type", - "transform": "translate", - "parameter": [ { - "valueId": "coded" - }, { - "valueString": "http://smart.who.int/ddcc/ConceptMap/lab-test-type-divoc-to-icd11" - }, { - "valueString": "Coding" - } ] - } ] - } ] - } ] - }, { - "name": "sampleOrigin", - "source": [ { - "context": "evidence", - "element": "sampleOrigin", - "variable": "sampleOrigin" - } ], - "rule": [ { - "name": "set default origin", - "source": [ { - "context": "sampleOrigin" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "origin", - "variable": "coding" - }, { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "sampleOrigin" - } ] - } ] - }, { - "name": "coding", - "source": [ { - "context": "sampleOrigin" - } ], - "target": [ { - "contextType": "variable", - "variable": "coded", - "transform": "c", - "parameter": [ { - "valueString": "http://smart.who.int/ddcc/CodeSystem/lab-test-sample-origin-divoc" - }, { - "valueId": "sampleOrigin" - } ] - } ], - "rule": [ { - "name": "translate DIVOC origin", - "source": [ { - "context": "sampleOrigin", - "condition": "coded.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-sample-origin-divoc')" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "origin", - "transform": "translate", - "parameter": [ { - "valueId": "coded" - }, { - "valueString": "http://smart.who.int/ddcc/ConceptMap/lab-test-sample-origin-divoc-to-icd11" - }, { - "valueString": "Coding" - } ] - } ] - } ] - } ] - }, { - "name": "result", - "source": [ { - "context": "evidence", - "element": "result", - "variable": "result" - } ], - "rule": [ { - "name": "set default result", - "source": [ { - "context": "result" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "result", - "variable": "coding" - }, { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "result" - } ] - } ] - }, { - "name": "coded", - "source": [ { - "context": "result" - } ], - "target": [ { - "contextType": "variable", - "variable": "coded", - "transform": "c", - "parameter": [ { - "valueString": "http://smart.who.int/ddcc/CodeSystem/lab-test-qual-result-divoc" - }, { - "valueId": "result" - } ] - } ], - "rule": [ { - "name": "translate DIVOC result", - "source": [ { - "context": "result", - "condition": "coded.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-qual-result-divoc')" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "result", - "transform": "translate", - "parameter": [ { - "valueId": "coded" - }, { - "valueString": "http://smart.who.int/ddcc/ConceptMap/lab-test-qual-result-divoc-to-icd11" - }, { - "valueString": "Coding" - } ] - } ] - } ] - } ] - }, { - "name": "set date", - "source": [ { - "context": "evidence", - "element": "sampleCollectionTimestamp", - "variable": "date" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "date", - "transform": "copy", - "parameter": [ { - "valueId": "date" - } ] - } ] - }, { - "name": "set brand", - "source": [ { - "context": "evidence", - "element": "testName", - "variable": "testName" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "brand", - "variable": "coding" - }, { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "testName" - } ] - } ] - }, { - "name": "set manufacturer", - "source": [ { - "context": "evidence", - "element": "manufacturer", - "variable": "manufacturer" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "manufacturer", - "variable": "coding" - }, { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "manufacturer" - } ] - } ] - }, { - "name": "facility", - "source": [ { - "context": "evidence", - "element": "facility", - "variable": "facility" - } ], - "rule": [ { - "name": "address", - "source": [ { - "context": "facility", - "element": "address", - "variable": "address" - } ], - "rule": [ { - "name": "set country", - "source": [ { - "context": "address", - "element": "addressCountry", - "variable": "addressCountry" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "country", - "variable": "coding" - }, { - "context": "coding", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueString": "urn:iso:std:iso:3166" - } ] - }, { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "addressCountry" - } ] - } ] - } ] - }, { - "name": "set centre", - "source": [ { - "context": "facility", - "element": "name", - "variable": "name" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "centre", - "variable": "coding" - }, { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "name" - } ] - } ] - } ] - } ] - } ] -} diff --git a/input/resources/StructureMap-CertICAOtoCoreDataSet.json b/input/resources/StructureMap-CertICAOtoCoreDataSet.json deleted file mode 100644 index be353e1489..0000000000 --- a/input/resources/StructureMap-CertICAOtoCoreDataSet.json +++ /dev/null @@ -1,1247 +0,0 @@ -{ - "resourceType": "StructureMap", - "id": "CertICAOtoCoreDataSet", - "meta": { - "versionId": "15", - "lastUpdated": "2023-02-21T00:05:31.658+00:00" - }, - "text": { - "status": "generated", - "div": "
map "http://smart.who.int/ddcc/StructureMap/CertICAOtoCoreDataSet" = "CertICAOtoCoreDataSet"\r\n\r\n// Structure map transforming CertICAO logical model to bundle of Core Data Set logical model\r\n\r\nuses "http://smart.who.int/ddcc/StructureDefinition/CertICAOVDS" alias VDS as source\r\nuses "http://hl7.org/fhir/StructureDefinition/Bundle" alias DDCCBundle as target\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet" alias DDCC as produced\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS" alias DDCCVS as produced\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-TR" alias DDCCTR as produced\r\n\r\ngroup CertICAOtoCoreDataSet(source src : VDS, target ddccBundle : DDCCBundle) {\r\n  src.data as data then {\r\n    data.msg as msg then {\r\n      msg.ve as ve then {\r\n        ve.vd as vd ->  ddccBundle.entry as outentry,  create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS') as ddcc then {\r\n          data.hdr as hdr -> ddcc.certificate as certificate then VDStoCoreDataSetCertificate(hdr, msg, certificate) "set certificate";\r\n          msg.pid as pid then ExtractPatient(pid, ddcc) "set patient";\r\n          vd -> ddcc.vaccination as vaccination then ExtractVaccine(ve, vd, vaccination) "set vaccination";\r\n          vd -> outentry.resource = ddcc "set outentry";\r\n        };\r\n      };\r\n      msg.tr as tr ->  ddccBundle.entry as outentry,  create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-TR') as ddcc then {\r\n        data.hdr as hdr -> ddcc.certificate as certificate then VDStoCoreDataSetCertificate(hdr, msg, certificate) "set certificate";\r\n        msg.pid as pid then ExtractPatient(pid, ddcc) "set patient";\r\n        msg.sp as sp then {\r\n          msg.dat as dat -> ddcc.test as test then ExtractTest(sp, dat, tr, test) "set test";\r\n        };\r\n        tr -> outentry.resource = ddcc "set outentry";\r\n      };\r\n    };\r\n  };\r\n}\r\n\r\ngroup VDStoCoreDataSetCertificate(source hdr, source msg, target certificate) {\r\n  hdr.v as v -> certificate.version = v "set version";\r\n  msg.uvci as uvci ->  certificate.hcid as hcid,  hcid.value = uvci "set hcid from uvci";\r\n  msg.utci as utci ->  certificate.hcid as hcid,  hcid.value = utci "set hcid from utci";\r\n  hdr.is as is ->  certificate.issuer = create('Reference') as issuer,  issuer.display = is "set issuer";\r\n}\r\n\r\ngroup ExtractPatient(source pid, target ddcc : DDCC) {\r\n  pid.n as name -> ddcc.name = name "set name";\r\n  pid.dob as birthDate -> ddcc.birthDate = birthDate "set birthDate";\r\n  pid.i as priorityIdentifier ->  ddcc.identifier as identifier,  identifier.value = priorityIdentifier "set priorityIdentifier";\r\n  pid.dn -> ddcc.identifier as identifier then ExtractDocumentTypeNumber(pid, identifier) "set Document Type Number";\r\n}\r\n\r\ngroup ExtractDocumentTypeNumber(source src, target identif : Identifier) {\r\n  src.dn as docNumber -> identif.value = docNumber "set doc number";\r\n  src.dt as docType where (docType = 'P') -> identif.system = 'PPN' "set doc number P";\r\n  // P – Passport (Doc 9303-4)\r\n  src.dt as docType where (docType = 'A') -> identif.system = 'DL' "set doc number A";\r\n  // A – ID Card (Doc 9303-5)\r\n  src.dt as docType where (docType = 'C') -> identif.system = 'DL' "set doc number C";\r\n  // C – ID Card (Doc 9303-5)\r\n  src.dt as docType where (docType = 'I') -> identif.system = 'DL' "set doc number I";\r\n  // I – ID Card Doc 9303-5)\r\n  src.dt as docType where (docType = 'AC') -> identif.system = 'EN' "set doc number AC";\r\n  // AC - Crew Member Certificate (Doc 9303-5)\r\n  src.dt as docType where (docType = 'V') -> identif.system = 'ACSN' "set doc number V";\r\n  // V – Visa (Doc 9303-7)\r\n  src.dt as docType where (docType = 'D') -> identif.system = 'DL' "set doc number D";\r\n}\r\n\r\ngroup ExtractVaccine(source ve, source vd, target vaccination) {\r\n  ve.des as des ->  vaccination.vaccine as coding,  coding.system = 'http://id.who.int/icd11/mms',  coding.code = des "set vaccine";\r\n  // brand code system is "As defined by member state"\r\n  ve.nam as nam ->  vaccination.brand as coding,  coding.code = nam "set brand";\r\n  ve.dis as dis ->  vaccination.disease as coding,  coding.system = 'http://id.who.int/icd11/mms',  coding.code = dis "set target disease";\r\n  vd.dvc as dvc -> vaccination.date = dvc "set date";\r\n  vd.seq as seq -> vaccination.dose = seq "set dose";\r\n  vd.dvn as dvn -> vaccination.nextDose = dvn "set nextDose";\r\n  vd.ctr as ctr -> vaccination.country as coding then {\r\n    ctr then ExtractCountry(ctr, coding) "set country";\r\n  };\r\n  vd.adm as adm -> vaccination.centre = adm "set centre";\r\n  vd.lot as lot -> vaccination.lot = lot "set lot";\r\n}\r\n\r\ngroup ExtractTest(source sp, source dat, source tr, target test) {\r\n  tr ->  test.pathogen as coding,  coding.system = 'http://id.who.int/icd11/mms',  coding.code = 'XN109' "set pathogen";\r\n  tr.tc as tc then {\r\n    tc ->  test.type as coding,  coding.code = tc "set default type";\r\n    tc -> c('http://smart.who.int/ddcc/CodeSystem/lab-test-type-icao', tc) as coded then {\r\n      tc where coded.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-type-icao') -> test.type = translate(coded, 'http://smart.who.int/ddcc/ConceptMap/lab-test-type-icao-to-icd11', 'Coding') "translate ICAO type";\r\n    } "coding";\r\n  };\r\n  tr.m as m then {\r\n    m ->  test.origin as coding,  coding.code = m "set default origin";\r\n    m -> c('http://smart.who.int/ddcc/CodeSystem/lab-test-sample-origin-icao', m) as coded then {\r\n      m where coded.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-sample-origin-icao') -> test.origin = translate(coded, 'http://smart.who.int/ddcc/ConceptMap/lab-test-sample-origin-icao-to-icd11', 'Coding') "translate ICAO origin";\r\n    } "coding";\r\n  };\r\n  dat.sc as date -> test.date = date "set date";\r\n  tr.r as r then {\r\n    r ->  test.result as coding,  coding.code = r "set default result";\r\n    r -> c('http://smart.who.int/ddcc/CodeSystem/lab-test-qual-result-icao', r) as coded then {\r\n      r where coded.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-qual-result-icao') -> test.result = translate(coded, 'http://smart.who.int/ddcc/ConceptMap/lab-test-qual-result-icao-to-icd11', 'Coding') "translate ICAO result";\r\n    } "coding";\r\n  };\r\n  sp.spn as spn ->  test.centre as coding,  coding.code = spn "set centre";\r\n  sp.ctr as ctr -> test.country as coding then {\r\n    ctr then ExtractCountry(ctr, coding) "set country";\r\n  };\r\n}\r\n\r\ngroup ExtractCountry(source country, target coding) {\r\n  // ICAO Doc 9303-1 country codes are a superset of ISO 3166 3 letter codes\r\n  country -> coding.code = country "set default country";\r\n  country -> c('urn:iso:std:iso:3166', country) as coded then {\r\n    country where coded.memberOf('http://hl7.org/fhir/ValueSet/iso3166-1-3') ->  coding.code = country,  coding.system = 'urn:iso:std:iso:3166' "set country with system";\r\n  } "coded";\r\n}\r\n\r\n
" - }, - "url": "http://smart.who.int/ddcc/StructureMap/CertICAOtoCoreDataSet", - "name": "CertICAOtoCoreDataSet", - "description": "Structure map transforming CertICAO logical model to bundle of Core Data Set logical model", - "structure": [ { - "url": "http://smart.who.int/ddcc/StructureDefinition/CertICAOVDS", - "mode": "source", - "alias": "VDS" - }, { - "url": "http://hl7.org/fhir/StructureDefinition/Bundle", - "mode": "target", - "alias": "DDCCBundle" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet", - "mode": "produced", - "alias": "DDCC" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS", - "mode": "produced", - "alias": "DDCCVS" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-TR", - "mode": "produced", - "alias": "DDCCTR" - } ], - "group": [ { - "name": "CertICAOtoCoreDataSet", - "typeMode": "none", - "input": [ { - "name": "src", - "type": "VDS", - "mode": "source" - }, { - "name": "ddccBundle", - "type": "DDCCBundle", - "mode": "target" - } ], - "rule": [ { - "name": "data", - "source": [ { - "context": "src", - "element": "data", - "variable": "data" - } ], - "rule": [ { - "name": "msg", - "source": [ { - "context": "data", - "element": "msg", - "variable": "msg" - } ], - "rule": [ { - "name": "ve", - "source": [ { - "context": "msg", - "element": "ve", - "variable": "ve" - } ], - "rule": [ { - "name": "vd", - "source": [ { - "context": "ve", - "element": "vd", - "variable": "vd" - } ], - "target": [ { - "context": "ddccBundle", - "contextType": "variable", - "element": "entry", - "variable": "outentry" - }, { - "contextType": "variable", - "variable": "ddcc", - "transform": "create", - "parameter": [ { - "valueString": "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS" - } ] - } ], - "rule": [ { - "name": "set certificate", - "source": [ { - "context": "data", - "element": "hdr", - "variable": "hdr" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "certificate", - "variable": "certificate" - } ], - "dependent": [ { - "name": "VDStoCoreDataSetCertificate", - "variable": [ "hdr", "msg", "certificate" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - }, { - "name": "set patient", - "source": [ { - "context": "msg", - "element": "pid", - "variable": "pid" - } ], - "dependent": [ { - "name": "ExtractPatient", - "variable": [ "pid", "ddcc" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - }, { - "name": "set vaccination", - "source": [ { - "context": "vd" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "vaccination", - "variable": "vaccination" - } ], - "dependent": [ { - "name": "ExtractVaccine", - "variable": [ "ve", "vd", "vaccination" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - }, { - "name": "set outentry", - "source": [ { - "context": "vd" - } ], - "target": [ { - "context": "outentry", - "contextType": "variable", - "element": "resource", - "transform": "copy", - "parameter": [ { - "valueId": "ddcc" - } ] - } ] - } ] - } ] - }, { - "name": "tr", - "source": [ { - "context": "msg", - "element": "tr", - "variable": "tr" - } ], - "target": [ { - "context": "ddccBundle", - "contextType": "variable", - "element": "entry", - "variable": "outentry" - }, { - "contextType": "variable", - "variable": "ddcc", - "transform": "create", - "parameter": [ { - "valueString": "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-TR" - } ] - } ], - "rule": [ { - "name": "set certificate", - "source": [ { - "context": "data", - "element": "hdr", - "variable": "hdr" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "certificate", - "variable": "certificate" - } ], - "dependent": [ { - "name": "VDStoCoreDataSetCertificate", - "variable": [ "hdr", "msg", "certificate" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - }, { - "name": "set patient", - "source": [ { - "context": "msg", - "element": "pid", - "variable": "pid" - } ], - "dependent": [ { - "name": "ExtractPatient", - "variable": [ "pid", "ddcc" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - }, { - "name": "sp", - "source": [ { - "context": "msg", - "element": "sp", - "variable": "sp" - } ], - "rule": [ { - "name": "set test", - "source": [ { - "context": "msg", - "element": "dat", - "variable": "dat" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "test", - "variable": "test" - } ], - "dependent": [ { - "name": "ExtractTest", - "variable": [ "sp", "dat", "tr", "test" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - } ] - }, { - "name": "set outentry", - "source": [ { - "context": "tr" - } ], - "target": [ { - "context": "outentry", - "contextType": "variable", - "element": "resource", - "transform": "copy", - "parameter": [ { - "valueId": "ddcc" - } ] - } ] - } ] - } ] - } ] - } ] - }, { - "name": "VDStoCoreDataSetCertificate", - "typeMode": "none", - "input": [ { - "name": "hdr", - "mode": "source" - }, { - "name": "msg", - "mode": "source" - }, { - "name": "certificate", - "mode": "target" - } ], - "rule": [ { - "name": "set version", - "source": [ { - "context": "hdr", - "element": "v", - "variable": "v" - } ], - "target": [ { - "context": "certificate", - "contextType": "variable", - "element": "version", - "transform": "copy", - "parameter": [ { - "valueId": "v" - } ] - } ] - }, { - "name": "set hcid from uvci", - "source": [ { - "context": "msg", - "element": "uvci", - "variable": "uvci" - } ], - "target": [ { - "context": "certificate", - "contextType": "variable", - "element": "hcid", - "variable": "hcid" - }, { - "context": "hcid", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "uvci" - } ] - } ] - }, { - "name": "set hcid from utci", - "source": [ { - "context": "msg", - "element": "utci", - "variable": "utci" - } ], - "target": [ { - "context": "certificate", - "contextType": "variable", - "element": "hcid", - "variable": "hcid" - }, { - "context": "hcid", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "utci" - } ] - } ] - }, { - "name": "set issuer", - "source": [ { - "context": "hdr", - "element": "is", - "variable": "is" - } ], - "target": [ { - "context": "certificate", - "contextType": "variable", - "element": "issuer", - "variable": "issuer", - "transform": "create", - "parameter": [ { - "valueString": "Reference" - } ] - }, { - "context": "issuer", - "contextType": "variable", - "element": "display", - "transform": "copy", - "parameter": [ { - "valueId": "is" - } ] - } ] - } ] - }, { - "name": "ExtractPatient", - "typeMode": "none", - "input": [ { - "name": "pid", - "mode": "source" - }, { - "name": "ddcc", - "type": "DDCC", - "mode": "target" - } ], - "rule": [ { - "name": "set name", - "source": [ { - "context": "pid", - "element": "n", - "variable": "name" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "transform": "copy", - "parameter": [ { - "valueId": "name" - } ] - } ] - }, { - "name": "set birthDate", - "source": [ { - "context": "pid", - "element": "dob", - "variable": "birthDate" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "birthDate", - "transform": "copy", - "parameter": [ { - "valueId": "birthDate" - } ] - } ] - }, { - "name": "set priorityIdentifier", - "source": [ { - "context": "pid", - "element": "i", - "variable": "priorityIdentifier" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "identifier", - "variable": "identifier" - }, { - "context": "identifier", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "priorityIdentifier" - } ] - } ] - }, { - "name": "set Document Type Number", - "source": [ { - "context": "pid", - "element": "dn" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "identifier", - "variable": "identifier" - } ], - "dependent": [ { - "name": "ExtractDocumentTypeNumber", - "variable": [ "pid", "identifier" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - } ] - }, { - "name": "ExtractDocumentTypeNumber", - "typeMode": "none", - "input": [ { - "name": "src", - "mode": "source" - }, { - "name": "identif", - "type": "Identifier", - "mode": "target" - } ], - "rule": [ { - "name": "set doc number", - "source": [ { - "context": "src", - "element": "dn", - "variable": "docNumber" - } ], - "target": [ { - "context": "identif", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "docNumber" - } ] - } ] - }, { - "name": "set doc number P", - "source": [ { - "context": "src", - "element": "dt", - "variable": "docType", - "condition": "(docType = 'P')" - } ], - "target": [ { - "context": "identif", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueString": "PPN" - } ] - } ] - }, { - "name": "set doc number A", - "source": [ { - "context": "src", - "element": "dt", - "variable": "docType", - "condition": "(docType = 'A')" - } ], - "target": [ { - "context": "identif", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueString": "DL" - } ] - } ], - "documentation": "P – Passport (Doc 9303-4)" - }, { - "name": "set doc number C", - "source": [ { - "context": "src", - "element": "dt", - "variable": "docType", - "condition": "(docType = 'C')" - } ], - "target": [ { - "context": "identif", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueString": "DL" - } ] - } ], - "documentation": "A – ID Card (Doc 9303-5)" - }, { - "name": "set doc number I", - "source": [ { - "context": "src", - "element": "dt", - "variable": "docType", - "condition": "(docType = 'I')" - } ], - "target": [ { - "context": "identif", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueString": "DL" - } ] - } ], - "documentation": "C – ID Card (Doc 9303-5)" - }, { - "name": "set doc number AC", - "source": [ { - "context": "src", - "element": "dt", - "variable": "docType", - "condition": "(docType = 'AC')" - } ], - "target": [ { - "context": "identif", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueString": "EN" - } ] - } ], - "documentation": "I – ID Card Doc 9303-5)" - }, { - "name": "set doc number V", - "source": [ { - "context": "src", - "element": "dt", - "variable": "docType", - "condition": "(docType = 'V')" - } ], - "target": [ { - "context": "identif", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueString": "ACSN" - } ] - } ], - "documentation": "AC - Crew Member Certificate (Doc 9303-5)" - }, { - "name": "set doc number D", - "source": [ { - "context": "src", - "element": "dt", - "variable": "docType", - "condition": "(docType = 'D')" - } ], - "target": [ { - "context": "identif", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueString": "DL" - } ] - } ], - "documentation": "V – Visa (Doc 9303-7)" - } ] - }, { - "name": "ExtractVaccine", - "typeMode": "none", - "input": [ { - "name": "ve", - "mode": "source" - }, { - "name": "vd", - "mode": "source" - }, { - "name": "vaccination", - "mode": "target" - } ], - "rule": [ { - "name": "set vaccine", - "source": [ { - "context": "ve", - "element": "des", - "variable": "des" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "vaccine", - "variable": "coding" - }, { - "context": "coding", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueString": "http://id.who.int/icd11/mms" - } ] - }, { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "des" - } ] - } ] - }, { - "name": "set brand", - "source": [ { - "context": "ve", - "element": "nam", - "variable": "nam" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "brand", - "variable": "coding" - }, { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "nam" - } ] - } ], - "documentation": "brand code system is \"As defined by member state\"" - }, { - "name": "set target disease", - "source": [ { - "context": "ve", - "element": "dis", - "variable": "dis" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "disease", - "variable": "coding" - }, { - "context": "coding", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueString": "http://id.who.int/icd11/mms" - } ] - }, { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "dis" - } ] - } ] - }, { - "name": "set date", - "source": [ { - "context": "vd", - "element": "dvc", - "variable": "dvc" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "date", - "transform": "copy", - "parameter": [ { - "valueId": "dvc" - } ] - } ] - }, { - "name": "set dose", - "source": [ { - "context": "vd", - "element": "seq", - "variable": "seq" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "dose", - "transform": "copy", - "parameter": [ { - "valueId": "seq" - } ] - } ] - }, { - "name": "set nextDose", - "source": [ { - "context": "vd", - "element": "dvn", - "variable": "dvn" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "nextDose", - "transform": "copy", - "parameter": [ { - "valueId": "dvn" - } ] - } ] - }, { - "name": "ctr", - "source": [ { - "context": "vd", - "element": "ctr", - "variable": "ctr" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "country", - "variable": "coding" - } ], - "rule": [ { - "name": "set country", - "source": [ { - "context": "ctr" - } ], - "dependent": [ { - "name": "ExtractCountry", - "variable": [ "ctr", "coding" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - } ] - }, { - "name": "set centre", - "source": [ { - "context": "vd", - "element": "adm", - "variable": "adm" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "centre", - "transform": "copy", - "parameter": [ { - "valueId": "adm" - } ] - } ] - }, { - "name": "set lot", - "source": [ { - "context": "vd", - "element": "lot", - "variable": "lot" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "lot", - "transform": "copy", - "parameter": [ { - "valueId": "lot" - } ] - } ] - } ] - }, { - "name": "ExtractTest", - "typeMode": "none", - "input": [ { - "name": "sp", - "mode": "source" - }, { - "name": "dat", - "mode": "source" - }, { - "name": "tr", - "mode": "source" - }, { - "name": "test", - "mode": "target" - } ], - "rule": [ { - "name": "set pathogen", - "source": [ { - "context": "tr" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "pathogen", - "variable": "coding" - }, { - "context": "coding", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueString": "http://id.who.int/icd11/mms" - } ] - }, { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueString": "XN109" - } ] - } ] - }, { - "name": "tc", - "source": [ { - "context": "tr", - "element": "tc", - "variable": "tc" - } ], - "rule": [ { - "name": "set default type", - "source": [ { - "context": "tc" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "type", - "variable": "coding" - }, { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "tc" - } ] - } ] - }, { - "name": "coding", - "source": [ { - "context": "tc" - } ], - "target": [ { - "contextType": "variable", - "variable": "coded", - "transform": "c", - "parameter": [ { - "valueString": "http://smart.who.int/ddcc/CodeSystem/lab-test-type-icao" - }, { - "valueId": "tc" - } ] - } ], - "rule": [ { - "name": "translate ICAO type", - "source": [ { - "context": "tc", - "condition": "coded.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-type-icao')" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "type", - "transform": "translate", - "parameter": [ { - "valueId": "coded" - }, { - "valueString": "http://smart.who.int/ddcc/ConceptMap/lab-test-type-icao-to-icd11" - }, { - "valueString": "Coding" - } ] - } ] - } ] - } ] - }, { - "name": "m", - "source": [ { - "context": "tr", - "element": "m", - "variable": "m" - } ], - "rule": [ { - "name": "set default origin", - "source": [ { - "context": "m" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "origin", - "variable": "coding" - }, { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "m" - } ] - } ] - }, { - "name": "coding", - "source": [ { - "context": "m" - } ], - "target": [ { - "contextType": "variable", - "variable": "coded", - "transform": "c", - "parameter": [ { - "valueString": "http://smart.who.int/ddcc/CodeSystem/lab-test-sample-origin-icao" - }, { - "valueId": "m" - } ] - } ], - "rule": [ { - "name": "translate ICAO origin", - "source": [ { - "context": "m", - "condition": "coded.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-sample-origin-icao')" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "origin", - "transform": "translate", - "parameter": [ { - "valueId": "coded" - }, { - "valueString": "http://smart.who.int/ddcc/ConceptMap/lab-test-sample-origin-icao-to-icd11" - }, { - "valueString": "Coding" - } ] - } ] - } ] - } ] - }, { - "name": "set date", - "source": [ { - "context": "dat", - "element": "sc", - "variable": "date" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "date", - "transform": "copy", - "parameter": [ { - "valueId": "date" - } ] - } ] - }, { - "name": "r", - "source": [ { - "context": "tr", - "element": "r", - "variable": "r" - } ], - "rule": [ { - "name": "set default result", - "source": [ { - "context": "r" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "result", - "variable": "coding" - }, { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "r" - } ] - } ] - }, { - "name": "coding", - "source": [ { - "context": "r" - } ], - "target": [ { - "contextType": "variable", - "variable": "coded", - "transform": "c", - "parameter": [ { - "valueString": "http://smart.who.int/ddcc/CodeSystem/lab-test-qual-result-icao" - }, { - "valueId": "r" - } ] - } ], - "rule": [ { - "name": "translate ICAO result", - "source": [ { - "context": "r", - "condition": "coded.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-qual-result-icao')" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "result", - "transform": "translate", - "parameter": [ { - "valueId": "coded" - }, { - "valueString": "http://smart.who.int/ddcc/ConceptMap/lab-test-qual-result-icao-to-icd11" - }, { - "valueString": "Coding" - } ] - } ] - } ] - } ] - }, { - "name": "set centre", - "source": [ { - "context": "sp", - "element": "spn", - "variable": "spn" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "centre", - "variable": "coding" - }, { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "spn" - } ] - } ] - }, { - "name": "ctr", - "source": [ { - "context": "sp", - "element": "ctr", - "variable": "ctr" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "country", - "variable": "coding" - } ], - "rule": [ { - "name": "set country", - "source": [ { - "context": "ctr" - } ], - "dependent": [ { - "name": "ExtractCountry", - "variable": [ "ctr", "coding" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - } ] - } ] - }, { - "name": "ExtractCountry", - "typeMode": "none", - "input": [ { - "name": "country", - "mode": "source" - }, { - "name": "coding", - "mode": "target" - } ], - "rule": [ { - "name": "set default country", - "source": [ { - "context": "country" - } ], - "target": [ { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "country" - } ] - } ], - "documentation": "ICAO Doc 9303-1 country codes are a superset of ISO 3166 3 letter codes" - }, { - "name": "coded", - "source": [ { - "context": "country" - } ], - "target": [ { - "contextType": "variable", - "variable": "coded", - "transform": "c", - "parameter": [ { - "valueString": "urn:iso:std:iso:3166" - }, { - "valueId": "country" - } ] - } ], - "rule": [ { - "name": "set country with system", - "source": [ { - "context": "country", - "condition": "coded.memberOf('http://hl7.org/fhir/ValueSet/iso3166-1-3')" - } ], - "target": [ { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "country" - } ] - }, { - "context": "coding", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueString": "urn:iso:std:iso:3166" - } ] - } ] - } ] - } ] - } ] -} diff --git a/input/resources/StructureMap-CertSHCtoCoreDataSet.json b/input/resources/StructureMap-CertSHCtoCoreDataSet.json deleted file mode 100644 index d659c76cc6..0000000000 --- a/input/resources/StructureMap-CertSHCtoCoreDataSet.json +++ /dev/null @@ -1,483 +0,0 @@ -{ - "resourceType": "StructureMap", - "id": "CertSHCtoCoreDataSet", - "meta": { - "versionId": "6", - "lastUpdated": "2023-02-07T17:09:07.618+00:00" - }, - "text": { - "status": "generated", - "div": "
map "http://smart.who.int/ddcc/StructureMap/CertSHCtoCoreDataSet" = "CertSHCtoCoreDataSet"\r\n\r\n// Structure map transforming CertSHC logical model to bundle of Core Data Set logical model\r\n\r\nuses "http://smart.who.int/ddcc/StructureDefinition/CertSHC" alias JWTPayload as source\r\nuses "http://hl7.org/fhir/StructureDefinition/Bundle" alias DDCCBundle as target\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet" alias DDCC as produced\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS" alias DDCCVS as produced\r\n\r\nimports "http://smart.who.int/ddcc/StructureMap/SHCToCoreDataSetVS"\r\nimports "http://smart.who.int/ddcc/StructureMap/SHCToCoreDataSetTR"\r\n\r\ngroup CertSHCtoCoreDataSetBundle(source src : JWTPayload, target ddccBundle : Bundle) {\r\n  src.vc as vc then {\r\n    vc.credentialSubject as credentialSubject then {\r\n      credentialSubject.fhirBundle as fhirBundle then {\r\n        fhirBundle.entry as patientEntrySHC then {\r\n          patientEntrySHC.resource : Patient first as patient then {\r\n            fhirBundle.entry as entry then {\r\n              entry.resource : Immunization as immunization ->  ddccBundle.entry as outentry,  create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS') as ddcc then {\r\n                immunization then PatientToDDCCVS(patient, ddcc) "set patient";\r\n                immunization -> ddcc.vaccination as vaccination then ImmunizationToDDCC(immunization, vaccination) "set vaccination";\r\n                immunization then CertSHCtoCoreDataSet(src, ddcc) "set ddcc";\r\n                immunization -> outentry.resource = ddcc "set outentry";\r\n              } "immunizations";\r\n              entry.resource : Observation as lab ->  ddccBundle.entry as outentry,  create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-TR') as ddcc then {\r\n                lab then PatientToDDCCTR(patient, ddcc) "set patient";\r\n                lab -> ddcc.test as test then LabToDDCC(lab, test) "set test";\r\n                lab then CertSHCtoCoreDataSet(src, ddcc) "set ddcc";\r\n                lab -> outentry.resource = ddcc "set outentry";\r\n              } "labs";\r\n            } "entries";\r\n          } "get patient";\r\n        } "find patient";\r\n      };\r\n    };\r\n  };\r\n}\r\n\r\ngroup CertSHCtoCoreDataSet(source src : JWTPayload, target ddcc : DDCC) {\r\n  src -> ddcc.certificate as cert then {\r\n    src.iss -> cert.issuer = create('Reference') as issuer then {\r\n      src.iss as iss -> issuer.reference = iss "set issuer";\r\n    } "issuer";\r\n    src -> cert.period = create('Period') as period then {\r\n      src then JwtToPeriod(src, period) "set period";\r\n    } "period";\r\n  } "certificate";\r\n}\r\n\r\ngroup JwtToPeriod(source src : JWTPayload, target tgt : Period) {\r\n  src.nbf as nbf ->  append(nbf, ' seconds') as epoch,  tgt.start = (@1970-01-01T00:00:00.000+00:00 + epoch.toQuantity()) "set period start to notBefore";\r\n  src.iat as iat ->  append(iat, ' seconds') as epoch,  tgt.start = (@1970-01-01T00:00:00.000+00:00 + epoch.toQuantity()) "set period start to  issuedAt";\r\n  src.exp as exp ->  append(exp, ' seconds') as epoch,  tgt.end = (@1970-01-01T00:00:00.000+00:00 + epoch.toQuantity()) "set period end";\r\n}\r\n\r\n
" - }, - "url": "http://smart.who.int/ddcc/StructureMap/CertSHCtoCoreDataSet", - "name": "CertSHCtoCoreDataSet", - "description": "Structure map transforming CertSHC logical model to bundle of Core Data Set logical model", - "structure": [ { - "url": "http://smart.who.int/ddcc/StructureDefinition/CertSHC", - "mode": "source", - "alias": "JWTPayload" - }, { - "url": "http://hl7.org/fhir/StructureDefinition/Bundle", - "mode": "target", - "alias": "DDCCBundle" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet", - "mode": "produced", - "alias": "DDCC" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS", - "mode": "produced", - "alias": "DDCCVS" - } ], - "import": [ "http://smart.who.int/ddcc/StructureMap/SHCToCoreDataSetVS", "http://smart.who.int/ddcc/StructureMap/SHCToCoreDataSetTR" ], - "group": [ { - "name": "CertSHCtoCoreDataSetBundle", - "typeMode": "none", - "input": [ { - "name": "src", - "type": "JWTPayload", - "mode": "source" - }, { - "name": "ddccBundle", - "type": "Bundle", - "mode": "target" - } ], - "rule": [ { - "name": "vc", - "source": [ { - "context": "src", - "element": "vc", - "variable": "vc" - } ], - "rule": [ { - "name": "credentialSubject", - "source": [ { - "context": "vc", - "element": "credentialSubject", - "variable": "credentialSubject" - } ], - "rule": [ { - "name": "fhirBundle", - "source": [ { - "context": "credentialSubject", - "element": "fhirBundle", - "variable": "fhirBundle" - } ], - "rule": [ { - "name": "find patient", - "source": [ { - "context": "fhirBundle", - "element": "entry", - "variable": "patientEntrySHC" - } ], - "rule": [ { - "name": "get patient", - "source": [ { - "context": "patientEntrySHC", - "type": "Patient", - "element": "resource", - "listMode": "first", - "variable": "patient" - } ], - "rule": [ { - "name": "entries", - "source": [ { - "context": "fhirBundle", - "element": "entry", - "variable": "entry" - } ], - "rule": [ { - "name": "immunizations", - "source": [ { - "context": "entry", - "type": "Immunization", - "element": "resource", - "variable": "immunization" - } ], - "target": [ { - "context": "ddccBundle", - "contextType": "variable", - "element": "entry", - "variable": "outentry" - }, { - "contextType": "variable", - "variable": "ddcc", - "transform": "create", - "parameter": [ { - "valueString": "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS" - } ] - } ], - "rule": [ { - "name": "set patient", - "source": [ { - "context": "immunization" - } ], - "dependent": [ { - "name": "PatientToDDCCVS", - "variable": [ "patient", "ddcc" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - }, { - "name": "set vaccination", - "source": [ { - "context": "immunization" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "vaccination", - "variable": "vaccination" - } ], - "dependent": [ { - "name": "ImmunizationToDDCC", - "variable": [ "immunization", "vaccination" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - }, { - "name": "set ddcc", - "source": [ { - "context": "immunization" - } ], - "dependent": [ { - "name": "CertSHCtoCoreDataSet", - "variable": [ "src", "ddcc" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - }, { - "name": "set outentry", - "source": [ { - "context": "immunization" - } ], - "target": [ { - "context": "outentry", - "contextType": "variable", - "element": "resource", - "transform": "copy", - "parameter": [ { - "valueId": "ddcc" - } ] - } ] - } ] - }, { - "name": "labs", - "source": [ { - "context": "entry", - "type": "Observation", - "element": "resource", - "variable": "lab" - } ], - "target": [ { - "context": "ddccBundle", - "contextType": "variable", - "element": "entry", - "variable": "outentry" - }, { - "contextType": "variable", - "variable": "ddcc", - "transform": "create", - "parameter": [ { - "valueString": "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-TR" - } ] - } ], - "rule": [ { - "name": "set patient", - "source": [ { - "context": "lab" - } ], - "dependent": [ { - "name": "PatientToDDCCTR", - "variable": [ "patient", "ddcc" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - }, { - "name": "set test", - "source": [ { - "context": "lab" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "test", - "variable": "test" - } ], - "dependent": [ { - "name": "LabToDDCC", - "variable": [ "lab", "test" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - }, { - "name": "set ddcc", - "source": [ { - "context": "lab" - } ], - "dependent": [ { - "name": "CertSHCtoCoreDataSet", - "variable": [ "src", "ddcc" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - }, { - "name": "set outentry", - "source": [ { - "context": "lab" - } ], - "target": [ { - "context": "outentry", - "contextType": "variable", - "element": "resource", - "transform": "copy", - "parameter": [ { - "valueId": "ddcc" - } ] - } ] - } ] - } ] - } ] - } ] - } ] - } ] - } ] - } ] - }, { - "name": "CertSHCtoCoreDataSet", - "typeMode": "none", - "input": [ { - "name": "src", - "type": "JWTPayload", - "mode": "source" - }, { - "name": "ddcc", - "type": "DDCC", - "mode": "target" - } ], - "rule": [ { - "name": "certificate", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "certificate", - "variable": "cert" - } ], - "rule": [ { - "name": "issuer", - "source": [ { - "context": "src", - "element": "iss" - } ], - "target": [ { - "context": "cert", - "contextType": "variable", - "element": "issuer", - "variable": "issuer", - "transform": "create", - "parameter": [ { - "valueString": "Reference" - } ] - } ], - "rule": [ { - "name": "set issuer", - "source": [ { - "context": "src", - "element": "iss", - "variable": "iss" - } ], - "target": [ { - "context": "issuer", - "contextType": "variable", - "element": "reference", - "transform": "copy", - "parameter": [ { - "valueId": "iss" - } ] - } ] - } ] - }, { - "name": "period", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "cert", - "contextType": "variable", - "element": "period", - "variable": "period", - "transform": "create", - "parameter": [ { - "valueString": "Period" - } ] - } ], - "rule": [ { - "name": "set period", - "source": [ { - "context": "src" - } ], - "dependent": [ { - "name": "JwtToPeriod", - "variable": [ "src", "period" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - } ] - } ] - } ] - }, { - "name": "JwtToPeriod", - "typeMode": "none", - "input": [ { - "name": "src", - "type": "JWTPayload", - "mode": "source" - }, { - "name": "tgt", - "type": "Period", - "mode": "target" - } ], - "rule": [ { - "name": "set period start to notBefore", - "source": [ { - "context": "src", - "element": "nbf", - "variable": "nbf" - } ], - "target": [ { - "contextType": "variable", - "variable": "epoch", - "transform": "append", - "parameter": [ { - "valueId": "nbf" - }, { - "valueString": " seconds" - } ] - }, { - "context": "tgt", - "contextType": "variable", - "element": "start", - "transform": "evaluate", - "parameter": [ { - "valueString": "@1970-01-01T00:00:00.000+00:00 + epoch.toQuantity()" - } ] - } ] - }, { - "name": "set period start to issuedAt", - "source": [ { - "context": "src", - "element": "iat", - "variable": "iat" - } ], - "target": [ { - "contextType": "variable", - "variable": "epoch", - "transform": "append", - "parameter": [ { - "valueId": "iat" - }, { - "valueString": " seconds" - } ] - }, { - "context": "tgt", - "contextType": "variable", - "element": "start", - "transform": "evaluate", - "parameter": [ { - "valueString": "@1970-01-01T00:00:00.000+00:00 + epoch.toQuantity()" - } ] - } ] - }, { - "name": "set period end", - "source": [ { - "context": "src", - "element": "exp", - "variable": "exp" - } ], - "target": [ { - "contextType": "variable", - "variable": "epoch", - "transform": "append", - "parameter": [ { - "valueId": "exp" - }, { - "valueString": " seconds" - } ] - }, { - "context": "tgt", - "contextType": "variable", - "element": "end", - "transform": "evaluate", - "parameter": [ { - "valueString": "@1970-01-01T00:00:00.000+00:00 + epoch.toQuantity()" - } ] - } ] - } ] - } ] -} diff --git a/input/resources/StructureMap-CoreDataSetLibrary.json b/input/resources/StructureMap-CoreDataSetLibrary.json deleted file mode 100644 index 1e0f170a28..0000000000 --- a/input/resources/StructureMap-CoreDataSetLibrary.json +++ /dev/null @@ -1,543 +0,0 @@ -{ - "resourceType": "StructureMap", - "id": "CoreDataSetLibrary", - "meta": { - "versionId": "1", - "lastUpdated": "2022-03-01T19:17:52.081+00:00" - }, - "text": { - "status": "generated", - "div": "
map "http://smart.who.int/ddcc/StructureMap/CoreDataSetLibrary" = "CoreDataSetLibrary"\r\n\r\n\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS" alias DDCCVS as source\r\nuses "http://hl7.org/fhir/StructureDefinition/Patient" alias Patient as target\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCPatient" alias DDCCPatient as produced\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCDocumentReferenceQR" alias DDCCDocRefQR as produced\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCComposition" alias DDCCComposition as produced\r\n\r\ngroup DDCCToPatient(source src : DDCCVS, target patient : DDCCPatient, source pid) {\r\n  pid -> patient.id = pid "set id";\r\n  src.name as name -> patient.name as tName then {\r\n    name -> tName.text = name "set name";\r\n  } "set full name";\r\n  src.birthDate as birthDate -> patient.birthDate = birthDate "set birthDate";\r\n  src.identifier as identifier -> patient.identifier = identifier "set identifier";\r\n}\r\n\r\ngroup DDCCToDocumentReference(source src : DDCCVS, target ref : DDCCDocRefQR, source id, source pid) {\r\n  id -> ref.id = id "set id";\r\n  src -> ref.status = 'current' "set status";\r\n  src ->  ref.subject as patient,  patient.reference = append('Patient/', pid) "set patient";\r\n  src -> ref.content as content then {\r\n    src ->  content.attachment as attachment,  attachment.contentType = 'application/json' "set contentType";\r\n    src ->  content.format as format,  format.system = 'http://smart.who.int/ddcc/CodeSystem/DDCCQRFormatCodeSystem',  format.code = 'serialized' "set format code";\r\n  } "set serialized content";\r\n  src -> ref.content as content then {\r\n    src ->  content.attachment as attachment,  attachment.contentType = 'image/png' "set contentType";\r\n    src ->  content.format as format,  format.system = 'http://smart.who.int/ddcc/CodeSystem/DDCCQRFormatCodeSystem',  format.code = 'image' "set format code";\r\n  } "set image content";\r\n  src -> ref.content as content then {\r\n    src ->  content.attachment as attachment,  attachment.contentType = 'application/pdf' "set contentType";\r\n    src ->  content.format as format,  format.system = 'http://smart.who.int/ddcc/CodeSystem/DDCCQRFormatCodeSystem',  format.code = 'pdf' "set format code";\r\n  } "set pdf content";\r\n}\r\n\r\ngroup DDCCToComposition(source src : DDCCVS, target comp : DDCCComposition, source id, source pid) {\r\n  id -> comp.id = id "set id";\r\n  src ->  comp.subject as patient,  patient.reference = append('Patient/', pid) "set patient";\r\n  src ->  comp.type as type,  type.coding as coding then {\r\n    src ->  coding.system = 'http://loinc.org',  coding.code = '82593-5' "set type coding";\r\n  } "set type";\r\n  src.certificate as certificate ->  comp.author as author,  comp.event as event then {\r\n    certificate.period as period -> event.period = period "set event period";\r\n    certificate.issuer as issuer -> author.type = 'Organization' then {\r\n      issuer.identifier as pha -> author.identifier as identifier then {\r\n        pha.value as value -> identifier.value = value "set pha";\r\n      } "set author identifier";\r\n    } "set author ref";\r\n  } "set certificate";\r\n}\r\n\r\n
" - }, - "url": "http://smart.who.int/ddcc/StructureMap/CoreDataSetLibrary", - "name": "CoreDataSetLibrary", - "structure": [ { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS", - "mode": "source", - "alias": "DDCCVS" - }, { - "url": "http://hl7.org/fhir/StructureDefinition/Patient", - "mode": "target", - "alias": "Patient" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCPatient", - "mode": "produced", - "alias": "DDCCPatient" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCDocumentReferenceQR", - "mode": "produced", - "alias": "DDCCDocRefQR" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCComposition", - "mode": "produced", - "alias": "DDCCComposition" - } ], - "group": [ { - "name": "DDCCToPatient", - "typeMode": "none", - "input": [ { - "name": "src", - "type": "DDCCVS", - "mode": "source" - }, { - "name": "patient", - "type": "DDCCPatient", - "mode": "target" - }, { - "name": "pid", - "mode": "source" - } ], - "rule": [ { - "name": "set id", - "source": [ { - "context": "pid" - } ], - "target": [ { - "context": "patient", - "contextType": "variable", - "element": "id", - "transform": "copy", - "parameter": [ { - "valueId": "pid" - } ] - } ] - }, { - "name": "set full name", - "source": [ { - "context": "src", - "element": "name", - "variable": "name" - } ], - "target": [ { - "context": "patient", - "contextType": "variable", - "element": "name", - "variable": "tName" - } ], - "rule": [ { - "name": "set name", - "source": [ { - "context": "name" - } ], - "target": [ { - "context": "tName", - "contextType": "variable", - "element": "text", - "transform": "copy", - "parameter": [ { - "valueId": "name" - } ] - } ] - } ] - }, { - "name": "set birthDate", - "source": [ { - "context": "src", - "element": "birthDate", - "variable": "birthDate" - } ], - "target": [ { - "context": "patient", - "contextType": "variable", - "element": "birthDate", - "transform": "copy", - "parameter": [ { - "valueId": "birthDate" - } ] - } ] - }, { - "name": "set identifier", - "source": [ { - "context": "src", - "element": "identifier", - "variable": "identifier" - } ], - "target": [ { - "context": "patient", - "contextType": "variable", - "element": "identifier", - "transform": "copy", - "parameter": [ { - "valueId": "identifier" - } ] - } ] - } ] - }, { - "name": "DDCCToDocumentReference", - "typeMode": "none", - "input": [ { - "name": "src", - "type": "DDCCVS", - "mode": "source" - }, { - "name": "ref", - "type": "DDCCDocRefQR", - "mode": "target" - }, { - "name": "id", - "mode": "source" - }, { - "name": "pid", - "mode": "source" - } ], - "rule": [ { - "name": "set id", - "source": [ { - "context": "id" - } ], - "target": [ { - "context": "ref", - "contextType": "variable", - "element": "id", - "transform": "copy", - "parameter": [ { - "valueId": "id" - } ] - } ] - }, { - "name": "set status", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "ref", - "contextType": "variable", - "element": "status", - "transform": "copy", - "parameter": [ { - "valueString": "current" - } ] - } ] - }, { - "name": "set patient", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "ref", - "contextType": "variable", - "element": "subject", - "variable": "patient" - }, { - "context": "patient", - "contextType": "variable", - "element": "reference", - "transform": "append", - "parameter": [ { - "valueString": "Patient/" - }, { - "valueId": "pid" - } ] - } ] - }, { - "name": "set serialized content", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "ref", - "contextType": "variable", - "element": "content", - "variable": "content" - } ], - "rule": [ { - "name": "set contentType", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "content", - "contextType": "variable", - "element": "attachment", - "variable": "attachment" - }, { - "context": "attachment", - "contextType": "variable", - "element": "contentType", - "transform": "copy", - "parameter": [ { - "valueString": "application/json" - } ] - } ] - }, { - "name": "set format code", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "content", - "contextType": "variable", - "element": "format", - "variable": "format" - }, { - "context": "format", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueString": "http://smart.who.int/ddcc/CodeSystem/DDCCQRFormatCodeSystem" - } ] - }, { - "context": "format", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueString": "serialized" - } ] - } ] - } ] - }, { - "name": "set image content", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "ref", - "contextType": "variable", - "element": "content", - "variable": "content" - } ], - "rule": [ { - "name": "set contentType", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "content", - "contextType": "variable", - "element": "attachment", - "variable": "attachment" - }, { - "context": "attachment", - "contextType": "variable", - "element": "contentType", - "transform": "copy", - "parameter": [ { - "valueString": "image/png" - } ] - } ] - }, { - "name": "set format code", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "content", - "contextType": "variable", - "element": "format", - "variable": "format" - }, { - "context": "format", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueString": "http://smart.who.int/ddcc/CodeSystem/DDCCQRFormatCodeSystem" - } ] - }, { - "context": "format", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueString": "image" - } ] - } ] - } ] - }, { - "name": "set pdf content", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "ref", - "contextType": "variable", - "element": "content", - "variable": "content" - } ], - "rule": [ { - "name": "set contentType", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "content", - "contextType": "variable", - "element": "attachment", - "variable": "attachment" - }, { - "context": "attachment", - "contextType": "variable", - "element": "contentType", - "transform": "copy", - "parameter": [ { - "valueString": "application/pdf" - } ] - } ] - }, { - "name": "set format code", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "content", - "contextType": "variable", - "element": "format", - "variable": "format" - }, { - "context": "format", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueString": "http://smart.who.int/ddcc/CodeSystem/DDCCQRFormatCodeSystem" - } ] - }, { - "context": "format", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueString": "pdf" - } ] - } ] - } ] - } ] - }, { - "name": "DDCCToComposition", - "typeMode": "none", - "input": [ { - "name": "src", - "type": "DDCCVS", - "mode": "source" - }, { - "name": "comp", - "type": "DDCCComposition", - "mode": "target" - }, { - "name": "id", - "mode": "source" - }, { - "name": "pid", - "mode": "source" - } ], - "rule": [ { - "name": "set id", - "source": [ { - "context": "id" - } ], - "target": [ { - "context": "comp", - "contextType": "variable", - "element": "id", - "transform": "copy", - "parameter": [ { - "valueId": "id" - } ] - } ] - }, { - "name": "set patient", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "comp", - "contextType": "variable", - "element": "subject", - "variable": "patient" - }, { - "context": "patient", - "contextType": "variable", - "element": "reference", - "transform": "append", - "parameter": [ { - "valueString": "Patient/" - }, { - "valueId": "pid" - } ] - } ] - }, { - "name": "set type", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "comp", - "contextType": "variable", - "element": "type", - "variable": "type" - }, { - "context": "type", - "contextType": "variable", - "element": "coding", - "variable": "coding" - } ], - "rule": [ { - "name": "set type coding", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "coding", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueString": "http://loinc.org" - } ] - }, { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueString": "82593-5" - } ] - } ] - } ] - }, { - "name": "set certificate", - "source": [ { - "context": "src", - "element": "certificate", - "variable": "certificate" - } ], - "target": [ { - "context": "comp", - "contextType": "variable", - "element": "author", - "variable": "author" - }, { - "context": "comp", - "contextType": "variable", - "element": "event", - "variable": "event" - } ], - "rule": [ { - "name": "set event period", - "source": [ { - "context": "certificate", - "element": "period", - "variable": "period" - } ], - "target": [ { - "context": "event", - "contextType": "variable", - "element": "period", - "transform": "copy", - "parameter": [ { - "valueId": "period" - } ] - } ] - }, { - "name": "set author ref", - "source": [ { - "context": "certificate", - "element": "issuer", - "variable": "issuer" - } ], - "target": [ { - "context": "author", - "contextType": "variable", - "element": "type", - "transform": "copy", - "parameter": [ { - "valueString": "Organization" - } ] - } ], - "rule": [ { - "name": "set author identifier", - "source": [ { - "context": "issuer", - "element": "identifier", - "variable": "pha" - } ], - "target": [ { - "context": "author", - "contextType": "variable", - "element": "identifier", - "variable": "identifier" - } ], - "rule": [ { - "name": "set pha", - "source": [ { - "context": "pha", - "element": "value", - "variable": "value" - } ], - "target": [ { - "context": "identifier", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "value" - } ] - } ] - } ] - } ] - } ] - } ] - } ] -} diff --git a/input/resources/StructureMap-CoreDataSetVSLibrary.json b/input/resources/StructureMap-CoreDataSetVSLibrary.json deleted file mode 100644 index b5ebe2f364..0000000000 --- a/input/resources/StructureMap-CoreDataSetVSLibrary.json +++ /dev/null @@ -1,2720 +0,0 @@ -{ - "resourceType": "StructureMap", - "id": "CoreDataSetVSLibrary", - "meta": { - "versionId": "2", - "lastUpdated": "2022-06-01T12:53:30.965+00:00" - }, - "text": { - "status": "generated", - "div": "
map "http://smart.who.int/ddcc/StructureMap/CoreDataSetVSLibrary" = "CoreDataSetVSLibrary"\r\n\r\n\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS" alias DDCCVS as source\r\nuses "http://hl7.org/fhir/StructureDefinition/Bundle" alias AddBundle as target\r\nuses "http://hl7.org/fhir/StructureDefinition/Patient" alias Patient as target\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCPatient" alias DDCCPatient as produced\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCDocumentReferenceQR" alias DDCCDocRefQR as produced\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCVSComposition" alias DDCCVSComposition as produced\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunization" alias DDCCImmunization as produced\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunizationRecommendation" alias DDCCImmRec as produced\r\n\r\nimports "http://smart.who.int/ddcc/StructureMap/CoreDataSetLibrary"\r\n\r\ngroup VSToAddBundle(source ddcc : DDCCVS, target bundle : AddBundle) {\r\n  ddcc -> bundle.type = 'transaction' "set bundle type";\r\n  ddcc ->  uuid() as pid,  uuid() as compid,  uuid() as iid,  uuid() as irid,  uuid() as qrwhoid,  uuid() as qrdccid then {\r\n    ddcc ->  bundle.entry as entry,  entry.fullUrl = append('urn:uuid:', pid),  entry.request as request,  request.method = 'PUT',  request.url = append('Patient/', pid),  create('http://smart.who.int/ddcc/StructureDefinition/DDCCPatient') as patient then {\r\n      ddcc then DDCCToPatient(ddcc, patient, pid) "setup patient";\r\n      ddcc -> entry.resource = patient "set patient resource";\r\n    } "create patient resource";\r\n    ddcc ->  bundle.entry as entry,  entry.fullUrl = append('urn:uuid:', compid),  entry.request as request,  request.method = 'PUT',  request.url = append('Composition/', compid),  create('http://smart.who.int/ddcc/StructureDefinition/DDCCVSComposition') as comp then {\r\n      ddcc then DDCCToComposition(ddcc, comp, compid, pid) "setup composition";\r\n      ddcc ->  comp.category as category,  category.coding as coding,  coding.system = 'http://smart.who.int/ddcc/CodeSystem/DDCCCompositionCategoryCodeSystem',  coding.code = 'ddcc-vs' "set category";\r\n      ddcc -> comp.title = 'International Certificate of Vaccination or Prophylaxis' "set title";\r\n      ddcc -> comp.section as section then {\r\n        ddcc ->  section.code as code,  code.coding as coding,  coding.system = 'http://loinc.org',  coding.code = '11369-6' "set code";\r\n        ddcc.certificate as certificate then {\r\n          certificate.issuer as issuer -> section.author = issuer "set author";\r\n        } "set certificate";\r\n        // ddcc.certificate as certificate -> section.author as author then {\r\n        //             certificate.issuer as issuer then {\r\n        //               issuer.identifier as pha -> author.identifier as identifier, author.type = "Organization" then {\r\n        //                 pha.value as value -> identifier.value = value "set pha";\r\n        //               } "set author identifier";\r\n        //             } "set author ref";\r\n        //             \r\n        //           } "set author";\r\n        ddcc ->  section.focus as focus,  focus.reference = append('Immunization/', iid) "set focus";\r\n        ddcc ->  section.entry as entry,  entry.reference = append('Immunization/', iid) "add Immunization entry";\r\n        ddcc ->  section.entry as entry,  entry.reference = append('ImmunizationRecommendation/', irid) "add ImmunizationRecommendation entry";\r\n        ddcc ->  section.entry as entry,  entry.reference = append('DocumentReference/', qrwhoid) "add WHO QR entry";\r\n        ddcc ->  section.entry as entry,  entry.reference = append('DocumentReference/', qrdccid) "add DCC QR entry";\r\n      } "set section";\r\n      ddcc -> entry.resource = comp "set composition resource";\r\n    } "create composition resource";\r\n    ddcc ->  bundle.entry as entry,  entry.fullUrl = append('urn:uuid:', qrwhoid),  entry.request as request,  request.method = 'PUT',  request.url = append('DocumentReference/', qrwhoid),  create('http://smart.who.int/ddcc/StructureDefinition/DDCCDocumentReferenceQR') as qr then {\r\n      ddcc then DDCCToDocumentReference(ddcc, qr, qrwhoid, pid) "setup WHO DocRef";\r\n      ddcc ->  qr.category as category,  category.coding as coding,  coding.system = 'http://smart.who.int/ddcc/CodeSystem/DDCCQRCategoryUsageCodeSystem',  coding.code = 'who' "set category";\r\n      ddcc -> qr.description = 'WHO QR code for COVID 19 Vaccine Certificate' "set description";\r\n      ddcc -> entry.resource = qr "set WHO QR";\r\n    } "create WHO QR Doc Ref";\r\n    ddcc ->  bundle.entry as entry,  entry.fullUrl = append('urn:uuid:', qrdccid),  entry.request as request,  request.method = 'PUT',  request.url = append('DocumentReference/', qrdccid),  create('http://smart.who.int/ddcc/StructureDefinition/DDCCDocumentReferenceQR') as qr then {\r\n      ddcc then DDCCToDocumentReference(ddcc, qr, qrdccid, pid) "setup DCC DocRef";\r\n      ddcc ->  qr.category as category,  category.coding as coding,  coding.system = 'http://smart.who.int/ddcc/CodeSystem/DDCCQRCategoryUsageCodeSystem',  coding.code = 'dcc' "set category";\r\n      ddcc -> qr.description = 'DCC QR code for COVID 19 Vaccine Certificate' "set description";\r\n      ddcc -> entry.resource = qr "set DCC QR";\r\n    } "create DCC QR Doc Ref";\r\n    ddcc.vaccination first as vaccination ->  bundle.entry as entry,  entry.fullUrl = append('urn:uuid:', iid),  entry.request as request,  request.method = 'PUT',  request.url = append('Immunization/', iid),  create('http://smart.who.int/ddcc/StructureDefinition/DDCCImmunization') as immunization then {\r\n      ddcc.certificate as certificate then DDCCToImmunization(vaccination, immunization, certificate, iid, pid) "setup immunization";\r\n      ddcc -> entry.resource = immunization "set immunization resource";\r\n    } "create immunization resource";\r\n    ddcc.vaccination first as vaccination ->  bundle.entry as entry,  entry.fullUrl = append('urn:uuid:', irid),  entry.request as request,  request.method = 'PUT',  request.url = append('ImmunizationRecommendation/', irid),  create('http://smart.who.int/ddcc/StructureDefinition/DDCCImmunizationRecommendation') as immrec then {\r\n      vaccination then DDCCToImmRec(vaccination, immrec, irid, iid, pid) "setup immunization recommendation";\r\n      ddcc -> entry.resource = immrec "set immunization recommendation resource";\r\n    } "create immunization recommendation resource";\r\n  } "set uuids";\r\n}\r\n\r\ngroup DDCCToImmunization(source src, target immunization : DDCCImmunization, source certificate, source iid, source pid) {\r\n  iid -> immunization.id = iid "set id";\r\n  src.brand as brand -> immunization.extension as ext then {\r\n    brand ->  ext.url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineBrand',  ext.value = brand "set brand extension values";\r\n  } "set brand extension";\r\n  src.maholder as maholder -> immunization.extension as ext then {\r\n    maholder ->  ext.url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineMarketAuthorization',  ext.value = maholder "set MA Holder extension values";\r\n  } "set maholder extension";\r\n  src.country as country -> immunization.extension as ext then {\r\n    country.code as code ->  ext.url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCCountryOfVaccination',  ext.value = code "set country extension values";\r\n  } "set country extension";\r\n  src.validFrom as validFrom -> immunization.extension as ext then {\r\n    validFrom ->  ext.url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineValidFrom',  ext.value = validFrom "set valid from extension values";\r\n  } "set vaccine valid extension";\r\n  src -> immunization.status = 'completed' "set status";\r\n  src.vaccine as vaccine ->  immunization.vaccineCode as vacCode,  vacCode.coding = vaccine "set vaccine";\r\n  src ->  immunization.patient as patient,  patient.reference = append('Patient/', pid) "set patient";\r\n  src.manufacturer as manufacturer ->  immunization.manufacturer as tman,  tman.identifier as ident then {\r\n    manufacturer.system as system -> ident.system = system "set system";\r\n    manufacturer.code as code -> ident.value = code "set value";\r\n  } "set manufacturer identifier";\r\n  src.lot as lot -> immunization.lotNumber = lot "set lot number";\r\n  src.date as date -> immunization.occurrence = date "set occurrence date";\r\n  src.centre as centre -> immunization.location as location then {\r\n    centre -> location.display = centre "set location display";\r\n  } "set location";\r\n  src.practitioner as practitioner -> immunization.performer as performer then {\r\n    practitioner.value as hw -> performer.actor as actor then {\r\n      hw ->  actor.type = 'Practitioner',  actor.identifier as identifier then {\r\n        hw -> identifier.value = hw "set hw identifier";\r\n      } "set actor";\r\n    } "set performer";\r\n  } "set practitioner";\r\n  src -> immunization.protocolApplied as protocol then {\r\n    src -> protocol.authority as authority then {\r\n      certificate.issuer as issuer -> authority.type = 'Organization' then {\r\n        issuer.identifier as pha -> authority.identifier as identifier then {\r\n          pha.value as value -> identifier.value = value "set pha";\r\n        } "set issuer identifier";\r\n      } "set issuer";\r\n    } "set authority";\r\n    src.disease as disease -> protocol.targetDisease as tdisease then {\r\n      disease -> tdisease.coding = disease "set target disease code";\r\n    } "set target disease";\r\n    src.dose as dose -> protocol.doseNumber = dose "set dose number";\r\n    src.totalDoses as totalDoses -> protocol.seriesDoses = totalDoses "set total doses";\r\n  } "set protocolApplied";\r\n}\r\n\r\ngroup DDCCToImmRec(source src, target immrec : DDCCImmunizationRecommendation, source irid, source iid, source pid) {\r\n  src.date as date -> immrec.date = date "set date";\r\n  src ->  immrec.patient as patient,  patient.reference = append('Patient/', pid) "set patient";\r\n  src -> immrec.recommendation as rec then {\r\n    src.vaccine as vaccine -> rec.vaccineCode as vaccineCode then {\r\n      vaccine -> vaccineCode.coding = vaccine "set vaccine code coding";\r\n    } "set vaccine code";\r\n    src.disease as disease -> rec.targetDisease as targetDisease then {\r\n      disease -> targetDisease.coding = disease "set target disease coding";\r\n    } "set target disease";\r\n    src -> rec.forecastStatus as forecast then {\r\n      src -> forecast.coding as coding then {\r\n        src -> coding.system = 'http://terminology.hl7.org/2.1.0/CodeSystem-immunization-recommendation-status.html' "set forecast system";\r\n        src -> coding.code = 'due' "set forecast code";\r\n      } "set forecast status coding";\r\n    } "set forecast status";\r\n    src -> rec.dateCriterion as due_date then {\r\n      src -> due_date.code as code then {\r\n        src -> code.coding as coding then {\r\n          src -> coding.system = 'http://loinc.org' "set due date code system";\r\n          src -> coding.code = '30980-7' "set due date code code";\r\n        } "set due date code coding";\r\n      } "set due date code";\r\n      src.nextDose as nextDose -> due_date.value = nextDose "set due date value";\r\n    } "set date criterion";\r\n    src.dose as dose -> rec.doseNumber = (dose.toInteger() + 1) "set dose number";\r\n    src.totalDoses as totalDoses -> rec.seriesDoses = totalDoses "set total doses";\r\n    src ->  rec.supportingImmunization as imm,  imm.reference = append('Immunization/', iid) "set supporting immunization";\r\n  } "set recommendation";\r\n}\r\n\r\n
" - }, - "url": "http://smart.who.int/ddcc/StructureMap/CoreDataSetVSLibrary", - "name": "CoreDataSetVSLibrary", - "structure": [ - { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS", - "mode": "source", - "alias": "DDCCVS" - }, - { - "url": "http://hl7.org/fhir/StructureDefinition/Bundle", - "mode": "target", - "alias": "AddBundle" - }, - { - "url": "http://hl7.org/fhir/StructureDefinition/Patient", - "mode": "target", - "alias": "Patient" - }, - { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCPatient", - "mode": "produced", - "alias": "DDCCPatient" - }, - { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCDocumentReferenceQR", - "mode": "produced", - "alias": "DDCCDocRefQR" - }, - { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCVSComposition", - "mode": "produced", - "alias": "DDCCVSComposition" - }, - { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunization", - "mode": "produced", - "alias": "DDCCImmunization" - }, - { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunizationRecommendation", - "mode": "produced", - "alias": "DDCCImmRec" - } - ], - "import": [ - "http://smart.who.int/ddcc/StructureMap/CoreDataSetLibrary" - ], - "group": [ - { - "name": "VSToAddBundle", - "typeMode": "none", - "input": [ - { - "name": "ddcc", - "type": "DDCCVS", - "mode": "source" - }, - { - "name": "bundle", - "type": "AddBundle", - "mode": "target" - } - ], - "rule": [ - { - "name": "set bundle type", - "source": [ - { - "context": "ddcc" - } - ], - "target": [ - { - "context": "bundle", - "contextType": "variable", - "element": "type", - "transform": "copy", - "parameter": [ - { - "valueString": "transaction" - } - ] - } - ] - }, - { - "name": "set uuids", - "source": [ - { - "context": "ddcc" - } - ], - "target": [ - { - "contextType": "variable", - "variable": "pid", - "transform": "uuid" - }, - { - "contextType": "variable", - "variable": "compid", - "transform": "uuid" - }, - { - "contextType": "variable", - "variable": "iid", - "transform": "uuid" - }, - { - "contextType": "variable", - "variable": "irid", - "transform": "uuid" - }, - { - "contextType": "variable", - "variable": "qrwhoid", - "transform": "uuid" - }, - { - "contextType": "variable", - "variable": "qrdccid", - "transform": "uuid" - } - ], - "rule": [ - { - "name": "create patient resource", - "source": [ - { - "context": "ddcc" - } - ], - "target": [ - { - "context": "bundle", - "contextType": "variable", - "element": "entry", - "variable": "entry" - }, - { - "context": "entry", - "contextType": "variable", - "element": "fullUrl", - "transform": "append", - "parameter": [ - { - "valueString": "urn:uuid:" - }, - { - "valueId": "pid" - } - ] - }, - { - "context": "entry", - "contextType": "variable", - "element": "request", - "variable": "request" - }, - { - "context": "request", - "contextType": "variable", - "element": "method", - "transform": "copy", - "parameter": [ - { - "valueString": "PUT" - } - ] - }, - { - "context": "request", - "contextType": "variable", - "element": "url", - "transform": "append", - "parameter": [ - { - "valueString": "Patient/" - }, - { - "valueId": "pid" - } - ] - }, - { - "contextType": "variable", - "variable": "patient", - "transform": "create", - "parameter": [ - { - "valueString": "http://smart.who.int/ddcc/StructureDefinition/DDCCPatient" - } - ] - } - ], - "rule": [ - { - "name": "setup patient", - "source": [ - { - "context": "ddcc" - } - ], - "dependent": [ - { - "name": "DDCCToPatient", - "variable": [ - "ddcc", - "patient", - "pid" - ], - "_variable": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } - ] - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } - ] - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } - ] - } - ] - } - ] - }, - { - "name": "set patient resource", - "source": [ - { - "context": "ddcc" - } - ], - "target": [ - { - "context": "entry", - "contextType": "variable", - "element": "resource", - "transform": "copy", - "parameter": [ - { - "valueId": "patient" - } - ] - } - ] - } - ] - }, - { - "name": "create composition resource", - "source": [ - { - "context": "ddcc" - } - ], - "target": [ - { - "context": "bundle", - "contextType": "variable", - "element": "entry", - "variable": "entry" - }, - { - "context": "entry", - "contextType": "variable", - "element": "fullUrl", - "transform": "append", - "parameter": [ - { - "valueString": "urn:uuid:" - }, - { - "valueId": "compid" - } - ] - }, - { - "context": "entry", - "contextType": "variable", - "element": "request", - "variable": "request" - }, - { - "context": "request", - "contextType": "variable", - "element": "method", - "transform": "copy", - "parameter": [ - { - "valueString": "PUT" - } - ] - }, - { - "context": "request", - "contextType": "variable", - "element": "url", - "transform": "append", - "parameter": [ - { - "valueString": "Composition/" - }, - { - "valueId": "compid" - } - ] - }, - { - "contextType": "variable", - "variable": "comp", - "transform": "create", - "parameter": [ - { - "valueString": "http://smart.who.int/ddcc/StructureDefinition/DDCCVSComposition" - } - ] - } - ], - "rule": [ - { - "name": "setup composition", - "source": [ - { - "context": "ddcc" - } - ], - "dependent": [ - { - "name": "DDCCToComposition", - "variable": [ - "ddcc", - "comp", - "compid", - "pid" - ], - "_variable": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } - ] - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } - ] - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } - ] - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } - ] - } - ] - } - ] - }, - { - "name": "set category", - "source": [ - { - "context": "ddcc" - } - ], - "target": [ - { - "context": "comp", - "contextType": "variable", - "element": "category", - "variable": "category" - }, - { - "context": "category", - "contextType": "variable", - "element": "coding", - "variable": "coding" - }, - { - "context": "coding", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ - { - "valueString": "http://smart.who.int/ddcc/CodeSystem/DDCCCompositionCategoryCodeSystem" - } - ] - }, - { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ - { - "valueString": "ddcc-vs" - } - ] - } - ] - }, - { - "name": "set title", - "source": [ - { - "context": "ddcc" - } - ], - "target": [ - { - "context": "comp", - "contextType": "variable", - "element": "title", - "transform": "copy", - "parameter": [ - { - "valueString": "International Certificate of Vaccination or Prophylaxis" - } - ] - } - ] - }, - { - "name": "set section", - "source": [ - { - "context": "ddcc" - } - ], - "target": [ - { - "context": "comp", - "contextType": "variable", - "element": "section", - "variable": "section" - } - ], - "rule": [ - { - "name": "set code", - "source": [ - { - "context": "ddcc" - } - ], - "target": [ - { - "context": "section", - "contextType": "variable", - "element": "code", - "variable": "code" - }, - { - "context": "code", - "contextType": "variable", - "element": "coding", - "variable": "coding" - }, - { - "context": "coding", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ - { - "valueString": "http://loinc.org" - } - ] - }, - { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ - { - "valueString": "11369-6" - } - ] - } - ] - }, - { - "name": "set certificate", - "source": [ - { - "context": "ddcc", - "element": "certificate", - "variable": "certificate" - } - ], - "rule": [ - { - "name": "set author", - "source": [ - { - "context": "certificate", - "element": "issuer", - "variable": "issuer" - } - ], - "target": [ - { - "context": "section", - "contextType": "variable", - "element": "author", - "transform": "copy", - "parameter": [ - { - "valueId": "issuer" - } - ] - } - ] - } - ] - }, - { - "name": "set focus", - "source": [ - { - "context": "ddcc" - } - ], - "target": [ - { - "context": "section", - "contextType": "variable", - "element": "focus", - "variable": "focus" - }, - { - "context": "focus", - "contextType": "variable", - "element": "reference", - "transform": "append", - "parameter": [ - { - "valueString": "Immunization/" - }, - { - "valueId": "iid" - } - ] - } - ], - "documentation": "ddcc.certificate as certificate -> section.author as author then {\n certificate.issuer as issuer then {\n issuer.identifier as pha -> author.identifier as identifier, author.type = \"Organization\" then {\n pha.value as value -> identifier.value = value \"set pha\";\n } \"set author identifier\";\n } \"set author ref\";\n \n } \"set author\";" - }, - { - "name": "add Immunization entry", - "source": [ - { - "context": "ddcc" - } - ], - "target": [ - { - "context": "section", - "contextType": "variable", - "element": "entry", - "variable": "entry" - }, - { - "context": "entry", - "contextType": "variable", - "element": "reference", - "transform": "append", - "parameter": [ - { - "valueString": "Immunization/" - }, - { - "valueId": "iid" - } - ] - } - ] - }, - { - "name": "add ImmunizationRecommendation entry", - "source": [ - { - "context": "ddcc" - } - ], - "target": [ - { - "context": "section", - "contextType": "variable", - "element": "entry", - "variable": "entry" - }, - { - "context": "entry", - "contextType": "variable", - "element": "reference", - "transform": "append", - "parameter": [ - { - "valueString": "ImmunizationRecommendation/" - }, - { - "valueId": "irid" - } - ] - } - ] - }, - { - "name": "add WHO QR entry", - "source": [ - { - "context": "ddcc" - } - ], - "target": [ - { - "context": "section", - "contextType": "variable", - "element": "entry", - "variable": "entry" - }, - { - "context": "entry", - "contextType": "variable", - "element": "reference", - "transform": "append", - "parameter": [ - { - "valueString": "DocumentReference/" - }, - { - "valueId": "qrwhoid" - } - ] - } - ] - }, - { - "name": "add DCC QR entry", - "source": [ - { - "context": "ddcc" - } - ], - "target": [ - { - "context": "section", - "contextType": "variable", - "element": "entry", - "variable": "entry" - }, - { - "context": "entry", - "contextType": "variable", - "element": "reference", - "transform": "append", - "parameter": [ - { - "valueString": "DocumentReference/" - }, - { - "valueId": "qrdccid" - } - ] - } - ] - } - ] - }, - { - "name": "set composition resource", - "source": [ - { - "context": "ddcc" - } - ], - "target": [ - { - "context": "entry", - "contextType": "variable", - "element": "resource", - "transform": "copy", - "parameter": [ - { - "valueId": "comp" - } - ] - } - ] - } - ] - }, - { - "name": "create WHO QR Doc Ref", - "source": [ - { - "context": "ddcc" - } - ], - "target": [ - { - "context": "bundle", - "contextType": "variable", - "element": "entry", - "variable": "entry" - }, - { - "context": "entry", - "contextType": "variable", - "element": "fullUrl", - "transform": "append", - "parameter": [ - { - "valueString": "urn:uuid:" - }, - { - "valueId": "qrwhoid" - } - ] - }, - { - "context": "entry", - "contextType": "variable", - "element": "request", - "variable": "request" - }, - { - "context": "request", - "contextType": "variable", - "element": "method", - "transform": "copy", - "parameter": [ - { - "valueString": "PUT" - } - ] - }, - { - "context": "request", - "contextType": "variable", - "element": "url", - "transform": "append", - "parameter": [ - { - "valueString": "DocumentReference/" - }, - { - "valueId": "qrwhoid" - } - ] - }, - { - "contextType": "variable", - "variable": "qr", - "transform": "create", - "parameter": [ - { - "valueString": "http://smart.who.int/ddcc/StructureDefinition/DDCCDocumentReferenceQR" - } - ] - } - ], - "rule": [ - { - "name": "setup WHO DocRef", - "source": [ - { - "context": "ddcc" - } - ], - "dependent": [ - { - "name": "DDCCToDocumentReference", - "variable": [ - "ddcc", - "qr", - "qrwhoid", - "pid" - ], - "_variable": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } - ] - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } - ] - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } - ] - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } - ] - } - ] - } - ] - }, - { - "name": "set category", - "source": [ - { - "context": "ddcc" - } - ], - "target": [ - { - "context": "qr", - "contextType": "variable", - "element": "category", - "variable": "category" - }, - { - "context": "category", - "contextType": "variable", - "element": "coding", - "variable": "coding" - }, - { - "context": "coding", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ - { - "valueString": "http://smart.who.int/ddcc/CodeSystem/DDCCQRCategoryUsageCodeSystem" - } - ] - }, - { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ - { - "valueString": "who" - } - ] - } - ] - }, - { - "name": "set description", - "source": [ - { - "context": "ddcc" - } - ], - "target": [ - { - "context": "qr", - "contextType": "variable", - "element": "description", - "transform": "copy", - "parameter": [ - { - "valueString": "WHO QR code for COVID 19 Vaccine Certificate" - } - ] - } - ] - }, - { - "name": "set WHO QR", - "source": [ - { - "context": "ddcc" - } - ], - "target": [ - { - "context": "entry", - "contextType": "variable", - "element": "resource", - "transform": "copy", - "parameter": [ - { - "valueId": "qr" - } - ] - } - ] - } - ] - }, - { - "name": "create DCC QR Doc Ref", - "source": [ - { - "context": "ddcc" - } - ], - "target": [ - { - "context": "bundle", - "contextType": "variable", - "element": "entry", - "variable": "entry" - }, - { - "context": "entry", - "contextType": "variable", - "element": "fullUrl", - "transform": "append", - "parameter": [ - { - "valueString": "urn:uuid:" - }, - { - "valueId": "qrdccid" - } - ] - }, - { - "context": "entry", - "contextType": "variable", - "element": "request", - "variable": "request" - }, - { - "context": "request", - "contextType": "variable", - "element": "method", - "transform": "copy", - "parameter": [ - { - "valueString": "PUT" - } - ] - }, - { - "context": "request", - "contextType": "variable", - "element": "url", - "transform": "append", - "parameter": [ - { - "valueString": "DocumentReference/" - }, - { - "valueId": "qrdccid" - } - ] - }, - { - "contextType": "variable", - "variable": "qr", - "transform": "create", - "parameter": [ - { - "valueString": "http://smart.who.int/ddcc/StructureDefinition/DDCCDocumentReferenceQR" - } - ] - } - ], - "rule": [ - { - "name": "setup DCC DocRef", - "source": [ - { - "context": "ddcc" - } - ], - "dependent": [ - { - "name": "DDCCToDocumentReference", - "variable": [ - "ddcc", - "qr", - "qrdccid", - "pid" - ], - "_variable": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } - ] - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } - ] - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } - ] - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } - ] - } - ] - } - ] - }, - { - "name": "set category", - "source": [ - { - "context": "ddcc" - } - ], - "target": [ - { - "context": "qr", - "contextType": "variable", - "element": "category", - "variable": "category" - }, - { - "context": "category", - "contextType": "variable", - "element": "coding", - "variable": "coding" - }, - { - "context": "coding", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ - { - "valueString": "http://smart.who.int/ddcc/CodeSystem/DDCCQRCategoryUsageCodeSystem" - } - ] - }, - { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ - { - "valueString": "dcc" - } - ] - } - ] - }, - { - "name": "set description", - "source": [ - { - "context": "ddcc" - } - ], - "target": [ - { - "context": "qr", - "contextType": "variable", - "element": "description", - "transform": "copy", - "parameter": [ - { - "valueString": "DCC QR code for COVID 19 Vaccine Certificate" - } - ] - } - ] - }, - { - "name": "set DCC QR", - "source": [ - { - "context": "ddcc" - } - ], - "target": [ - { - "context": "entry", - "contextType": "variable", - "element": "resource", - "transform": "copy", - "parameter": [ - { - "valueId": "qr" - } - ] - } - ] - } - ] - }, - { - "name": "create immunization resource", - "source": [ - { - "context": "ddcc", - "element": "vaccination", - "listMode": "first", - "variable": "vaccination" - } - ], - "target": [ - { - "context": "bundle", - "contextType": "variable", - "element": "entry", - "variable": "entry" - }, - { - "context": "entry", - "contextType": "variable", - "element": "fullUrl", - "transform": "append", - "parameter": [ - { - "valueString": "urn:uuid:" - }, - { - "valueId": "iid" - } - ] - }, - { - "context": "entry", - "contextType": "variable", - "element": "request", - "variable": "request" - }, - { - "context": "request", - "contextType": "variable", - "element": "method", - "transform": "copy", - "parameter": [ - { - "valueString": "PUT" - } - ] - }, - { - "context": "request", - "contextType": "variable", - "element": "url", - "transform": "append", - "parameter": [ - { - "valueString": "Immunization/" - }, - { - "valueId": "iid" - } - ] - }, - { - "contextType": "variable", - "variable": "immunization", - "transform": "create", - "parameter": [ - { - "valueString": "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunization" - } - ] - } - ], - "rule": [ - { - "name": "setup immunization", - "source": [ - { - "context": "ddcc", - "element": "certificate", - "variable": "certificate" - } - ], - "dependent": [ - { - "name": "DDCCToImmunization", - "variable": [ - "vaccination", - "immunization", - "certificate", - "iid", - "pid" - ], - "_variable": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } - ] - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } - ] - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } - ] - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } - ] - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } - ] - } - ] - } - ] - }, - { - "name": "set immunization resource", - "source": [ - { - "context": "ddcc" - } - ], - "target": [ - { - "context": "entry", - "contextType": "variable", - "element": "resource", - "transform": "copy", - "parameter": [ - { - "valueId": "immunization" - } - ] - } - ] - } - ] - }, - { - "name": "create immunization recommendation resource", - "source": [ - { - "context": "ddcc", - "element": "vaccination", - "listMode": "first", - "variable": "vaccination" - } - ], - "target": [ - { - "context": "bundle", - "contextType": "variable", - "element": "entry", - "variable": "entry" - }, - { - "context": "entry", - "contextType": "variable", - "element": "fullUrl", - "transform": "append", - "parameter": [ - { - "valueString": "urn:uuid:" - }, - { - "valueId": "irid" - } - ] - }, - { - "context": "entry", - "contextType": "variable", - "element": "request", - "variable": "request" - }, - { - "context": "request", - "contextType": "variable", - "element": "method", - "transform": "copy", - "parameter": [ - { - "valueString": "PUT" - } - ] - }, - { - "context": "request", - "contextType": "variable", - "element": "url", - "transform": "append", - "parameter": [ - { - "valueString": "ImmunizationRecommendation/" - }, - { - "valueId": "irid" - } - ] - }, - { - "contextType": "variable", - "variable": "immrec", - "transform": "create", - "parameter": [ - { - "valueString": "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunizationRecommendation" - } - ] - } - ], - "rule": [ - { - "name": "setup immunization recommendation", - "source": [ - { - "context": "vaccination" - } - ], - "dependent": [ - { - "name": "DDCCToImmRec", - "variable": [ - "vaccination", - "immrec", - "irid", - "iid", - "pid" - ], - "_variable": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } - ] - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } - ] - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } - ] - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } - ] - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } - ] - } - ] - } - ] - }, - { - "name": "set immunization recommendation resource", - "source": [ - { - "context": "ddcc" - } - ], - "target": [ - { - "context": "entry", - "contextType": "variable", - "element": "resource", - "transform": "copy", - "parameter": [ - { - "valueId": "immrec" - } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "name": "DDCCToImmunization", - "typeMode": "none", - "input": [ - { - "name": "src", - "mode": "source" - }, - { - "name": "immunization", - "type": "DDCCImmunization", - "mode": "target" - }, - { - "name": "certificate", - "mode": "source" - }, - { - "name": "iid", - "mode": "source" - }, - { - "name": "pid", - "mode": "source" - } - ], - "rule": [ - { - "name": "set id", - "source": [ - { - "context": "iid" - } - ], - "target": [ - { - "context": "immunization", - "contextType": "variable", - "element": "id", - "transform": "copy", - "parameter": [ - { - "valueId": "iid" - } - ] - } - ] - }, - { - "name": "set brand extension", - "source": [ - { - "context": "src", - "element": "brand", - "variable": "brand" - } - ], - "target": [ - { - "context": "immunization", - "contextType": "variable", - "element": "extension", - "variable": "ext" - } - ], - "rule": [ - { - "name": "set brand extension values", - "source": [ - { - "context": "brand" - } - ], - "target": [ - { - "context": "ext", - "contextType": "variable", - "element": "url", - "transform": "copy", - "parameter": [ - { - "valueString": "http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineBrand" - } - ] - }, - { - "context": "ext", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ - { - "valueId": "brand" - } - ] - } - ] - } - ] - }, - { - "name": "set maholder extension", - "source": [ - { - "context": "src", - "element": "maholder", - "variable": "maholder" - } - ], - "target": [ - { - "context": "immunization", - "contextType": "variable", - "element": "extension", - "variable": "ext" - } - ], - "rule": [ - { - "name": "set MA Holder extension values", - "source": [ - { - "context": "maholder" - } - ], - "target": [ - { - "context": "ext", - "contextType": "variable", - "element": "url", - "transform": "copy", - "parameter": [ - { - "valueString": "http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineMarketAuthorization" - } - ] - }, - { - "context": "ext", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ - { - "valueId": "maholder" - } - ] - } - ] - } - ] - }, - { - "name": "set country extension", - "source": [ - { - "context": "src", - "element": "country", - "variable": "country" - } - ], - "target": [ - { - "context": "immunization", - "contextType": "variable", - "element": "extension", - "variable": "ext" - } - ], - "rule": [ - { - "name": "set country extension values", - "source": [ - { - "context": "country", - "element": "code", - "variable": "code" - } - ], - "target": [ - { - "context": "ext", - "contextType": "variable", - "element": "url", - "transform": "copy", - "parameter": [ - { - "valueString": "http://smart.who.int/ddcc/StructureDefinition/DDCCCountryOfVaccination" - } - ] - }, - { - "context": "ext", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ - { - "valueId": "code" - } - ] - } - ] - } - ] - }, - { - "name": "set vaccine valid extension", - "source": [ - { - "context": "src", - "element": "validFrom", - "variable": "validFrom" - } - ], - "target": [ - { - "context": "immunization", - "contextType": "variable", - "element": "extension", - "variable": "ext" - } - ], - "rule": [ - { - "name": "set valid from extension values", - "source": [ - { - "context": "validFrom" - } - ], - "target": [ - { - "context": "ext", - "contextType": "variable", - "element": "url", - "transform": "copy", - "parameter": [ - { - "valueString": "http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineValidFrom" - } - ] - }, - { - "context": "ext", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ - { - "valueId": "validFrom" - } - ] - } - ] - } - ] - }, - { - "name": "set status", - "source": [ - { - "context": "src" - } - ], - "target": [ - { - "context": "immunization", - "contextType": "variable", - "element": "status", - "transform": "copy", - "parameter": [ - { - "valueString": "completed" - } - ] - } - ] - }, - { - "name": "set vaccine", - "source": [ - { - "context": "src", - "element": "vaccine", - "variable": "vaccine" - } - ], - "target": [ - { - "context": "immunization", - "contextType": "variable", - "element": "vaccineCode", - "variable": "vacCode" - }, - { - "context": "vacCode", - "contextType": "variable", - "element": "coding", - "transform": "copy", - "parameter": [ - { - "valueId": "vaccine" - } - ] - } - ] - }, - { - "name": "set patient", - "source": [ - { - "context": "src" - } - ], - "target": [ - { - "context": "immunization", - "contextType": "variable", - "element": "patient", - "variable": "patient" - }, - { - "context": "patient", - "contextType": "variable", - "element": "reference", - "transform": "append", - "parameter": [ - { - "valueString": "Patient/" - }, - { - "valueId": "pid" - } - ] - } - ] - }, - { - "name": "set manufacturer identifier", - "source": [ - { - "context": "src", - "element": "manufacturer", - "variable": "manufacturer" - } - ], - "target": [ - { - "context": "immunization", - "contextType": "variable", - "element": "manufacturer", - "variable": "tman" - }, - { - "context": "tman", - "contextType": "variable", - "element": "identifier", - "variable": "ident" - } - ], - "rule": [ - { - "name": "set system", - "source": [ - { - "context": "manufacturer", - "element": "system", - "variable": "system" - } - ], - "target": [ - { - "context": "ident", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ - { - "valueId": "system" - } - ] - } - ] - }, - { - "name": "set value", - "source": [ - { - "context": "manufacturer", - "element": "code", - "variable": "code" - } - ], - "target": [ - { - "context": "ident", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ - { - "valueId": "code" - } - ] - } - ] - } - ] - }, - { - "name": "set lot number", - "source": [ - { - "context": "src", - "element": "lot", - "variable": "lot" - } - ], - "target": [ - { - "context": "immunization", - "contextType": "variable", - "element": "lotNumber", - "transform": "copy", - "parameter": [ - { - "valueId": "lot" - } - ] - } - ] - }, - { - "name": "set occurrence date", - "source": [ - { - "context": "src", - "element": "date", - "variable": "date" - } - ], - "target": [ - { - "context": "immunization", - "contextType": "variable", - "element": "occurrence", - "transform": "copy", - "parameter": [ - { - "valueId": "date" - } - ] - } - ] - }, - { - "name": "set location", - "source": [ - { - "context": "src", - "element": "centre", - "variable": "centre" - } - ], - "target": [ - { - "context": "immunization", - "contextType": "variable", - "element": "location", - "variable": "location" - } - ], - "rule": [ - { - "name": "set location display", - "source": [ - { - "context": "centre" - } - ], - "target": [ - { - "context": "location", - "contextType": "variable", - "element": "display", - "transform": "copy", - "parameter": [ - { - "valueId": "centre" - } - ] - } - ] - } - ] - }, - { - "name": "set practitioner", - "source": [ - { - "context": "src", - "element": "practitioner", - "variable": "practitioner" - } - ], - "target": [ - { - "context": "immunization", - "contextType": "variable", - "element": "performer", - "variable": "performer" - } - ], - "rule": [ - { - "name": "set performer", - "source": [ - { - "context": "practitioner", - "element": "value", - "variable": "hw" - } - ], - "target": [ - { - "context": "performer", - "contextType": "variable", - "element": "actor", - "variable": "actor" - } - ], - "rule": [ - { - "name": "set actor", - "source": [ - { - "context": "hw" - } - ], - "target": [ - { - "context": "actor", - "contextType": "variable", - "element": "type", - "transform": "copy", - "parameter": [ - { - "valueString": "Practitioner" - } - ] - }, - { - "context": "actor", - "contextType": "variable", - "element": "identifier", - "variable": "identifier" - } - ], - "rule": [ - { - "name": "set hw identifier", - "source": [ - { - "context": "hw" - } - ], - "target": [ - { - "context": "identifier", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ - { - "valueId": "hw" - } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "name": "set protocolApplied", - "source": [ - { - "context": "src" - } - ], - "target": [ - { - "context": "immunization", - "contextType": "variable", - "element": "protocolApplied", - "variable": "protocol" - } - ], - "rule": [ - { - "name": "set authority", - "source": [ - { - "context": "src" - } - ], - "target": [ - { - "context": "protocol", - "contextType": "variable", - "element": "authority", - "variable": "authority" - } - ], - "rule": [ - { - "name": "set issuer", - "source": [ - { - "context": "certificate", - "element": "issuer", - "variable": "issuer" - } - ], - "target": [ - { - "context": "authority", - "contextType": "variable", - "element": "type", - "transform": "copy", - "parameter": [ - { - "valueString": "Organization" - } - ] - } - ], - "rule": [ - { - "name": "set issuer identifier", - "source": [ - { - "context": "issuer", - "element": "identifier", - "variable": "pha" - } - ], - "target": [ - { - "context": "authority", - "contextType": "variable", - "element": "identifier", - "variable": "identifier" - } - ], - "rule": [ - { - "name": "set pha", - "source": [ - { - "context": "pha", - "element": "value", - "variable": "value" - } - ], - "target": [ - { - "context": "identifier", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ - { - "valueId": "value" - } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "name": "set target disease", - "source": [ - { - "context": "src", - "element": "disease", - "variable": "disease" - } - ], - "target": [ - { - "context": "protocol", - "contextType": "variable", - "element": "targetDisease", - "variable": "tdisease" - } - ], - "rule": [ - { - "name": "set target disease code", - "source": [ - { - "context": "disease" - } - ], - "target": [ - { - "context": "tdisease", - "contextType": "variable", - "element": "coding", - "transform": "copy", - "parameter": [ - { - "valueId": "disease" - } - ] - } - ] - } - ] - }, - { - "name": "set dose number", - "source": [ - { - "context": "src", - "element": "dose", - "variable": "dose" - } - ], - "target": [ - { - "context": "protocol", - "contextType": "variable", - "element": "doseNumber", - "transform": "copy", - "parameter": [ - { - "valueId": "dose" - } - ] - } - ] - }, - { - "name": "set total doses", - "source": [ - { - "context": "src", - "element": "totalDoses", - "variable": "totalDoses" - } - ], - "target": [ - { - "context": "protocol", - "contextType": "variable", - "element": "seriesDoses", - "transform": "copy", - "parameter": [ - { - "valueId": "totalDoses" - } - ] - } - ] - } - ] - } - ] - }, - { - "name": "DDCCToImmRec", - "typeMode": "none", - "input": [ - { - "name": "src", - "mode": "source" - }, - { - "name": "immrec", - "type": "DDCCImmunizationRecommendation", - "mode": "target" - }, - { - "name": "irid", - "mode": "source" - }, - { - "name": "iid", - "mode": "source" - }, - { - "name": "pid", - "mode": "source" - } - ], - "rule": [ - { - "name": "set date", - "source": [ - { - "context": "src", - "element": "date", - "variable": "date" - } - ], - "target": [ - { - "context": "immrec", - "contextType": "variable", - "element": "date", - "transform": "copy", - "parameter": [ - { - "valueId": "date" - } - ] - } - ] - }, - { - "name": "set patient", - "source": [ - { - "context": "src" - } - ], - "target": [ - { - "context": "immrec", - "contextType": "variable", - "element": "patient", - "variable": "patient" - }, - { - "context": "patient", - "contextType": "variable", - "element": "reference", - "transform": "append", - "parameter": [ - { - "valueString": "Patient/" - }, - { - "valueId": "pid" - } - ] - } - ] - }, - { - "name": "set recommendation", - "source": [ - { - "context": "src" - } - ], - "target": [ - { - "context": "immrec", - "contextType": "variable", - "element": "recommendation", - "variable": "rec" - } - ], - "rule": [ - { - "name": "set vaccine code", - "source": [ - { - "context": "src", - "element": "vaccine", - "variable": "vaccine" - } - ], - "target": [ - { - "context": "rec", - "contextType": "variable", - "element": "vaccineCode", - "variable": "vaccineCode" - } - ], - "rule": [ - { - "name": "set vaccine code coding", - "source": [ - { - "context": "vaccine" - } - ], - "target": [ - { - "context": "vaccineCode", - "contextType": "variable", - "element": "coding", - "transform": "copy", - "parameter": [ - { - "valueId": "vaccine" - } - ] - } - ] - } - ] - }, - { - "name": "set target disease", - "source": [ - { - "context": "src", - "element": "disease", - "variable": "disease" - } - ], - "target": [ - { - "context": "rec", - "contextType": "variable", - "element": "targetDisease", - "variable": "targetDisease" - } - ], - "rule": [ - { - "name": "set target disease coding", - "source": [ - { - "context": "disease" - } - ], - "target": [ - { - "context": "targetDisease", - "contextType": "variable", - "element": "coding", - "transform": "copy", - "parameter": [ - { - "valueId": "disease" - } - ] - } - ] - } - ] - }, - { - "name": "set forecast status", - "source": [ - { - "context": "src" - } - ], - "target": [ - { - "context": "rec", - "contextType": "variable", - "element": "forecastStatus", - "variable": "forecast" - } - ], - "rule": [ - { - "name": "set forecast status coding", - "source": [ - { - "context": "src" - } - ], - "target": [ - { - "context": "forecast", - "contextType": "variable", - "element": "coding", - "variable": "coding" - } - ], - "rule": [ - { - "name": "set forecast system", - "source": [ - { - "context": "src" - } - ], - "target": [ - { - "context": "coding", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ - { - "valueString": "http://terminology.hl7.org/2.1.0/CodeSystem-immunization-recommendation-status.html" - } - ] - } - ] - }, - { - "name": "set forecast code", - "source": [ - { - "context": "src" - } - ], - "target": [ - { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ - { - "valueString": "due" - } - ] - } - ] - } - ] - } - ] - }, - { - "name": "set date criterion", - "source": [ - { - "context": "src" - } - ], - "target": [ - { - "context": "rec", - "contextType": "variable", - "element": "dateCriterion", - "variable": "due_date" - } - ], - "rule": [ - { - "name": "set due date code", - "source": [ - { - "context": "src" - } - ], - "target": [ - { - "context": "due_date", - "contextType": "variable", - "element": "code", - "variable": "code" - } - ], - "rule": [ - { - "name": "set due date code coding", - "source": [ - { - "context": "src" - } - ], - "target": [ - { - "context": "code", - "contextType": "variable", - "element": "coding", - "variable": "coding" - } - ], - "rule": [ - { - "name": "set due date code system", - "source": [ - { - "context": "src" - } - ], - "target": [ - { - "context": "coding", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ - { - "valueString": "http://loinc.org" - } - ] - } - ] - }, - { - "name": "set due date code code", - "source": [ - { - "context": "src" - } - ], - "target": [ - { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ - { - "valueString": "30980-7" - } - ] - } - ] - } - ] - } - ] - }, - { - "name": "set due date value", - "source": [ - { - "context": "src", - "element": "nextDose", - "variable": "nextDose" - } - ], - "target": [ - { - "context": "due_date", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ - { - "valueId": "nextDose" - } - ] - } - ] - } - ] - }, - { - "name": "set dose number", - "source": [ - { - "context": "src", - "element": "dose", - "variable": "dose" - } - ], - "target": [ - { - "context": "rec", - "contextType": "variable", - "element": "doseNumber", - "transform": "evaluate", - "parameter": [ - { - "valueString": "dose.toInteger() + 1" - } - ] - } - ] - }, - { - "name": "set total doses", - "source": [ - { - "context": "src", - "element": "totalDoses", - "variable": "totalDoses" - } - ], - "target": [ - { - "context": "rec", - "contextType": "variable", - "element": "seriesDoses", - "transform": "copy", - "parameter": [ - { - "valueId": "totalDoses" - } - ] - } - ] - }, - { - "name": "set supporting immunization", - "source": [ - { - "context": "src" - } - ], - "target": [ - { - "context": "rec", - "contextType": "variable", - "element": "supportingImmunization", - "variable": "imm" - }, - { - "context": "imm", - "contextType": "variable", - "element": "reference", - "transform": "append", - "parameter": [ - { - "valueString": "Immunization/" - }, - { - "valueId": "iid" - } - ] - } - ] - } - ] - } - ] - } - ] -} - diff --git a/input/resources/StructureMap-CoreDataSetVSToAddBundle.json b/input/resources/StructureMap-CoreDataSetVSToAddBundle.json deleted file mode 100644 index 71d4699692..0000000000 --- a/input/resources/StructureMap-CoreDataSetVSToAddBundle.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "resourceType": "StructureMap", - "id": "CoreDataSetVSToAddBundle", - "meta": { - "versionId": "2", - "lastUpdated": "2022-06-01T12:54:53.172+00:00" - }, - "text": { - "status": "generated", - "div": "
map "http://smart.who.int/ddcc/StructureMap/CoreDataSetVSToAddBundle" = "CoreDataSetVSToAddBundle"\r\n\r\n\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS" alias DDCCVS as source\r\nuses "http://hl7.org/fhir/StructureDefinition/Bundle" alias AddBundle as target\r\n\r\nimports "http://smart.who.int/ddcc/StructureMap/CoreDataSetVSLibrary"\r\n\r\ngroup CoreDataSetVSToAddBundle(source ddcc : DDCCVS, target bundle : AddBundle) {\r\n  ddcc -> bundle then VSToAddBundle(ddcc, bundle) "setup add bundle";\r\n}\r\n\r\n
" - }, - "url": "http://smart.who.int/ddcc/StructureMap/CoreDataSetVSToAddBundle", - "name": "CoreDataSetVSToAddBundle", - "structure": [ - { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS", - "mode": "source", - "alias": "DDCCVS" - }, - { - "url": "http://hl7.org/fhir/StructureDefinition/Bundle", - "mode": "target", - "alias": "AddBundle" - } - ], - "import": [ - "http://smart.who.int/ddcc/StructureMap/CoreDataSetVSLibrary" - ], - "group": [ - { - "name": "CoreDataSetVSToAddBundle", - "typeMode": "none", - "input": [ - { - "name": "ddcc", - "type": "DDCCVS", - "mode": "source" - }, - { - "name": "bundle", - "type": "AddBundle", - "mode": "target" - } - ], - "rule": [ - { - "name": "setup add bundle", - "source": [ - { - "context": "ddcc" - } - ], - "target": [ - { - "contextType": "variable", - "transform": "copy", - "parameter": [ - { - "valueId": "bundle" - } - ] - } - ], - "dependent": [ - { - "name": "VSToAddBundle", - "variable": [ - "ddcc", - "bundle" - ], - "_variable": [ - { - "extension": [ - { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } - ] - }, - { - "extension": [ - { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } - ] - } - ] - } - ] - } - ] - } - ] -} - diff --git a/input/resources/StructureMap-CoreDataSetVSToSHC.json b/input/resources/StructureMap-CoreDataSetVSToSHC.json deleted file mode 100644 index b6445db4ae..0000000000 --- a/input/resources/StructureMap-CoreDataSetVSToSHC.json +++ /dev/null @@ -1,506 +0,0 @@ -{ - "resourceType": "StructureMap", - "id": "CoreDataSetVSToSHC", - "meta": { - "versionId": "11", - "lastUpdated": "2022-01-06T19:34:21.893+00:00" - }, - "text": { - "status": "generated", - "div": "
map "http://smart.who.int/ddcc/StructureMap/CoreDataSetVSToSHC" = "CoreDataSetVSToSHC"\r\n\r\n\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS" alias DDCCVS as source\r\nuses "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-vaccination-bundle-dm" alias SHCVaccinationBundleDM as target\r\nuses "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-patient-general-dm" alias SHCPatientDM as produced\r\nuses "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-vaccination-dm" alias SHCImmunizationDM as produced\r\n\r\ngroup VSToSHC(source ddcc : DDCCVS, target shc : SHCVaccinationBundleDM) {\r\n  ddcc -> shc.type = 'collection' "set bundle type";\r\n  ddcc -> shc then {\r\n    ddcc ->  shc.entry as entry,  entry.fullUrl = 'resource:0',  create('http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-patient-general-dm') as patient then {\r\n      ddcc then DDCCToPatient(ddcc, patient) "setup patient";\r\n      ddcc -> entry.resource = patient "set patient resource";\r\n    } "create patient resource";\r\n    ddcc.vaccination first as vaccination ->  shc.entry as entry,  entry.fullUrl = 'resource:1',  create('http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-vaccination-dm') as immunization then {\r\n      vaccination then DDCCToImmunization(vaccination, immunization) "setup immunization";\r\n      ddcc -> entry.resource = immunization "set immunization resource";\r\n    } "create immunization resource";\r\n  } "set bundle entries";\r\n}\r\n\r\ngroup DDCCToPatient(source src : DDCCVS, target patient : SHCPatientDM) {\r\n  src.name as name -> patient.name as tName then {\r\n    name as content -> tName.text = content "set name";\r\n  } "set full name";\r\n  src.birthDate as birthDate -> patient.birthDate = birthDate "set birthDate";\r\n}\r\n\r\ngroup DDCCToImmunization(source src : DDCCVS, target immunization : SHCImmunizationDM) {\r\n  src -> immunization.status = 'completed' "set status";\r\n  src.vaccine as vaccine ->  immunization.vaccineCode as vaccineCode,  vaccineCode.coding as coding then {\r\n    vaccine.system as system -> coding.system = system "set vaccine code system";\r\n    vaccine.code as code -> coding.code = code "set vaccine code";\r\n  } "set vaccine";\r\n  src ->  immunization.patient as patient,  patient.reference = 'resource:0' "set patient";\r\n  src.maholder as maholder where src.maholder.code.hasValue() ->  immunization.manufacturer as tman,  tman.identifier as ident then {\r\n    maholder.system as system -> ident.system = system "set system";\r\n    maholder.code as code -> ident.value = code "set value";\r\n  } "set maholder";\r\n  src as ddccvs where ddccvs.maholder.code.hasValue().not() then {\r\n    ddccvs.manufacturer as manufacturer ->  immunization.manufacturer as tman,  tman.identifier as ident then {\r\n      manufacturer.system as system -> ident.system = system "set system";\r\n      manufacturer.code as code -> ident.value = code "set value";\r\n    } "set manufacturer";\r\n  } "if maholder code empty";\r\n  src.lot as lot -> immunization.lotNumber = lot "set lot number";\r\n  src.date as date -> immunization.occurrence = date "set occurrence date";\r\n  src.centre as centre ->  immunization.performer as performer,  performer.actor as actor then {\r\n    centre -> actor.display = centre "set actor display";\r\n  } "set performer";\r\n}\r\n\r\n
" - }, - "url": "http://smart.who.int/ddcc/StructureMap/CoreDataSetVSToSHC", - "name": "CoreDataSetVSToSHC", - "structure": [ { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS", - "mode": "source", - "alias": "DDCCVS" - }, { - "url": "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-vaccination-bundle-dm", - "mode": "target", - "alias": "SHCVaccinationBundleDM" - }, { - "url": "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-patient-general-dm", - "mode": "produced", - "alias": "SHCPatientDM" - }, { - "url": "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-vaccination-dm", - "mode": "produced", - "alias": "SHCImmunizationDM" - } ], - "group": [ { - "name": "VSToSHC", - "typeMode": "none", - "input": [ { - "name": "ddcc", - "type": "DDCCVS", - "mode": "source" - }, { - "name": "shc", - "type": "SHCVaccinationBundleDM", - "mode": "target" - } ], - "rule": [ { - "name": "set bundle type", - "source": [ { - "context": "ddcc" - } ], - "target": [ { - "context": "shc", - "contextType": "variable", - "element": "type", - "transform": "copy", - "parameter": [ { - "valueString": "collection" - } ] - } ] - }, { - "name": "set bundle entries", - "source": [ { - "context": "ddcc" - } ], - "target": [ { - "contextType": "variable", - "transform": "copy", - "parameter": [ { - "valueId": "shc" - } ] - } ], - "rule": [ { - "name": "create patient resource", - "source": [ { - "context": "ddcc" - } ], - "target": [ { - "context": "shc", - "contextType": "variable", - "element": "entry", - "variable": "entry" - }, { - "context": "entry", - "contextType": "variable", - "element": "fullUrl", - "transform": "copy", - "parameter": [ { - "valueString": "resource:0" - } ] - }, { - "contextType": "variable", - "variable": "patient", - "transform": "create", - "parameter": [ { - "valueString": "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-patient-general-dm" - } ] - } ], - "rule": [ { - "name": "setup patient", - "source": [ { - "context": "ddcc" - } ], - "dependent": [ { - "name": "DDCCToPatient", - "variable": [ "ddcc", "patient" ] - } ] - }, { - "name": "set patient resource", - "source": [ { - "context": "ddcc" - } ], - "target": [ { - "context": "entry", - "contextType": "variable", - "element": "resource", - "transform": "copy", - "parameter": [ { - "valueId": "patient" - } ] - } ] - } ] - }, { - "name": "create immunization resource", - "source": [ { - "context": "ddcc", - "element": "vaccination", - "listMode": "first", - "variable": "vaccination" - } ], - "target": [ { - "context": "shc", - "contextType": "variable", - "element": "entry", - "variable": "entry" - }, { - "context": "entry", - "contextType": "variable", - "element": "fullUrl", - "transform": "copy", - "parameter": [ { - "valueString": "resource:1" - } ] - }, { - "contextType": "variable", - "variable": "immunization", - "transform": "create", - "parameter": [ { - "valueString": "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-vaccination-dm" - } ] - } ], - "rule": [ { - "name": "setup immunization", - "source": [ { - "context": "vaccination" - } ], - "dependent": [ { - "name": "DDCCToImmunization", - "variable": [ "vaccination", "immunization" ] - } ] - }, { - "name": "set immunization resource", - "source": [ { - "context": "ddcc" - } ], - "target": [ { - "context": "entry", - "contextType": "variable", - "element": "resource", - "transform": "copy", - "parameter": [ { - "valueId": "immunization" - } ] - } ] - } ] - } ] - } ] - }, { - "name": "DDCCToPatient", - "typeMode": "none", - "input": [ { - "name": "src", - "type": "DDCCVS", - "mode": "source" - }, { - "name": "patient", - "type": "SHCPatientDM", - "mode": "target" - } ], - "rule": [ { - "name": "set full name", - "source": [ { - "context": "src", - "element": "name", - "variable": "name" - } ], - "target": [ { - "context": "patient", - "contextType": "variable", - "element": "name", - "variable": "tName" - } ], - "rule": [ { - "name": "set name", - "source": [ { - "context": "name", - "variable": "content" - } ], - "target": [ { - "context": "tName", - "contextType": "variable", - "element": "text", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "set birthDate", - "source": [ { - "context": "src", - "element": "birthDate", - "variable": "birthDate" - } ], - "target": [ { - "context": "patient", - "contextType": "variable", - "element": "birthDate", - "transform": "copy", - "parameter": [ { - "valueId": "birthDate" - } ] - } ] - } ] - }, { - "name": "DDCCToImmunization", - "typeMode": "none", - "input": [ { - "name": "src", - "type": "DDCCVS", - "mode": "source" - }, { - "name": "immunization", - "type": "SHCImmunizationDM", - "mode": "target" - } ], - "rule": [ { - "name": "set status", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "immunization", - "contextType": "variable", - "element": "status", - "transform": "copy", - "parameter": [ { - "valueString": "completed" - } ] - } ] - }, { - "name": "set vaccine", - "source": [ { - "context": "src", - "element": "vaccine", - "variable": "vaccine" - } ], - "target": [ { - "context": "immunization", - "contextType": "variable", - "element": "vaccineCode", - "variable": "vaccineCode" - }, { - "context": "vaccineCode", - "contextType": "variable", - "element": "coding", - "variable": "coding" - } ], - "rule": [ { - "name": "set vaccine code system", - "source": [ { - "context": "vaccine", - "element": "system", - "variable": "system" - } ], - "target": [ { - "context": "coding", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueId": "system" - } ] - } ] - }, { - "name": "set vaccine code", - "source": [ { - "context": "vaccine", - "element": "code", - "variable": "code" - } ], - "target": [ { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "code" - } ] - } ] - } ] - }, { - "name": "set patient", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "immunization", - "contextType": "variable", - "element": "patient", - "variable": "patient" - }, { - "context": "patient", - "contextType": "variable", - "element": "reference", - "transform": "copy", - "parameter": [ { - "valueString": "resource:0" - } ] - } ] - }, { - "name": "set maholder", - "source": [ { - "context": "src", - "element": "maholder", - "variable": "maholder", - "condition": "src.maholder.code.hasValue()" - } ], - "target": [ { - "context": "immunization", - "contextType": "variable", - "element": "manufacturer", - "variable": "tman" - }, { - "context": "tman", - "contextType": "variable", - "element": "identifier", - "variable": "ident" - } ], - "rule": [ { - "name": "set system", - "source": [ { - "context": "maholder", - "element": "system", - "variable": "system" - } ], - "target": [ { - "context": "ident", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueId": "system" - } ] - } ] - }, { - "name": "set value", - "source": [ { - "context": "maholder", - "element": "code", - "variable": "code" - } ], - "target": [ { - "context": "ident", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "code" - } ] - } ] - } ] - }, { - "name": "if maholder code empty", - "source": [ { - "context": "src", - "variable": "ddccvs", - "condition": "ddccvs.maholder.code.hasValue().not()" - } ], - "rule": [ { - "name": "set manufacturer", - "source": [ { - "context": "ddccvs", - "element": "manufacturer", - "variable": "manufacturer" - } ], - "target": [ { - "context": "immunization", - "contextType": "variable", - "element": "manufacturer", - "variable": "tman" - }, { - "context": "tman", - "contextType": "variable", - "element": "identifier", - "variable": "ident" - } ], - "rule": [ { - "name": "set system", - "source": [ { - "context": "manufacturer", - "element": "system", - "variable": "system" - } ], - "target": [ { - "context": "ident", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueId": "system" - } ] - } ] - }, { - "name": "set value", - "source": [ { - "context": "manufacturer", - "element": "code", - "variable": "code" - } ], - "target": [ { - "context": "ident", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "code" - } ] - } ] - } ] - } ] - }, { - "name": "set lot number", - "source": [ { - "context": "src", - "element": "lot", - "variable": "lot" - } ], - "target": [ { - "context": "immunization", - "contextType": "variable", - "element": "lotNumber", - "transform": "copy", - "parameter": [ { - "valueId": "lot" - } ] - } ] - }, { - "name": "set occurrence date", - "source": [ { - "context": "src", - "element": "date", - "variable": "date" - } ], - "target": [ { - "context": "immunization", - "contextType": "variable", - "element": "occurrence", - "transform": "copy", - "parameter": [ { - "valueId": "date" - } ] - } ] - }, { - "name": "set performer", - "source": [ { - "context": "src", - "element": "centre", - "variable": "centre" - } ], - "target": [ { - "context": "immunization", - "contextType": "variable", - "element": "performer", - "variable": "performer" - }, { - "context": "performer", - "contextType": "variable", - "element": "actor", - "variable": "actor" - } ], - "rule": [ { - "name": "set actor display", - "source": [ { - "context": "centre" - } ], - "target": [ { - "context": "actor", - "contextType": "variable", - "element": "display", - "transform": "copy", - "parameter": [ { - "valueId": "centre" - } ] - } ] - } ] - } ] - } ] -} diff --git a/input/resources/StructureMap-DDCCtoCoredataset.json b/input/resources/StructureMap-DDCCtoCoredataset.json deleted file mode 100644 index 1cc183d69d..0000000000 --- a/input/resources/StructureMap-DDCCtoCoredataset.json +++ /dev/null @@ -1,434 +0,0 @@ -{ - "resourceType": "StructureMap", - "id": "DDCCtoCoredataset", - "meta": { - "versionId": "1", - "lastUpdated": "2022-03-01T19:17:56.589+00:00" - }, - "text": { - "status": "generated", - "div": "
map "http://smart.who.int/ddcc/StructureMap/DDCCtoCoredataset" = "DDCCtoCoredataset"\r\n\r\n\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCVSComposition" alias DDCC as source\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCDocument" alias DDCCDocument as source\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCPatient" alias DDCCPatient as source\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCVSComposition" alias DDCCVSComposition as source\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCCountryOfVaccination" alias DDCCCountryOfVaccination as source\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineBrand" alias DDCCVaccineBrand as source\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCOrganization" alias DDCCOrganization as source\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunization" alias DDCCImmunization as source\r\nuses "http://smart.who.int/ddcc/DDCCCoreDataSet-VS-PoV" alias DDCCCoreDataSetPoV as target\r\n\r\ngroup DecodeDDCCtoQR(source ddcc : DDCCDocument, target qr : DDCCCoreDataSetPoV) {\r\n  ddcc.entry as entry then {\r\n    // entry.resource : DDCCPatient as patient\r\n    entry.resource : Patient as patient then DecodePatientToQR(patient, qr) "Patient";\r\n  };\r\n  ddcc.entry as entry then {\r\n    entry.resource : Immunization as immunization log immunization then DecodeImmunizationToQR(ddcc, immunization, qr) "Immunization";\r\n  };\r\n}\r\n\r\ngroup DecodePatientToQR(source patient : DDCCPatient, target qr : DDCCCoreDataSetPoV) {\r\n  patient.birthDate as birthDate -> qr.birthDate = birthDate;\r\n  patient.name as name then {\r\n    name.text as text -> qr.name = text;\r\n  };\r\n}\r\n\r\ngroup DecodeImmunizationToQR(source ddcc : DDCCDocument, source immunization : DDCCImmunization, target qr : DDCCCoreDataSetPoV) {\r\n  immunization -> qr.vaccination = create('BackboneElement') as vacEvent then {\r\n    immunization.protocolApplied as protocol then {\r\n      protocol.doseNumberPositiveInt as dose -> vacEvent.dose = dose;\r\n      protocol.seriesDosesPositiveInt as doseNum -> vacEvent.totalDoses = doseNum;\r\n      protocol.targetDisease as targetDisease then {\r\n        targetDisease.valueCodableConcept as valueCodableConcept -> vacEvent.disease = valueCodableConcept;\r\n      } "Target-Disease";\r\n    };\r\n    immunization.occurrenceDateTime as date -> vacEvent.date = date;\r\n    // TODO: need to populate vacEvent.maholder\r\n    immunization.extension as country where (url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCCountryOfEvent') then {\r\n      country.valueCode as code ->  vacEvent.country = create('Coding') as coding,  coding.code = code,  coding.system = 'http://hl7.org/fhir/ValueSet/iso3166-1-3';\r\n    } "Country";\r\n    // immunization.extension : DDCCBrand as brand\r\n    immunization.extension as brand where (url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCEventBrand') then {\r\n      brand.valueCoding as valueCoding -> vacEvent.brand = valueCoding;\r\n    } "Vaccine-Brand";\r\n    immunization.vaccineCode as vaccineCode then {\r\n      vaccineCode.coding as coding -> vacEvent.vaccine = coding;\r\n    } "Vaccine-Code";\r\n    ddcc.entry as entry then {\r\n      // entry.resource : DDCCOrganization as organization\r\n      entry.resource : Organization as organization then {\r\n        organization.name as name -> vacEvent.centre = name;\r\n      } "Centre-Name";\r\n    } "Vaccination-Centre";\r\n    ddcc.entry as entry then {\r\n      // entry.resource : DDCCVSComposition as composition\r\n      entry.resource : Composition as composition then {\r\n        composition.identifier as identifier -> qr.identifier = identifier;\r\n      } "Vaccination-Event-ID";\r\n    } "Vaccination-Event";\r\n  } "Vaccination";\r\n}\r\n\r\n
" - }, - "url": "http://smart.who.int/ddcc/StructureMap/DDCCtoCoredataset", - "name": "DDCCtoCoredataset", - "structure": [ { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCVSComposition", - "mode": "source", - "alias": "DDCC" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCDocument", - "mode": "source", - "alias": "DDCCDocument" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCPatient", - "mode": "source", - "alias": "DDCCPatient" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCVSComposition", - "mode": "source", - "alias": "DDCCVSComposition" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCCountryOfVaccination", - "mode": "source", - "alias": "DDCCCountryOfVaccination" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineBrand", - "mode": "source", - "alias": "DDCCVaccineBrand" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCOrganization", - "mode": "source", - "alias": "DDCCOrganization" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunization", - "mode": "source", - "alias": "DDCCImmunization" - }, { - "url": "http://smart.who.int/ddcc/DDCCCoreDataSet-VS-PoV", - "mode": "target", - "alias": "DDCCCoreDataSetPoV" - } ], - "group": [ { - "name": "DecodeDDCCtoQR", - "typeMode": "none", - "input": [ { - "name": "ddcc", - "type": "DDCCDocument", - "mode": "source" - }, { - "name": "qr", - "type": "DDCCCoreDataSetPoV", - "mode": "target" - } ], - "rule": [ { - "name": "entry", - "source": [ { - "context": "ddcc", - "element": "entry", - "variable": "entry" - } ], - "rule": [ { - "name": "Patient", - "source": [ { - "context": "entry", - "type": "Patient", - "element": "resource", - "variable": "patient" - } ], - "dependent": [ { - "name": "DecodePatientToQR", - "variable": [ "patient", "qr" ] - } ], - "documentation": "entry.resource : DDCCPatient as patient" - } ] - }, { - "name": "entry", - "source": [ { - "context": "ddcc", - "element": "entry", - "variable": "entry" - } ], - "rule": [ { - "name": "Immunization", - "source": [ { - "context": "entry", - "type": "Immunization", - "element": "resource", - "variable": "immunization", - "logMessage": "immunization" - } ], - "dependent": [ { - "name": "DecodeImmunizationToQR", - "variable": [ "ddcc", "immunization", "qr" ] - } ] - } ] - } ] - }, { - "name": "DecodePatientToQR", - "typeMode": "none", - "input": [ { - "name": "patient", - "type": "DDCCPatient", - "mode": "source" - }, { - "name": "qr", - "type": "DDCCCoreDataSetPoV", - "mode": "target" - } ], - "rule": [ { - "name": "birthDate", - "source": [ { - "context": "patient", - "element": "birthDate", - "variable": "birthDate" - } ], - "target": [ { - "context": "qr", - "contextType": "variable", - "element": "birthDate", - "transform": "copy", - "parameter": [ { - "valueId": "birthDate" - } ] - } ] - }, { - "name": "name", - "source": [ { - "context": "patient", - "element": "name", - "variable": "name" - } ], - "rule": [ { - "name": "text", - "source": [ { - "context": "name", - "element": "text", - "variable": "text" - } ], - "target": [ { - "context": "qr", - "contextType": "variable", - "element": "name", - "transform": "copy", - "parameter": [ { - "valueId": "text" - } ] - } ] - } ] - } ] - }, { - "name": "DecodeImmunizationToQR", - "typeMode": "none", - "input": [ { - "name": "ddcc", - "type": "DDCCDocument", - "mode": "source" - }, { - "name": "immunization", - "type": "DDCCImmunization", - "mode": "source" - }, { - "name": "qr", - "type": "DDCCCoreDataSetPoV", - "mode": "target" - } ], - "rule": [ { - "name": "Vaccination", - "source": [ { - "context": "immunization" - } ], - "target": [ { - "context": "qr", - "contextType": "variable", - "element": "vaccination", - "variable": "vacEvent", - "transform": "create", - "parameter": [ { - "valueString": "BackboneElement" - } ] - } ], - "rule": [ { - "name": "protocolApplied", - "source": [ { - "context": "immunization", - "element": "protocolApplied", - "variable": "protocol" - } ], - "rule": [ { - "name": "doseNumberPositiveInt", - "source": [ { - "context": "protocol", - "element": "doseNumberPositiveInt", - "variable": "dose" - } ], - "target": [ { - "context": "vacEvent", - "contextType": "variable", - "element": "dose", - "transform": "copy", - "parameter": [ { - "valueId": "dose" - } ] - } ] - }, { - "name": "seriesDosesPositiveInt", - "source": [ { - "context": "protocol", - "element": "seriesDosesPositiveInt", - "variable": "doseNum" - } ], - "target": [ { - "context": "vacEvent", - "contextType": "variable", - "element": "totalDoses", - "transform": "copy", - "parameter": [ { - "valueId": "doseNum" - } ] - } ] - }, { - "name": "Target-Disease", - "source": [ { - "context": "protocol", - "element": "targetDisease", - "variable": "targetDisease" - } ], - "rule": [ { - "name": "valueCodableConcept", - "source": [ { - "context": "targetDisease", - "element": "valueCodableConcept", - "variable": "valueCodableConcept" - } ], - "target": [ { - "context": "vacEvent", - "contextType": "variable", - "element": "disease", - "transform": "copy", - "parameter": [ { - "valueId": "valueCodableConcept" - } ] - } ] - } ] - } ] - }, { - "name": "occurrenceDateTime", - "source": [ { - "context": "immunization", - "element": "occurrenceDateTime", - "variable": "date" - } ], - "target": [ { - "context": "vacEvent", - "contextType": "variable", - "element": "date", - "transform": "copy", - "parameter": [ { - "valueId": "date" - } ] - } ] - }, { - "name": "Country", - "source": [ { - "context": "immunization", - "element": "extension", - "variable": "country", - "condition": "(url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCCountryOfEvent')" - } ], - "rule": [ { - "name": "valueCode", - "source": [ { - "context": "country", - "element": "valueCode", - "variable": "code" - } ], - "target": [ { - "context": "vacEvent", - "contextType": "variable", - "element": "country", - "variable": "coding", - "transform": "create", - "parameter": [ { - "valueString": "Coding" - } ] - }, { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "code" - } ] - }, { - "context": "coding", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueString": "http://hl7.org/fhir/ValueSet/iso3166-1-3" - } ] - } ] - } ], - "documentation": "TODO: need to populate vacEvent.maholder" - }, { - "name": "Vaccine-Brand", - "source": [ { - "context": "immunization", - "element": "extension", - "variable": "brand", - "condition": "(url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCEventBrand')" - } ], - "rule": [ { - "name": "valueCoding", - "source": [ { - "context": "brand", - "element": "valueCoding", - "variable": "valueCoding" - } ], - "target": [ { - "context": "vacEvent", - "contextType": "variable", - "element": "brand", - "transform": "copy", - "parameter": [ { - "valueId": "valueCoding" - } ] - } ] - } ], - "documentation": "immunization.extension : DDCCBrand as brand" - }, { - "name": "Vaccine-Code", - "source": [ { - "context": "immunization", - "element": "vaccineCode", - "variable": "vaccineCode" - } ], - "rule": [ { - "name": "coding", - "source": [ { - "context": "vaccineCode", - "element": "coding", - "variable": "coding" - } ], - "target": [ { - "context": "vacEvent", - "contextType": "variable", - "element": "vaccine", - "transform": "copy", - "parameter": [ { - "valueId": "coding" - } ] - } ] - } ] - }, { - "name": "Vaccination-Centre", - "source": [ { - "context": "ddcc", - "element": "entry", - "variable": "entry" - } ], - "rule": [ { - "name": "Centre-Name", - "source": [ { - "context": "entry", - "type": "Organization", - "element": "resource", - "variable": "organization" - } ], - "rule": [ { - "name": "name", - "source": [ { - "context": "organization", - "element": "name", - "variable": "name" - } ], - "target": [ { - "context": "vacEvent", - "contextType": "variable", - "element": "centre", - "transform": "copy", - "parameter": [ { - "valueId": "name" - } ] - } ] - } ], - "documentation": "entry.resource : DDCCOrganization as organization" - } ] - }, { - "name": "Vaccination-Event", - "source": [ { - "context": "ddcc", - "element": "entry", - "variable": "entry" - } ], - "rule": [ { - "name": "Vaccination-Event-ID", - "source": [ { - "context": "entry", - "type": "Composition", - "element": "resource", - "variable": "composition" - } ], - "rule": [ { - "name": "identifier", - "source": [ { - "context": "composition", - "element": "identifier", - "variable": "identifier" - } ], - "target": [ { - "context": "qr", - "contextType": "variable", - "element": "identifier", - "transform": "copy", - "parameter": [ { - "valueId": "identifier" - } ] - } ] - } ], - "documentation": "entry.resource : DDCCVSComposition as composition" - } ] - } ] - } ] - } ] -} diff --git a/input/resources/StructureMap-DDCCtoEUdcc.json b/input/resources/StructureMap-DDCCtoEUdcc.json deleted file mode 100644 index 0f448edcbb..0000000000 --- a/input/resources/StructureMap-DDCCtoEUdcc.json +++ /dev/null @@ -1,466 +0,0 @@ -{ - "resourceType": "StructureMap", - "id": "DDCCtoEUdcc", - "meta": { - "versionId": "1", - "lastUpdated": "2022-03-01T19:17:57.411+00:00" - }, - "text": { - "status": "generated", - "div": "
map "http://smart.who.int/ddcc/StructureMap/DDCCtoEUdcc" = "DDCCtoEUdcc"\r\n\r\n\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCVSomposition" alias DDCC as source\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCDocument" alias DDCCDocument as source\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCPatient" alias DDCCPatient as source\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCVSComposition" alias DDCCVSComposition as source\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCOrganization" alias DDCCOrganization as source\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCCountryOfVaccination" alias DDCCCountryOfVaccination as source\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineBrand" alias DDCCVaccineBrand as source\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunization" alias DDCCImmunization as source\r\nuses "http://hl7.eu/fhir/ig/dcc/StructureDefinition/HC1" alias EUDCC as target\r\nuses "http://hl7.eu/fhir/ig/dcc/StructureDefinition/v" alias vacEvent as target\r\n\r\ngroup DecodeDDCCtoQR(source ddcc : DDCCDocument, target qr : EUDCC) {\r\n  ddcc -> qr.ver = 'XXX' "Version";\r\n  ddcc.entry as entry then {\r\n    entry.resource : DDCCPatient as patient then DecodePatientToQR(patient, qr) "Patient";\r\n  } "Patient";\r\n  ddcc.entry as entry then {\r\n    entry.resource : Immunization as immunization then DecodeImmunizationToQR(ddcc, immunization, qr) "Immunization";\r\n  } "Immunization";\r\n}\r\n\r\ngroup DecodePatientToQR(source patient : DDCCPatient, target qr : EUDCC) {\r\n  patient.birthDate as birthDate -> qr.dob = birthDate;\r\n  patient.name as name then {\r\n    name.text as text -> qr.nam = text;\r\n  };\r\n}\r\n\r\ngroup DecodeImmunizationToQR(source ddcc : DDCCDocument, source immunization : DDCCImmunization, target qr : EUDCC) {\r\n  immunization -> qr.v = create('http://hl7.eu/fhir/ig/dcc/StructureDefinition/v') as vacEvent then {\r\n    immunization.protocolApplied as protocol then {\r\n      protocol.doseNumberPositiveInt as dose -> vacEvent.dn = dose;\r\n      protocol.seriesDosesPositiveInt as doseNum -> vacEvent.sd = doseNum;\r\n      protocol.targetDisease as targetDisease then {\r\n        targetDisease.coding as coding then {\r\n          coding.code as code -> vacEvent.tg = code;\r\n        } "Protocol-Disease-Code";\r\n      } "Protocol-Disease";\r\n    } "Protocol";\r\n    immunization.occurrenceDateTime as date -> vacEvent.dt = date;\r\n    // TODO: need to populate vacEvent.ma market authorization holder\r\n    immunization.extension as country where (url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCCountryOfEvent') then {\r\n      country.valueCode as code -> vacEvent.co = code;\r\n    } "Country";\r\n    // immunization.extension : DDCCBrand as brand\r\n    immunization.extension as brand where (url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCEventBrand') then {\r\n      brand.valueCoding as valueCoding then {\r\n        valueCoding.code as code -> vacEvent.mp = code;\r\n      } "Vaccine-Brand-Code";\r\n    } "Vaccine-Brand";\r\n    // immunization.vaccineCode : Coding as vaccineCode then {\r\n    immunization.vaccineCode as vaccineCode then {\r\n      vaccineCode.coding as coding then {\r\n        coding.code as code -> vacEvent.vp = code;\r\n      } "Vaccine-Code";\r\n    } "Vaccine-Coding";\r\n    ddcc.entry as entry then {\r\n      // entry.resource : DDCCOrganization as organization\r\n      entry.resource : Organization as organization then {\r\n        organization.name as name -> vacEvent.is = name;\r\n      } "Centre-Name";\r\n    } "Vaccination-Centre";\r\n    ddcc.entry as entry then {\r\n      // entry.resource : DDCCVSComposition as composition\r\n      entry.resource : Composition as composition then {\r\n        composition.identifier as identifier then {\r\n          identifier.value as value -> vacEvent.ci = value;\r\n        } "Vaccination-Event-ID-Value";\r\n      } "Vaccination-Event-ID";\r\n    } "Vaccination-Event";\r\n  } "Vaccination";\r\n}\r\n\r\n
" - }, - "url": "http://smart.who.int/ddcc/StructureMap/DDCCtoEUdcc", - "name": "DDCCtoEUdcc", - "structure": [ { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCVSomposition", - "mode": "source", - "alias": "DDCC" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCDocument", - "mode": "source", - "alias": "DDCCDocument" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCPatient", - "mode": "source", - "alias": "DDCCPatient" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCVSComposition", - "mode": "source", - "alias": "DDCCVSComposition" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCOrganization", - "mode": "source", - "alias": "DDCCOrganization" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCCountryOfVaccination", - "mode": "source", - "alias": "DDCCCountryOfVaccination" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineBrand", - "mode": "source", - "alias": "DDCCVaccineBrand" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunization", - "mode": "source", - "alias": "DDCCImmunization" - }, { - "url": "http://hl7.eu/fhir/ig/dcc/StructureDefinition/HC1", - "mode": "target", - "alias": "EUDCC" - }, { - "url": "http://hl7.eu/fhir/ig/dcc/StructureDefinition/v", - "mode": "target", - "alias": "vacEvent" - } ], - "group": [ { - "name": "DecodeDDCCtoQR", - "typeMode": "none", - "input": [ { - "name": "ddcc", - "type": "DDCCDocument", - "mode": "source" - }, { - "name": "qr", - "type": "EUDCC", - "mode": "target" - } ], - "rule": [ { - "name": "Version", - "source": [ { - "context": "ddcc" - } ], - "target": [ { - "context": "qr", - "contextType": "variable", - "element": "ver", - "transform": "copy", - "parameter": [ { - "valueString": "XXX" - } ] - } ] - }, { - "name": "Patient", - "source": [ { - "context": "ddcc", - "element": "entry", - "variable": "entry" - } ], - "rule": [ { - "name": "Patient", - "source": [ { - "context": "entry", - "type": "DDCCPatient", - "element": "resource", - "variable": "patient" - } ], - "dependent": [ { - "name": "DecodePatientToQR", - "variable": [ "patient", "qr" ] - } ] - } ] - }, { - "name": "Immunization", - "source": [ { - "context": "ddcc", - "element": "entry", - "variable": "entry" - } ], - "rule": [ { - "name": "Immunization", - "source": [ { - "context": "entry", - "type": "Immunization", - "element": "resource", - "variable": "immunization" - } ], - "dependent": [ { - "name": "DecodeImmunizationToQR", - "variable": [ "ddcc", "immunization", "qr" ] - } ] - } ] - } ] - }, { - "name": "DecodePatientToQR", - "typeMode": "none", - "input": [ { - "name": "patient", - "type": "DDCCPatient", - "mode": "source" - }, { - "name": "qr", - "type": "EUDCC", - "mode": "target" - } ], - "rule": [ { - "name": "birthDate", - "source": [ { - "context": "patient", - "element": "birthDate", - "variable": "birthDate" - } ], - "target": [ { - "context": "qr", - "contextType": "variable", - "element": "dob", - "transform": "copy", - "parameter": [ { - "valueId": "birthDate" - } ] - } ] - }, { - "name": "name", - "source": [ { - "context": "patient", - "element": "name", - "variable": "name" - } ], - "rule": [ { - "name": "text", - "source": [ { - "context": "name", - "element": "text", - "variable": "text" - } ], - "target": [ { - "context": "qr", - "contextType": "variable", - "element": "nam", - "transform": "copy", - "parameter": [ { - "valueId": "text" - } ] - } ] - } ] - } ] - }, { - "name": "DecodeImmunizationToQR", - "typeMode": "none", - "input": [ { - "name": "ddcc", - "type": "DDCCDocument", - "mode": "source" - }, { - "name": "immunization", - "type": "DDCCImmunization", - "mode": "source" - }, { - "name": "qr", - "type": "EUDCC", - "mode": "target" - } ], - "rule": [ { - "name": "Vaccination", - "source": [ { - "context": "immunization" - } ], - "target": [ { - "context": "qr", - "contextType": "variable", - "element": "v", - "variable": "vacEvent", - "transform": "create", - "parameter": [ { - "valueString": "http://hl7.eu/fhir/ig/dcc/StructureDefinition/v" - } ] - } ], - "rule": [ { - "name": "Protocol", - "source": [ { - "context": "immunization", - "element": "protocolApplied", - "variable": "protocol" - } ], - "rule": [ { - "name": "doseNumberPositiveInt", - "source": [ { - "context": "protocol", - "element": "doseNumberPositiveInt", - "variable": "dose" - } ], - "target": [ { - "context": "vacEvent", - "contextType": "variable", - "element": "dn", - "transform": "copy", - "parameter": [ { - "valueId": "dose" - } ] - } ] - }, { - "name": "seriesDosesPositiveInt", - "source": [ { - "context": "protocol", - "element": "seriesDosesPositiveInt", - "variable": "doseNum" - } ], - "target": [ { - "context": "vacEvent", - "contextType": "variable", - "element": "sd", - "transform": "copy", - "parameter": [ { - "valueId": "doseNum" - } ] - } ] - }, { - "name": "Protocol-Disease", - "source": [ { - "context": "protocol", - "element": "targetDisease", - "variable": "targetDisease" - } ], - "rule": [ { - "name": "Protocol-Disease-Code", - "source": [ { - "context": "targetDisease", - "element": "coding", - "variable": "coding" - } ], - "rule": [ { - "name": "code", - "source": [ { - "context": "coding", - "element": "code", - "variable": "code" - } ], - "target": [ { - "context": "vacEvent", - "contextType": "variable", - "element": "tg", - "transform": "copy", - "parameter": [ { - "valueId": "code" - } ] - } ] - } ] - } ] - } ] - }, { - "name": "occurrenceDateTime", - "source": [ { - "context": "immunization", - "element": "occurrenceDateTime", - "variable": "date" - } ], - "target": [ { - "context": "vacEvent", - "contextType": "variable", - "element": "dt", - "transform": "copy", - "parameter": [ { - "valueId": "date" - } ] - } ] - }, { - "name": "Country", - "source": [ { - "context": "immunization", - "element": "extension", - "variable": "country", - "condition": "(url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCCountryOfEvent')" - } ], - "rule": [ { - "name": "valueCode", - "source": [ { - "context": "country", - "element": "valueCode", - "variable": "code" - } ], - "target": [ { - "context": "vacEvent", - "contextType": "variable", - "element": "co", - "transform": "copy", - "parameter": [ { - "valueId": "code" - } ] - } ] - } ], - "documentation": "TODO: need to populate vacEvent.ma market authorization holder" - }, { - "name": "Vaccine-Brand", - "source": [ { - "context": "immunization", - "element": "extension", - "variable": "brand", - "condition": "(url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCEventBrand')" - } ], - "rule": [ { - "name": "Vaccine-Brand-Code", - "source": [ { - "context": "brand", - "element": "valueCoding", - "variable": "valueCoding" - } ], - "rule": [ { - "name": "code", - "source": [ { - "context": "valueCoding", - "element": "code", - "variable": "code" - } ], - "target": [ { - "context": "vacEvent", - "contextType": "variable", - "element": "mp", - "transform": "copy", - "parameter": [ { - "valueId": "code" - } ] - } ] - } ] - } ], - "documentation": "immunization.extension : DDCCBrand as brand" - }, { - "name": "Vaccine-Coding", - "source": [ { - "context": "immunization", - "element": "vaccineCode", - "variable": "vaccineCode" - } ], - "rule": [ { - "name": "Vaccine-Code", - "source": [ { - "context": "vaccineCode", - "element": "coding", - "variable": "coding" - } ], - "rule": [ { - "name": "code", - "source": [ { - "context": "coding", - "element": "code", - "variable": "code" - } ], - "target": [ { - "context": "vacEvent", - "contextType": "variable", - "element": "vp", - "transform": "copy", - "parameter": [ { - "valueId": "code" - } ] - } ] - } ] - } ], - "documentation": "immunization.vaccineCode : Coding as vaccineCode then {" - }, { - "name": "Vaccination-Centre", - "source": [ { - "context": "ddcc", - "element": "entry", - "variable": "entry" - } ], - "rule": [ { - "name": "Centre-Name", - "source": [ { - "context": "entry", - "type": "Organization", - "element": "resource", - "variable": "organization" - } ], - "rule": [ { - "name": "name", - "source": [ { - "context": "organization", - "element": "name", - "variable": "name" - } ], - "target": [ { - "context": "vacEvent", - "contextType": "variable", - "element": "is", - "transform": "copy", - "parameter": [ { - "valueId": "name" - } ] - } ] - } ], - "documentation": "entry.resource : DDCCOrganization as organization" - } ] - }, { - "name": "Vaccination-Event", - "source": [ { - "context": "ddcc", - "element": "entry", - "variable": "entry" - } ], - "rule": [ { - "name": "Vaccination-Event-ID", - "source": [ { - "context": "entry", - "type": "Composition", - "element": "resource", - "variable": "composition" - } ], - "rule": [ { - "name": "Vaccination-Event-ID-Value", - "source": [ { - "context": "composition", - "element": "identifier", - "variable": "identifier" - } ], - "rule": [ { - "name": "value", - "source": [ { - "context": "identifier", - "element": "value", - "variable": "value" - } ], - "target": [ { - "context": "vacEvent", - "contextType": "variable", - "element": "ci", - "transform": "copy", - "parameter": [ { - "valueId": "value" - } ] - } ] - } ] - } ], - "documentation": "entry.resource : DDCCVSComposition as composition" - } ] - } ] - } ] - } ] -} diff --git a/input/resources/StructureMap-IPSToCoreDataSetVS.json b/input/resources/StructureMap-IPSToCoreDataSetVS.json deleted file mode 100644 index 50f12506b8..0000000000 --- a/input/resources/StructureMap-IPSToCoreDataSetVS.json +++ /dev/null @@ -1,658 +0,0 @@ -{ - "resourceType": "StructureMap", - "id": "IPSToCoreDataSetVS", - "text": { - "status": "generated", - "div": "
map "http://smart.who.int/ddcc/StructureMap/IPSToCoreDataSetVS" = "IPSToCoreDataSetVS"\r\n\r\n\r\nuses "http://hl7.org/fhir/StructureDefinition/Bundle" alias IPS as source\r\nuses "http://hl7.org/fhir/StructureDefinition/Bundle" alias DDCCBundle as target\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS-PoV" alias DDCC as produced\r\n\r\ngroup IPSToCoreDataSetVS(source ips : IPS, target ddccBundle : DDCCBundle) {\r\n  ips.id as id -> ddccBundle.id = id "set id";\r\n  ips.entry first as compentry then {\r\n    compentry.resource : Composition as composition then {\r\n      composition.subject as subject then {\r\n        subject.reference as patientid then {\r\n          ips.entry as findpatient where resource.is(Patient) and (resource.id = patientid.replaceMatches('.*Patient/(?<id>[A-Za-z0-9\\\\-\\\\.]{1,64})$', '${id}')) then {\r\n            findpatient.resource as patient then {\r\n              ips.entry as entry then {\r\n                entry.resource : Immunization as immunization where vaccineCode.memberOf('http://smart.who.int/ddcc/ValueSet/who-ddcc-allowed-vaccines-covid-19') ->  ddccBundle.entry as outentry,  create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS-PoV') as ddcc then {\r\n                  immunization then PatientToDDCC(patient, ddcc) "set patient info";\r\n                  immunization -> ddcc.vaccination as vaccination then ImmunizationToVaccination(immunization, vaccination) "set vaccination";\r\n                  immunization -> ddcc.certificate as certificate then IPSToCertificate(composition, certificate, immunization) "set certificate";\r\n                  immunization -> outentry.resource = ddcc "set outentry";\r\n                } "immunizations";\r\n              } "entries";\r\n            } "get patient";\r\n          } "find patient";\r\n        } "get subject reference";\r\n      } "get subject";\r\n    } "get composition";\r\n  } "get first entry";\r\n}\r\n\r\ngroup ImmunizationToVaccination(source immunization, target vaccination) {\r\n  immunization.vaccineCode as vaccine then {\r\n    vaccine.coding as coding where memberOf('http://smart.who.int/ddcc/ValueSet/WHODDCCVaccinesCOVID19') then {\r\n      coding -> vaccination.vaccine = coding "set coding";\r\n    } "copy vaccine";\r\n    vaccine.coding as coding where memberOf('http://smart.who.int/ddcc/ValueSet/WHODDCCVaccinesCOVID19').not() then {\r\n      coding -> vaccination.vaccine = translate(coding, 'who-ddcc-map-cvx-icd11-vaccines', 'Coding') "translate code";\r\n    } "translate vaccine coding";\r\n    vaccine.coding as coding -> vaccination.brand = translate(coding, 'who-ddcc-map-cvx-icd11-brands', 'Coding') "translate brand";\r\n  } "set vaccine";\r\n  immunization -> vaccination.country = c('urn:iso:std:iso:3166', 'USA') "set country";\r\n  immunization.lotNumber as lot -> vaccination.lot = lot "set lot";\r\n  immunization.occurrence as occurrence -> vaccination.date = occurrence "set date";\r\n  immunization.manufacturer as manufacturer then {\r\n    manufacturer.identifier as identifier -> vaccination.manufacturer as vMan then {\r\n      identifier.system as system -> vMan.system = system "set manufacturer system";\r\n      identifier.value as value -> vMan.code = value "set manufactutuer code";\r\n    } "set manufacturer id";\r\n  } "set manufacturer";\r\n}\r\n\r\ngroup IPSToCertificate(source composition, target certificate, source immunization) {\r\n  immunization.id as id ->  certificate.ddccid as ddccid,  ddccid.value = id "set ddccid";\r\n  composition.id as id ->  certificate.hcid as hcid,  hcid.value = id "set hcid";\r\n  composition.author first as author -> certificate.issuer = author "set issuer";\r\n}\r\n\r\ngroup PatientToDDCC(source patient, target ddcc) {\r\n  patient.name as name then NameToText(name, ddcc) "set name";\r\n  patient.birthDate as birthDate -> ddcc.birthDate = birthDate "set birthdate";\r\n  // patient.gender as gender -> ddcc.sex = gender "set sex";\r\n  patient.identifier first as identifier -> ddcc.identifier = identifier "set identifier";\r\n}\r\n\r\ngroup NameToText(source name : HumanName, target ddcc) {\r\n  // annoying because append doesn't work until ddcc.name is set\r\n  name.given first as given -> ddcc.name = (given.replaceMatches('$', ' ')) "set first name";\r\n  // name.given not_first as other -> ddcc.name as tName, ddcc.name = append( tName, other ) "set other names";\r\n  name.given not_first as other ->  ddcc.name as tName,  (other.replaceMatches('$', ' ')) as spaced,  ddcc.name = append(tName, spaced) "set other names";\r\n  name.family as family ->  ddcc.name as tName,  ddcc.name = append(tName, family) "add family name";\r\n  name.text as text -> ddcc.name = text "set full name";\r\n}\r\n\r\n
" - }, - "url": "http://smart.who.int/ddcc/StructureMap/IPSToCoreDataSetVS", - "name": "IPSToCoreDataSetVS", - "structure": [ { - "url": "http://hl7.org/fhir/StructureDefinition/Bundle", - "mode": "source", - "alias": "IPS" - }, { - "url": "http://hl7.org/fhir/StructureDefinition/Bundle", - "mode": "target", - "alias": "DDCCBundle" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS-PoV", - "mode": "produced", - "alias": "DDCC" - } ], - "group": [ { - "name": "IPSToCoreDataSetVS", - "typeMode": "none", - "input": [ { - "name": "ips", - "type": "IPS", - "mode": "source" - }, { - "name": "ddccBundle", - "type": "DDCCBundle", - "mode": "target" - } ], - "rule": [ { - "name": "set id", - "source": [ { - "context": "ips", - "element": "id", - "variable": "id" - } ], - "target": [ { - "context": "ddccBundle", - "contextType": "variable", - "element": "id", - "transform": "copy", - "parameter": [ { - "valueId": "id" - } ] - } ] - }, { - "name": "get first entry", - "source": [ { - "context": "ips", - "element": "entry", - "listMode": "first", - "variable": "compentry" - } ], - "rule": [ { - "name": "get composition", - "source": [ { - "context": "compentry", - "type": "Composition", - "element": "resource", - "variable": "composition" - } ], - "rule": [ { - "name": "get subject", - "source": [ { - "context": "composition", - "element": "subject", - "variable": "subject" - } ], - "rule": [ { - "name": "get subject reference", - "source": [ { - "context": "subject", - "element": "reference", - "variable": "patientid" - } ], - "rule": [ { - "name": "find patient", - "source": [ { - "context": "ips", - "element": "entry", - "variable": "findpatient", - "condition": "resource.is(Patient) and (resource.id = patientid.replaceMatches('.*Patient/(?[A-Za-z0-9\\\\-\\\\.]{1,64})$', '${id}'))" - } ], - "rule": [ { - "name": "get patient", - "source": [ { - "context": "findpatient", - "element": "resource", - "variable": "patient" - } ], - "rule": [ { - "name": "entries", - "source": [ { - "context": "ips", - "element": "entry", - "variable": "entry" - } ], - "rule": [ { - "name": "immunizations", - "source": [ { - "context": "entry", - "type": "Immunization", - "element": "resource", - "variable": "immunization", - "condition": "vaccineCode.memberOf('http://smart.who.int/ddcc/ValueSet/who-ddcc-allowed-vaccines-covid-19')" - } ], - "target": [ { - "context": "ddccBundle", - "contextType": "variable", - "element": "entry", - "variable": "outentry" - }, { - "contextType": "variable", - "variable": "ddcc", - "transform": "create", - "parameter": [ { - "valueString": "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS-PoV" - } ] - } ], - "rule": [ { - "name": "set patient info", - "source": [ { - "context": "immunization" - } ], - "dependent": [ { - "name": "PatientToDDCC", - "variable": [ "patient", "ddcc" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - }, { - "name": "set vaccination", - "source": [ { - "context": "immunization" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "vaccination", - "variable": "vaccination" - } ], - "dependent": [ { - "name": "ImmunizationToVaccination", - "variable": [ "immunization", "vaccination" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - }, { - "name": "set certificate", - "source": [ { - "context": "immunization" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "certificate", - "variable": "certificate" - } ], - "dependent": [ { - "name": "IPSToCertificate", - "variable": [ "composition", "certificate", "immunization" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - }, { - "name": "set outentry", - "source": [ { - "context": "immunization" - } ], - "target": [ { - "context": "outentry", - "contextType": "variable", - "element": "resource", - "transform": "copy", - "parameter": [ { - "valueId": "ddcc" - } ] - } ] - } ] - } ] - } ] - } ] - } ] - } ] - } ] - } ] - } ] - }, { - "name": "ImmunizationToVaccination", - "typeMode": "none", - "input": [ { - "name": "immunization", - "mode": "source" - }, { - "name": "vaccination", - "mode": "target" - } ], - "rule": [ { - "name": "set vaccine", - "source": [ { - "context": "immunization", - "element": "vaccineCode", - "variable": "vaccine" - } ], - "rule": [ { - "name": "copy vaccine", - "source": [ { - "context": "vaccine", - "element": "coding", - "variable": "coding", - "condition": "memberOf('http://smart.who.int/ddcc/ValueSet/WHODDCCVaccinesCOVID19')" - } ], - "rule": [ { - "name": "set coding", - "source": [ { - "context": "coding" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "vaccine", - "transform": "copy", - "parameter": [ { - "valueId": "coding" - } ] - } ] - } ] - }, { - "name": "translate vaccine coding", - "source": [ { - "context": "vaccine", - "element": "coding", - "variable": "coding", - "condition": "memberOf('http://smart.who.int/ddcc/ValueSet/WHODDCCVaccinesCOVID19').not()" - } ], - "rule": [ { - "name": "translate code", - "source": [ { - "context": "coding" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "vaccine", - "transform": "translate", - "parameter": [ { - "valueId": "coding" - }, { - "valueString": "who-ddcc-map-cvx-icd11-vaccines" - }, { - "valueString": "Coding" - } ] - } ] - } ] - }, { - "name": "translate brand", - "source": [ { - "context": "vaccine", - "element": "coding", - "variable": "coding" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "brand", - "transform": "translate", - "parameter": [ { - "valueId": "coding" - }, { - "valueString": "who-ddcc-map-cvx-icd11-brands" - }, { - "valueString": "Coding" - } ] - } ] - } ] - }, { - "name": "set country", - "source": [ { - "context": "immunization" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "country", - "transform": "c", - "parameter": [ { - "valueString": "urn:iso:std:iso:3166" - }, { - "valueString": "USA" - } ] - } ] - }, { - "name": "set lot", - "source": [ { - "context": "immunization", - "element": "lotNumber", - "variable": "lot" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "lot", - "transform": "copy", - "parameter": [ { - "valueId": "lot" - } ] - } ] - }, { - "name": "set date", - "source": [ { - "context": "immunization", - "element": "occurrence", - "variable": "occurrence" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "date", - "transform": "copy", - "parameter": [ { - "valueId": "occurrence" - } ] - } ] - }, { - "name": "set manufacturer", - "source": [ { - "context": "immunization", - "element": "manufacturer", - "variable": "manufacturer" - } ], - "rule": [ { - "name": "set manufacturer id", - "source": [ { - "context": "manufacturer", - "element": "identifier", - "variable": "identifier" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "manufacturer", - "variable": "vMan" - } ], - "rule": [ { - "name": "set manufacturer system", - "source": [ { - "context": "identifier", - "element": "system", - "variable": "system" - } ], - "target": [ { - "context": "vMan", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueId": "system" - } ] - } ] - }, { - "name": "set manufactutuer code", - "source": [ { - "context": "identifier", - "element": "value", - "variable": "value" - } ], - "target": [ { - "context": "vMan", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "value" - } ] - } ] - } ] - } ] - } ] - }, { - "name": "IPSToCertificate", - "typeMode": "none", - "input": [ { - "name": "composition", - "mode": "source" - }, { - "name": "certificate", - "mode": "target" - }, { - "name": "immunization", - "mode": "source" - } ], - "rule": [ { - "name": "set ddccid", - "source": [ { - "context": "immunization", - "element": "id", - "variable": "id" - } ], - "target": [ { - "context": "certificate", - "contextType": "variable", - "element": "ddccid", - "variable": "ddccid" - }, { - "context": "ddccid", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "id" - } ] - } ] - }, { - "name": "set hcid", - "source": [ { - "context": "composition", - "element": "id", - "variable": "id" - } ], - "target": [ { - "context": "certificate", - "contextType": "variable", - "element": "hcid", - "variable": "hcid" - }, { - "context": "hcid", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "id" - } ] - } ] - }, { - "name": "set issuer", - "source": [ { - "context": "composition", - "element": "author", - "listMode": "first", - "variable": "author" - } ], - "target": [ { - "context": "certificate", - "contextType": "variable", - "element": "issuer", - "transform": "copy", - "parameter": [ { - "valueId": "author" - } ] - } ] - } ] - }, { - "name": "PatientToDDCC", - "typeMode": "none", - "input": [ { - "name": "patient", - "mode": "source" - }, { - "name": "ddcc", - "mode": "target" - } ], - "rule": [ { - "name": "set name", - "source": [ { - "context": "patient", - "element": "name", - "variable": "name" - } ], - "dependent": [ { - "name": "NameToText", - "variable": [ "name", "ddcc" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - }, { - "name": "set birthdate", - "source": [ { - "context": "patient", - "element": "birthDate", - "variable": "birthDate" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "birthDate", - "transform": "copy", - "parameter": [ { - "valueId": "birthDate" - } ] - } ] - }, { - "name": "set identifier", - "source": [ { - "context": "patient", - "element": "identifier", - "listMode": "first", - "variable": "identifier" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "identifier", - "transform": "copy", - "parameter": [ { - "valueId": "identifier" - } ] - } ], - "documentation": "patient.gender as gender -> ddcc.sex = gender \"set sex\";" - } ] - }, { - "name": "NameToText", - "typeMode": "none", - "input": [ { - "name": "name", - "type": "HumanName", - "mode": "source" - }, { - "name": "ddcc", - "mode": "target" - } ], - "rule": [ { - "name": "set first name", - "source": [ { - "context": "name", - "element": "given", - "listMode": "first", - "variable": "given" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "transform": "evaluate", - "parameter": [ { - "valueString": "given.replaceMatches('$', ' ')" - } ] - } ], - "documentation": "annoying because append doesn't work until ddcc.name is set" - }, { - "name": "set other names", - "source": [ { - "context": "name", - "element": "given", - "listMode": "not_first", - "variable": "other" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "variable": "tName" - }, { - "contextType": "variable", - "variable": "spaced", - "transform": "evaluate", - "parameter": [ { - "valueString": "other.replaceMatches('$', ' ')" - } ] - }, { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "transform": "append", - "parameter": [ { - "valueId": "tName" - }, { - "valueId": "spaced" - } ] - } ], - "documentation": "name.given not_first as other -> ddcc.name as tName, ddcc.name = append( tName, other ) \"set other names\";" - }, { - "name": "add family name", - "source": [ { - "context": "name", - "element": "family", - "variable": "family" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "variable": "tName" - }, { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "transform": "append", - "parameter": [ { - "valueId": "tName" - }, { - "valueId": "family" - } ] - } ] - }, { - "name": "set full name", - "source": [ { - "context": "name", - "element": "text", - "variable": "text" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "transform": "copy", - "parameter": [ { - "valueId": "text" - } ] - } ] - } ] - } ] -} diff --git a/input/resources/StructureMap-QRespToVSCoreDataSet.json b/input/resources/StructureMap-QRespToVSCoreDataSet.json deleted file mode 100644 index ce9d32930a..0000000000 --- a/input/resources/StructureMap-QRespToVSCoreDataSet.json +++ /dev/null @@ -1,796 +0,0 @@ -{ - "resourceType": "StructureMap", - "id": "QRespToVSCoreDataSet", - "meta": { - "versionId": "1", - "lastUpdated": "2022-03-01T19:17:58.292+00:00" - }, - "text": { - "status": "generated", - "div": "
map "http://smart.who.int/ddcc/StructureMap/QRespToVSCoreDataSet" = "QRespToVSCoreDataSet"\r\n\r\n\r\nuses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QResp as source\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS-CoC" alias DDCC as target\r\n\r\ngroup QRespToCoreDataSet(source qr : QResp, target ddcc : DDCC) {\r\n  qr as src then QRespToHeader(src, ddcc) "set header content";\r\n  qr as src -> ddcc.vaccination as vaccination then QRespToVaccination(src, vaccination) "set vaccination content";\r\n  qr as src -> ddcc.certificate as certificate then QRespToCertificate(src, certificate) "set certificate content";\r\n}\r\n\r\ngroup QRespToHeader(source qr, target ddcc) {\r\n  qr.item as item then {\r\n    item.answer first as answer where item.linkId = 'name' then {\r\n      answer.valueString as content -> ddcc.name = content "set name";\r\n    } "first answser for name";\r\n    item.answer first as answer where item.linkId = 'birthDate' then {\r\n      answer.valueDate as content -> ddcc.birthDate = content "set birthDate";\r\n    } "first answer for birthDate";\r\n    item.answer first as answer where item.linkId = 'identifier' -> ddcc.identifier as identifier then {\r\n      answer.valueString as content -> identifier.value = content "set identifier";\r\n    } "first answer for identifier";\r\n    item.answer first as answer where item.linkId = 'sex' then {\r\n      answer.valueCoding as coding then {\r\n        coding.code as content -> ddcc.sex = content "set sex";\r\n      } "process coding";\r\n    } "first answer for sex";\r\n  } "header items";\r\n}\r\n\r\ngroup QRespToVaccination(source qr, target vaccination) {\r\n  qr.item as item then {\r\n    item.answer first as answer where item.linkId = 'vaccine' then {\r\n      answer.valueCoding as content -> vaccination.vaccine = content "set vaccine";\r\n    } "first answer for vaccine";\r\n    item.answer first as answer where item.linkId = 'brand' then {\r\n      answer.valueCoding as content -> vaccination.brand = content "set brand";\r\n    } "first answer for brand";\r\n    item.answer first as answer where item.linkId = 'manufacturer' then {\r\n      answer.valueCoding as content -> vaccination.manufacturer = content "set manufacturer";\r\n    } "first answer for manufacturer";\r\n    item.answer first as answer where item.linkId = 'ma_holder' then {\r\n      answer.valueCoding as content -> vaccination.maholder = content "set maholder";\r\n    } "first answer for maholder";\r\n    item.answer first as answer where item.linkId = 'lot' then {\r\n      answer.valueString as content -> vaccination.lot = content "set lot";\r\n    } "first answser for lot";\r\n    item.answer first as answer where item.linkId = 'date' then {\r\n      answer.valueDate as content -> vaccination.date = content "set date";\r\n    } "first answer for date";\r\n    item.answer first as answer where item.linkId = 'vaccine_valid' then {\r\n      answer.valueDate as content -> vaccination.validFrom = content "set validFrom";\r\n    } "first answer for validFrom";\r\n    item.answer first as answer where item.linkId = 'dose' then {\r\n      answer.valueInteger as content -> vaccination.dose = content "set dose";\r\n    } "first answer for dose";\r\n    item.answer first as answer where item.linkId = 'total_doses' then {\r\n      answer.valueInteger as content -> vaccination.totalDoses = content "set totalDoses";\r\n    } "first answer for totalDoses";\r\n    item.answer first as answer where item.linkId = 'country' then {\r\n      answer.valueCoding as content -> vaccination.country = content "set country";\r\n    } "first answer for country";\r\n    item.answer first as answer where item.linkId = 'centre' then {\r\n      answer.valueString as content -> vaccination.centre = content "set centre";\r\n    } "first answser for centre";\r\n    item.answer first as answer where item.linkId = 'hw' -> vaccination.practitioner as identifier then {\r\n      answer.valueString as content -> identifier.value = content "set practitioner";\r\n    } "first answser for practitioner";\r\n    item.answer first as answer where item.linkId = 'disease' then {\r\n      answer.valueCoding as content -> vaccination.disease = content "set disease";\r\n    } "first answer for disease";\r\n    item.answer first as answer where item.linkId = 'due_date' then {\r\n      answer.valueDate as content -> vaccination.nextDose = content "set nextDose";\r\n    } "first answer for nextDose";\r\n  } "vaccination items";\r\n}\r\n\r\ngroup QRespToPeriod(source qr, target period) {\r\n  qr.item as item then {\r\n    item.answer first as answer where item.linkId = 'valid_from' then {\r\n      answer.valueDate as content -> period.start = content "set valid_from";\r\n    } "first answer for valid_from";\r\n    item.answer first as answer where item.linkId = 'valid_until' then {\r\n      answer.valueDate as content -> period.end = content "set valid_until";\r\n    } "first answer for valid_until";\r\n  } "vaccination validity items";\r\n}\r\n\r\ngroup QRespToCertificate(source qr, target certificate) {\r\n  qr.item as item then {\r\n    item.answer first as answer where item.linkId = 'pha' -> certificate.issuer as issuer then {\r\n      answer.valueString as content -> issuer.identifier as identifier then {\r\n        content as value -> identifier.value = value "set issuer identifier";\r\n      } "set issuer";\r\n    } "first answser for hcid";\r\n    item.answer first as answer where item.linkId = 'hcid' -> certificate.hcid as hcid then {\r\n      answer.valueString as content ->  hcid.value = content,  certificate.version = 'RC2' "set hcid and version";\r\n    } "first answser for hcid";\r\n  } "certificate items";\r\n  qr as src -> certificate.period as period then QRespToPeriod(src, period) "set vaccination period";\r\n}\r\n\r\n
" - }, - "url": "http://smart.who.int/ddcc/StructureMap/QRespToVSCoreDataSet", - "name": "QRespToVSCoreDataSet", - "structure": [ { - "url": "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse", - "mode": "source", - "alias": "QResp" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS-CoC", - "mode": "target", - "alias": "DDCC" - } ], - "group": [ { - "name": "QRespToCoreDataSet", - "typeMode": "none", - "input": [ { - "name": "qr", - "type": "QResp", - "mode": "source" - }, { - "name": "ddcc", - "type": "DDCC", - "mode": "target" - } ], - "rule": [ { - "name": "set header content", - "source": [ { - "context": "qr", - "variable": "src" - } ], - "dependent": [ { - "name": "QRespToHeader", - "variable": [ "src", "ddcc" ] - } ] - }, { - "name": "set vaccination content", - "source": [ { - "context": "qr", - "variable": "src" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "vaccination", - "variable": "vaccination" - } ], - "dependent": [ { - "name": "QRespToVaccination", - "variable": [ "src", "vaccination" ] - } ] - }, { - "name": "set certificate content", - "source": [ { - "context": "qr", - "variable": "src" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "certificate", - "variable": "certificate" - } ], - "dependent": [ { - "name": "QRespToCertificate", - "variable": [ "src", "certificate" ] - } ] - } ] - }, { - "name": "QRespToHeader", - "typeMode": "none", - "input": [ { - "name": "qr", - "mode": "source" - }, { - "name": "ddcc", - "mode": "target" - } ], - "rule": [ { - "name": "header items", - "source": [ { - "context": "qr", - "element": "item", - "variable": "item" - } ], - "rule": [ { - "name": "first answser for name", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'name'" - } ], - "rule": [ { - "name": "set name", - "source": [ { - "context": "answer", - "element": "valueString", - "variable": "content" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "first answer for birthDate", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'birthDate'" - } ], - "rule": [ { - "name": "set birthDate", - "source": [ { - "context": "answer", - "element": "valueDate", - "variable": "content" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "birthDate", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "first answer for identifier", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'identifier'" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "identifier", - "variable": "identifier" - } ], - "rule": [ { - "name": "set identifier", - "source": [ { - "context": "answer", - "element": "valueString", - "variable": "content" - } ], - "target": [ { - "context": "identifier", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "first answer for sex", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'sex'" - } ], - "rule": [ { - "name": "process coding", - "source": [ { - "context": "answer", - "element": "valueCoding", - "variable": "coding" - } ], - "rule": [ { - "name": "set sex", - "source": [ { - "context": "coding", - "element": "code", - "variable": "content" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "sex", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - } ] - } ] - } ] - }, { - "name": "QRespToVaccination", - "typeMode": "none", - "input": [ { - "name": "qr", - "mode": "source" - }, { - "name": "vaccination", - "mode": "target" - } ], - "rule": [ { - "name": "vaccination items", - "source": [ { - "context": "qr", - "element": "item", - "variable": "item" - } ], - "rule": [ { - "name": "first answer for vaccine", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'vaccine'" - } ], - "rule": [ { - "name": "set vaccine", - "source": [ { - "context": "answer", - "element": "valueCoding", - "variable": "content" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "vaccine", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "first answer for brand", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'brand'" - } ], - "rule": [ { - "name": "set brand", - "source": [ { - "context": "answer", - "element": "valueCoding", - "variable": "content" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "brand", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "first answer for manufacturer", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'manufacturer'" - } ], - "rule": [ { - "name": "set manufacturer", - "source": [ { - "context": "answer", - "element": "valueCoding", - "variable": "content" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "manufacturer", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "first answer for maholder", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'ma_holder'" - } ], - "rule": [ { - "name": "set maholder", - "source": [ { - "context": "answer", - "element": "valueCoding", - "variable": "content" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "maholder", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "first answser for lot", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'lot'" - } ], - "rule": [ { - "name": "set lot", - "source": [ { - "context": "answer", - "element": "valueString", - "variable": "content" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "lot", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "first answer for date", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'date'" - } ], - "rule": [ { - "name": "set date", - "source": [ { - "context": "answer", - "element": "valueDate", - "variable": "content" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "date", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "first answer for validFrom", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'vaccine_valid'" - } ], - "rule": [ { - "name": "set validFrom", - "source": [ { - "context": "answer", - "element": "valueDate", - "variable": "content" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "validFrom", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "first answer for dose", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'dose'" - } ], - "rule": [ { - "name": "set dose", - "source": [ { - "context": "answer", - "element": "valueInteger", - "variable": "content" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "dose", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "first answer for totalDoses", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'total_doses'" - } ], - "rule": [ { - "name": "set totalDoses", - "source": [ { - "context": "answer", - "element": "valueInteger", - "variable": "content" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "totalDoses", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "first answer for country", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'country'" - } ], - "rule": [ { - "name": "set country", - "source": [ { - "context": "answer", - "element": "valueCoding", - "variable": "content" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "country", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "first answser for centre", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'centre'" - } ], - "rule": [ { - "name": "set centre", - "source": [ { - "context": "answer", - "element": "valueString", - "variable": "content" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "centre", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "first answser for practitioner", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'hw'" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "practitioner", - "variable": "identifier" - } ], - "rule": [ { - "name": "set practitioner", - "source": [ { - "context": "answer", - "element": "valueString", - "variable": "content" - } ], - "target": [ { - "context": "identifier", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "first answer for disease", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'disease'" - } ], - "rule": [ { - "name": "set disease", - "source": [ { - "context": "answer", - "element": "valueCoding", - "variable": "content" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "disease", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "first answer for nextDose", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'due_date'" - } ], - "rule": [ { - "name": "set nextDose", - "source": [ { - "context": "answer", - "element": "valueDate", - "variable": "content" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "nextDose", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - } ] - } ] - }, { - "name": "QRespToPeriod", - "typeMode": "none", - "input": [ { - "name": "qr", - "mode": "source" - }, { - "name": "period", - "mode": "target" - } ], - "rule": [ { - "name": "vaccination validity items", - "source": [ { - "context": "qr", - "element": "item", - "variable": "item" - } ], - "rule": [ { - "name": "first answer for valid_from", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'valid_from'" - } ], - "rule": [ { - "name": "set valid_from", - "source": [ { - "context": "answer", - "element": "valueDate", - "variable": "content" - } ], - "target": [ { - "context": "period", - "contextType": "variable", - "element": "start", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "first answer for valid_until", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'valid_until'" - } ], - "rule": [ { - "name": "set valid_until", - "source": [ { - "context": "answer", - "element": "valueDate", - "variable": "content" - } ], - "target": [ { - "context": "period", - "contextType": "variable", - "element": "end", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - } ] - } ] - }, { - "name": "QRespToCertificate", - "typeMode": "none", - "input": [ { - "name": "qr", - "mode": "source" - }, { - "name": "certificate", - "mode": "target" - } ], - "rule": [ { - "name": "certificate items", - "source": [ { - "context": "qr", - "element": "item", - "variable": "item" - } ], - "rule": [ { - "name": "first answser for hcid", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'pha'" - } ], - "target": [ { - "context": "certificate", - "contextType": "variable", - "element": "issuer", - "variable": "issuer" - } ], - "rule": [ { - "name": "set issuer", - "source": [ { - "context": "answer", - "element": "valueString", - "variable": "content" - } ], - "target": [ { - "context": "issuer", - "contextType": "variable", - "element": "identifier", - "variable": "identifier" - } ], - "rule": [ { - "name": "set issuer identifier", - "source": [ { - "context": "content", - "variable": "value" - } ], - "target": [ { - "context": "identifier", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "value" - } ] - } ] - } ] - } ] - }, { - "name": "first answser for hcid", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'hcid'" - } ], - "target": [ { - "context": "certificate", - "contextType": "variable", - "element": "hcid", - "variable": "hcid" - } ], - "rule": [ { - "name": "set hcid and version", - "source": [ { - "context": "answer", - "element": "valueString", - "variable": "content" - } ], - "target": [ { - "context": "hcid", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - }, { - "context": "certificate", - "contextType": "variable", - "element": "version", - "transform": "copy", - "parameter": [ { - "valueString": "RC2" - } ] - } ] - } ] - } ] - }, { - "name": "set vaccination period", - "source": [ { - "context": "qr", - "variable": "src" - } ], - "target": [ { - "context": "certificate", - "contextType": "variable", - "element": "period", - "variable": "period" - } ], - "dependent": [ { - "name": "QRespToPeriod", - "variable": [ "src", "period" ] - } ] - } ] - } ] -} diff --git a/input/resources/StructureMap-ResourcesToCoreDataSet.json b/input/resources/StructureMap-ResourcesToCoreDataSet.json deleted file mode 100644 index 181a059bfe..0000000000 --- a/input/resources/StructureMap-ResourcesToCoreDataSet.json +++ /dev/null @@ -1,968 +0,0 @@ -{ - "resourceType": "StructureMap", - "id": "ResourcesToCoreDataSet", - "meta": { - "versionId": "1", - "lastUpdated": "2021-12-21T20:57:05.702+00:00" - }, - "text": { - "status": "generated", - "div": "
map "http://smart.who.int/ddcc/StructureMap/ResourcesToCoreDataSet" = "ResourcesToCoreDataSet"\r\n\r\n\r\nuses "http://hl7.org/fhir/StructureDefinition/Bundle" alias Bundle as source\r\nuses "http://hl7.org/fhir/StructureDefinition/HumanName" alias HumanName as produced\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCPatient" alias DDCCPatient as source\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunization" alias DDCCImmunization as source\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunizationRecommendation" alias DDCCImmunizationRecommendation as source\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCComposition" alias DDCCComposition as source\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS-PoV" alias DDCCPoV as target\r\n\r\ngroup ResourcesToCoreDataSet(source bundle : Bundle, target ddcc : DDCCPoV) {\r\n  bundle ->  ddcc.vaccination as vaccination,  ddcc.certificate as certificate then {\r\n    bundle.link first as link -> certificate.hcid as hcid then {\r\n      // There's got to be a better way to do this\r\n      link.url as url -> hcid.value = (url.replaceMatches('[Uu][Rr][Nn]:[Hh][Cc][Ii][Dd]:', '')) "set hcid value";\r\n    } "set hcid";\r\n    bundle.id as id ->  certificate.ddccid as ddccid,  ddccid.value = id "set ddcc id value";\r\n    bundle.entry as entry then {\r\n      entry.resource : Patient first as patient then PatientToDDCCVS(patient, ddcc) "set patient details";\r\n      entry.resource : Immunization first as immunization then ImmunizationToDDCCVS(immunization, vaccination, certificate) "set immunization";\r\n      entry.resource : ImmunizationRecommendation first as immRec then ImmRecToDDCCVS(immRec, vaccination) "set immunization recommendation";\r\n      entry.resource : Composition first as composition then CompositionToDDCCVS(composition, certificate) "set composition";\r\n    } "set header from patient";\r\n  } "setup ddcc";\r\n}\r\n\r\ngroup CompositionToDDCCVS(source composition : DDCCComposition, target certificate) {\r\n  composition -> certificate.version = 'RC2' "set version";\r\n  composition.event first as event then {\r\n    event.period as period -> certificate.period as tPeriod then {\r\n      period.start as start -> tPeriod.start = start "set period start";\r\n      period.end as end -> tPeriod.end = end "set period end";\r\n    } "set period";\r\n  } "set certificate period";\r\n}\r\n\r\ngroup PatientToDDCCVS(source patient : DDCCPatient, target ddcc : DDCCPoV) {\r\n  patient.name as name then NameToText(name, ddcc) "set name";\r\n  patient.birthDate as bday -> ddcc.birthDate = bday "set birth date";\r\n  patient.id as id ->  ddcc.identifier as identifier,  identifier.value = id "set identifier from id";\r\n  // this will override what was set from id if it exists\r\n  patient.identifier first as sId -> ddcc.identifier as identifier then {\r\n    sId.value as id -> identifier.value = id "set identifier value";\r\n  } "set identifier from identifier";\r\n  patient.gender as gender -> ddcc.sex = gender "set sex";\r\n}\r\n\r\ngroup NameToText(source name : HumanName, target ddcc) {\r\n  // annoying because append doesn't work until ddcc.name is set\r\n  name.given first as given -> ddcc.name = (given.replaceMatches('$', ' ')) "set first name";\r\n  // name.given not_first as other -> ddcc.name as tName, ddcc.name = append( tName, other ) "set other names";\r\n  name.given not_first as other ->  ddcc.name as tName,  (other.replaceMatches('$', ' ')) as spaced,  ddcc.name = append(tName, spaced) "set other names";\r\n  name.family as family ->  ddcc.name as tName,  ddcc.name = append(tName, family) "add family name";\r\n  name.text as text -> ddcc.name = text "set full name";\r\n}\r\n\r\ngroup ImmunizationToDDCCVS(source immunization : DDCCImmunization, target vaccination, target certificate) {\r\n  immunization.vaccineCode as code then {\r\n    code.coding first as coding -> vaccination.vaccine = coding "set vaccine";\r\n  } "set vaccine code";\r\n  immunization.extension as ext then {\r\n    ext first as brand where ext.url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineBrand' then {\r\n      brand.valueCoding as coding -> vaccination.brand = coding "set brand code";\r\n    } "set brand";\r\n    ext first as maholder where ext.url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineMarketAuthorization' then {\r\n      maholder.valueCoding as coding -> vaccination.maholder = coding "set maholder code";\r\n    } "set maholder";\r\n    ext first as valid where ext.url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineValidFrom' then {\r\n      valid.valueDateTime as date -> vaccination.validFrom = date "set validFrom date";\r\n    } "set validFrom";\r\n    ext first as country where ext.url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCCountryOfVaccination' then {\r\n      country.valueCode as code ->  vaccination.country as vCountry,  vCountry.system = 'urn:iso:std:iso:3166',  vCountry.code = code "set country code";\r\n    } "set country";\r\n  } "set extensions";\r\n  immunization.manufacturer as manufacturer then {\r\n    manufacturer.identifier as identifier -> vaccination.manufacturer as vMan then {\r\n      identifier.system as system -> vMan.system = system "set manufacturer system";\r\n      identifier.value as value -> vMan.code = value "set manufactutuer code";\r\n    } "set manufacturer id";\r\n  } "set manufacturer";\r\n  immunization.lotNumber as lot -> vaccination.lot = lot "set lot number";\r\n  immunization.occurrence as date -> vaccination.date = date "set date";\r\n  immunization.protocolApplied first as protocol then {\r\n    protocol.doseNumber as dose -> vaccination.dose = dose "set dose";\r\n    protocol.seriesDoses as totalDoses -> vaccination.totalDoses = totalDoses "set totalDoses";\r\n    protocol.targetDisease first as disease then {\r\n      disease.coding first as coding -> vaccination.disease = coding "set disease coding";\r\n    } "set disease";\r\n    protocol.authority as authority -> certificate.issuer as issuer then {\r\n      authority.reference as reference -> issuer.identifier as identifier then {\r\n        reference -> identifier.value = reference "set reference";\r\n      } "set issuer from reference";\r\n      authority.identifier as identifier -> issuer.identifier = identifier "set issuer identifier";\r\n    } "set issuer";\r\n  } "set protocol applied";\r\n  immunization.location as location then {\r\n    location.reference as reference -> vaccination.centre = reference "set vaccination centre from reference";\r\n    location.display as centre -> vaccination.centre = centre "set vaccination centre";\r\n  } "set vaccination centre location";\r\n  immunization.performer first as performer then {\r\n    performer.actor as actor then {\r\n      actor.identifier as identifier -> vaccination.practitioner = identifier "set practitioner";\r\n    } "set actor";\r\n  } "set performer";\r\n}\r\n\r\ngroup ImmRecToDDCCVS(source immRec : DDCCImmunizationRecommendation, target vaccination) {\r\n  immRec.recommendation as rec then {\r\n    rec.dateCriterion first as due_date then {\r\n      due_date.value as date -> vaccination.nextDose = date "set due date";\r\n    } "get date criterion";\r\n  } "get recommendation";\r\n}\r\n\r\n
" - }, - "url": "http://smart.who.int/ddcc/StructureMap/ResourcesToCoreDataSet", - "name": "ResourcesToCoreDataSet", - "structure": [ { - "url": "http://hl7.org/fhir/StructureDefinition/Bundle", - "mode": "source", - "alias": "Bundle" - }, { - "url": "http://hl7.org/fhir/StructureDefinition/HumanName", - "mode": "produced", - "alias": "HumanName" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCPatient", - "mode": "source", - "alias": "DDCCPatient" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunization", - "mode": "source", - "alias": "DDCCImmunization" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunizationRecommendation", - "mode": "source", - "alias": "DDCCImmunizationRecommendation" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCComposition", - "mode": "source", - "alias": "DDCCComposition" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS-PoV", - "mode": "target", - "alias": "DDCCPoV" - } ], - "group": [ { - "name": "ResourcesToCoreDataSet", - "typeMode": "none", - "input": [ { - "name": "bundle", - "type": "Bundle", - "mode": "source" - }, { - "name": "ddcc", - "type": "DDCCPoV", - "mode": "target" - } ], - "rule": [ { - "name": "setup ddcc", - "source": [ { - "context": "bundle" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "vaccination", - "variable": "vaccination" - }, { - "context": "ddcc", - "contextType": "variable", - "element": "certificate", - "variable": "certificate" - } ], - "rule": [ { - "name": "set hcid", - "source": [ { - "context": "bundle", - "element": "link", - "listMode": "first", - "variable": "link" - } ], - "target": [ { - "context": "certificate", - "contextType": "variable", - "element": "hcid", - "variable": "hcid" - } ], - "rule": [ { - "name": "set hcid value", - "source": [ { - "context": "link", - "element": "url", - "variable": "url" - } ], - "target": [ { - "context": "hcid", - "contextType": "variable", - "element": "value", - "transform": "evaluate", - "parameter": [ { - "valueString": "url.replaceMatches('[Uu][Rr][Nn]:[Hh][Cc][Ii][Dd]:', '')" - } ] - } ], - "documentation": "There's got to be a better way to do this" - } ] - }, { - "name": "set ddcc id value", - "source": [ { - "context": "bundle", - "element": "id", - "variable": "id" - } ], - "target": [ { - "context": "certificate", - "contextType": "variable", - "element": "ddccid", - "variable": "ddccid" - }, { - "context": "ddccid", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "id" - } ] - } ] - }, { - "name": "set header from patient", - "source": [ { - "context": "bundle", - "element": "entry", - "variable": "entry" - } ], - "rule": [ { - "name": "set patient details", - "source": [ { - "context": "entry", - "type": "Patient", - "element": "resource", - "listMode": "first", - "variable": "patient" - } ], - "dependent": [ { - "name": "PatientToDDCCVS", - "variable": [ "patient", "ddcc" ] - } ] - }, { - "name": "set immunization", - "source": [ { - "context": "entry", - "type": "Immunization", - "element": "resource", - "listMode": "first", - "variable": "immunization" - } ], - "dependent": [ { - "name": "ImmunizationToDDCCVS", - "variable": [ "immunization", "vaccination", "certificate" ] - } ] - }, { - "name": "set immunization recommendation", - "source": [ { - "context": "entry", - "type": "ImmunizationRecommendation", - "element": "resource", - "listMode": "first", - "variable": "immRec" - } ], - "dependent": [ { - "name": "ImmRecToDDCCVS", - "variable": [ "immRec", "vaccination" ] - } ] - }, { - "name": "set composition", - "source": [ { - "context": "entry", - "type": "Composition", - "element": "resource", - "listMode": "first", - "variable": "composition" - } ], - "dependent": [ { - "name": "CompositionToDDCCVS", - "variable": [ "composition", "certificate" ] - } ] - } ] - } ] - } ] - }, { - "name": "CompositionToDDCCVS", - "typeMode": "none", - "input": [ { - "name": "composition", - "type": "DDCCComposition", - "mode": "source" - }, { - "name": "certificate", - "mode": "target" - } ], - "rule": [ { - "name": "set version", - "source": [ { - "context": "composition" - } ], - "target": [ { - "context": "certificate", - "contextType": "variable", - "element": "version", - "transform": "copy", - "parameter": [ { - "valueString": "RC2" - } ] - } ] - }, { - "name": "set certificate period", - "source": [ { - "context": "composition", - "element": "event", - "listMode": "first", - "variable": "event" - } ], - "rule": [ { - "name": "set period", - "source": [ { - "context": "event", - "element": "period", - "variable": "period" - } ], - "target": [ { - "context": "certificate", - "contextType": "variable", - "element": "period", - "variable": "tPeriod" - } ], - "rule": [ { - "name": "set period start", - "source": [ { - "context": "period", - "element": "start", - "variable": "start" - } ], - "target": [ { - "context": "tPeriod", - "contextType": "variable", - "element": "start", - "transform": "copy", - "parameter": [ { - "valueId": "start" - } ] - } ] - }, { - "name": "set period end", - "source": [ { - "context": "period", - "element": "end", - "variable": "end" - } ], - "target": [ { - "context": "tPeriod", - "contextType": "variable", - "element": "end", - "transform": "copy", - "parameter": [ { - "valueId": "end" - } ] - } ] - } ] - } ] - } ] - }, { - "name": "PatientToDDCCVS", - "typeMode": "none", - "input": [ { - "name": "patient", - "type": "DDCCPatient", - "mode": "source" - }, { - "name": "ddcc", - "type": "DDCCPoV", - "mode": "target" - } ], - "rule": [ { - "name": "set name", - "source": [ { - "context": "patient", - "element": "name", - "variable": "name" - } ], - "dependent": [ { - "name": "NameToText", - "variable": [ "name", "ddcc" ] - } ] - }, { - "name": "set birth date", - "source": [ { - "context": "patient", - "element": "birthDate", - "variable": "bday" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "birthDate", - "transform": "copy", - "parameter": [ { - "valueId": "bday" - } ] - } ] - }, { - "name": "set identifier from id", - "source": [ { - "context": "patient", - "element": "id", - "variable": "id" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "identifier", - "variable": "identifier" - }, { - "context": "identifier", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "id" - } ] - } ] - }, { - "name": "set identifier from identifier", - "source": [ { - "context": "patient", - "element": "identifier", - "listMode": "first", - "variable": "sId" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "identifier", - "variable": "identifier" - } ], - "rule": [ { - "name": "set identifier value", - "source": [ { - "context": "sId", - "element": "value", - "variable": "id" - } ], - "target": [ { - "context": "identifier", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "id" - } ] - } ] - } ], - "documentation": "this will override what was set from id if it exists" - }, { - "name": "set sex", - "source": [ { - "context": "patient", - "element": "gender", - "variable": "gender" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "sex", - "transform": "copy", - "parameter": [ { - "valueId": "gender" - } ] - } ] - } ] - }, { - "name": "NameToText", - "typeMode": "none", - "input": [ { - "name": "name", - "type": "HumanName", - "mode": "source" - }, { - "name": "ddcc", - "mode": "target" - } ], - "rule": [ { - "name": "set first name", - "source": [ { - "context": "name", - "element": "given", - "listMode": "first", - "variable": "given" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "transform": "evaluate", - "parameter": [ { - "valueString": "given.replaceMatches('$', ' ')" - } ] - } ], - "documentation": "annoying because append doesn't work until ddcc.name is set" - }, { - "name": "set other names", - "source": [ { - "context": "name", - "element": "given", - "listMode": "not_first", - "variable": "other" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "variable": "tName" - }, { - "contextType": "variable", - "variable": "spaced", - "transform": "evaluate", - "parameter": [ { - "valueString": "other.replaceMatches('$', ' ')" - } ] - }, { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "transform": "append", - "parameter": [ { - "valueId": "tName" - }, { - "valueId": "spaced" - } ] - } ], - "documentation": "name.given not_first as other -> ddcc.name as tName, ddcc.name = append( tName, other ) \"set other names\";" - }, { - "name": "add family name", - "source": [ { - "context": "name", - "element": "family", - "variable": "family" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "variable": "tName" - }, { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "transform": "append", - "parameter": [ { - "valueId": "tName" - }, { - "valueId": "family" - } ] - } ] - }, { - "name": "set full name", - "source": [ { - "context": "name", - "element": "text", - "variable": "text" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "transform": "copy", - "parameter": [ { - "valueId": "text" - } ] - } ] - } ] - }, { - "name": "ImmunizationToDDCCVS", - "typeMode": "none", - "input": [ { - "name": "immunization", - "type": "DDCCImmunization", - "mode": "source" - }, { - "name": "vaccination", - "mode": "target" - }, { - "name": "certificate", - "mode": "target" - } ], - "rule": [ { - "name": "set vaccine code", - "source": [ { - "context": "immunization", - "element": "vaccineCode", - "variable": "code" - } ], - "rule": [ { - "name": "set vaccine", - "source": [ { - "context": "code", - "element": "coding", - "listMode": "first", - "variable": "coding" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "vaccine", - "transform": "copy", - "parameter": [ { - "valueId": "coding" - } ] - } ] - } ] - }, { - "name": "set extensions", - "source": [ { - "context": "immunization", - "element": "extension", - "variable": "ext" - } ], - "rule": [ { - "name": "set brand", - "source": [ { - "context": "ext", - "listMode": "first", - "variable": "brand", - "condition": "ext.url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineBrand'" - } ], - "rule": [ { - "name": "set brand code", - "source": [ { - "context": "brand", - "element": "valueCoding", - "variable": "coding" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "brand", - "transform": "copy", - "parameter": [ { - "valueId": "coding" - } ] - } ] - } ] - }, { - "name": "set maholder", - "source": [ { - "context": "ext", - "listMode": "first", - "variable": "maholder", - "condition": "ext.url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineMarketAuthorization'" - } ], - "rule": [ { - "name": "set maholder code", - "source": [ { - "context": "maholder", - "element": "valueCoding", - "variable": "coding" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "maholder", - "transform": "copy", - "parameter": [ { - "valueId": "coding" - } ] - } ] - } ] - }, { - "name": "set validFrom", - "source": [ { - "context": "ext", - "listMode": "first", - "variable": "valid", - "condition": "ext.url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineValidFrom'" - } ], - "rule": [ { - "name": "set validFrom date", - "source": [ { - "context": "valid", - "element": "valueDateTime", - "variable": "date" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "validFrom", - "transform": "copy", - "parameter": [ { - "valueId": "date" - } ] - } ] - } ] - }, { - "name": "set country", - "source": [ { - "context": "ext", - "listMode": "first", - "variable": "country", - "condition": "ext.url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCCountryOfVaccination'" - } ], - "rule": [ { - "name": "set country code", - "source": [ { - "context": "country", - "element": "valueCode", - "variable": "code" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "country", - "variable": "vCountry" - }, { - "context": "vCountry", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueString": "urn:iso:std:iso:3166" - } ] - }, { - "context": "vCountry", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "code" - } ] - } ] - } ] - } ] - }, { - "name": "set manufacturer", - "source": [ { - "context": "immunization", - "element": "manufacturer", - "variable": "manufacturer" - } ], - "rule": [ { - "name": "set manufacturer id", - "source": [ { - "context": "manufacturer", - "element": "identifier", - "variable": "identifier" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "manufacturer", - "variable": "vMan" - } ], - "rule": [ { - "name": "set manufacturer system", - "source": [ { - "context": "identifier", - "element": "system", - "variable": "system" - } ], - "target": [ { - "context": "vMan", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueId": "system" - } ] - } ] - }, { - "name": "set manufactutuer code", - "source": [ { - "context": "identifier", - "element": "value", - "variable": "value" - } ], - "target": [ { - "context": "vMan", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "value" - } ] - } ] - } ] - } ] - }, { - "name": "set lot number", - "source": [ { - "context": "immunization", - "element": "lotNumber", - "variable": "lot" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "lot", - "transform": "copy", - "parameter": [ { - "valueId": "lot" - } ] - } ] - }, { - "name": "set date", - "source": [ { - "context": "immunization", - "element": "occurrence", - "variable": "date" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "date", - "transform": "copy", - "parameter": [ { - "valueId": "date" - } ] - } ] - }, { - "name": "set protocol applied", - "source": [ { - "context": "immunization", - "element": "protocolApplied", - "listMode": "first", - "variable": "protocol" - } ], - "rule": [ { - "name": "set dose", - "source": [ { - "context": "protocol", - "element": "doseNumber", - "variable": "dose" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "dose", - "transform": "copy", - "parameter": [ { - "valueId": "dose" - } ] - } ] - }, { - "name": "set totalDoses", - "source": [ { - "context": "protocol", - "element": "seriesDoses", - "variable": "totalDoses" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "totalDoses", - "transform": "copy", - "parameter": [ { - "valueId": "totalDoses" - } ] - } ] - }, { - "name": "set disease", - "source": [ { - "context": "protocol", - "element": "targetDisease", - "listMode": "first", - "variable": "disease" - } ], - "rule": [ { - "name": "set disease coding", - "source": [ { - "context": "disease", - "element": "coding", - "listMode": "first", - "variable": "coding" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "disease", - "transform": "copy", - "parameter": [ { - "valueId": "coding" - } ] - } ] - } ] - }, { - "name": "set issuer", - "source": [ { - "context": "protocol", - "element": "authority", - "variable": "authority" - } ], - "target": [ { - "context": "certificate", - "contextType": "variable", - "element": "issuer", - "variable": "issuer" - } ], - "rule": [ { - "name": "set issuer from reference", - "source": [ { - "context": "authority", - "element": "reference", - "variable": "reference" - } ], - "target": [ { - "context": "issuer", - "contextType": "variable", - "element": "identifier", - "variable": "identifier" - } ], - "rule": [ { - "name": "set reference", - "source": [ { - "context": "reference" - } ], - "target": [ { - "context": "identifier", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "reference" - } ] - } ] - } ] - }, { - "name": "set issuer identifier", - "source": [ { - "context": "authority", - "element": "identifier", - "variable": "identifier" - } ], - "target": [ { - "context": "issuer", - "contextType": "variable", - "element": "identifier", - "transform": "copy", - "parameter": [ { - "valueId": "identifier" - } ] - } ] - } ] - } ] - }, { - "name": "set vaccination centre location", - "source": [ { - "context": "immunization", - "element": "location", - "variable": "location" - } ], - "rule": [ { - "name": "set vaccination centre from reference", - "source": [ { - "context": "location", - "element": "reference", - "variable": "reference" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "centre", - "transform": "copy", - "parameter": [ { - "valueId": "reference" - } ] - } ] - }, { - "name": "set vaccination centre", - "source": [ { - "context": "location", - "element": "display", - "variable": "centre" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "centre", - "transform": "copy", - "parameter": [ { - "valueId": "centre" - } ] - } ] - } ] - }, { - "name": "set performer", - "source": [ { - "context": "immunization", - "element": "performer", - "listMode": "first", - "variable": "performer" - } ], - "rule": [ { - "name": "set actor", - "source": [ { - "context": "performer", - "element": "actor", - "variable": "actor" - } ], - "rule": [ { - "name": "set practitioner", - "source": [ { - "context": "actor", - "element": "identifier", - "variable": "identifier" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "practitioner", - "transform": "copy", - "parameter": [ { - "valueId": "identifier" - } ] - } ] - } ] - } ] - } ] - }, { - "name": "ImmRecToDDCCVS", - "typeMode": "none", - "input": [ { - "name": "immRec", - "type": "DDCCImmunizationRecommendation", - "mode": "source" - }, { - "name": "vaccination", - "mode": "target" - } ], - "rule": [ { - "name": "get recommendation", - "source": [ { - "context": "immRec", - "element": "recommendation", - "variable": "rec" - } ], - "rule": [ { - "name": "get date criterion", - "source": [ { - "context": "rec", - "element": "dateCriterion", - "listMode": "first", - "variable": "due_date" - } ], - "rule": [ { - "name": "set due date", - "source": [ { - "context": "due_date", - "element": "value", - "variable": "date" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "nextDose", - "transform": "copy", - "parameter": [ { - "valueId": "date" - } ] - } ] - } ] - } ] - } ] - } ] -} diff --git a/input/resources/StructureMap-ResourcesToVSCoreDataSet.json b/input/resources/StructureMap-ResourcesToVSCoreDataSet.json deleted file mode 100644 index ea5de0785f..0000000000 --- a/input/resources/StructureMap-ResourcesToVSCoreDataSet.json +++ /dev/null @@ -1,968 +0,0 @@ -{ - "resourceType": "StructureMap", - "id": "ResourcesToVSCoreDataSet", - "meta": { - "versionId": "1", - "lastUpdated": "2022-03-01T19:17:58.969+00:00" - }, - "text": { - "status": "generated", - "div": "
map "http://smart.who.int/ddcc/StructureMap/ResourcesToVSCoreDataSet" = "ResourcesToVSCoreDataSet"\r\n\r\n\r\nuses "http://hl7.org/fhir/StructureDefinition/Bundle" alias Bundle as source\r\nuses "http://hl7.org/fhir/StructureDefinition/HumanName" alias HumanName as produced\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCPatient" alias DDCCPatient as source\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunization" alias DDCCImmunization as source\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunizationRecommendation" alias DDCCImmunizationRecommendation as source\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCVSComposition" alias DDCCVSComposition as source\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS-PoV" alias DDCCPoV as target\r\n\r\ngroup ResourcesToCoreDataSet(source bundle : Bundle, target ddcc : DDCCPoV) {\r\n  bundle ->  ddcc.vaccination as vaccination,  ddcc.certificate as certificate then {\r\n    bundle.link first as link -> certificate.hcid as hcid then {\r\n      // There's got to be a better way to do this\r\n      link.url as url -> hcid.value = (url.replaceMatches('[Uu][Rr][Nn]:[Hh][Cc][Ii][Dd]:', '')) "set hcid value";\r\n    } "set hcid";\r\n    bundle.id as id ->  certificate.ddccid as ddccid,  ddccid.value = id "set ddcc id value";\r\n    bundle.entry as entry then {\r\n      entry.resource : Patient first as patient then PatientToDDCCVS(patient, ddcc) "set patient details";\r\n      entry.resource : Immunization first as immunization then ImmunizationToDDCCVS(immunization, vaccination, certificate) "set immunization";\r\n      entry.resource : ImmunizationRecommendation first as immRec then ImmRecToDDCCVS(immRec, vaccination) "set immunization recommendation";\r\n      entry.resource : Composition first as composition then CompositionToDDCCVS(composition, certificate) "set composition";\r\n    } "set header from patient";\r\n  } "setup ddcc";\r\n}\r\n\r\ngroup CompositionToDDCCVS(source composition : DDCCVSComposition, target certificate) {\r\n  composition -> certificate.version = 'RC2' "set version";\r\n  composition.event first as event then {\r\n    event.period as period -> certificate.period as tPeriod then {\r\n      period.start as start -> tPeriod.start = start "set period start";\r\n      period.end as end -> tPeriod.end = end "set period end";\r\n    } "set period";\r\n  } "set certificate period";\r\n}\r\n\r\ngroup PatientToDDCCVS(source patient : DDCCPatient, target ddcc : DDCCPoV) {\r\n  patient.name as name then NameToText(name, ddcc) "set name";\r\n  patient.birthDate as bday -> ddcc.birthDate = bday "set birth date";\r\n  patient.id as id ->  ddcc.identifier as identifier,  identifier.value = id "set identifier from id";\r\n  // this will override what was set from id if it exists\r\n  patient.identifier first as sId -> ddcc.identifier as identifier then {\r\n    sId.value as id -> identifier.value = id "set identifier value";\r\n  } "set identifier from identifier";\r\n  patient.gender as gender -> ddcc.sex = gender "set sex";\r\n}\r\n\r\ngroup NameToText(source name : HumanName, target ddcc) {\r\n  // annoying because append doesn't work until ddcc.name is set\r\n  name.given first as given -> ddcc.name = (given.replaceMatches('$', ' ')) "set first name";\r\n  // name.given not_first as other -> ddcc.name as tName, ddcc.name = append( tName, other ) "set other names";\r\n  name.given not_first as other ->  ddcc.name as tName,  (other.replaceMatches('$', ' ')) as spaced,  ddcc.name = append(tName, spaced) "set other names";\r\n  name.family as family ->  ddcc.name as tName,  ddcc.name = append(tName, family) "add family name";\r\n  name.text as text -> ddcc.name = text "set full name";\r\n}\r\n\r\ngroup ImmunizationToDDCCVS(source immunization : DDCCImmunization, target vaccination, target certificate) {\r\n  immunization.vaccineCode as code then {\r\n    code.coding first as coding -> vaccination.vaccine = coding "set vaccine";\r\n  } "set vaccine code";\r\n  immunization.extension as ext then {\r\n    ext first as brand where ext.url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineBrand' then {\r\n      brand.valueCoding as coding -> vaccination.brand = coding "set brand code";\r\n    } "set brand";\r\n    ext first as maholder where ext.url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineMarketAuthorization' then {\r\n      maholder.valueCoding as coding -> vaccination.maholder = coding "set maholder code";\r\n    } "set maholder";\r\n    ext first as valid where ext.url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineValidFrom' then {\r\n      valid.valueDateTime as date -> vaccination.validFrom = date "set validFrom date";\r\n    } "set validFrom";\r\n    ext first as country where ext.url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCCountryOfVaccination' then {\r\n      country.valueCode as code ->  vaccination.country as vCountry,  vCountry.system = 'urn:iso:std:iso:3166',  vCountry.code = code "set country code";\r\n    } "set country";\r\n  } "set extensions";\r\n  immunization.manufacturer as manufacturer then {\r\n    manufacturer.identifier as identifier -> vaccination.manufacturer as vMan then {\r\n      identifier.system as system -> vMan.system = system "set manufacturer system";\r\n      identifier.value as value -> vMan.code = value "set manufactutuer code";\r\n    } "set manufacturer id";\r\n  } "set manufacturer";\r\n  immunization.lotNumber as lot -> vaccination.lot = lot "set lot number";\r\n  immunization.occurrence as date -> vaccination.date = date "set date";\r\n  immunization.protocolApplied first as protocol then {\r\n    protocol.doseNumber as dose -> vaccination.dose = dose "set dose";\r\n    protocol.seriesDoses as totalDoses -> vaccination.totalDoses = totalDoses "set totalDoses";\r\n    protocol.targetDisease first as disease then {\r\n      disease.coding first as coding -> vaccination.disease = coding "set disease coding";\r\n    } "set disease";\r\n    protocol.authority as authority -> certificate.issuer as issuer then {\r\n      authority.reference as reference -> issuer.identifier as identifier then {\r\n        reference -> identifier.value = reference "set reference";\r\n      } "set issuer from reference";\r\n      authority.identifier as identifier -> issuer.identifier = identifier "set issuer identifier";\r\n    } "set issuer";\r\n  } "set protocol applied";\r\n  immunization.location as location then {\r\n    location.reference as reference -> vaccination.centre = reference "set vaccination centre from reference";\r\n    location.display as centre -> vaccination.centre = centre "set vaccination centre";\r\n  } "set vaccination centre location";\r\n  immunization.performer first as performer then {\r\n    performer.actor as actor then {\r\n      actor.identifier as identifier -> vaccination.practitioner = identifier "set practitioner";\r\n    } "set actor";\r\n  } "set performer";\r\n}\r\n\r\ngroup ImmRecToDDCCVS(source immRec : DDCCImmunizationRecommendation, target vaccination) {\r\n  immRec.recommendation as rec then {\r\n    rec.dateCriterion first as due_date then {\r\n      due_date.value as date -> vaccination.nextDose = date "set due date";\r\n    } "get date criterion";\r\n  } "get recommendation";\r\n}\r\n\r\n
" - }, - "url": "http://smart.who.int/ddcc/StructureMap/ResourcesToVSCoreDataSet", - "name": "ResourcesToVSCoreDataSet", - "structure": [ { - "url": "http://hl7.org/fhir/StructureDefinition/Bundle", - "mode": "source", - "alias": "Bundle" - }, { - "url": "http://hl7.org/fhir/StructureDefinition/HumanName", - "mode": "produced", - "alias": "HumanName" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCPatient", - "mode": "source", - "alias": "DDCCPatient" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunization", - "mode": "source", - "alias": "DDCCImmunization" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunizationRecommendation", - "mode": "source", - "alias": "DDCCImmunizationRecommendation" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCVSComposition", - "mode": "source", - "alias": "DDCCVSComposition" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS-PoV", - "mode": "target", - "alias": "DDCCPoV" - } ], - "group": [ { - "name": "ResourcesToCoreDataSet", - "typeMode": "none", - "input": [ { - "name": "bundle", - "type": "Bundle", - "mode": "source" - }, { - "name": "ddcc", - "type": "DDCCPoV", - "mode": "target" - } ], - "rule": [ { - "name": "setup ddcc", - "source": [ { - "context": "bundle" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "vaccination", - "variable": "vaccination" - }, { - "context": "ddcc", - "contextType": "variable", - "element": "certificate", - "variable": "certificate" - } ], - "rule": [ { - "name": "set hcid", - "source": [ { - "context": "bundle", - "element": "link", - "listMode": "first", - "variable": "link" - } ], - "target": [ { - "context": "certificate", - "contextType": "variable", - "element": "hcid", - "variable": "hcid" - } ], - "rule": [ { - "name": "set hcid value", - "source": [ { - "context": "link", - "element": "url", - "variable": "url" - } ], - "target": [ { - "context": "hcid", - "contextType": "variable", - "element": "value", - "transform": "evaluate", - "parameter": [ { - "valueString": "url.replaceMatches('[Uu][Rr][Nn]:[Hh][Cc][Ii][Dd]:', '')" - } ] - } ], - "documentation": "There's got to be a better way to do this" - } ] - }, { - "name": "set ddcc id value", - "source": [ { - "context": "bundle", - "element": "id", - "variable": "id" - } ], - "target": [ { - "context": "certificate", - "contextType": "variable", - "element": "ddccid", - "variable": "ddccid" - }, { - "context": "ddccid", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "id" - } ] - } ] - }, { - "name": "set header from patient", - "source": [ { - "context": "bundle", - "element": "entry", - "variable": "entry" - } ], - "rule": [ { - "name": "set patient details", - "source": [ { - "context": "entry", - "type": "Patient", - "element": "resource", - "listMode": "first", - "variable": "patient" - } ], - "dependent": [ { - "name": "PatientToDDCCVS", - "variable": [ "patient", "ddcc" ] - } ] - }, { - "name": "set immunization", - "source": [ { - "context": "entry", - "type": "Immunization", - "element": "resource", - "listMode": "first", - "variable": "immunization" - } ], - "dependent": [ { - "name": "ImmunizationToDDCCVS", - "variable": [ "immunization", "vaccination", "certificate" ] - } ] - }, { - "name": "set immunization recommendation", - "source": [ { - "context": "entry", - "type": "ImmunizationRecommendation", - "element": "resource", - "listMode": "first", - "variable": "immRec" - } ], - "dependent": [ { - "name": "ImmRecToDDCCVS", - "variable": [ "immRec", "vaccination" ] - } ] - }, { - "name": "set composition", - "source": [ { - "context": "entry", - "type": "Composition", - "element": "resource", - "listMode": "first", - "variable": "composition" - } ], - "dependent": [ { - "name": "CompositionToDDCCVS", - "variable": [ "composition", "certificate" ] - } ] - } ] - } ] - } ] - }, { - "name": "CompositionToDDCCVS", - "typeMode": "none", - "input": [ { - "name": "composition", - "type": "DDCCVSComposition", - "mode": "source" - }, { - "name": "certificate", - "mode": "target" - } ], - "rule": [ { - "name": "set version", - "source": [ { - "context": "composition" - } ], - "target": [ { - "context": "certificate", - "contextType": "variable", - "element": "version", - "transform": "copy", - "parameter": [ { - "valueString": "RC2" - } ] - } ] - }, { - "name": "set certificate period", - "source": [ { - "context": "composition", - "element": "event", - "listMode": "first", - "variable": "event" - } ], - "rule": [ { - "name": "set period", - "source": [ { - "context": "event", - "element": "period", - "variable": "period" - } ], - "target": [ { - "context": "certificate", - "contextType": "variable", - "element": "period", - "variable": "tPeriod" - } ], - "rule": [ { - "name": "set period start", - "source": [ { - "context": "period", - "element": "start", - "variable": "start" - } ], - "target": [ { - "context": "tPeriod", - "contextType": "variable", - "element": "start", - "transform": "copy", - "parameter": [ { - "valueId": "start" - } ] - } ] - }, { - "name": "set period end", - "source": [ { - "context": "period", - "element": "end", - "variable": "end" - } ], - "target": [ { - "context": "tPeriod", - "contextType": "variable", - "element": "end", - "transform": "copy", - "parameter": [ { - "valueId": "end" - } ] - } ] - } ] - } ] - } ] - }, { - "name": "PatientToDDCCVS", - "typeMode": "none", - "input": [ { - "name": "patient", - "type": "DDCCPatient", - "mode": "source" - }, { - "name": "ddcc", - "type": "DDCCPoV", - "mode": "target" - } ], - "rule": [ { - "name": "set name", - "source": [ { - "context": "patient", - "element": "name", - "variable": "name" - } ], - "dependent": [ { - "name": "NameToText", - "variable": [ "name", "ddcc" ] - } ] - }, { - "name": "set birth date", - "source": [ { - "context": "patient", - "element": "birthDate", - "variable": "bday" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "birthDate", - "transform": "copy", - "parameter": [ { - "valueId": "bday" - } ] - } ] - }, { - "name": "set identifier from id", - "source": [ { - "context": "patient", - "element": "id", - "variable": "id" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "identifier", - "variable": "identifier" - }, { - "context": "identifier", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "id" - } ] - } ] - }, { - "name": "set identifier from identifier", - "source": [ { - "context": "patient", - "element": "identifier", - "listMode": "first", - "variable": "sId" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "identifier", - "variable": "identifier" - } ], - "rule": [ { - "name": "set identifier value", - "source": [ { - "context": "sId", - "element": "value", - "variable": "id" - } ], - "target": [ { - "context": "identifier", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "id" - } ] - } ] - } ], - "documentation": "this will override what was set from id if it exists" - }, { - "name": "set sex", - "source": [ { - "context": "patient", - "element": "gender", - "variable": "gender" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "sex", - "transform": "copy", - "parameter": [ { - "valueId": "gender" - } ] - } ] - } ] - }, { - "name": "NameToText", - "typeMode": "none", - "input": [ { - "name": "name", - "type": "HumanName", - "mode": "source" - }, { - "name": "ddcc", - "mode": "target" - } ], - "rule": [ { - "name": "set first name", - "source": [ { - "context": "name", - "element": "given", - "listMode": "first", - "variable": "given" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "transform": "evaluate", - "parameter": [ { - "valueString": "given.replaceMatches('$', ' ')" - } ] - } ], - "documentation": "annoying because append doesn't work until ddcc.name is set" - }, { - "name": "set other names", - "source": [ { - "context": "name", - "element": "given", - "listMode": "not_first", - "variable": "other" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "variable": "tName" - }, { - "contextType": "variable", - "variable": "spaced", - "transform": "evaluate", - "parameter": [ { - "valueString": "other.replaceMatches('$', ' ')" - } ] - }, { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "transform": "append", - "parameter": [ { - "valueId": "tName" - }, { - "valueId": "spaced" - } ] - } ], - "documentation": "name.given not_first as other -> ddcc.name as tName, ddcc.name = append( tName, other ) \"set other names\";" - }, { - "name": "add family name", - "source": [ { - "context": "name", - "element": "family", - "variable": "family" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "variable": "tName" - }, { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "transform": "append", - "parameter": [ { - "valueId": "tName" - }, { - "valueId": "family" - } ] - } ] - }, { - "name": "set full name", - "source": [ { - "context": "name", - "element": "text", - "variable": "text" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "transform": "copy", - "parameter": [ { - "valueId": "text" - } ] - } ] - } ] - }, { - "name": "ImmunizationToDDCCVS", - "typeMode": "none", - "input": [ { - "name": "immunization", - "type": "DDCCImmunization", - "mode": "source" - }, { - "name": "vaccination", - "mode": "target" - }, { - "name": "certificate", - "mode": "target" - } ], - "rule": [ { - "name": "set vaccine code", - "source": [ { - "context": "immunization", - "element": "vaccineCode", - "variable": "code" - } ], - "rule": [ { - "name": "set vaccine", - "source": [ { - "context": "code", - "element": "coding", - "listMode": "first", - "variable": "coding" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "vaccine", - "transform": "copy", - "parameter": [ { - "valueId": "coding" - } ] - } ] - } ] - }, { - "name": "set extensions", - "source": [ { - "context": "immunization", - "element": "extension", - "variable": "ext" - } ], - "rule": [ { - "name": "set brand", - "source": [ { - "context": "ext", - "listMode": "first", - "variable": "brand", - "condition": "ext.url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineBrand'" - } ], - "rule": [ { - "name": "set brand code", - "source": [ { - "context": "brand", - "element": "valueCoding", - "variable": "coding" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "brand", - "transform": "copy", - "parameter": [ { - "valueId": "coding" - } ] - } ] - } ] - }, { - "name": "set maholder", - "source": [ { - "context": "ext", - "listMode": "first", - "variable": "maholder", - "condition": "ext.url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineMarketAuthorization'" - } ], - "rule": [ { - "name": "set maholder code", - "source": [ { - "context": "maholder", - "element": "valueCoding", - "variable": "coding" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "maholder", - "transform": "copy", - "parameter": [ { - "valueId": "coding" - } ] - } ] - } ] - }, { - "name": "set validFrom", - "source": [ { - "context": "ext", - "listMode": "first", - "variable": "valid", - "condition": "ext.url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineValidFrom'" - } ], - "rule": [ { - "name": "set validFrom date", - "source": [ { - "context": "valid", - "element": "valueDateTime", - "variable": "date" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "validFrom", - "transform": "copy", - "parameter": [ { - "valueId": "date" - } ] - } ] - } ] - }, { - "name": "set country", - "source": [ { - "context": "ext", - "listMode": "first", - "variable": "country", - "condition": "ext.url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCCountryOfVaccination'" - } ], - "rule": [ { - "name": "set country code", - "source": [ { - "context": "country", - "element": "valueCode", - "variable": "code" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "country", - "variable": "vCountry" - }, { - "context": "vCountry", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueString": "urn:iso:std:iso:3166" - } ] - }, { - "context": "vCountry", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "code" - } ] - } ] - } ] - } ] - }, { - "name": "set manufacturer", - "source": [ { - "context": "immunization", - "element": "manufacturer", - "variable": "manufacturer" - } ], - "rule": [ { - "name": "set manufacturer id", - "source": [ { - "context": "manufacturer", - "element": "identifier", - "variable": "identifier" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "manufacturer", - "variable": "vMan" - } ], - "rule": [ { - "name": "set manufacturer system", - "source": [ { - "context": "identifier", - "element": "system", - "variable": "system" - } ], - "target": [ { - "context": "vMan", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueId": "system" - } ] - } ] - }, { - "name": "set manufactutuer code", - "source": [ { - "context": "identifier", - "element": "value", - "variable": "value" - } ], - "target": [ { - "context": "vMan", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "value" - } ] - } ] - } ] - } ] - }, { - "name": "set lot number", - "source": [ { - "context": "immunization", - "element": "lotNumber", - "variable": "lot" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "lot", - "transform": "copy", - "parameter": [ { - "valueId": "lot" - } ] - } ] - }, { - "name": "set date", - "source": [ { - "context": "immunization", - "element": "occurrence", - "variable": "date" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "date", - "transform": "copy", - "parameter": [ { - "valueId": "date" - } ] - } ] - }, { - "name": "set protocol applied", - "source": [ { - "context": "immunization", - "element": "protocolApplied", - "listMode": "first", - "variable": "protocol" - } ], - "rule": [ { - "name": "set dose", - "source": [ { - "context": "protocol", - "element": "doseNumber", - "variable": "dose" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "dose", - "transform": "copy", - "parameter": [ { - "valueId": "dose" - } ] - } ] - }, { - "name": "set totalDoses", - "source": [ { - "context": "protocol", - "element": "seriesDoses", - "variable": "totalDoses" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "totalDoses", - "transform": "copy", - "parameter": [ { - "valueId": "totalDoses" - } ] - } ] - }, { - "name": "set disease", - "source": [ { - "context": "protocol", - "element": "targetDisease", - "listMode": "first", - "variable": "disease" - } ], - "rule": [ { - "name": "set disease coding", - "source": [ { - "context": "disease", - "element": "coding", - "listMode": "first", - "variable": "coding" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "disease", - "transform": "copy", - "parameter": [ { - "valueId": "coding" - } ] - } ] - } ] - }, { - "name": "set issuer", - "source": [ { - "context": "protocol", - "element": "authority", - "variable": "authority" - } ], - "target": [ { - "context": "certificate", - "contextType": "variable", - "element": "issuer", - "variable": "issuer" - } ], - "rule": [ { - "name": "set issuer from reference", - "source": [ { - "context": "authority", - "element": "reference", - "variable": "reference" - } ], - "target": [ { - "context": "issuer", - "contextType": "variable", - "element": "identifier", - "variable": "identifier" - } ], - "rule": [ { - "name": "set reference", - "source": [ { - "context": "reference" - } ], - "target": [ { - "context": "identifier", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "reference" - } ] - } ] - } ] - }, { - "name": "set issuer identifier", - "source": [ { - "context": "authority", - "element": "identifier", - "variable": "identifier" - } ], - "target": [ { - "context": "issuer", - "contextType": "variable", - "element": "identifier", - "transform": "copy", - "parameter": [ { - "valueId": "identifier" - } ] - } ] - } ] - } ] - }, { - "name": "set vaccination centre location", - "source": [ { - "context": "immunization", - "element": "location", - "variable": "location" - } ], - "rule": [ { - "name": "set vaccination centre from reference", - "source": [ { - "context": "location", - "element": "reference", - "variable": "reference" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "centre", - "transform": "copy", - "parameter": [ { - "valueId": "reference" - } ] - } ] - }, { - "name": "set vaccination centre", - "source": [ { - "context": "location", - "element": "display", - "variable": "centre" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "centre", - "transform": "copy", - "parameter": [ { - "valueId": "centre" - } ] - } ] - } ] - }, { - "name": "set performer", - "source": [ { - "context": "immunization", - "element": "performer", - "listMode": "first", - "variable": "performer" - } ], - "rule": [ { - "name": "set actor", - "source": [ { - "context": "performer", - "element": "actor", - "variable": "actor" - } ], - "rule": [ { - "name": "set practitioner", - "source": [ { - "context": "actor", - "element": "identifier", - "variable": "identifier" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "practitioner", - "transform": "copy", - "parameter": [ { - "valueId": "identifier" - } ] - } ] - } ] - } ] - } ] - }, { - "name": "ImmRecToDDCCVS", - "typeMode": "none", - "input": [ { - "name": "immRec", - "type": "DDCCImmunizationRecommendation", - "mode": "source" - }, { - "name": "vaccination", - "mode": "target" - } ], - "rule": [ { - "name": "get recommendation", - "source": [ { - "context": "immRec", - "element": "recommendation", - "variable": "rec" - } ], - "rule": [ { - "name": "get date criterion", - "source": [ { - "context": "rec", - "element": "dateCriterion", - "listMode": "first", - "variable": "due_date" - } ], - "rule": [ { - "name": "set due date", - "source": [ { - "context": "due_date", - "element": "value", - "variable": "date" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "nextDose", - "transform": "copy", - "parameter": [ { - "valueId": "date" - } ] - } ] - } ] - } ] - } ] - } ] -} diff --git a/input/resources/StructureMap-SHCToCoreDataSetTR.json b/input/resources/StructureMap-SHCToCoreDataSetTR.json deleted file mode 100644 index ac36a053af..0000000000 --- a/input/resources/StructureMap-SHCToCoreDataSetTR.json +++ /dev/null @@ -1,470 +0,0 @@ -{ - "resourceType": "StructureMap", - "id": "SHCToCoreDataSetTR", - "meta": { - "versionId": "9", - "lastUpdated": "2023-02-15T19:50:41.165+00:00" - }, - "text": { - "status": "generated", - "div": "
map "http://smart.who.int/ddcc/StructureMap/SHCToCoreDataSetTR" = "SHCToCoreDataSetTR"\r\n\r\n\r\nuses "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-infectious-disease-laboratory-bundle-dm" alias SHCLabBundleDM as source\r\nuses "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-patient-general-dm" alias SHCPatientDM as source\r\nuses "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-infectious-disease-laboratory-result-observation-dm" alias SHCLabDM as source\r\nuses "http://hl7.org/fhir/StructureDefinition/Bundle" alias DDCCBundle as target\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-TR" alias DDCCTR as produced\r\n\r\ngroup SHCToTR(source shc : SHCLabBundleDM, target ddccBundle : DDCCBundle) {\r\n  shc.entry as patientEntrySHC then {\r\n    patientEntrySHC.resource : Patient first as patient then {\r\n      shc.entry as entry then {\r\n        // entry.resource : Immunization as immunization where vaccineCode.memberOf('http://smart.who.int/ddcc/ValueSet/who-ddcc-allowed-vaccines-covid-19') ->  ddccBundle.entry as outentry,  create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS') as ddcc then {\r\n        entry.resource : Observation as lab ->  ddccBundle.entry as outentry,  create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-TR') as ddcc then {\r\n          lab then PatientToDDCCTR(patient, ddcc) "set patient";\r\n          lab -> ddcc.test as test then LabToDDCC(lab, test) "set test";\r\n          lab -> outentry.resource = ddcc "set outentry";\r\n        } "labs";\r\n      } "entries";\r\n    } "get patient";\r\n  } "find patient";\r\n}\r\n\r\ngroup PatientToDDCCTR(source patient : SHCPatientDM, target tgt : DDCCTR) {\r\n  patient.name as name then NameToText(name, tgt) "set name";\r\n  patient.birthDate as birthDate -> tgt.birthDate = birthDate "set birthDate";\r\n  patient.identifier first as identifier -> tgt.identifier = identifier "set identifier";\r\n}\r\n\r\ngroup NameToText(source name : HumanName, target ddcc) {\r\n  // append doesn't work until ddcc.name is set\r\n  name.given first as given -> ddcc.name = (given.replaceMatches('$', ' ')) "set first name";\r\n  // name.given not_first as other -> ddcc.name as tName, ddcc.name = append( tName, other ) "set other names";\r\n  name.given not_first as other ->  ddcc.name as tName,  (other.replaceMatches('$', ' ')) as spaced,  ddcc.name = append(tName, spaced) "set other names";\r\n  name.family as family ->  ddcc.name as tName,  ddcc.name = append(tName, family) "add family name";\r\n  name.text as text -> ddcc.name = text "set full name";\r\n}\r\n\r\ngroup LabToDDCC(source lab : SHCLabDM, target test) {\r\n  lab.code as code then {\r\n    code.coding first as labType then {\r\n      labType -> test.type = labType "set default type";\r\n      labType where labType.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-type-covid19-loinc') -> test.type = translate(labType, 'http://smart.who.int/ddcc/ConceptMap/lab-test-type-covid19-loinc-to-icd11', 'Coding') "translate loinc type";\r\n      labType where labType.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-type-covid19-loinc') -> test.pathogen = c('http://id.who.int/icd11/mms', 'XN109') "set pathogen to COVID";\r\n    };\r\n  };\r\n  lab.effectiveDateTime as date -> test.date = date "set date";\r\n  lab.valueCodeableConcept as value then {\r\n    value.coding first as result then {\r\n      result -> test.result = result "set default result";\r\n      result where result.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-qual-result-snomed') -> test.result = translate(result, 'http://smart.who.int/ddcc/ConceptMap/lab-test-qual-result-snomed-to-icd11') "translate snomed result";\r\n    };\r\n  };\r\n}\r\n\r\n
" - }, - "url": "http://smart.who.int/ddcc/StructureMap/SHCToCoreDataSetTR", - "name": "SHCToCoreDataSetTR", - "structure": [ { - "url": "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-infectious-disease-laboratory-bundle-dm", - "mode": "source", - "alias": "SHCLabBundleDM" - }, { - "url": "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-patient-general-dm", - "mode": "source", - "alias": "SHCPatientDM" - }, { - "url": "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-infectious-disease-laboratory-result-observation-dm", - "mode": "source", - "alias": "SHCLabDM" - }, { - "url": "http://hl7.org/fhir/StructureDefinition/Bundle", - "mode": "target", - "alias": "DDCCBundle" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-TR", - "mode": "produced", - "alias": "DDCCTR" - } ], - "group": [ { - "name": "SHCToTR", - "typeMode": "none", - "input": [ { - "name": "shc", - "type": "SHCLabBundleDM", - "mode": "source" - }, { - "name": "ddccBundle", - "type": "DDCCBundle", - "mode": "target" - } ], - "rule": [ { - "name": "find patient", - "source": [ { - "context": "shc", - "element": "entry", - "variable": "patientEntrySHC" - } ], - "rule": [ { - "name": "get patient", - "source": [ { - "context": "patientEntrySHC", - "type": "Patient", - "element": "resource", - "listMode": "first", - "variable": "patient" - } ], - "rule": [ { - "name": "entries", - "source": [ { - "context": "shc", - "element": "entry", - "variable": "entry" - } ], - "rule": [ { - "name": "labs", - "source": [ { - "context": "entry", - "type": "Observation", - "element": "resource", - "variable": "lab" - } ], - "target": [ { - "context": "ddccBundle", - "contextType": "variable", - "element": "entry", - "variable": "outentry" - }, { - "contextType": "variable", - "variable": "ddcc", - "transform": "create", - "parameter": [ { - "valueString": "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-TR" - } ] - } ], - "rule": [ { - "name": "set patient", - "source": [ { - "context": "lab" - } ], - "dependent": [ { - "name": "PatientToDDCCTR", - "variable": [ "patient", "ddcc" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - }, { - "name": "set test", - "source": [ { - "context": "lab" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "test", - "variable": "test" - } ], - "dependent": [ { - "name": "LabToDDCC", - "variable": [ "lab", "test" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - }, { - "name": "set outentry", - "source": [ { - "context": "lab" - } ], - "target": [ { - "context": "outentry", - "contextType": "variable", - "element": "resource", - "transform": "copy", - "parameter": [ { - "valueId": "ddcc" - } ] - } ] - } ], - "documentation": "entry.resource : Immunization as immunization where vaccineCode.memberOf('http://smart.who.int/ddcc/ValueSet/who-ddcc-allowed-vaccines-covid-19') -> ddccBundle.entry as outentry, create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS') as ddcc then {" - } ] - } ] - } ] - } ] - }, { - "name": "PatientToDDCCTR", - "typeMode": "none", - "input": [ { - "name": "patient", - "type": "SHCPatientDM", - "mode": "source" - }, { - "name": "tgt", - "type": "DDCCTR", - "mode": "target" - } ], - "rule": [ { - "name": "set name", - "source": [ { - "context": "patient", - "element": "name", - "variable": "name" - } ], - "dependent": [ { - "name": "NameToText", - "variable": [ "name", "tgt" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - }, { - "name": "set birthDate", - "source": [ { - "context": "patient", - "element": "birthDate", - "variable": "birthDate" - } ], - "target": [ { - "context": "tgt", - "contextType": "variable", - "element": "birthDate", - "transform": "copy", - "parameter": [ { - "valueId": "birthDate" - } ] - } ] - }, { - "name": "set identifier", - "source": [ { - "context": "patient", - "element": "identifier", - "listMode": "first", - "variable": "identifier" - } ], - "target": [ { - "context": "tgt", - "contextType": "variable", - "element": "identifier", - "transform": "copy", - "parameter": [ { - "valueId": "identifier" - } ] - } ] - } ] - }, { - "name": "NameToText", - "typeMode": "none", - "input": [ { - "name": "name", - "type": "HumanName", - "mode": "source" - }, { - "name": "ddcc", - "mode": "target" - } ], - "rule": [ { - "name": "set first name", - "source": [ { - "context": "name", - "element": "given", - "listMode": "first", - "variable": "given" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "transform": "evaluate", - "parameter": [ { - "valueString": "given.replaceMatches('$', ' ')" - } ] - } ], - "documentation": "append doesn't work until ddcc.name is set" - }, { - "name": "set other names", - "source": [ { - "context": "name", - "element": "given", - "listMode": "not_first", - "variable": "other" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "variable": "tName" - }, { - "contextType": "variable", - "variable": "spaced", - "transform": "evaluate", - "parameter": [ { - "valueString": "other.replaceMatches('$', ' ')" - } ] - }, { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "transform": "append", - "parameter": [ { - "valueId": "tName" - }, { - "valueId": "spaced" - } ] - } ], - "documentation": "name.given not_first as other -> ddcc.name as tName, ddcc.name = append( tName, other ) \"set other names\";" - }, { - "name": "add family name", - "source": [ { - "context": "name", - "element": "family", - "variable": "family" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "variable": "tName" - }, { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "transform": "append", - "parameter": [ { - "valueId": "tName" - }, { - "valueId": "family" - } ] - } ] - }, { - "name": "set full name", - "source": [ { - "context": "name", - "element": "text", - "variable": "text" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "transform": "copy", - "parameter": [ { - "valueId": "text" - } ] - } ] - } ] - }, { - "name": "LabToDDCC", - "typeMode": "none", - "input": [ { - "name": "lab", - "type": "SHCLabDM", - "mode": "source" - }, { - "name": "test", - "mode": "target" - } ], - "rule": [ { - "name": "code", - "source": [ { - "context": "lab", - "element": "code", - "variable": "code" - } ], - "rule": [ { - "name": "coding", - "source": [ { - "context": "code", - "element": "coding", - "listMode": "first", - "variable": "labType" - } ], - "rule": [ { - "name": "set default type", - "source": [ { - "context": "labType" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "type", - "transform": "copy", - "parameter": [ { - "valueId": "labType" - } ] - } ] - }, { - "name": "translate loinc type", - "source": [ { - "context": "labType", - "condition": "labType.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-type-covid19-loinc')" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "type", - "transform": "translate", - "parameter": [ { - "valueId": "labType" - }, { - "valueString": "http://smart.who.int/ddcc/ConceptMap/lab-test-type-covid19-loinc-to-icd11" - }, { - "valueString": "Coding" - } ] - } ] - }, { - "name": "set pathogen to COVID", - "source": [ { - "context": "labType", - "condition": "labType.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-type-covid19-loinc')" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "pathogen", - "transform": "c", - "parameter": [ { - "valueString": "http://id.who.int/icd11/mms" - }, { - "valueString": "XN109" - } ] - } ] - } ] - } ] - }, { - "name": "set date", - "source": [ { - "context": "lab", - "element": "effectiveDateTime", - "variable": "date" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "date", - "transform": "copy", - "parameter": [ { - "valueId": "date" - } ] - } ] - }, { - "name": "valueCodeableConcept", - "source": [ { - "context": "lab", - "element": "valueCodeableConcept", - "variable": "value" - } ], - "rule": [ { - "name": "coding", - "source": [ { - "context": "value", - "element": "coding", - "listMode": "first", - "variable": "result" - } ], - "rule": [ { - "name": "set default result", - "source": [ { - "context": "result" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "result", - "transform": "copy", - "parameter": [ { - "valueId": "result" - } ] - } ] - }, { - "name": "translate snomed result", - "source": [ { - "context": "result", - "condition": "result.memberOf('http://smart.who.int/ddcc/ValueSet/lab-test-qual-result-snomed')" - } ], - "target": [ { - "context": "test", - "contextType": "variable", - "element": "result", - "transform": "translate", - "parameter": [ { - "valueId": "result" - }, { - "valueString": "http://smart.who.int/ddcc/ConceptMap/lab-test-qual-result-snomed-to-icd11" - } ] - } ] - } ] - } ] - } ] - } ] -} diff --git a/input/resources/StructureMap-SHCToCoreDataSetVS.json b/input/resources/StructureMap-SHCToCoreDataSetVS.json deleted file mode 100644 index 636901999c..0000000000 --- a/input/resources/StructureMap-SHCToCoreDataSetVS.json +++ /dev/null @@ -1,539 +0,0 @@ -{ - "resourceType": "StructureMap", - "id": "SHCToCoreDataSetVS", - "meta": { - "versionId": "11", - "lastUpdated": "2023-02-15T20:22:07.304+00:00" - }, - "text": { - "status": "generated", - "div": "
map "http://smart.who.int/ddcc/StructureMap/SHCToCoreDataSetVS" = "SHCToCoreDataSetVS"\r\n\r\n\r\nuses "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-vaccination-bundle-dm" alias SHCVaccinationBundleDM as source\r\nuses "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-patient-general-dm" alias SHCPatientDM as source\r\nuses "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-vaccination-dm" alias SHCImmunizationDM as source\r\nuses "http://hl7.org/fhir/StructureDefinition/Bundle" alias DDCCBundle as target\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS" alias DDCCVS as produced\r\n\r\ngroup SHCToVS(source shc : SHCVaccinationBundleDM, target ddccBundle : DDCCBundle) {\r\n  shc.entry as patientEntrySHC then {\r\n    patientEntrySHC.resource : Patient first as patient then {\r\n      shc.entry as entry then {\r\n        // entry.resource : Immunization as immunization where vaccineCode.memberOf('http://smart.who.int/ddcc/ValueSet/who-ddcc-allowed-vaccines-covid-19') ->  ddccBundle.entry as outentry,  create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS') as ddcc then {\r\n        entry.resource : Immunization as immunization ->  ddccBundle.entry as outentry,  create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS') as ddcc then {\r\n          immunization then PatientToDDCCVS(patient, ddcc) "set patient";\r\n          immunization -> ddcc.vaccination as vaccination then ImmunizationToDDCC(immunization, vaccination) "set vaccination";\r\n          immunization -> outentry.resource = ddcc "set outentry";\r\n        } "immunizations";\r\n      } "entries";\r\n    } "get patient";\r\n  } "find patient";\r\n}\r\n\r\ngroup PatientToDDCCVS(source patient : SHCPatientDM, target tgt : DDCCVS) {\r\n  patient.name as name then NameToText(name, tgt) "set name";\r\n  patient.birthDate as birthDate -> tgt.birthDate = birthDate "set birthDate";\r\n  patient.identifier first as identifier -> tgt.identifier = identifier "set identifier";\r\n}\r\n\r\ngroup NameToText(source name : HumanName, target ddcc) {\r\n  // append doesn't work until ddcc.name is set\r\n  name.given first as given -> ddcc.name = (given.replaceMatches('$', ' ')) "set first name";\r\n  // name.given not_first as other -> ddcc.name as tName, ddcc.name = append( tName, other ) "set other names";\r\n  name.given not_first as other ->  ddcc.name as tName,  (other.replaceMatches('$', ' ')) as spaced,  ddcc.name = append(tName, spaced) "set other names";\r\n  name.family as family ->  ddcc.name as tName,  ddcc.name = append(tName, family) "add family name";\r\n  name.text as text -> ddcc.name = text "set full name";\r\n}\r\n\r\ngroup ImmunizationToDDCC(source immunization : SHCImmunizationDM, target vaccination) {\r\n  immunization.vaccineCode as vaccine then {\r\n    vaccine.coding as coding then {\r\n      coding -> vaccination.vaccine = coding "set default vaccine";\r\n      coding -> vaccination.brand = coding "set default brand";\r\n      coding where coding.memberOf('http://smart.who.int/ddcc/ValueSet/vaccine-covid19-cvx') -> vaccination.vaccine = translate(coding, 'http://smart.who.int/ddcc/ConceptMap/vaccine-covid19-cvx-to-icd11', 'Coding') "translate COVID CVX vaccine";\r\n      coding where coding.memberOf('http://smart.who.int/ddcc/ValueSet/vaccine-covid19-snomed') -> vaccination.vaccine = translate(coding, 'http://smart.who.int/ddcc/ConceptMap/vaccine-covid19-snomed-to-icd11', 'Coding') "translate COVID SNOMED vaccine";\r\n    };\r\n  };\r\n  immunization.manufacturer as tman then {\r\n    tman.identifier as identifier -> vaccination.manufacturer as manufacturer then {\r\n      identifier.system as system -> manufacturer.system = system "set manufacturer system";\r\n      identifier.value as value -> manufacturer.code = value "set manufacturer value";\r\n    } "set manufacturer id";\r\n  };\r\n  immunization.lotNumber as lot -> vaccination.lot = lot "set lot";\r\n  immunization.occurrence as date -> vaccination.date = date "set date";\r\n  immunization.performer as performer then {\r\n    performer.actor as actor then {\r\n      actor.display as centre -> vaccination.centre = centre "set centre";\r\n    };\r\n  };\r\n}\r\n\r\n
" - }, - "url": "http://smart.who.int/ddcc/StructureMap/SHCToCoreDataSetVS", - "name": "SHCToCoreDataSetVS", - "structure": [ { - "url": "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-vaccination-bundle-dm", - "mode": "source", - "alias": "SHCVaccinationBundleDM" - }, { - "url": "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-patient-general-dm", - "mode": "source", - "alias": "SHCPatientDM" - }, { - "url": "http://hl7.org/fhir/uv/shc-vaccination/StructureDefinition/shc-vaccination-dm", - "mode": "source", - "alias": "SHCImmunizationDM" - }, { - "url": "http://hl7.org/fhir/StructureDefinition/Bundle", - "mode": "target", - "alias": "DDCCBundle" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS", - "mode": "produced", - "alias": "DDCCVS" - } ], - "group": [ { - "name": "SHCToVS", - "typeMode": "none", - "input": [ { - "name": "shc", - "type": "SHCVaccinationBundleDM", - "mode": "source" - }, { - "name": "ddccBundle", - "type": "DDCCBundle", - "mode": "target" - } ], - "rule": [ { - "name": "find patient", - "source": [ { - "context": "shc", - "element": "entry", - "variable": "patientEntrySHC" - } ], - "rule": [ { - "name": "get patient", - "source": [ { - "context": "patientEntrySHC", - "type": "Patient", - "element": "resource", - "listMode": "first", - "variable": "patient" - } ], - "rule": [ { - "name": "entries", - "source": [ { - "context": "shc", - "element": "entry", - "variable": "entry" - } ], - "rule": [ { - "name": "immunizations", - "source": [ { - "context": "entry", - "type": "Immunization", - "element": "resource", - "variable": "immunization" - } ], - "target": [ { - "context": "ddccBundle", - "contextType": "variable", - "element": "entry", - "variable": "outentry" - }, { - "contextType": "variable", - "variable": "ddcc", - "transform": "create", - "parameter": [ { - "valueString": "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS" - } ] - } ], - "rule": [ { - "name": "set patient", - "source": [ { - "context": "immunization" - } ], - "dependent": [ { - "name": "PatientToDDCCVS", - "variable": [ "patient", "ddcc" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - }, { - "name": "set vaccination", - "source": [ { - "context": "immunization" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "vaccination", - "variable": "vaccination" - } ], - "dependent": [ { - "name": "ImmunizationToDDCC", - "variable": [ "immunization", "vaccination" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - }, { - "name": "set outentry", - "source": [ { - "context": "immunization" - } ], - "target": [ { - "context": "outentry", - "contextType": "variable", - "element": "resource", - "transform": "copy", - "parameter": [ { - "valueId": "ddcc" - } ] - } ] - } ], - "documentation": "entry.resource : Immunization as immunization where vaccineCode.memberOf('http://smart.who.int/ddcc/ValueSet/who-ddcc-allowed-vaccines-covid-19') -> ddccBundle.entry as outentry, create('http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSet-VS') as ddcc then {" - } ] - } ] - } ] - } ] - }, { - "name": "PatientToDDCCVS", - "typeMode": "none", - "input": [ { - "name": "patient", - "type": "SHCPatientDM", - "mode": "source" - }, { - "name": "tgt", - "type": "DDCCVS", - "mode": "target" - } ], - "rule": [ { - "name": "set name", - "source": [ { - "context": "patient", - "element": "name", - "variable": "name" - } ], - "dependent": [ { - "name": "NameToText", - "variable": [ "name", "tgt" ], - "_variable": [ { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - }, { - "extension": [ { - "url": "http://hl7.org/fhir/tools/StructureDefinition/original-item-type", - "valueUrl": "id" - } ] - } ] - } ] - }, { - "name": "set birthDate", - "source": [ { - "context": "patient", - "element": "birthDate", - "variable": "birthDate" - } ], - "target": [ { - "context": "tgt", - "contextType": "variable", - "element": "birthDate", - "transform": "copy", - "parameter": [ { - "valueId": "birthDate" - } ] - } ] - }, { - "name": "set identifier", - "source": [ { - "context": "patient", - "element": "identifier", - "listMode": "first", - "variable": "identifier" - } ], - "target": [ { - "context": "tgt", - "contextType": "variable", - "element": "identifier", - "transform": "copy", - "parameter": [ { - "valueId": "identifier" - } ] - } ] - } ] - }, { - "name": "NameToText", - "typeMode": "none", - "input": [ { - "name": "name", - "type": "HumanName", - "mode": "source" - }, { - "name": "ddcc", - "mode": "target" - } ], - "rule": [ { - "name": "set first name", - "source": [ { - "context": "name", - "element": "given", - "listMode": "first", - "variable": "given" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "transform": "evaluate", - "parameter": [ { - "valueString": "given.replaceMatches('$', ' ')" - } ] - } ], - "documentation": "append doesn't work until ddcc.name is set" - }, { - "name": "set other names", - "source": [ { - "context": "name", - "element": "given", - "listMode": "not_first", - "variable": "other" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "variable": "tName" - }, { - "contextType": "variable", - "variable": "spaced", - "transform": "evaluate", - "parameter": [ { - "valueString": "other.replaceMatches('$', ' ')" - } ] - }, { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "transform": "append", - "parameter": [ { - "valueId": "tName" - }, { - "valueId": "spaced" - } ] - } ], - "documentation": "name.given not_first as other -> ddcc.name as tName, ddcc.name = append( tName, other ) \"set other names\";" - }, { - "name": "add family name", - "source": [ { - "context": "name", - "element": "family", - "variable": "family" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "variable": "tName" - }, { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "transform": "append", - "parameter": [ { - "valueId": "tName" - }, { - "valueId": "family" - } ] - } ] - }, { - "name": "set full name", - "source": [ { - "context": "name", - "element": "text", - "variable": "text" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "transform": "copy", - "parameter": [ { - "valueId": "text" - } ] - } ] - } ] - }, { - "name": "ImmunizationToDDCC", - "typeMode": "none", - "input": [ { - "name": "immunization", - "type": "SHCImmunizationDM", - "mode": "source" - }, { - "name": "vaccination", - "mode": "target" - } ], - "rule": [ { - "name": "vaccineCode", - "source": [ { - "context": "immunization", - "element": "vaccineCode", - "variable": "vaccine" - } ], - "rule": [ { - "name": "coding", - "source": [ { - "context": "vaccine", - "element": "coding", - "variable": "coding" - } ], - "rule": [ { - "name": "set default vaccine", - "source": [ { - "context": "coding" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "vaccine", - "transform": "copy", - "parameter": [ { - "valueId": "coding" - } ] - } ] - }, { - "name": "set default brand", - "source": [ { - "context": "coding" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "brand", - "transform": "copy", - "parameter": [ { - "valueId": "coding" - } ] - } ] - }, { - "name": "translate COVID CVX vaccine", - "source": [ { - "context": "coding", - "condition": "coding.memberOf('http://smart.who.int/ddcc/ValueSet/vaccine-covid19-cvx')" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "vaccine", - "transform": "translate", - "parameter": [ { - "valueId": "coding" - }, { - "valueString": "http://smart.who.int/ddcc/ConceptMap/vaccine-covid19-cvx-to-icd11" - }, { - "valueString": "Coding" - } ] - } ] - }, { - "name": "translate COVID SNOMED vaccine", - "source": [ { - "context": "coding", - "condition": "coding.memberOf('http://smart.who.int/ddcc/ValueSet/vaccine-covid19-snomed')" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "vaccine", - "transform": "translate", - "parameter": [ { - "valueId": "coding" - }, { - "valueString": "http://smart.who.int/ddcc/ConceptMap/vaccine-covid19-snomed-to-icd11" - }, { - "valueString": "Coding" - } ] - } ] - } ] - } ] - }, { - "name": "manufacturer", - "source": [ { - "context": "immunization", - "element": "manufacturer", - "variable": "tman" - } ], - "rule": [ { - "name": "set manufacturer id", - "source": [ { - "context": "tman", - "element": "identifier", - "variable": "identifier" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "manufacturer", - "variable": "manufacturer" - } ], - "rule": [ { - "name": "set manufacturer system", - "source": [ { - "context": "identifier", - "element": "system", - "variable": "system" - } ], - "target": [ { - "context": "manufacturer", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueId": "system" - } ] - } ] - }, { - "name": "set manufacturer value", - "source": [ { - "context": "identifier", - "element": "value", - "variable": "value" - } ], - "target": [ { - "context": "manufacturer", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueId": "value" - } ] - } ] - } ] - } ] - }, { - "name": "set lot", - "source": [ { - "context": "immunization", - "element": "lotNumber", - "variable": "lot" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "lot", - "transform": "copy", - "parameter": [ { - "valueId": "lot" - } ] - } ] - }, { - "name": "set date", - "source": [ { - "context": "immunization", - "element": "occurrence", - "variable": "date" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "date", - "transform": "copy", - "parameter": [ { - "valueId": "date" - } ] - } ] - }, { - "name": "performer", - "source": [ { - "context": "immunization", - "element": "performer", - "variable": "performer" - } ], - "rule": [ { - "name": "actor", - "source": [ { - "context": "performer", - "element": "actor", - "variable": "actor" - } ], - "rule": [ { - "name": "set centre", - "source": [ { - "context": "actor", - "element": "display", - "variable": "centre" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "centre", - "transform": "copy", - "parameter": [ { - "valueId": "centre" - } ] - } ] - } ] - } ] - } ] - } ] -} diff --git a/input/resources/StructureMap-coredataset-to-addbundle.json b/input/resources/StructureMap-coredataset-to-addbundle.json deleted file mode 100644 index 0d9ae0e5d3..0000000000 --- a/input/resources/StructureMap-coredataset-to-addbundle.json +++ /dev/null @@ -1,1278 +0,0 @@ -{ - "resourceType": "StructureMap", - "id": "coredataset-to-addbundle", - "meta": { - "versionId": "1", - "lastUpdated": "2021-12-14T19:11:42.010+00:00" - }, - "text": { - "status": "generated", - "div": "
map "http://smart.who.int/ddcc/StructureMap/CoreDataSetToAddBundle" = "CoreDataSetToAddBundle"\r\n\r\n\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetPoV" alias DDCCPoV as source\r\nuses "http://hl7.org/fhir/StructureDefinition/Bundle" alias AddBundle as target\r\nuses "http://hl7.org/fhir/StructureDefinition/Patient" alias Patient as target\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCPatient" alias DDCCPatient as produced\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunization" alias DDCCImmunization as produced\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunizationRecommendation" alias DDCCImmRec as produced\r\n\r\ngroup CoreDataSetToAddBundle(source ddcc : DDCCPoV, target bundle : AddBundle) {\r\n  ddcc -> bundle.type = 'transaction' "set bundle type";\r\n  ddcc ->  uuid() as pid,  uuid() as iid,  uuid() as irid then {\r\n    ddcc ->  bundle.entry as entry,  entry.fullUrl = append('urn:uuid:', pid),  entry.request as request,  request.method = 'PUT',  request.url = append('Patient/', pid),  create('http://smart.who.int/ddcc/StructureDefinition/DDCCPatient') as patient then {\r\n      ddcc then DDCCToPatient(ddcc, patient, pid) "setup patient";\r\n      ddcc -> entry.resource = patient "set patient resource";\r\n    } "create patient resource";\r\n    ddcc.vaccination first as vaccination ->  bundle.entry as entry,  entry.fullUrl = append('urn:uuid:', iid),  entry.request as request,  request.method = 'PUT',  request.url = append('Immunization/', iid),  create('http://smart.who.int/ddcc/StructureDefinition/DDCCImmunization') as immunization then {\r\n      ddcc.certificate as certificate then DDCCToImmunization(vaccination, immunization, certificate, iid, pid) "setup immunization";\r\n      ddcc -> entry.resource = immunization "set immunization resource";\r\n    } "create immunization resource";\r\n    ddcc.vaccination first as vaccination ->  bundle.entry as entry,  entry.fullUrl = append('urn:uuid:', irid),  entry.request as request,  request.method = 'PUT',  request.url = append('ImmunizationRecommendation/', irid),  create('http://smart.who.int/ddcc/StructureDefinition/DDCCImmunizationRecommendation') as immrec then {\r\n      vaccination then DDCCToImmRec(vaccination, immrec, irid, iid, pid) "setup immunization recommendation";\r\n      ddcc -> entry.resource = immrec "set immunization recommendation resource";\r\n    } "create immunization recommendation resource";\r\n  } "set uuids";\r\n}\r\n\r\ngroup DDCCToPatient(source src : DDCCPoV, target patient : DDCCPatient, source pid) {\r\n  pid -> patient.id = pid "set id";\r\n  src.name as name -> patient.name as tName then {\r\n    name as content -> tName.text = content "set name";\r\n  } "set full name";\r\n  src.birthDate as birthDate -> patient.birthDate = birthDate "set birthDate";\r\n  src.sex as sex -> patient.gender = sex "set gender";\r\n  src.identifier as identifier -> patient.identifier = identifier "set identifier";\r\n}\r\n\r\ngroup DDCCToImmunization(source src, target immunization : DDCCImmunization, source certificate, source iid, source pid) {\r\n  iid -> immunization.id = iid "set id";\r\n  src.brand as brand -> immunization.extension as ext then {\r\n    brand ->  ext.url = 'https://smart.who.int/ddcc/StructureDefinition/DDCCVaccineBrand',  ext.value = brand "set brand extension values";\r\n  } "set brand extension";\r\n  src.maholder as maholder -> immunization.extension as ext then {\r\n    maholder ->  ext.url = 'https://smart.who.int/ddcc/StructureDefinition/DDCCVaccineMarketAuthorization',  ext.value = maholder "set MA Holder extension values";\r\n  } "set maholder extension";\r\n  src.country as country -> immunization.extension as ext then {\r\n    country.code as code ->  ext.url = 'https://smart.who.int/ddcc/StructureDefinition/DDCCCountryOfVaccination',  ext.value = code "set country extension values";\r\n  } "set country extension";\r\n  src.validFrom as validFrom -> immunization.extension as ext then {\r\n    validFrom ->  ext.url = 'https://smart.who.int/ddcc/StructureDefinition/DDCCVaccineValidFrom',  ext.value = validFrom "set valid from extension values";\r\n  } "set vaccine valid extension";\r\n  src -> immunization.status = 'completed' "set status";\r\n  src.vaccine as vaccine ->  immunization.vaccineCode as vacCode,  vacCode.coding = vaccine "set vaccine";\r\n  src ->  immunization.patient as patient,  patient.reference = append('Patient/', pid) "set patient";\r\n  src.manufacturer as manufacturer ->  immunization.manufacturer as tman,  tman.identifier as ident then {\r\n    manufacturer.system as system -> ident.system = system "set system";\r\n    manufacturer.code as code -> ident.value = code "set value";\r\n  } "set manufacturer identifier";\r\n  src.lot as lot -> immunization.lotNumber = lot "set lot number";\r\n  src.date as date -> immunization.occurrence = date "set occurrence date";\r\n  src.centre as centre -> immunization.location as location then {\r\n    centre -> location.display = centre "set location display";\r\n  } "set location";\r\n  src.practitioner as practitioner -> immunization.performer as performer then {\r\n    practitioner.value as hw -> performer.actor as actor then {\r\n      hw ->  actor.type = 'Practitioner',  actor.identifier as identifier then {\r\n        hw -> identifier.value = hw "set hw identifier";\r\n      } "set actor";\r\n    } "set performer";\r\n  } "set practitioner";\r\n  src -> immunization.protocolApplied as protocol then {\r\n    src -> protocol.authority as authority then {\r\n      certificate.issuer as issuer -> authority.type = 'Organization' then {\r\n        issuer.identifier as pha -> authority.identifier as identifier then {\r\n          pha.value as value -> identifier.value = value "set pha";\r\n        } "set issuer identifier";\r\n      } "set issuer";\r\n    } "set authority";\r\n    src.disease as disease -> protocol.targetDisease as tdisease then {\r\n      disease -> tdisease.coding = disease "set target disease code";\r\n    } "set target disease";\r\n    src.dose as dose -> protocol.doseNumber = dose "set dose number";\r\n    src.totalDoses as totalDoses -> protocol.seriesDoses = totalDoses "set total doses";\r\n  } "set protocolApplied";\r\n}\r\n\r\ngroup DDCCToImmRec(source src, target immrec : DDCCImmunizationRecommendation, source irid, source iid, source pid) {\r\n  src.date as date -> immrec.date = date "set date";\r\n  src ->  immrec.patient as patient,  patient.reference = append('Patient/', pid) "set patient";\r\n  src -> immrec.recommendation as rec then {\r\n    src.vaccine as vaccine -> rec.vaccineCode as vaccineCode then {\r\n      vaccine -> vaccineCode.coding = vaccine "set vaccine code coding";\r\n    } "set vaccine code";\r\n    src.disease as disease -> rec.targetDisease as targetDisease then {\r\n      disease -> targetDisease.coding = disease "set target disease coding";\r\n    } "set target disease";\r\n    src -> rec.forecastStatus as forecast then {\r\n      src -> forecast.coding as coding then {\r\n        src -> coding.system = 'http://terminology.hl7.org/2.1.0/CodeSystem-immunization-recommendation-status.html' "set forecast system";\r\n        src -> coding.code = 'due' "set forecast code";\r\n      } "set forecast status coding";\r\n    } "set forecast status";\r\n    src -> rec.dateCriterion as due_date then {\r\n      src -> due_date.code as code then {\r\n        src -> code.coding as coding then {\r\n          src -> coding.system = 'http://loinc.org' "set due date code system";\r\n          src -> coding.code = '30980-7' "set due date code code";\r\n        } "set due date code coding";\r\n      } "set due date code";\r\n      src.nextDose as nextDose -> due_date.value = nextDose "set due date value";\r\n    } "set date criterion";\r\n    src.dose as dose -> rec.doseNumber = (dose.toInteger() + 1) "set dose number";\r\n    src.totalDoses as totalDoses -> rec.seriesDoses = totalDoses "set total doses";\r\n    src ->  rec.supportingImmunization as imm,  imm.reference = append('Immunization/', iid) "set supporting immunization";\r\n  } "set recommendation";\r\n}\r\n\r\n
" - }, - "url": "http://smart.who.int/ddcc/StructureMap/CoreDataSetToAddBundle", - "name": "CoreDataSetToAddBundle", - "structure": [ { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetPoV", - "mode": "source", - "alias": "DDCCPoV" - }, { - "url": "http://hl7.org/fhir/StructureDefinition/Bundle", - "mode": "target", - "alias": "AddBundle" - }, { - "url": "http://hl7.org/fhir/StructureDefinition/Patient", - "mode": "target", - "alias": "Patient" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCPatient", - "mode": "produced", - "alias": "DDCCPatient" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunization", - "mode": "produced", - "alias": "DDCCImmunization" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunizationRecommendation", - "mode": "produced", - "alias": "DDCCImmRec" - } ], - "group": [ { - "name": "CoreDataSetToAddBundle", - "typeMode": "none", - "input": [ { - "name": "ddcc", - "type": "DDCCPoV", - "mode": "source" - }, { - "name": "bundle", - "type": "AddBundle", - "mode": "target" - } ], - "rule": [ { - "name": "set bundle type", - "source": [ { - "context": "ddcc" - } ], - "target": [ { - "context": "bundle", - "contextType": "variable", - "element": "type", - "transform": "copy", - "parameter": [ { - "valueString": "transaction" - } ] - } ] - }, { - "name": "set uuids", - "source": [ { - "context": "ddcc" - } ], - "target": [ { - "contextType": "variable", - "variable": "pid", - "transform": "uuid" - }, { - "contextType": "variable", - "variable": "iid", - "transform": "uuid" - }, { - "contextType": "variable", - "variable": "irid", - "transform": "uuid" - } ], - "rule": [ { - "name": "create patient resource", - "source": [ { - "context": "ddcc" - } ], - "target": [ { - "context": "bundle", - "contextType": "variable", - "element": "entry", - "variable": "entry" - }, { - "context": "entry", - "contextType": "variable", - "element": "fullUrl", - "transform": "append", - "parameter": [ { - "valueString": "urn:uuid:" - }, { - "valueId": "pid" - } ] - }, { - "context": "entry", - "contextType": "variable", - "element": "request", - "variable": "request" - }, { - "context": "request", - "contextType": "variable", - "element": "method", - "transform": "copy", - "parameter": [ { - "valueString": "PUT" - } ] - }, { - "context": "request", - "contextType": "variable", - "element": "url", - "transform": "append", - "parameter": [ { - "valueString": "Patient/" - }, { - "valueId": "pid" - } ] - }, { - "contextType": "variable", - "variable": "patient", - "transform": "create", - "parameter": [ { - "valueString": "http://smart.who.int/ddcc/StructureDefinition/DDCCPatient" - } ] - } ], - "rule": [ { - "name": "setup patient", - "source": [ { - "context": "ddcc" - } ], - "dependent": [ { - "name": "DDCCToPatient", - "variable": [ "ddcc", "patient", "pid" ] - } ] - }, { - "name": "set patient resource", - "source": [ { - "context": "ddcc" - } ], - "target": [ { - "context": "entry", - "contextType": "variable", - "element": "resource", - "transform": "copy", - "parameter": [ { - "valueId": "patient" - } ] - } ] - } ] - }, { - "name": "create immunization resource", - "source": [ { - "context": "ddcc", - "element": "vaccination", - "listMode": "first", - "variable": "vaccination" - } ], - "target": [ { - "context": "bundle", - "contextType": "variable", - "element": "entry", - "variable": "entry" - }, { - "context": "entry", - "contextType": "variable", - "element": "fullUrl", - "transform": "append", - "parameter": [ { - "valueString": "urn:uuid:" - }, { - "valueId": "iid" - } ] - }, { - "context": "entry", - "contextType": "variable", - "element": "request", - "variable": "request" - }, { - "context": "request", - "contextType": "variable", - "element": "method", - "transform": "copy", - "parameter": [ { - "valueString": "PUT" - } ] - }, { - "context": "request", - "contextType": "variable", - "element": "url", - "transform": "append", - "parameter": [ { - "valueString": "Immunization/" - }, { - "valueId": "iid" - } ] - }, { - "contextType": "variable", - "variable": "immunization", - "transform": "create", - "parameter": [ { - "valueString": "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunization" - } ] - } ], - "rule": [ { - "name": "setup immunization", - "source": [ { - "context": "ddcc", - "element": "certificate", - "variable": "certificate" - } ], - "dependent": [ { - "name": "DDCCToImmunization", - "variable": [ "vaccination", "immunization", "certificate", "iid", "pid" ] - } ] - }, { - "name": "set immunization resource", - "source": [ { - "context": "ddcc" - } ], - "target": [ { - "context": "entry", - "contextType": "variable", - "element": "resource", - "transform": "copy", - "parameter": [ { - "valueId": "immunization" - } ] - } ] - } ] - }, { - "name": "create immunization recommendation resource", - "source": [ { - "context": "ddcc", - "element": "vaccination", - "listMode": "first", - "variable": "vaccination" - } ], - "target": [ { - "context": "bundle", - "contextType": "variable", - "element": "entry", - "variable": "entry" - }, { - "context": "entry", - "contextType": "variable", - "element": "fullUrl", - "transform": "append", - "parameter": [ { - "valueString": "urn:uuid:" - }, { - "valueId": "irid" - } ] - }, { - "context": "entry", - "contextType": "variable", - "element": "request", - "variable": "request" - }, { - "context": "request", - "contextType": "variable", - "element": "method", - "transform": "copy", - "parameter": [ { - "valueString": "PUT" - } ] - }, { - "context": "request", - "contextType": "variable", - "element": "url", - "transform": "append", - "parameter": [ { - "valueString": "ImmunizationRecommendation/" - }, { - "valueId": "irid" - } ] - }, { - "contextType": "variable", - "variable": "immrec", - "transform": "create", - "parameter": [ { - "valueString": "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunizationRecommendation" - } ] - } ], - "rule": [ { - "name": "setup immunization recommendation", - "source": [ { - "context": "vaccination" - } ], - "dependent": [ { - "name": "DDCCToImmRec", - "variable": [ "vaccination", "immrec", "irid", "iid", "pid" ] - } ] - }, { - "name": "set immunization recommendation resource", - "source": [ { - "context": "ddcc" - } ], - "target": [ { - "context": "entry", - "contextType": "variable", - "element": "resource", - "transform": "copy", - "parameter": [ { - "valueId": "immrec" - } ] - } ] - } ] - } ] - } ] - }, { - "name": "DDCCToPatient", - "typeMode": "none", - "input": [ { - "name": "src", - "type": "DDCCPoV", - "mode": "source" - }, { - "name": "patient", - "type": "DDCCPatient", - "mode": "target" - }, { - "name": "pid", - "mode": "source" - } ], - "rule": [ { - "name": "set id", - "source": [ { - "context": "pid" - } ], - "target": [ { - "context": "patient", - "contextType": "variable", - "element": "id", - "transform": "copy", - "parameter": [ { - "valueId": "pid" - } ] - } ] - }, { - "name": "set full name", - "source": [ { - "context": "src", - "element": "name", - "variable": "name" - } ], - "target": [ { - "context": "patient", - "contextType": "variable", - "element": "name", - "variable": "tName" - } ], - "rule": [ { - "name": "set name", - "source": [ { - "context": "name", - "variable": "content" - } ], - "target": [ { - "context": "tName", - "contextType": "variable", - "element": "text", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "set birthDate", - "source": [ { - "context": "src", - "element": "birthDate", - "variable": "birthDate" - } ], - "target": [ { - "context": "patient", - "contextType": "variable", - "element": "birthDate", - "transform": "copy", - "parameter": [ { - "valueId": "birthDate" - } ] - } ] - }, { - "name": "set gender", - "source": [ { - "context": "src", - "element": "sex", - "variable": "sex" - } ], - "target": [ { - "context": "patient", - "contextType": "variable", - "element": "gender", - "transform": "copy", - "parameter": [ { - "valueId": "sex" - } ] - } ] - }, { - "name": "set identifier", - "source": [ { - "context": "src", - "element": "identifier", - "variable": "identifier" - } ], - "target": [ { - "context": "patient", - "contextType": "variable", - "element": "identifier", - "transform": "copy", - "parameter": [ { - "valueId": "identifier" - } ] - } ] - } ] - }, { - "name": "DDCCToImmunization", - "typeMode": "none", - "input": [ { - "name": "src", - "mode": "source" - }, { - "name": "immunization", - "type": "DDCCImmunization", - "mode": "target" - }, { - "name": "certificate", - "mode": "source" - }, { - "name": "iid", - "mode": "source" - }, { - "name": "pid", - "mode": "source" - } ], - "rule": [ { - "name": "set id", - "source": [ { - "context": "iid" - } ], - "target": [ { - "context": "immunization", - "contextType": "variable", - "element": "id", - "transform": "copy", - "parameter": [ { - "valueId": "iid" - } ] - } ] - }, { - "name": "set brand extension", - "source": [ { - "context": "src", - "element": "brand", - "variable": "brand" - } ], - "target": [ { - "context": "immunization", - "contextType": "variable", - "element": "extension", - "variable": "ext" - } ], - "rule": [ { - "name": "set brand extension values", - "source": [ { - "context": "brand" - } ], - "target": [ { - "context": "ext", - "contextType": "variable", - "element": "url", - "transform": "copy", - "parameter": [ { - "valueString": "https://smart.who.int/ddcc/StructureDefinition/DDCCVaccineBrand" - } ] - }, { - "context": "ext", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "brand" - } ] - } ] - } ] - }, { - "name": "set maholder extension", - "source": [ { - "context": "src", - "element": "maholder", - "variable": "maholder" - } ], - "target": [ { - "context": "immunization", - "contextType": "variable", - "element": "extension", - "variable": "ext" - } ], - "rule": [ { - "name": "set MA Holder extension values", - "source": [ { - "context": "maholder" - } ], - "target": [ { - "context": "ext", - "contextType": "variable", - "element": "url", - "transform": "copy", - "parameter": [ { - "valueString": "https://smart.who.int/ddcc/StructureDefinition/DDCCVaccineMarketAuthorization" - } ] - }, { - "context": "ext", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "maholder" - } ] - } ] - } ] - }, { - "name": "set country extension", - "source": [ { - "context": "src", - "element": "country", - "variable": "country" - } ], - "target": [ { - "context": "immunization", - "contextType": "variable", - "element": "extension", - "variable": "ext" - } ], - "rule": [ { - "name": "set country extension values", - "source": [ { - "context": "country", - "element": "code", - "variable": "code" - } ], - "target": [ { - "context": "ext", - "contextType": "variable", - "element": "url", - "transform": "copy", - "parameter": [ { - "valueString": "https://smart.who.int/ddcc/StructureDefinition/DDCCCountryOfVaccination" - } ] - }, { - "context": "ext", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "code" - } ] - } ] - } ] - }, { - "name": "set vaccine valid extension", - "source": [ { - "context": "src", - "element": "validFrom", - "variable": "validFrom" - } ], - "target": [ { - "context": "immunization", - "contextType": "variable", - "element": "extension", - "variable": "ext" - } ], - "rule": [ { - "name": "set valid from extension values", - "source": [ { - "context": "validFrom" - } ], - "target": [ { - "context": "ext", - "contextType": "variable", - "element": "url", - "transform": "copy", - "parameter": [ { - "valueString": "https://smart.who.int/ddcc/StructureDefinition/DDCCVaccineValidFrom" - } ] - }, { - "context": "ext", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "validFrom" - } ] - } ] - } ] - }, { - "name": "set status", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "immunization", - "contextType": "variable", - "element": "status", - "transform": "copy", - "parameter": [ { - "valueString": "completed" - } ] - } ] - }, { - "name": "set vaccine", - "source": [ { - "context": "src", - "element": "vaccine", - "variable": "vaccine" - } ], - "target": [ { - "context": "immunization", - "contextType": "variable", - "element": "vaccineCode", - "variable": "vacCode" - }, { - "context": "vacCode", - "contextType": "variable", - "element": "coding", - "transform": "copy", - "parameter": [ { - "valueId": "vaccine" - } ] - } ] - }, { - "name": "set patient", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "immunization", - "contextType": "variable", - "element": "patient", - "variable": "patient" - }, { - "context": "patient", - "contextType": "variable", - "element": "reference", - "transform": "append", - "parameter": [ { - "valueString": "Patient/" - }, { - "valueId": "pid" - } ] - } ] - }, { - "name": "set manufacturer identifier", - "source": [ { - "context": "src", - "element": "manufacturer", - "variable": "manufacturer" - } ], - "target": [ { - "context": "immunization", - "contextType": "variable", - "element": "manufacturer", - "variable": "tman" - }, { - "context": "tman", - "contextType": "variable", - "element": "identifier", - "variable": "ident" - } ], - "rule": [ { - "name": "set system", - "source": [ { - "context": "manufacturer", - "element": "system", - "variable": "system" - } ], - "target": [ { - "context": "ident", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueId": "system" - } ] - } ] - }, { - "name": "set value", - "source": [ { - "context": "manufacturer", - "element": "code", - "variable": "code" - } ], - "target": [ { - "context": "ident", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "code" - } ] - } ] - } ] - }, { - "name": "set lot number", - "source": [ { - "context": "src", - "element": "lot", - "variable": "lot" - } ], - "target": [ { - "context": "immunization", - "contextType": "variable", - "element": "lotNumber", - "transform": "copy", - "parameter": [ { - "valueId": "lot" - } ] - } ] - }, { - "name": "set occurrence date", - "source": [ { - "context": "src", - "element": "date", - "variable": "date" - } ], - "target": [ { - "context": "immunization", - "contextType": "variable", - "element": "occurrence", - "transform": "copy", - "parameter": [ { - "valueId": "date" - } ] - } ] - }, { - "name": "set location", - "source": [ { - "context": "src", - "element": "centre", - "variable": "centre" - } ], - "target": [ { - "context": "immunization", - "contextType": "variable", - "element": "location", - "variable": "location" - } ], - "rule": [ { - "name": "set location display", - "source": [ { - "context": "centre" - } ], - "target": [ { - "context": "location", - "contextType": "variable", - "element": "display", - "transform": "copy", - "parameter": [ { - "valueId": "centre" - } ] - } ] - } ] - }, { - "name": "set practitioner", - "source": [ { - "context": "src", - "element": "practitioner", - "variable": "practitioner" - } ], - "target": [ { - "context": "immunization", - "contextType": "variable", - "element": "performer", - "variable": "performer" - } ], - "rule": [ { - "name": "set performer", - "source": [ { - "context": "practitioner", - "element": "value", - "variable": "hw" - } ], - "target": [ { - "context": "performer", - "contextType": "variable", - "element": "actor", - "variable": "actor" - } ], - "rule": [ { - "name": "set actor", - "source": [ { - "context": "hw" - } ], - "target": [ { - "context": "actor", - "contextType": "variable", - "element": "type", - "transform": "copy", - "parameter": [ { - "valueString": "Practitioner" - } ] - }, { - "context": "actor", - "contextType": "variable", - "element": "identifier", - "variable": "identifier" - } ], - "rule": [ { - "name": "set hw identifier", - "source": [ { - "context": "hw" - } ], - "target": [ { - "context": "identifier", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "hw" - } ] - } ] - } ] - } ] - } ] - }, { - "name": "set protocolApplied", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "immunization", - "contextType": "variable", - "element": "protocolApplied", - "variable": "protocol" - } ], - "rule": [ { - "name": "set authority", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "protocol", - "contextType": "variable", - "element": "authority", - "variable": "authority" - } ], - "rule": [ { - "name": "set issuer", - "source": [ { - "context": "certificate", - "element": "issuer", - "variable": "issuer" - } ], - "target": [ { - "context": "authority", - "contextType": "variable", - "element": "type", - "transform": "copy", - "parameter": [ { - "valueString": "Organization" - } ] - } ], - "rule": [ { - "name": "set issuer identifier", - "source": [ { - "context": "issuer", - "element": "identifier", - "variable": "pha" - } ], - "target": [ { - "context": "authority", - "contextType": "variable", - "element": "identifier", - "variable": "identifier" - } ], - "rule": [ { - "name": "set pha", - "source": [ { - "context": "pha", - "element": "value", - "variable": "value" - } ], - "target": [ { - "context": "identifier", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "value" - } ] - } ] - } ] - } ] - } ] - }, { - "name": "set target disease", - "source": [ { - "context": "src", - "element": "disease", - "variable": "disease" - } ], - "target": [ { - "context": "protocol", - "contextType": "variable", - "element": "targetDisease", - "variable": "tdisease" - } ], - "rule": [ { - "name": "set target disease code", - "source": [ { - "context": "disease" - } ], - "target": [ { - "context": "tdisease", - "contextType": "variable", - "element": "coding", - "transform": "copy", - "parameter": [ { - "valueId": "disease" - } ] - } ] - } ] - }, { - "name": "set dose number", - "source": [ { - "context": "src", - "element": "dose", - "variable": "dose" - } ], - "target": [ { - "context": "protocol", - "contextType": "variable", - "element": "doseNumber", - "transform": "copy", - "parameter": [ { - "valueId": "dose" - } ] - } ] - }, { - "name": "set total doses", - "source": [ { - "context": "src", - "element": "totalDoses", - "variable": "totalDoses" - } ], - "target": [ { - "context": "protocol", - "contextType": "variable", - "element": "seriesDoses", - "transform": "copy", - "parameter": [ { - "valueId": "totalDoses" - } ] - } ] - } ] - } ] - }, { - "name": "DDCCToImmRec", - "typeMode": "none", - "input": [ { - "name": "src", - "mode": "source" - }, { - "name": "immrec", - "type": "DDCCImmunizationRecommendation", - "mode": "target" - }, { - "name": "irid", - "mode": "source" - }, { - "name": "iid", - "mode": "source" - }, { - "name": "pid", - "mode": "source" - } ], - "rule": [ { - "name": "set date", - "source": [ { - "context": "src", - "element": "date", - "variable": "date" - } ], - "target": [ { - "context": "immrec", - "contextType": "variable", - "element": "date", - "transform": "copy", - "parameter": [ { - "valueId": "date" - } ] - } ] - }, { - "name": "set patient", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "immrec", - "contextType": "variable", - "element": "patient", - "variable": "patient" - }, { - "context": "patient", - "contextType": "variable", - "element": "reference", - "transform": "append", - "parameter": [ { - "valueString": "Patient/" - }, { - "valueId": "pid" - } ] - } ] - }, { - "name": "set recommendation", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "immrec", - "contextType": "variable", - "element": "recommendation", - "variable": "rec" - } ], - "rule": [ { - "name": "set vaccine code", - "source": [ { - "context": "src", - "element": "vaccine", - "variable": "vaccine" - } ], - "target": [ { - "context": "rec", - "contextType": "variable", - "element": "vaccineCode", - "variable": "vaccineCode" - } ], - "rule": [ { - "name": "set vaccine code coding", - "source": [ { - "context": "vaccine" - } ], - "target": [ { - "context": "vaccineCode", - "contextType": "variable", - "element": "coding", - "transform": "copy", - "parameter": [ { - "valueId": "vaccine" - } ] - } ] - } ] - }, { - "name": "set target disease", - "source": [ { - "context": "src", - "element": "disease", - "variable": "disease" - } ], - "target": [ { - "context": "rec", - "contextType": "variable", - "element": "targetDisease", - "variable": "targetDisease" - } ], - "rule": [ { - "name": "set target disease coding", - "source": [ { - "context": "disease" - } ], - "target": [ { - "context": "targetDisease", - "contextType": "variable", - "element": "coding", - "transform": "copy", - "parameter": [ { - "valueId": "disease" - } ] - } ] - } ] - }, { - "name": "set forecast status", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "rec", - "contextType": "variable", - "element": "forecastStatus", - "variable": "forecast" - } ], - "rule": [ { - "name": "set forecast status coding", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "forecast", - "contextType": "variable", - "element": "coding", - "variable": "coding" - } ], - "rule": [ { - "name": "set forecast system", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "coding", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueString": "http://terminology.hl7.org/2.1.0/CodeSystem-immunization-recommendation-status.html" - } ] - } ] - }, { - "name": "set forecast code", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueString": "due" - } ] - } ] - } ] - } ] - }, { - "name": "set date criterion", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "rec", - "contextType": "variable", - "element": "dateCriterion", - "variable": "due_date" - } ], - "rule": [ { - "name": "set due date code", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "due_date", - "contextType": "variable", - "element": "code", - "variable": "code" - } ], - "rule": [ { - "name": "set due date code coding", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "code", - "contextType": "variable", - "element": "coding", - "variable": "coding" - } ], - "rule": [ { - "name": "set due date code system", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "coding", - "contextType": "variable", - "element": "system", - "transform": "copy", - "parameter": [ { - "valueString": "http://loinc.org" - } ] - } ] - }, { - "name": "set due date code code", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "coding", - "contextType": "variable", - "element": "code", - "transform": "copy", - "parameter": [ { - "valueString": "30980-7" - } ] - } ] - } ] - } ] - }, { - "name": "set due date value", - "source": [ { - "context": "src", - "element": "nextDose", - "variable": "nextDose" - } ], - "target": [ { - "context": "due_date", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "nextDose" - } ] - } ] - } ] - }, { - "name": "set dose number", - "source": [ { - "context": "src", - "element": "dose", - "variable": "dose" - } ], - "target": [ { - "context": "rec", - "contextType": "variable", - "element": "doseNumber", - "transform": "evaluate", - "parameter": [ { - "valueString": "dose.toInteger() + 1" - } ] - } ] - }, { - "name": "set total doses", - "source": [ { - "context": "src", - "element": "totalDoses", - "variable": "totalDoses" - } ], - "target": [ { - "context": "rec", - "contextType": "variable", - "element": "seriesDoses", - "transform": "copy", - "parameter": [ { - "valueId": "totalDoses" - } ] - } ] - }, { - "name": "set supporting immunization", - "source": [ { - "context": "src" - } ], - "target": [ { - "context": "rec", - "contextType": "variable", - "element": "supportingImmunization", - "variable": "imm" - }, { - "context": "imm", - "contextType": "variable", - "element": "reference", - "transform": "append", - "parameter": [ { - "valueString": "Immunization/" - }, { - "valueId": "iid" - } ] - } ] - } ] - } ] - } ] -} diff --git a/input/resources/StructureMap-ddcc-qresp-to-coredataset.json b/input/resources/StructureMap-ddcc-qresp-to-coredataset.json deleted file mode 100644 index cbe0e5eb94..0000000000 --- a/input/resources/StructureMap-ddcc-qresp-to-coredataset.json +++ /dev/null @@ -1,797 +0,0 @@ -{ - "resourceType": "StructureMap", - "id": "ddcc-qresp-to-coredataset", - "meta": { - "versionId": "1", - "lastUpdated": "2021-12-14T19:11:42.812+00:00" - }, - "text": { - "status": "generated", - "div": "
map "http://smart.who.int/ddcc/StructureMap/QRespToCoreDataSet" = "QRespToCoreDataSet"\r\n\r\n\r\nuses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QResp as source\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetPoV" alias DDCCPoV as target\r\n\r\ngroup QRespToCoreDataSet(source qr : QResp, target ddcc : DDCCPoV) {\r\n  // qr.item as item where item.linkId = 'name' -> ddcc.name as name then {\r\n  //     log 'got answer';\r\n  //     item.answer first as answer -> name = answer.valueString;\r\n  //   };\r\n  qr as src then QRespToHeader(src, ddcc) "set header content";\r\n  qr as src -> ddcc.vaccination as vaccination then QRespToVaccination(src, vaccination) "set vaccination content";\r\n  qr as src -> ddcc.certificate as certificate then QRespToCertificate(src, certificate) "set certificate content";\r\n}\r\n\r\ngroup QRespToHeader(source qr, target ddcc) {\r\n  qr.item as item then {\r\n    item.answer first as answer where item.linkId = 'name' then {\r\n      answer.valueString as content -> ddcc.name = content "set name";\r\n    } "first answser for name";\r\n    item.answer first as answer where item.linkId = 'birthDate' then {\r\n      answer.valueDate as content -> ddcc.birthDate = content "set birthDate";\r\n    } "first answer for birthDate";\r\n    item.answer first as answer where item.linkId = 'identifier' -> ddcc.identifier as identifier then {\r\n      answer.valueString as content -> identifier.value = content "set identifier";\r\n    } "first answer for identifier";\r\n    item.answer first as answer where item.linkId = 'sex' then {\r\n      answer.valueCoding as coding then {\r\n        coding.code as content -> ddcc.sex = content "set sex";\r\n      } "process coding";\r\n    } "first answer for sex";\r\n  } "header items";\r\n}\r\n\r\ngroup QRespToVaccination(source qr, target vaccination) {\r\n  qr.item as item then {\r\n    item.answer first as answer where item.linkId = 'vaccine' then {\r\n      answer.valueCoding as content -> vaccination.vaccine = content "set vaccine";\r\n    } "first answer for vaccine";\r\n    item.answer first as answer where item.linkId = 'brand' then {\r\n      answer.valueCoding as content -> vaccination.brand = content "set brand";\r\n    } "first answer for brand";\r\n    item.answer first as answer where item.linkId = 'manufacturer' then {\r\n      answer.valueCoding as content -> vaccination.manufacturer = content "set manufacturer";\r\n    } "first answer for manufacturer";\r\n    item.answer first as answer where item.linkId = 'ma_holder' then {\r\n      answer.valueCoding as content -> vaccination.maholder = content "set maholder";\r\n    } "first answer for maholder";\r\n    item.answer first as answer where item.linkId = 'lot' then {\r\n      answer.valueString as content -> vaccination.lot = content "set lot";\r\n    } "first answser for lot";\r\n    item.answer first as answer where item.linkId = 'date' then {\r\n      answer.valueDate as content -> vaccination.date = content "set date";\r\n    } "first answer for date";\r\n    item.answer first as answer where item.linkId = 'vaccine_valid' then {\r\n      answer.valueDate as content -> vaccination.validFrom = content "set validFrom";\r\n    } "first answer for validFrom";\r\n    item.answer first as answer where item.linkId = 'dose' then {\r\n      answer.valueInteger as content -> vaccination.dose = content "set dose";\r\n    } "first answer for dose";\r\n    item.answer first as answer where item.linkId = 'total_doses' then {\r\n      answer.valueInteger as content -> vaccination.totalDoses = content "set totalDoses";\r\n    } "first answer for totalDoses";\r\n    item.answer first as answer where item.linkId = 'country' then {\r\n      answer.valueCoding as content -> vaccination.country = content "set country";\r\n    } "first answer for country";\r\n    item.answer first as answer where item.linkId = 'centre' then {\r\n      answer.valueString as content -> vaccination.centre = content "set centre";\r\n    } "first answser for centre";\r\n    item.answer first as answer where item.linkId = 'hw' -> vaccination.practitioner as identifier then {\r\n      answer.valueString as content -> identifier.value = content "set practitioner";\r\n    } "first answser for practitioner";\r\n    item.answer first as answer where item.linkId = 'disease' then {\r\n      answer.valueCoding as content -> vaccination.disease = content "set disease";\r\n    } "first answer for disease";\r\n    item.answer first as answer where item.linkId = 'due_date' then {\r\n      answer.valueDate as content -> vaccination.nextDose = content "set nextDose";\r\n    } "first answer for nextDose";\r\n  } "vaccination items";\r\n  qr as src -> vaccination.period as period then QRespToVaccinePeriod(src, period) "set vaccination period";\r\n}\r\n\r\ngroup QRespToVaccinePeriod(source qr, target period) {\r\n  qr.item as item then {\r\n    item.answer first as answer where item.linkId = 'valid_from' then {\r\n      answer.valueDate as content -> period.start = content "set valid_from";\r\n    } "first answer for valid_from";\r\n    item.answer first as answer where item.linkId = 'valid_until' then {\r\n      answer.valueDate as content -> period.end = content "set valid_until";\r\n    } "first answer for valid_until";\r\n  } "vaccination validity items";\r\n}\r\n\r\ngroup QRespToCertificate(source qr, target certificate) {\r\n  qr.item as item then {\r\n    item.answer first as answer where item.linkId = 'pha' -> certificate.issuer as issuer then {\r\n      answer.valueString as content -> issuer.identifier as identifier then {\r\n        content as value -> identifier.value = value "set issuer identifier";\r\n      } "set issuer";\r\n    } "first answser for hcid";\r\n    item.answer first as answer where item.linkId = 'hcid' -> certificate.hcid as hcid then {\r\n      answer.valueString as content ->  hcid.value = content,  certificate.version = 'RC2' "set hcid and version";\r\n    } "first answser for hcid";\r\n  } "certificate items";\r\n}\r\n\r\n
" - }, - "url": "http://smart.who.int/ddcc/StructureMap/QRespToCoreDataSet", - "name": "QRespToCoreDataSet", - "structure": [ { - "url": "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse", - "mode": "source", - "alias": "QResp" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetPoV", - "mode": "target", - "alias": "DDCCPoV" - } ], - "group": [ { - "name": "QRespToCoreDataSet", - "typeMode": "none", - "input": [ { - "name": "qr", - "type": "QResp", - "mode": "source" - }, { - "name": "ddcc", - "type": "DDCCPoV", - "mode": "target" - } ], - "rule": [ { - "name": "set header content", - "source": [ { - "context": "qr", - "variable": "src" - } ], - "dependent": [ { - "name": "QRespToHeader", - "variable": [ "src", "ddcc" ] - } ], - "documentation": "qr.item as item where item.linkId = 'name' -> ddcc.name as name then {\r\n log 'got answer';\r\n item.answer first as answer -> name = answer.valueString;\r\n };" - }, { - "name": "set vaccination content", - "source": [ { - "context": "qr", - "variable": "src" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "vaccination", - "variable": "vaccination" - } ], - "dependent": [ { - "name": "QRespToVaccination", - "variable": [ "src", "vaccination" ] - } ] - }, { - "name": "set certificate content", - "source": [ { - "context": "qr", - "variable": "src" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "certificate", - "variable": "certificate" - } ], - "dependent": [ { - "name": "QRespToCertificate", - "variable": [ "src", "certificate" ] - } ] - } ] - }, { - "name": "QRespToHeader", - "typeMode": "none", - "input": [ { - "name": "qr", - "mode": "source" - }, { - "name": "ddcc", - "mode": "target" - } ], - "rule": [ { - "name": "header items", - "source": [ { - "context": "qr", - "element": "item", - "variable": "item" - } ], - "rule": [ { - "name": "first answser for name", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'name'" - } ], - "rule": [ { - "name": "set name", - "source": [ { - "context": "answer", - "element": "valueString", - "variable": "content" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "name", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "first answer for birthDate", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'birthDate'" - } ], - "rule": [ { - "name": "set birthDate", - "source": [ { - "context": "answer", - "element": "valueDate", - "variable": "content" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "birthDate", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "first answer for identifier", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'identifier'" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "identifier", - "variable": "identifier" - } ], - "rule": [ { - "name": "set identifier", - "source": [ { - "context": "answer", - "element": "valueString", - "variable": "content" - } ], - "target": [ { - "context": "identifier", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "first answer for sex", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'sex'" - } ], - "rule": [ { - "name": "process coding", - "source": [ { - "context": "answer", - "element": "valueCoding", - "variable": "coding" - } ], - "rule": [ { - "name": "set sex", - "source": [ { - "context": "coding", - "element": "code", - "variable": "content" - } ], - "target": [ { - "context": "ddcc", - "contextType": "variable", - "element": "sex", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - } ] - } ] - } ] - }, { - "name": "QRespToVaccination", - "typeMode": "none", - "input": [ { - "name": "qr", - "mode": "source" - }, { - "name": "vaccination", - "mode": "target" - } ], - "rule": [ { - "name": "vaccination items", - "source": [ { - "context": "qr", - "element": "item", - "variable": "item" - } ], - "rule": [ { - "name": "first answer for vaccine", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'vaccine'" - } ], - "rule": [ { - "name": "set vaccine", - "source": [ { - "context": "answer", - "element": "valueCoding", - "variable": "content" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "vaccine", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "first answer for brand", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'brand'" - } ], - "rule": [ { - "name": "set brand", - "source": [ { - "context": "answer", - "element": "valueCoding", - "variable": "content" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "brand", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "first answer for manufacturer", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'manufacturer'" - } ], - "rule": [ { - "name": "set manufacturer", - "source": [ { - "context": "answer", - "element": "valueCoding", - "variable": "content" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "manufacturer", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "first answer for maholder", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'ma_holder'" - } ], - "rule": [ { - "name": "set maholder", - "source": [ { - "context": "answer", - "element": "valueCoding", - "variable": "content" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "maholder", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "first answser for lot", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'lot'" - } ], - "rule": [ { - "name": "set lot", - "source": [ { - "context": "answer", - "element": "valueString", - "variable": "content" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "lot", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "first answer for date", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'date'" - } ], - "rule": [ { - "name": "set date", - "source": [ { - "context": "answer", - "element": "valueDate", - "variable": "content" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "date", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "first answer for validFrom", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'vaccine_valid'" - } ], - "rule": [ { - "name": "set validFrom", - "source": [ { - "context": "answer", - "element": "valueDate", - "variable": "content" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "validFrom", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "first answer for dose", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'dose'" - } ], - "rule": [ { - "name": "set dose", - "source": [ { - "context": "answer", - "element": "valueInteger", - "variable": "content" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "dose", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "first answer for totalDoses", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'total_doses'" - } ], - "rule": [ { - "name": "set totalDoses", - "source": [ { - "context": "answer", - "element": "valueInteger", - "variable": "content" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "totalDoses", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "first answer for country", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'country'" - } ], - "rule": [ { - "name": "set country", - "source": [ { - "context": "answer", - "element": "valueCoding", - "variable": "content" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "country", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "first answser for centre", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'centre'" - } ], - "rule": [ { - "name": "set centre", - "source": [ { - "context": "answer", - "element": "valueString", - "variable": "content" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "centre", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "first answser for practitioner", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'hw'" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "practitioner", - "variable": "identifier" - } ], - "rule": [ { - "name": "set practitioner", - "source": [ { - "context": "answer", - "element": "valueString", - "variable": "content" - } ], - "target": [ { - "context": "identifier", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "first answer for disease", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'disease'" - } ], - "rule": [ { - "name": "set disease", - "source": [ { - "context": "answer", - "element": "valueCoding", - "variable": "content" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "disease", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "first answer for nextDose", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'due_date'" - } ], - "rule": [ { - "name": "set nextDose", - "source": [ { - "context": "answer", - "element": "valueDate", - "variable": "content" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "nextDose", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - } ] - }, { - "name": "set vaccination period", - "source": [ { - "context": "qr", - "variable": "src" - } ], - "target": [ { - "context": "vaccination", - "contextType": "variable", - "element": "period", - "variable": "period" - } ], - "dependent": [ { - "name": "QRespToVaccinePeriod", - "variable": [ "src", "period" ] - } ] - } ] - }, { - "name": "QRespToVaccinePeriod", - "typeMode": "none", - "input": [ { - "name": "qr", - "mode": "source" - }, { - "name": "period", - "mode": "target" - } ], - "rule": [ { - "name": "vaccination validity items", - "source": [ { - "context": "qr", - "element": "item", - "variable": "item" - } ], - "rule": [ { - "name": "first answer for valid_from", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'valid_from'" - } ], - "rule": [ { - "name": "set valid_from", - "source": [ { - "context": "answer", - "element": "valueDate", - "variable": "content" - } ], - "target": [ { - "context": "period", - "contextType": "variable", - "element": "start", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - }, { - "name": "first answer for valid_until", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'valid_until'" - } ], - "rule": [ { - "name": "set valid_until", - "source": [ { - "context": "answer", - "element": "valueDate", - "variable": "content" - } ], - "target": [ { - "context": "period", - "contextType": "variable", - "element": "end", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - } ] - } ] - } ] - } ] - }, { - "name": "QRespToCertificate", - "typeMode": "none", - "input": [ { - "name": "qr", - "mode": "source" - }, { - "name": "certificate", - "mode": "target" - } ], - "rule": [ { - "name": "certificate items", - "source": [ { - "context": "qr", - "element": "item", - "variable": "item" - } ], - "rule": [ { - "name": "first answser for hcid", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'pha'" - } ], - "target": [ { - "context": "certificate", - "contextType": "variable", - "element": "issuer", - "variable": "issuer" - } ], - "rule": [ { - "name": "set issuer", - "source": [ { - "context": "answer", - "element": "valueString", - "variable": "content" - } ], - "target": [ { - "context": "issuer", - "contextType": "variable", - "element": "identifier", - "variable": "identifier" - } ], - "rule": [ { - "name": "set issuer identifier", - "source": [ { - "context": "content", - "variable": "value" - } ], - "target": [ { - "context": "identifier", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "value" - } ] - } ] - } ] - } ] - }, { - "name": "first answser for hcid", - "source": [ { - "context": "item", - "element": "answer", - "listMode": "first", - "variable": "answer", - "condition": "item.linkId = 'hcid'" - } ], - "target": [ { - "context": "certificate", - "contextType": "variable", - "element": "hcid", - "variable": "hcid" - } ], - "rule": [ { - "name": "set hcid and version", - "source": [ { - "context": "answer", - "element": "valueString", - "variable": "content" - } ], - "target": [ { - "context": "hcid", - "contextType": "variable", - "element": "value", - "transform": "copy", - "parameter": [ { - "valueId": "content" - } ] - }, { - "context": "certificate", - "contextType": "variable", - "element": "version", - "transform": "copy", - "parameter": [ { - "valueString": "RC2" - } ] - } ] - } ] - } ] - } ] - } ] -} diff --git a/input/resources/StructureMap-ddcc-resources-to-coredataset.json b/input/resources/StructureMap-ddcc-resources-to-coredataset.json deleted file mode 100644 index dc7ce88cb2..0000000000 --- a/input/resources/StructureMap-ddcc-resources-to-coredataset.json +++ /dev/null @@ -1,140 +0,0 @@ -{ - "resourceType": "StructureMap", - "id": "ddcc-resources-to-coredataset", - "meta": { - "versionId": "1", - "lastUpdated": "2021-12-14T19:11:43.510+00:00" - }, - "text": { - "status": "generated", - "div": "
map "http://smart.who.int/ddcc/StructureMap/ResourcesToCoreDataSet" = "ResourcesToCoreDataSet"\r\n\r\n\r\nuses "http://hl7.org/fhir/StructureDefinition/Bundle" alias Bundle as source\r\nuses "http://hl7.org/fhir/StructureDefinition/HumanName" alias HumanName as produced\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCPatient" alias DDCCPatient as source\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunization" alias DDCCImmunization as source\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunizationRecommendation" alias DDCCImmunizationRecommendation as source\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetPoV" alias DDCCPoV as target\r\n\r\ngroup ResourcesToCoreDataSet(source bundle : Bundle, target ddcc : DDCCPoV) {\r\n  bundle.entry as entry then {\r\n    entry.resource : Patient as patient then PatientToHeader(patient, ddcc) "set header";\r\n  } "set header from patient";\r\n}\r\n\r\ngroup PatientToHeader(source patient : DDCCPatient, target ddcc : DDCCPoV) {\r\n  patient.name as name then {\r\n    name as src -> ddcc as tgt then NameToText(src, tgt) "setting name";\r\n  } "set name";\r\n}\r\n\r\ngroup NameToText(source src : HumanName, target tgt) {\r\n  src.given as given -> tgt.name = given "set here";\r\n}\r\n\r\n
" - }, - "url": "http://smart.who.int/ddcc/StructureMap/ResourcesToCoreDataSet", - "name": "ResourcesToCoreDataSet", - "structure": [ { - "url": "http://hl7.org/fhir/StructureDefinition/Bundle", - "mode": "source", - "alias": "Bundle" - }, { - "url": "http://hl7.org/fhir/StructureDefinition/HumanName", - "mode": "produced", - "alias": "HumanName" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCPatient", - "mode": "source", - "alias": "DDCCPatient" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunization", - "mode": "source", - "alias": "DDCCImmunization" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunizationRecommendation", - "mode": "source", - "alias": "DDCCImmunizationRecommendation" - }, { - "url": "http://smart.who.int/ddcc/StructureDefinition/DDCCCoreDataSetPoV", - "mode": "target", - "alias": "DDCCPoV" - } ], - "group": [ { - "name": "ResourcesToCoreDataSet", - "typeMode": "none", - "input": [ { - "name": "bundle", - "type": "Bundle", - "mode": "source" - }, { - "name": "ddcc", - "type": "DDCCPoV", - "mode": "target" - } ], - "rule": [ { - "name": "set header from patient", - "source": [ { - "context": "bundle", - "element": "entry", - "variable": "entry" - } ], - "rule": [ { - "name": "set header", - "source": [ { - "context": "entry", - "type": "Patient", - "element": "resource", - "variable": "patient" - } ], - "dependent": [ { - "name": "PatientToHeader", - "variable": [ "patient", "ddcc" ] - } ] - } ] - } ] - }, { - "name": "PatientToHeader", - "typeMode": "none", - "input": [ { - "name": "patient", - "type": "DDCCPatient", - "mode": "source" - }, { - "name": "ddcc", - "type": "DDCCPoV", - "mode": "target" - } ], - "rule": [ { - "name": "set name", - "source": [ { - "context": "patient", - "element": "name", - "variable": "name" - } ], - "rule": [ { - "name": "setting name", - "source": [ { - "context": "name", - "variable": "src" - } ], - "target": [ { - "contextType": "variable", - "variable": "tgt", - "transform": "copy", - "parameter": [ { - "valueId": "ddcc" - } ] - } ], - "dependent": [ { - "name": "NameToText", - "variable": [ "src", "tgt" ] - } ] - } ] - } ] - }, { - "name": "NameToText", - "typeMode": "none", - "input": [ { - "name": "src", - "type": "HumanName", - "mode": "source" - }, { - "name": "tgt", - "mode": "target" - } ], - "rule": [ { - "name": "set here", - "source": [ { - "context": "src", - "element": "given", - "variable": "given" - } ], - "target": [ { - "context": "tgt", - "contextType": "variable", - "element": "name", - "transform": "copy", - "parameter": [ { - "valueId": "given" - } ] - } ] - } ] - } ] -} diff --git a/input/resources/svc-map-qr-uvci-bundle.xml.old b/input/resources/svc-map-qr-uvci-bundle.xml.old deleted file mode 100644 index 3a7ad14a88..0000000000 --- a/input/resources/svc-map-qr-uvci-bundle.xml.old +++ /dev/null @@ -1,671 +0,0 @@ - - - - -
-
map "http://who-int.github.io/svc/StructureMap/svc-map-qr-uvci-bundle" = "svc-map-qr-uvci-bundle"
-
-uses "http://who-int.github.io/svc/refs/heads/qr-encoding/StructureDefinition/svc-qr-uvci" alias QR as source
-uses "http://who-int.github.io/svc/StructureDefinition/svc-bundle" alias SVC_Bundle as target
-uses "http://who-int.github.io/svc/StructureDefinition/svc-composition" alias SVC_Composition as produced
-uses "http://who-int.github.io/svc/StructureDefinition/svc-patient" alias SVC_Patient as produced
-uses "http://who-int.github.io/svc/StructureDefinition/svc-organization" alias SVC_Organization as produced
-uses "http://who-int.github.io/svc/StructureDefinition/svc-provenance" alias SVC_Provenance as produced
-
-group Decode_QR(source qr : QR, target bundle) {
-  qr ->  create('SVC_Patient') as patient,  create('SVC_Organization') as organization then Decode_QR_Patient(qr, patient), Decode_QR_Organization(qr, organization), Decode_QR_Bundle(qr, patient, organzation, bundle) "Create resources and process bundle";
-}
-
-group Decode_QR_Patient(source qr : QR, target patient : SVC_Patient) {
-  qr.name as qrname, patient.name as pname ->  pname.text = qrname,  pname.use = 'official' "Load Name";
-  qr.pid as pid -> patient.identifier = id('XXXXXurn:uetf:rfc:3986', pid) "Load Patient Identifer";
-  qr.birthDate as birthDate -> patient.birthDate = birthDate "Load Birth Date";
-}
-
-group Decode_QR_Organization(source qr : QR, target organization : SVC_Organization) {
-  qr.phaid as phaid -> organization.identifier = id('XXXXXurn:ietf:rfc:3986', phaid) "Load PHA ID";
-}
-
-group Decode_QR_Bundle(source qr : QR, target patient : SVC_Patient, target bundle : SVC_Bundle) {
-  qr ->  bundle.status = 'final',  bundle.type = 'document' "Set Bundle Metadata";
-  qr.paperid as paperid -> bundle.identifier = id('XXXXXurn:ietf:rfc:3986', paperid) "Load Paper SVC ID";
-  qr.signature as qrsig, bundle.signature as bsig ->  bsig.data = qrsig,  bsig.type = '1.2.840.10065.1.12.1.14',  bsig.format = 'XXXXXXX TBD',  bsig.who = reference(organization) "Load Signature";
-  qr ->  bundle.entry as e,  e.resource = create('SVC_Composition') as compostion then Decode_QR_Composition(qr, bundle, composition) "Process Composition Entry";
-}
-
-group Decode_QR_Composition(source qr : QR, source ,, target bundle : SVC_Bundle, target patient : SVC_Patient, target organization : SVC_Organization, target composition : SVC_Composition) {
-  qr ->  composition.subject = reference(patient),  composition.author = reference(organization) "Set Composition Meta";
-  qr.digitalid as digitalid -> composition.identifier = id('XXXXXurn:ietf:rfc:3986', digitalid) "Load Digital SVC ID";
-}
-
-group Decode_QR_Provenance(source qr : QR, target bundle : SVC_Bundle, target patient : SVC_Patient, target organization : SVC_Organization, target paper : SVC_Composition, target digital : SVC_Composition, target provenance : SVC_Provenance) {
-  qr, provenance.entity as e_digital, provenance.agent as agent, provenance.signature as psig ->  provenance.reason = 'PUBHLTH',  provenance.policy = 'XXXXXXX urn:example:who:smart:vaccine-certificate:RC1',  provenance.target = reference(bundle),  e_digital.role = 'source',  e_digital.what = reference(composition),  e_digital.agent = reference(organization),  e_paper.role = 'source',  e_paper.what = reference(bundle),  e_paper.agent = reference(organization),  psig.format = 'XXXXX TBD',  psig.who = reference(organization),  psg.type = '1.2.840.10065.1.12.1.14',  psig.data = signature then {
-    agent.who as who ->  who.reference = reference(organization),  who.onBehalfOf = reference(patient) as "Set who";
-  } "Set provenance";
-}
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
\ No newline at end of file