← back

NemsisEPatientToPatient

Authored in FHIR Mapping Language. Executed natively in Python by the mapper; this map is the authored spec and a CI-only fidelity oracle.

Canonicalhttps://emsinterop.com/fhir/StructureMap/NemsisEPatientToPatient
Resource typeStructureMap
Statusdraft

Machine-readable

../NemsisEPatientToPatient.json

../NemsisEPatientToPatient.fml — the authored FML source

Preview

{
  "resourceType": "StructureMap",
  "url": "https://emsinterop.com/fhir/StructureMap/NemsisEPatientToPatient",
  "name": "NemsisEPatientToPatient",
  "status": "draft",
  "description": "Authored in FHIR Mapping Language. Executed natively in Python by the mapper; this map is the authored spec and a CI-only fidelity oracle.",
  "_fml": "// NEMSIS ePatient -> FHIR R4 Patient (canonical Layer A)\n// The authored, upstream-contributable spec for the patient panel (ADR-002).\n// Production execution is native Python (src/emsinterop/mapping/patient.py);\n// this map is executed by the reference Java engine in CI as a fidelity\n// oracle. Sex translates through the authored cm-nemsis-sex ConceptMap\n// (ADR-007: ePatient.25 is the source of truth).\n\nmap \"https://emsinterop.com/fhir/StructureMap/NemsisEPatientToPatient\" = \"NemsisEPatientToPatient\"\n\nuses \"https://emsinterop.com/fhir/StructureDefinition/NemsisEPatient\" alias EPatient as source\nuses \"http://hl7.org/fhir/StructureDefinition/Patient\" alias Patient as target\n\ngroup ePatientToPatient(source src : EPatient, target tgt : Patient) {\n  src.ePatient_01 as pid -> tgt.identifier as ident then {\n    pid -> ident.system = 'urn:nemsis:identifier:patient' \"identSystem\";\n    pid -> ident.value = pid \"identValue\";\n    pid -> ident.use = 'usual' \"identUse\";\n  } \"agencyPatientId\";\n\n  src -> tgt.name as name, name.use = 'official' then {\n    src.ePatient_02 as family -> name.family = family \"family\";\n    src.ePatient_03 as given -> name.given = given \"givenFirst\";\n    src.ePatient_04 as middle -> name.given = middle \"givenMiddle\";\n  } \"officialName\";\n\n  src -> tgt.address as addr, addr.use = 'home' then {\n    src.ePatient_05 as line -> addr.line = line \"line\";\n    src.ePatient_06 as city -> addr.city = city \"city\";\n    src.ePatient_07 as county -> addr.district = county \"district\";\n    src.ePatient_08 as state -> addr.state = state \"state\";\n    src.ePatient_09 as zip -> addr.postalCode = zip \"postalCode\";\n    src.ePatient_10 as country -> addr.country = country \"country\";\n  } \"homeAddress\";\n\n  src.ePatient_18 as phone -> tgt.telecom as t then {\n    phone -> t.system = 'phone' \"phoneSystem\";\n    phone -> t.value = phone \"phoneValue\";\n  } \"telecomPhone\";\n\n  src.ePatient_19 as email -> tgt.telecom as t then {\n    email -> t.system = 'email' \"emailSystem\";\n    email -> t.value = email \"emailValue\";\n  } \"telecomEmail\";\n\n  // ADR-007: ePatient.25 Sex is the source of truth, translated through the\n  // authored ConceptMap (dual-coded fidelity is a Python-side addition).\n  src.ePatient_25 as sex -> tgt.gender = translate(sex, 'https://emsinterop.com/fhir/ConceptMap/cm-nemsis-sex', 'code') \"gender\";\n\n  src.ePatient_17 as dob -> tgt.birthDate = dob \"birthDate\";\n}\n"
}