Generated Narrative: StructureMap Patient4toSGHI5 #xD; /// url = 'https://fhir.slade360.co.ke/fhir/StructureMap/Patient4toSGHI5'#xD; /// name = 'Patient4toSGHI5'#xD; /// title = 'Patient Transforms: R4 → SGHI R5'#xD; /// status = 'active'#xD; #xD; uses "http://hl7.org/fhir/4.0/StructureDefinition/Patient" alias PatientR4 as source#xD; uses "https://fhir.slade360.co.ke/fhir/StructureDefinition/patient" alias SGHIPatient as target#xD; uses "https://fhir.slade360.co.ke/fhir/StructureDefinition/human-name" alias SGHIHumanName as produced#xD; uses "https://fhir.slade360.co.ke/fhir/StructureDefinition/contact-point" alias SGHIContactPoint as produced#xD; uses "https://fhir.slade360.co.ke/fhir/StructureDefinition/codeableconcept" alias SGHICodeableConcept as produced#xD; uses "https://fhir.slade360.co.ke/fhir/StructureDefinition/reference" alias SGHIReference as produced#xD; #xD; imports "http://hl7.org/fhir/StructureMap/*4to5"#xD; #xD; group SGHIPatient(source src : PatientR4, target tgt : SGHIPatient) extends DomainResource <<type+>> {#xD; src.text -> tgt.text;#xD; src.identifier as s where (s.system != 'healthcloud.msisdn') and s.value.exists() -> tgt.identifier as t then {#xD; s.use -> t.use "copyuse";#xD; s.value -> t.value "copyvalue";#xD; s.period -> t.period "copyperiod";#xD; s.type as ty then {#xD; ty.coding first as cf then {#xD; cf.system as legacy -> t.type as result then TranslateLegacyIdentifier(legacy, result) "calltranslator";#xD; } "whensourcehascoding";#xD; } "mapidentifiertype";#xD; s -> t.system = 'https://fhir.slade360.co.ke/fhir/CodeSystem/identifier-codesystem' "SetFixedIdentifierSystem";#xD; src.managingOrganization as mo -> t.assigner = create('Reference') as t_assigner then {#xD; mo.reference -> t_assigner.reference "setassignerreffrommo";#xD; mo.display -> t_assigner.display "setassignerdisplayfrommo";#xD; } "createandpopulateassigner";#xD; } "processoneidentifier";#xD; src.identifier as s_id -> tgt.identifier as t_id then {#xD; s_id.use -> t_id.use "copyuse";#xD; src.id as uuid -> t_id.value = uuid;#xD; s_id.period -> t_id.period;#xD; s_id.type as st -> t_id.type as tt then {#xD; st.coding -> tt.coding = create('CodeableConcept') as tt, tt.system = 'https://fhir.slade360.co.ke/fhir/CodeSystem/identifier-codesystem', tt.code = 'fhir-id', tt.display = 'FHIR Id';#xD; };#xD; s_id -> t_id.system = 'https://fhir.slade360.co.ke/fhir/CodeSystem/identifier-codesystem' "SetFixedIdentifierSystem";#xD; } "create the default FHIR ID identifier type";#xD; src.active -> tgt.active;#xD; src.name first as s -> tgt.name as t then SGHIHumanNameMap(s, t);#xD; src.telecom as s -> tgt.telecom as t then SGHIContactPointMap(s, t);#xD; src.gender as v -> tgt.gender = translate(v, 'http://hl7.org/fhir/uv/xver/ConceptMap/pat.gender-4to5', 'code') "mapgender";#xD; src.birthDate -> tgt.birthDate;#xD; src.deceased : boolean -> tgt.deceased;#xD; src.deceased : dateTime -> tgt.deceased;#xD; src.multipleBirth : boolean -> tgt.multipleBirth;#xD; src.multipleBirth : integer -> tgt.multipleBirth;#xD; src.address -> tgt.address;#xD; src.photo -> tgt.photo;#xD; src.contact as s -> tgt.contact as t then SGHIPatientContact(s, t);#xD; src.communication as s -> tgt.communication as t then PatientCommunication(s, t);#xD; src.managingOrganization -> tgt.managingOrganization;#xD; src.generalPractitioner -> tgt.generalPractitioner;#xD; src.link as s -> tgt.link as t then SGHIPatientLink(s, t);#xD; src -> 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.meta as t_meta then {#xD; src -> t_meta.profile = 'https://fhir.slade360.co.ke/fhir/StructureDefinition/patient' "addprofile";#xD; } "addprofiletometa";#xD; }#xD; #xD; group TranslateLegacyIdentifier(source legacy_code : string, target result : CodeableConcept) {#xD; legacy_code -> result.coding = translate(legacy_code, 'https://fhir.slade360.co.ke/fhir/ConceptMap/LegacyIdentifierToSGHI', 'Coding') "translatetocoding";#xD; legacy_code -> result.text "settext";#xD; }#xD; #xD; group SGHIHumanNameMap(source src, target tgt) extends HumanName {#xD; src.use -> tgt.use;#xD; src.text -> tgt.text;#xD; src.family -> tgt.family;#xD; src.given -> tgt.given;#xD; src.prefix -> tgt.prefix;#xD; src.suffix -> tgt.suffix;#xD; src.period -> tgt.period;#xD; }#xD; #xD; group SGHIContactPointMap(source src, target tgt) extends ContactPoint {#xD; src.system -> tgt.system;#xD; src.value -> tgt.value;#xD; src.use -> tgt.use;#xD; src.rank -> tgt.rank;#xD; src.period -> tgt.period;#xD; }#xD; #xD; group SGHICodeableConceptCopy(source src, target tgt) extends CodeableConcept {#xD; src.coding -> tgt.coding;#xD; src.text -> tgt.text;#xD; }#xD; #xD; group SGHIPatientContact(source src, target tgt) extends BackboneElement {#xD; src.relationship as r -> tgt.relationship as t then SGHICodeableConceptCopy(r, t);#xD; src.name as n -> tgt.name as tn then SGHIHumanNameMap(n, tn);#xD; src.telecom first as c -> tgt.telecom as tc then SGHIContactPointMap(c, tc);#xD; src.address -> tgt.address;#xD; src.gender as v -> tgt.gender = translate(v, 'http://hl7.org/fhir/uv/xver/ConceptMap/pat.co.gender-4to5', 'code') "mapcontactgender";#xD; src.organization -> tgt.organization;#xD; src.period -> tgt.period;#xD; }#xD; #xD; group PatientCommunication(source src, target tgt) extends BackboneElement {#xD; src.language -> tgt.language;#xD; src.preferred -> tgt.preferred;#xD; }#xD; #xD; group SGHIPatientLink(source src, target tgt) extends BackboneElement {#xD; src.other -> tgt.other;#xD; src.type as v -> tgt.type = translate(v, 'http://hl7.org/fhir/uv/xver/ConceptMap/pat.li.type-4to5', 'code') "maplinktype";#xD; }#xD; #xD;
(s.system != 'healthcloud.msisdn') and s.value.exists()
create the default FHIR ID identifier type
Generated text