Generated Narrative: StructureMap DocumentReferenceSGHI5 #xD; /// url = 'https://fhir.slade360.co.ke/fhir/StructureMap/DocumentReferenceSGHI5'#xD; /// name = 'DocumentReferenceSGHI5'#xD; /// title = 'DocumentReference Transforms: R4 to SGHI R5'#xD; /// status = 'active'#xD; #xD; uses "http://hl7.org/fhir/4.0/StructureDefinition/DocumentReference" alias DocumentReferenceR4 as source#xD; uses "https://fhir.slade360.co.ke/fhir/StructureDefinition/documentreference" alias SGHIDocumentReference as target#xD; #xD; imports "http://hl7.org/fhir/StructureMap/*4to5"#xD; #xD; group SGHIDocumentReference(source src : DocumentReferenceR4, target tgt : SGHIDocumentReference) <<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/documentreference' "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.context as sctx then {#xD; sctx.related as sr -> tgt.basedOn = create('Reference') as tr then TransformReference(sr, tr);#xD; sctx.encounter as se -> tgt.context = create('Reference') as te then TransformReference(se, te);#xD; };#xD; src.status -> tgt.status;#xD; src.docStatus -> tgt.docStatus;#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.type as stype -> tgt.type as ttype then {#xD; stype.coding as scoding -> ttype.coding = create('Coding') as tcoding then {#xD; scoding.code as d -> tcoding.code = translate(d, 'https://fhir.slade360.co.ke/fhir/ConceptMap/CIELtoFHIRCategoryCodeBindingsMap', 'code');#xD; scoding.code as d -> tcoding.system = translate(d, 'https://fhir.slade360.co.ke/fhir/ConceptMap/CIELtoFHIRCategoryCodeBindingsMap', 'system');#xD; scoding.code as d -> tcoding.display = translate(d, 'https://fhir.slade360.co.ke/fhir/ConceptMap/CIELtoFHIRCategoryCodeBindingsMap', 'display');#xD; scoding.code as d -> ttype.text = translate(d, 'https://fhir.slade360.co.ke/fhir/ConceptMap/CIELtoFHIRCategoryCodeBindingsMap', 'display');#xD; };#xD; };#xD; src where type.exists().not() -> tgt.type = create('CodeableConcept') as tconcept then {#xD; src -> tconcept.coding = create('Coding') as tcoding then {#xD; src -> tcoding.system = 'https://fhir.slade360.co.ke/fhir/ConceptMap/CIELtoFHIRCategoryCodeBindingsMap' "setting system";#xD; src -> tcoding.code = 'referral' "setting code";#xD; src -> tcoding.display = 'Referral' "setting display";#xD; } "setting coding";#xD; } "setting default type";#xD; src.subject as sb -> tgt.subject as tb then TransformReference(sb, tb);#xD; src.date -> tgt.date;#xD; src.author as sa -> tgt.author as ta then TransformReference(sa, ta);#xD; src where author.exists().not() then {#xD; src.meta as sm then {#xD; sm.tag last as st -> tgt.author = create('Reference') as ta then TransformAssigner(st, ta);#xD; } "setting author";#xD; } "setting author";#xD; src.custodian as scd -> tgt.custodian as tcd then TransformReference(scd, tcd);#xD; src where custodian.exists().not() then {#xD; src.meta as sm then {#xD; sm.tag last as st -> tgt.custodian = create('Reference') as ta then TransformAssigner(st, ta);#xD; } "setting custodian";#xD; } "set custodian";#xD; src.content as sct -> tgt.content = create('BackboneElement') as tct then {#xD; sct.attachment as sa -> tct.attachment as ta then {#xD; sa.contentType -> ta.contentType;#xD; sa.title -> ta.title;#xD; sa.url -> ta.url;#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.text -> 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;
DocumentReference Transforms: R4 to SGHI R5
Generated text