From 038dcbc627df398dc208f3ada8fd318ddbe93c63 Mon Sep 17 00:00:00 2001 From: Divya Ramnath Date: Mon, 23 Oct 2023 09:27:02 +0000 Subject: [PATCH] Patrick's fixes to structure maps --- input/maps/IMMZD1LMToResources.fml | 33 +++++++++++++++--------------- input/maps/IMMZD4LMToResources.fml | 9 +++----- input/maps/IMMZD4QRToLM.fml | 16 ++++----------- 3 files changed, 24 insertions(+), 34 deletions(-) diff --git a/input/maps/IMMZD1LMToResources.fml b/input/maps/IMMZD1LMToResources.fml index 5e35a61e97..8641ef7bc9 100644 --- a/input/maps/IMMZD1LMToResources.fml +++ b/input/maps/IMMZD1LMToResources.fml @@ -11,8 +11,8 @@ group IMMZD1ToBundle (source immz : IMMZD1, target bundle: Bundle) { immz.dose0 as content -> bundle.entry as entry, entry.resource = create('Observation') as obs then { patient -> obs.subject = patient "SetPatient"; - content -> obs.code as code then { - content -> code.coding as coding then { + content -> obs.code = create('CodeableConcept') as code then { + content -> code.coding = create('Coding') as coding then { content -> coding.system = 'http://smart.who.int/ig/smart-immunizations/CodeSystem/IMMZ.D1' "SetObsSystem"; content -> coding.code = 'DE80' "SetObsCode"; } "SetObsCoding"; @@ -22,8 +22,8 @@ group IMMZD1ToBundle (source immz : IMMZD1, target bundle: Bundle) { immz.completedPrimarySeries as content -> bundle.entry as entry, entry.resource = create('Observation') as obs then { patient -> obs.subject = patient "SetPatient"; - content -> obs.code as code then { - content -> code.coding as coding then { + content -> obs.code = create('CodeableConcept') as code then { + content -> code.coding = create('Coding') as coding then { content -> coding.system = 'http://smart.who.int/ig/smart-immunizations/CodeSystem/IMMZ.D1' "SetObsSystem"; content -> coding.code = 'DE8' "SetObsCode"; } "SetObsCoding"; @@ -33,8 +33,8 @@ group IMMZD1ToBundle (source immz : IMMZD1, target bundle: Bundle) { immz.dateSeriesCompleted as content -> bundle.entry as entry, entry.resource = create('Observation') as obs then { patient -> obs.subject = patient "SetPatient"; - content -> obs.code as code then { - content -> code.coding as coding then { + content -> obs.code = create('CodeableConcept') as code then { + content -> code.coding = create('Coding') as coding then { content -> coding.system = 'http://smart.who.int/ig/smart-immunizations/CodeSystem/IMMZ.D1' "SetObsSystem"; content -> coding.code = 'DE81' "SetObsCode"; } "SetObsCoding"; @@ -44,21 +44,22 @@ group IMMZD1ToBundle (source immz : IMMZD1, target bundle: Bundle) { immz.hivStatus as content -> bundle.entry as entry, entry.resource = create('Observation') as obs then { patient -> obs.subject = patient "SetPatient"; - content -> obs.code as code then { - content -> code.coding as coding then { + content -> obs.code = create('CodeableConcept') as code then { + content -> code.coding = create('Coding') as coding then { content -> coding.system = 'http://smart.who.int/ig/smart-immunizations/CodeSystem/IMMZ.D1' "SetObsSystem"; content -> coding.code = 'DE10' "SetObsCode"; } "SetObsCoding"; } "SetObsCode"; - content -> obs.valueCodeableConcept as code then { + + content -> obs.value = create('CodeableConcept') as code then { content -> code.coding = content "SetCoding"; } "SetCodeableConcept"; } "SetHIVStatusObservation"; immz.pretermBirth as content -> bundle.entry as entry, entry.resource = create('Observation') as obs then { patient -> obs.subject = patient "SetPatient"; - content -> obs.code as code then { - content -> code.coding as coding then { + content -> obs.code = create('CodeableConcept') as code then { + content -> code.coding = create('Coding') as coding then { content -> coding.system = 'http://smart.who.int/ig/smart-immunizations/CodeSystem/IMMZ.D1' "SetObsSystem"; content -> coding.code = 'DE15' "SetObsCode"; } "SetObsCoding"; @@ -68,8 +69,8 @@ group IMMZD1ToBundle (source immz : IMMZD1, target bundle: Bundle) { immz.severelyImmunosuppressed as content -> bundle.entry as entry, entry.resource = create('Observation') as obs then { patient -> obs.subject = patient "SetPatient"; - content -> obs.code as code then { - content -> code.coding as coding then { + content -> obs.code = create('CodeableConcept') as code then { + content -> code.coding = create('Coding') as coding then { content -> coding.system = 'http://smart.who.int/ig/smart-immunizations/CodeSystem/IMMZ.D1' "SetObsSystem"; content -> coding.code = 'DE92' "SetObsCode"; } "SetObsCoding"; @@ -79,8 +80,8 @@ group IMMZD1ToBundle (source immz : IMMZD1, target bundle: Bundle) { immz.artStartDate as content -> bundle.entry as entry, entry.resource = create('Observation') as obs then { patient -> obs.subject = patient "SetPatient"; - content -> obs.code as code then { - content -> code.coding as coding then { + content -> obs.code = create('CodeableConcept') as code then { + content -> code.coding = create('Coding') as coding then { content -> coding.system = 'http://smart.who.int/ig/smart-immunizations/CodeSystem/IMMZ.D1' "SetObsSystem"; content -> coding.code = 'DE49' "SetObsCode"; } "SetObsCoding"; @@ -95,7 +96,7 @@ group IMMZD1ToBundle (source immz : IMMZD1, target bundle: Bundle) { history.vaccineType as vaccine -> imm.vaccineCode as code then { vaccine -> code.coding = vaccine "SetVaccineCoding"; } "SetVaccineType"; - history.vaccineDate as date -> imm.occurrence = cast(date, 'dateTime') "SetDate"; + history.vaccineDate as date -> imm.occurrence = cast(date, 'string') "SetDate"; } "SetVaccineHistoryObservation"; diff --git a/input/maps/IMMZD4LMToResources.fml b/input/maps/IMMZD4LMToResources.fml index 0be4df9739..27e0016059 100644 --- a/input/maps/IMMZD4LMToResources.fml +++ b/input/maps/IMMZD4LMToResources.fml @@ -1,19 +1,16 @@ map "http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZD4LMToResources" = "IMMZD4LMToResources" - -uses "http://smart.who.int/ig/smart-immunizations/StructureDefinition/IMMZD4CheckContraindicationsMeasles" alias IMMZD4 as source +uses "http://smart.who.int/ig/smart-immunizations/StructureDefinition/IMMZD4CheckContraindications" alias IMMZD4 as source uses "http://hl7.org/fhir/StructureDefinition/Bundle" alias Bundle as target group IMMZD4ToBundle (source immz : IMMZD4, target bundle: Bundle) { immz -> bundle.type = 'collection' "SetCollection"; - immz.patient as patient then { immz.contraindications as ci -> bundle.entry as entry, entry.resource = create('Condition') as condition then { patient -> condition.subject = patient "SetPatient"; - ci -> condition.clinicalStatus = 'active' "SetStatus"; - ci -> condition.code as code then { + ci -> condition.clinicalStatus = create('CodeableConcept') as cc, cc.coding = create('Coding') as c, c.system = 'http://hl7.org/fhir/ValueSet/condition-clinical', c.code = 'active' "SetClinicalStatus"; + ci -> condition.code = create('CodeableConcept') as code then { ci -> code.coding = ci "SetCoding"; } "SetCode"; } "SetCondition"; } "GetPatient"; - } diff --git a/input/maps/IMMZD4QRToLM.fml b/input/maps/IMMZD4QRToLM.fml index 0dd61fa870..b1fe77996f 100644 --- a/input/maps/IMMZD4QRToLM.fml +++ b/input/maps/IMMZD4QRToLM.fml @@ -1,20 +1,12 @@ map "http://smart.who.int/ig/smart-immunizations/StructureMap/IMMZD4QRToLM" = "IMMZD4QRToLM" - uses "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" alias QResp as source -uses "http://smart.who.int/ig/smart-immunizations/StructureDefinition/IMMZD4CheckContraindicationsMeasles" alias IMMZD4 as target +uses "http://smart.who.int/ig/smart-immunizations/StructureDefinition/IMMZD4CheckContraindications" alias IMMZD4 as target group QRespToIMMZD4 ( source qr : QResp, target immz : IMMZD4) { - qr.subject as patient -> immz.patient = patient "SetPatient"; - - qr.item as item then { - - - - item.answer as answer where item.linkId = 'contraindications' then { - answer.value as content -> immz.contraindications = content "SetContraindication"; + qr.item as item where linkId = 'contraindications' then { + item.answer as answer then { + answer.value as val -> immz.contraindications = val "SetContraindication"; } "SetContraindicationAnswer"; - } "processItems"; } -