From 78ae5c449c08d01d56a420d50fb9fd6566789d8f Mon Sep 17 00:00:00 2001
From: Carl Leitner
- The message semantics for the Register Health Certificate transaction utilizes a DDCC Submit Health Event Request which is a batch Bundle of Parameters for the Generate Health Certificate Operation which includes DDCC Questionnaire Response resources for the request message. The specific DDCC Questionnaire Response resource is determined by the health event that is the subject of the transaction.
+ The message semantics for the Register Health Certificate transaction utilizes a DDCC Submit Health Event Request which is a batch Bundle of Parameters for the Generate Health Certificate Operation which includes DDCC Questionnaire Response resources for the request message. The specific DDCC Questionnaire Response resource is determined by the health event that is the subject of the transaction.
Logical Models
-
DDCC:VS Core Data Set
diff --git a/input/pagecontent/interoperability.xml b/input/pagecontent/interoperability.xml
index c2a96342c9..82b7395344 100644
--- a/input/pagecontent/interoperability.xml
+++ b/input/pagecontent/interoperability.xml
@@ -39,7 +39,7 @@
Element Data Type Cardinality Condition (IF True) Mapping Equivalence Element Data Type Cardinality Assignment Comments
- Min Max Computable FHIRPath Narrative Min Max
+ DDCCCoreDataSet.VS DDCCCoreDataSet 1 * SHCVaccinationBundleDM Bundle 1 1 DDCCCoreDataSet-VS DDCCCoreDataSet 1 * SHCVaccinationBundleDM Bundle 1 1 SHCVaccinationBundleDM.type code 1 1 "collection" SHCVaccinationBundleDM.entry:patient.resource SHCPatientGeneralDM 1 1
@@ -85,4 +85,4 @@
-
\ No newline at end of file
+
diff --git a/input/pagecontent/testing.xml b/input/pagecontent/testing.xml
index 10545e15d4..e70689bb60 100644
--- a/input/pagecontent/testing.xml
+++ b/input/pagecontent/testing.xml
@@ -34,7 +34,7 @@
SHCPatientGeneralDM.name HumanName 1 1
diff --git a/input/pagecontent/transactions.xml b/input/pagecontent/transactions.xml
index 2f418e4d1b..df196641ac 100644
--- a/input/pagecontent/transactions.xml
+++ b/input/pagecontent/transactions.xml
@@ -22,7 +22,7 @@
Message Semantics Request
Message Semantics Response
@@ -230,7 +230,7 @@
- The Revoke Health Certificate transaction is a Revoke Health Certificate Operation. The client will submit + The Revoke Health Certificate transaction is a Revoke Health Certificate Operation. The client will submit Parameters which include the DDCC ID of the DDCC to be revoked. The response will be a boolean value, indicating whether the revocation succeeded or not.
diff --git a/input/resources/CapabilityStatement-WHO.DDCC.Generator.xml b/input/resources/CapabilityStatement-WHO.DDCC.Generator.xml index a8e0f6639c..e02d1febdd 100644 --- a/input/resources/CapabilityStatement-WHO.DDCC.Generator.xml +++ b/input/resources/CapabilityStatement-WHO.DDCC.Generator.xml @@ -45,7 +45,7 @@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
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
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
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
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
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
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
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
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/DDCC-QR-Format-CodeSystem', 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/DDCC-QR-Format-CodeSystem', 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/DDCC-QR-Format-CodeSystem', 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
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
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/DDCC-Composition-Category-CodeSystem', 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/DDCC-QR-Category-Usage-CodeSystem', 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/DDCC-QR-Category-Usage-CodeSystem', 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
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
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
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
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
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
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
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
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/who-ddcc-vaccines-covid-19') 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/who-ddcc-vaccines-covid-19').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
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
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
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
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
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
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
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
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
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
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
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