Starter FHIR Implementation Guide
1.0.1 - draft International flag

Starter FHIR Implementation Guide, published by Jembi Health Systems. This guide is not an authorized publication; it is the continuous build for version 1.0.1 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/jembi/Starter-FHIR-IG/ and changes regularly. See the Directory of published versions

StructureMap: Map CHT Patient to FHIR Patient

Official URL: http://jembi.org/fhir/StructureMap/CHTPatientToFHIRR4Patient Version: 1.0.1
Draft as of 2024-11-08 Computable Name: CHTPatientToFHIRR4Patient

Generated Narrative: StructureMap CHTPatientToFHIRR4Patient

map "http://jembi.org/fhir/StructureMap/CHTPatientToFHIRR4Patient" = "CHTPatientToFHIRR4Patient"

uses "http://jembi.org/fhir/StructureDefinition/CHTPatientLogicalModel" as source
uses "http://hl7.org/fhir/StructureDefinition/Patient" as target

group CHTPatientToFHIRR4Patient(source src : CHTPatientLogicalModel, target tgt : Patient) {
  src._id as srcID -> tgt.id = srcID "SetPatientResourceId";
  src.name as srcName -> tgt.name as pName then {
    srcName -> pName.text = srcName "SetPatientFullName";
  };
  src.phone as srcPhoneNumber -> tgt.telecom as pTelecom then {
    srcPhoneNumber -> pTelecom.system = 'phone' "SetPatientTelecomCodeAsPhone";
    srcPhoneNumber -> pTelecom.value = srcPhoneNumber "SetPatientTelecomValue";
  };
  src.date_of_birth as dob -> tgt.birthDate = dob "SetPatientBirthDate";
  src.sex as sex -> tgt.gender = sex "SetPatientGender";
  src.patient_id as srcBusinessID -> tgt.identifier as tgtBusinessID then {
    srcBusinessID -> tgtBusinessID.value = srcBusinessID "SetBusinessIDValue";
  } "patientId";
  src.nationality as nationality -> tgt.extension = create('Extension') as nationalityExt then {
    nationality -> nationalityExt.url = 'http://hl7.org/fhir/StructureDefinition/patient-nationality' "SetNationalityUrl";
    nationality -> nationalityExt.extension = create('Extension') as countryCodeExtension then {
      nationality -> countryCodeExtension.url = 'code' "SetCountryCodeUrl";
      nationality -> countryCodeExtension.value = create('CodeableConcept') as countryCode then {
        nationality -> countryCode.coding = create('Coding') as coding then {
          nationality -> coding.system = 'urn:iso:std:iso:3166' "SetCountryCodeSystem";
          nationality -> coding.code = nationality "SetCountryCodeCode";
        } "SetCountryCodeCoding";
      } "ProcessCountryCodeCodeableConcept";
    } "ProcessCountryCode";
  };
}