Generated Narrative: StructureMap AllergyIntoleranceSGHI5 #xD; /// url = 'https://fhir.slade360.co.ke/fhir/StructureMap/AllergyIntoleranceSGHI5'#xD; /// name = 'AllergyIntoleranceSGHI5'#xD; /// title = 'Encounter Transforms: R4 → SGHI R5'#xD; /// status = 'active'#xD; #xD; uses "http://hl7.org/fhir/4.0/StructureDefinition/AllergyIntolerance" alias AllergyIntoleranceR4 as source#xD; uses "https://fhir.slade360.co.ke/fhir/StructureDefinition/allergyintolerance" alias SGHIAllergyIntolerance as target#xD; #xD; imports "http://hl7.org/fhir/StructureMap/*4to5"#xD; #xD; group SGHIAllergyIntolerance(source src : AllergyIntoleranceR4, target tgt : SGHIAllergyIntolerance) <<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/allergyintolerance' "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.clinicalStatus as sg -> tgt.clinicalStatus as tg then {#xD; sg.coding as sc -> tg.coding as tc then TransformCoding(sc, tc);#xD; sg.text -> tg.text;#xD; };#xD; src.verificationStatus as sv -> tgt.verificationStatus as tv then {#xD; sv.coding as sc -> tv.coding as tc then TransformCoding(sc, tc);#xD; sv.text -> tv.text;#xD; };#xD; src.type as st where type.exists() -> tgt.type = cc('http://hl7.org/fhir/allergy-intolerance-type', st, st);#xD; src.patient as sb -> tgt.patient as tb then TransformReference(sb, tb);#xD; src.encounter as se -> tgt.encounter as te then {#xD; se.id -> te.id;#xD; se.reference -> te.reference;#xD; se where reference.exists().not() then {#xD; se.id as id -> te.reference = append('Encounter/', id);#xD; } "setting reference";#xD; se.display -> te.display;#xD; se where display.exists().not() -> te.display = 'Unknown display' "setting the default display";#xD; };#xD; src.code as sc -> tgt.code as tc then {#xD; sc.coding as scc -> tc.coding as tcc then TransformCoding(scc, tcc);#xD; sc.text -> tc.text;#xD; };#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.criticality -> tgt.criticality;#xD; src.onsetDateTime -> tgt.recordedDate;#xD; src.reaction as sre -> tgt.reaction as tre then {#xD; sre.manifestation as scpt -> tre.manifestation = create('CodeableReference') as tcpt then {#xD; src -> tcpt.concept = create('CodeableConcept') as tcc then {#xD; scpt.coding as sc -> tcc.coding = create('Coding') as tc then TransformCoding(sc, tc);#xD; } "creating codeable concept";#xD; };#xD; sre.description -> tre.description;#xD; sre.severity -> tre.severity;#xD; sre.note as sn -> tre.note as tn then TransformNote(sn, tn);#xD; };#xD; src.severity as sv -> tgt.severity as tv then {#xD; sv.coding as sc -> tv.coding as tc then {#xD; sc.system -> tc.system = 'https://fhir.slade360.co.ke/fhir/CodeSystem/identifier-codesystem';#xD; sc.code -> tc.code;#xD; sc.display -> tc.display;#xD; };#xD; sv.text -> tv.text;#xD; };#xD; src where participant.exists().not() -> tgt.participant = create('BackboneElement') as tb then {#xD; src.patient as sp -> tb.actor = create('Reference') as trf then TransformReference(sp, trf);#xD; } "setting participant";#xD; src.recordedDate -> tgt.recordedDate;#xD; src where onsetDateTime.exists() then {#xD; src.onsetDateTime as sd -> tgt.onset = sd;#xD; } "setting onset date";#xD; src where onsetDateTime.exists().not() then {#xD; src.recordedDate as sd -> tgt.onset = sd;#xD; } "setting onset date";#xD; src.note as sn -> tgt.note as tn then TransformNote(sn, tn);#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; group TransformNote(source src, target tgt) <<types>> {#xD; src.time -> tgt.time;#xD; src.text -> tgt.text;#xD; }#xD; #xD;
Generated text