Generated Narrative: StructureMap Observation4toSGHI5 #xD; /// url = 'https://fhir.slade360.co.ke/fhir/StructureMap/Observation4toSGHI5'#xD; /// name = 'Observation4toSGHI5'#xD; /// title = 'Observation Transforms: R4 to SGHI R5'#xD; /// status = 'active'#xD; #xD; uses "http://hl7.org/fhir/4.0/StructureDefinition/Observation" alias ObservationR4 as source#xD; uses "https://fhir.slade360.co.ke/fhir/StructureDefinition/observation" alias SGHIObservation as target#xD; #xD; imports "http://hl7.org/fhir/StructureMap/*4to5"#xD; #xD; group SGHIObservation(source src : ObservationR4, target tgt : SGHIObservation) <<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/observation' "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.effectiveInstant as se -> tgt.issued = se "mapissuedfromeffective";#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/CIELtoLOINCObservationMap', 'Coding');#xD; scode.coding as d where system.exists() -> tcode.coding = create('Coding') as tcoding then {#xD; d.code as code -> tcoding.code = translate(code, 'https://fhir.slade360.co.ke/fhir/ConceptMap/CIELtoLOINCObservationMap', 'code');#xD; d.code as sd -> tcoding.system = translate(sd, 'https://fhir.slade360.co.ke/fhir/ConceptMap/CIELtoLOINCObservationMap', 'system');#xD; d.code as d -> tcoding.display = translate(d, 'https://fhir.slade360.co.ke/fhir/ConceptMap/CIELtoLOINCObservationMap', 'display');#xD; d.code as d -> tcode.text = translate(d, 'https://fhir.slade360.co.ke/fhir/ConceptMap/CIELtoLOINCObservationMap', 'display');#xD; };#xD; };#xD; src.code as s_code -> tgt.code as t_code then {#xD; s_code.text -> t_code.text;#xD; src.basedOn -> tgt.basedOn;#xD; src.partOf -> tgt.partOf;#xD; src.category -> tgt.category;#xD; src.status as v -> tgt.status = translate(v, 'http://hl7.org/fhir/uv/xver/ConceptMap/obs.status-4to5', 'code');#xD; src.subject as sb -> tgt.subject as tb then TransformReference(sb, tb);#xD; src.focus -> tgt.focus;#xD; src.encounter as se -> tgt.encounter as te then TransformReference(se, te);#xD; src.effective : dateTime -> tgt.effective;#xD; src.effective : Period -> tgt.effective;#xD; src.effective : Timing -> tgt.effective;#xD; src.effective : instant -> tgt.effective;#xD; src.value : Quantity -> tgt.value;#xD; src.value : CodeableConcept as sv -> tgt.value = sv;#xD; src.value : string -> tgt.value;#xD; src.value : boolean -> tgt.value;#xD; src.value : integer -> tgt.value;#xD; src.value : Range -> tgt.value;#xD; src.value : Ratio -> tgt.value;#xD; src.value : SampledData -> tgt.value;#xD; src.value : time -> tgt.value;#xD; src.value : dateTime -> tgt.value;#xD; src.value : Period -> tgt.value;#xD; src.dataAbsentReason -> tgt.dataAbsentReason;#xD; src.interpretation -> tgt.interpretation;#xD; src.note -> tgt.note;#xD; src.bodySite -> tgt.bodySite;#xD; src.method -> tgt.method;#xD; src.specimen -> tgt.specimen;#xD; src.device -> tgt.device;#xD; src.referenceRange as s -> tgt.referenceRange as t then ObservationReferenceRange(s, t);#xD; src.hasMember -> tgt.hasMember;#xD; src.derivedFrom -> tgt.derivedFrom;#xD; src.component as s -> tgt.component as t then ObservationComponent(s, t);#xD; src.performer as spf -> tgt.performer as tpf then TransformReference(spf, tpf);#xD; src where performer.exists().not() then {#xD; src.meta as sm then {#xD; sm.tag last as st -> tgt.performer = create('Reference') as tp then TransformAssigner(st, tp);#xD; };#xD; } "setting performer";#xD; };#xD; }#xD; #xD; group ObservationReferenceRange(source src, target tgt) extends BackboneElement {#xD; src.low as sl -> tgt.low = sl;#xD; src.high -> tgt.high;#xD; src.type -> tgt.type;#xD; src.appliesTo -> tgt.appliesTo;#xD; src.age -> tgt.age;#xD; src.text -> tgt.text;#xD; }#xD; #xD; group ObservationComponent(source src, target tgt) extends BackboneElement {#xD; src.value : Quantity -> tgt.value;#xD; src.value : CodeableConcept -> tgt.value;#xD; src.value : string -> tgt.value;#xD; src.value : boolean -> tgt.value;#xD; src.value : integer -> tgt.value;#xD; src.value : Range -> tgt.value;#xD; src.value : Ratio -> tgt.value;#xD; src.value : SampledData -> tgt.value;#xD; src.value : time -> tgt.value;#xD; src.value : dateTime -> tgt.value;#xD; src.value : Period -> tgt.value;#xD; src.dataAbsentReason -> tgt.dataAbsentReason;#xD; src.interpretation -> tgt.interpretation;#xD; src.referenceRange as s -> tgt.referenceRange as t then ObservationReferenceRange(s, t);#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;
Generated text