Generated Narrative: StructureMap MedicationRequestSGHI5 #xD; /// url = 'https://fhir.slade360.co.ke/fhir/StructureMap/MedicationRequestSGHI5'#xD; /// name = 'MedicationRequestSGHI5'#xD; /// title = 'MedicationRequest Transforms: R4 → SGHI R5'#xD; /// status = 'active'#xD; #xD; uses "http://hl7.org/fhir/4.0/StructureDefinition/MedicationRequest" alias MedicationRequestR4 as source#xD; uses "https://fhir.slade360.co.ke/fhir/StructureDefinition/medicationrequest" alias SGHIMedicationRequest as target#xD; #xD; imports "http://hl7.org/fhir/StructureMap/*4to5"#xD; #xD; group SGHIMedicationRequest(source src : MedicationRequestR4, target tgt : SGHIMedicationRequest) <<type+>> {#xD; src.id as uuid -> tgt.id = uuid;#xD; src.active -> tgt.active;#xD; src.language -> tgt.language;#xD; src -> tgt.meta as t_meta then {#xD; src -> t_meta.profile = 'https://fhir.slade360.co.ke/fhir/StructureDefinition/medicationrequest' "addprofile";#xD; } "addtometa";#xD; src where text.exists().not() -> tgt.text = create('Narrative') as t_text then {#xD; src -> t_text.status = 'generated' "settextstatus";#xD; src -> t_text.div = ' Generated text ' "settextdiv";#xD; } "createhardcodedtext";#xD; src -> tgt.text = create('Narrative') as ttt then {#xD; src.text as st then {#xD; st.status as s -> ttt.status = s;#xD; st.div as d -> ttt.div = (' ' + d + ' ') "wraptextinhtml";#xD; };#xD; } "setting text";#xD; src.id as s_id -> tgt.identifier = create('Identifier') as t_ident then {#xD; s_id as uuid -> t_ident.value = uuid "copyid";#xD; src -> t_ident.use = 'official' "setuse";#xD; src -> t_ident.system = 'https://fhir.slade360.co.ke/fhir/CodeSystem/identifier-codesystem' "setsystem";#xD; src -> t_ident.type = create('CodeableConcept') as t_type then {#xD; src -> t_type.coding = create('Coding') as t_code then {#xD; src -> t_code.system = 'https://fhir.slade360.co.ke/fhir/CodeSystem/identifier-codesystem' "typesystem";#xD; src -> t_code.code = 'fhir-id' "typecode";#xD; src -> t_code.display = 'FHIR Id' "typedisplay";#xD; } "initcoding";#xD; } "inittype";#xD; src.meta as sm then {#xD; sm.tag last as st -> t_ident.assigner = create('Reference') as ta then TransformAssigner(st, ta);#xD; } "setting owner";#xD; } "addfhirididentifier";#xD; src.status -> tgt.status;#xD; src.intent -> tgt.intent;#xD; src.priority -> tgt.priority;#xD; src.authoredOn -> tgt.authoredOn;#xD; src.medication as sm -> tgt.medication = create('CodeableReference') as tm then {#xD; src where reference.exists().not() -> tm.reference = create('Reference') as trf then {#xD; sm.text -> trf.display;#xD; sm.text as txt -> trf.reference = append('Medication/', txt) "dummy reference";#xD; } "set reference";#xD; };#xD; src.subject as sb -> tgt.subject as tb then TransformReference(sb, tb);#xD; src.encounter as se -> tgt.encounter as te then TransformReference(se, te);#xD; src.requester as sr -> tgt.requester as tr then TransformReference(sr, tr);#xD; src.category as sg -> tgt.category as tg then {#xD; sg.coding as sc -> tg.coding as tc then TransformCoding(sc, tc);#xD; sg.text -> tg.text;#xD; };#xD; src.note as sn -> tgt.note as tn then {#xD; sn.time -> tn.time;#xD; sn.text -> tn.text;#xD; };#xD; src.dosageInstruction as sd -> tgt.dosageInstruction as td then {#xD; sd.asNeeded -> td.asNeeded;#xD; sd.doseAndRate as sd -> td.doseAndRate as td then {#xD; sd.doseQuantity as sq -> td.doseQuantity as tq then {#xD; sq.code -> tq.code;#xD; sq.system -> tq.system;#xD; sq.unit -> tq.unit;#xD; sq.value -> tq.value;#xD; };#xD; };#xD; sd.patientInstruction -> td.patientInstruction;#xD; sd.route as sr -> td.route as tr then {#xD; sr.coding as sc -> tr.coding as tc then TransformCoding(sc, tc);#xD; sr where coding.exists().not() -> tr.coding = create('Coding') as tc, tc.system = 'https://fhir.slade360.co.ke/fhir/CodeSystem/identifier-codesystem', tc.code = 'iv', tc.display = 'Intravenous' "setting default route";#xD; sr.text -> tr.text;#xD; };#xD; sd.timing as st -> td.timing as tt then {#xD; st.repeat as sp -> tt.repeat as tp then {#xD; sp.boundsPeriod as sprd -> tp.boundsPeriod as tprd then {#xD; sprd.end -> tprd.end;#xD; sprd.start -> tprd.start;#xD; };#xD; sp.duration -> tp.duration;#xD; sp.durationUnit -> tp.durationUnit;#xD; sp.frequency -> tp.frequency;#xD; sp.period -> tp.period;#xD; sp.periodUnit -> tp.periodUnit;#xD; };#xD; };#xD; };#xD; }#xD; #xD; group TransformAssigner(source src, target tgt) <<types>> {#xD; src.code as code -> tgt.reference = append('Organization/', code);#xD; src where display.exists().not() -> tgt.display = 'Unknown display' "setting default display";#xD; src.display -> tgt.display;#xD; src.code -> tgt.id;#xD; }#xD; #xD; group TransformReference(source src, target tgt) <<types>> {#xD; src.id -> tgt.id;#xD; src.reference -> tgt.reference;#xD; src.display -> tgt.display;#xD; src where display.exists().not() -> tgt.display = 'Unknown display' "setting display";#xD; }#xD; #xD; group TransformCoding(source src, target tgt) <<types>> {#xD; src.code -> tgt.code;#xD; src.display -> tgt.display;#xD; src where display.exists().not() -> tgt.display = 'Unknown display' "settingdefaultdisplay";#xD; src.system -> tgt.system;#xD; }#xD; #xD;
MedicationRequest Transforms: R4 → SGHI R5
Generated text