{ "resourceType" : "StructureMap", "id" : "DDCCtoCoredataset", "meta" : { "versionId" : "1", "lastUpdated" : "2022-03-01T19:17:56.589+00:00" }, "text" : { "status" : "generated", "div" : "
map "http://smart.who.int/ddcc/StructureMap/DDCCtoCoredataset" = "DDCCtoCoredataset"\r\n\r\n\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCVSComposition" alias DDCC as source\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCDocument" alias DDCCDocument as source\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCPatient" alias DDCCPatient as source\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCVSComposition" alias DDCCVSComposition as source\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCCountryOfVaccination" alias DDCCCountryOfVaccination as source\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCVaccineBrand" alias DDCCVaccineBrand as source\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCOrganization" alias DDCCOrganization as source\r\nuses "http://smart.who.int/ddcc/StructureDefinition/DDCCImmunization" alias DDCCImmunization as source\r\nuses "http://smart.who.int/ddcc/DDCCCoreDataSet.VS.PoV" alias DDCCCoreDataSetPoV as target\r\n\r\ngroup DecodeDDCCtoQR(source ddcc : DDCCDocument, target qr : DDCCCoreDataSetPoV) {\r\n ddcc.entry as entry then {\r\n // entry.resource : DDCCPatient as patient\r\n entry.resource : Patient as patient then DecodePatientToQR(patient, qr) "Patient";\r\n };\r\n ddcc.entry as entry then {\r\n entry.resource : Immunization as immunization log immunization then DecodeImmunizationToQR(ddcc, immunization, qr) "Immunization";\r\n };\r\n}\r\n\r\ngroup DecodePatientToQR(source patient : DDCCPatient, target qr : DDCCCoreDataSetPoV) {\r\n patient.birthDate as birthDate -> qr.birthDate = birthDate;\r\n patient.name as name then {\r\n name.text as text -> qr.name = text;\r\n };\r\n}\r\n\r\ngroup DecodeImmunizationToQR(source ddcc : DDCCDocument, source immunization : DDCCImmunization, target qr : DDCCCoreDataSetPoV) {\r\n immunization -> qr.vaccination = create('BackboneElement') as vacEvent then {\r\n immunization.protocolApplied as protocol then {\r\n protocol.doseNumberPositiveInt as dose -> vacEvent.dose = dose;\r\n protocol.seriesDosesPositiveInt as doseNum -> vacEvent.totalDoses = doseNum;\r\n protocol.targetDisease as targetDisease then {\r\n targetDisease.valueCodableConcept as valueCodableConcept -> vacEvent.disease = valueCodableConcept;\r\n } "Target-Disease";\r\n };\r\n immunization.occurrenceDateTime as date -> vacEvent.date = date;\r\n // TODO: need to populate vacEvent.maholder\r\n immunization.extension as country where (url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCCountryOfEvent') then {\r\n country.valueCode as code -> vacEvent.country = create('Coding') as coding, coding.code = code, coding.system = 'http://hl7.org/fhir/ValueSet/iso3166-1-3';\r\n } "Country";\r\n // immunization.extension : DDCCBrand as brand\r\n immunization.extension as brand where (url = 'http://smart.who.int/ddcc/StructureDefinition/DDCCEventBrand') then {\r\n brand.valueCoding as valueCoding -> vacEvent.brand = valueCoding;\r\n } "Vaccine-Brand";\r\n immunization.vaccineCode as vaccineCode then {\r\n vaccineCode.coding as coding -> vacEvent.vaccine = coding;\r\n } "Vaccine-Code";\r\n ddcc.entry as entry then {\r\n // entry.resource : DDCCOrganization as organization\r\n entry.resource : Organization as organization then {\r\n organization.name as name -> vacEvent.centre = name;\r\n } "Centre-Name";\r\n } "Vaccination-Centre";\r\n ddcc.entry as entry then {\r\n // entry.resource : DDCCVSComposition as composition\r\n entry.resource : Composition as composition then {\r\n composition.identifier as identifier -> qr.identifier = identifier;\r\n } "Vaccination-Event-ID";\r\n } "Vaccination-Event";\r\n } "Vaccination";\r\n}\r\n\r\n