Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes to StructureMaps #82

Open
wants to merge 1 commit into
base: cleanup
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions input/maps/IMMZD1LMToResources.fml
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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";
Expand All @@ -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";
Expand All @@ -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";
Expand All @@ -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";
Expand All @@ -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";
Expand All @@ -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";

Expand Down
9 changes: 3 additions & 6 deletions input/maps/IMMZD4LMToResources.fml
Original file line number Diff line number Diff line change
@@ -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";

}
16 changes: 4 additions & 12 deletions input/maps/IMMZD4QRToLM.fml
Original file line number Diff line number Diff line change
@@ -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";
}