Generated Narrative: StructureMap ConditionSGHI5 #xD; /// url = 'https://fhir.slade360.co.ke/fhir/StructureMap/ConditionSGHI5'#xD; /// name = 'ConditionSGHI5'#xD; /// title = 'Condition Transforms: R4 → SGHI R5'#xD; /// status = 'active'#xD; #xD; uses "http://hl7.org/fhir/4.0/StructureDefinition/Condition" alias ConditionR4 as source#xD; uses "https://fhir.slade360.co.ke/fhir/StructureDefinition/condition" alias SGHICondition as target#xD; #xD; imports "http://hl7.org/fhir/StructureMap/*4to5"#xD; #xD; group SGHICondition(source src : ConditionR4, target tgt : SGHICondition) <<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/condition' "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.code as scode -> tgt.code as tcode then {#xD; scode.coding as d where system.exists().not() -> tcode.coding = translate(d, 'https://fhir.slade360.co.ke/fhir/ConceptMap/CIELtoICD11Condition', 'Coding');#xD; scode.coding as d where d.system.exists() -> tcode.coding = create('Coding') as tcoding then {#xD; d.code as d -> tcoding.code = translate(d, 'https://fhir.slade360.co.ke/fhir/ConceptMap/CIELtoICD11Condition', 'code');#xD; d.code as d -> tcoding.system = translate(d, 'https://fhir.slade360.co.ke/fhir/ConceptMap/CIELtoICD11Condition', 'system');#xD; d.code as d -> tcoding.display = translate(d, 'https://fhir.slade360.co.ke/fhir/ConceptMap/CIELtoICD11Condition', 'display');#xD; d.code as d -> tcode.text = translate(d, 'https://fhir.slade360.co.ke/fhir/ConceptMap/CIELtoICD11Condition', 'display');#xD; };#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.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.category as sg -> tgt.category as tg then {#xD; sg.coding as d -> tg.coding = create('Coding') as tcode then {#xD; d.code as d -> tcode.code = translate(d, 'https://fhir.slade360.co.ke/fhir/ConceptMap/FHIRCodeCategoryMap', 'code');#xD; d.code as d -> tcode.system = translate(d, 'https://fhir.slade360.co.ke/fhir/ConceptMap/FHIRCodeCategoryMap', 'system');#xD; d.code as d -> tcode.display = translate(d, 'https://fhir.slade360.co.ke/fhir/ConceptMap/FHIRCodeCategoryMap', 'display');#xD; d.code as d -> tg.text = translate(d, 'https://fhir.slade360.co.ke/fhir/ConceptMap/FHIRCodeCategoryMap', 'display');#xD; };#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.clinicalStatus as sg -> tgt.clinicalStatus as tg then {#xD; sg.coding as scode -> tg.coding = create('Coding') as tcode then {#xD; scode.code as d -> tcode.code = translate(d, 'https://fhir.slade360.co.ke/fhir/ConceptMap/FHIRClinicalStatusMap', 'code');#xD; scode.code as d -> tcode.system = translate(d, 'https://fhir.slade360.co.ke/fhir/ConceptMap/FHIRClinicalStatusMap', 'system');#xD; scode.code as d -> tcode.display = translate(d, 'https://fhir.slade360.co.ke/fhir/ConceptMap/FHIRClinicalStatusMap', 'display');#xD; scode.code as d -> tg.text = translate(d, 'https://fhir.slade360.co.ke/fhir/ConceptMap/FHIRClinicalStatusMap', 'display');#xD; };#xD; };#xD; src where severity.exists().not() -> tgt.severity = create('CodeableConcept') as tcc then {#xD; src -> tcc.coding = create('Coding') as tc then {#xD; src -> tc.system = 'https://fhir.slade360.co.ke/fhir/CodeSystem/identifier-codesystem' "set default system";#xD; src -> tc.code = 'mild' "set default code";#xD; src -> tc.display = 'Mild' "setting default display";#xD; } "set severity coding";#xD; } "set default severity";#xD; src where participant.exists().not() -> tgt.participant = create('BackboneElement') as tb then {#xD; src.meta as sm then {#xD; src.meta as sm then {#xD; sm.tag last as st -> tb.actor = create('Reference') as ta then TransformAssigner(st, ta);#xD; };#xD; };#xD; } "setting participant";#xD; src.recordedDate -> tgt.recordedDate;#xD; src.onsetDate as sd -> tgt.onset = sd;#xD; src.note as sn -> tgt.note as tn then {#xD; sn.time -> tn.time;#xD; sn.text -> tn.text;#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;
Generated text