← back

NemsisEVitalsToBPObservation

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/NemsisEVitalsToBPObservation
Resource typeStructureMap
Statusdraft

Machine-readable

../NemsisEVitalsToBPObservation.json

../NemsisEVitalsToBPObservation.fml — the authored FML source

Preview

{
  "resourceType": "StructureMap",
  "url": "https://emsinterop.com/fhir/StructureMap/NemsisEVitalsToBPObservation",
  "name": "NemsisEVitalsToBPObservation",
  "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 eVitals.VitalGroup -> FHIR R4 Observation (blood pressure panel)\n// Encodes two hard rules declaratively:\n//  - the GROUP timestamp: every Observation from a VitalGroup shares eVitals.01\n//  - NV routing (hard rule #4): a 7701xxx Not-Value on SBP/DBP becomes a\n//    component dataAbsentReason via cm-nemsis-nv \u2014 never fabricated, never\n//    skipped. Dispatch is presence-driven (exporter emits value XOR _nv).\n// Production execution is native Python (mapping/vitals.py); the reference\n// Java engine runs this map in CI as the fidelity oracle.\n\nmap \"https://emsinterop.com/fhir/StructureMap/NemsisEVitalsToBPObservation\" = \"NemsisEVitalsToBPObservation\"\n\nuses \"https://emsinterop.com/fhir/StructureDefinition/NemsisEVitalsGroup\" alias EVitalsGroup as source\nuses \"http://hl7.org/fhir/StructureDefinition/Observation\" alias Observation as target\n\ngroup VitalGroupToBloodPressure(source grp : EVitalsGroup, target tgt : Observation) {\n  grp -> tgt.status = 'final' \"status\";\n  grp -> tgt.code = create('CodeableConcept') as cc, cc.coding as c,\n    c.system = 'http://loinc.org', c.code = '85354-9' \"panelCode\";\n  grp.eVitals_01 as t -> tgt.effective = cast(t, \"dateTime\") \"groupTimestamp\";\n\n  grp.eVitals_06 as v -> tgt.component as comp then {\n    v -> comp.code = create('CodeableConcept') as cc, cc.coding as c,\n      c.system = 'http://loinc.org', c.code = '8480-6' \"sbpCode\";\n    v -> comp.value = create('Quantity') as q, q.value = cast(v, \"decimal\"),\n      q.unit = 'mmHg', q.system = 'http://unitsofmeasure.org', q.code = 'mm[Hg]' \"sbpValue\";\n  } \"sbp\";\n\n  grp.eVitals_06_nv as nv -> tgt.component as comp then {\n    nv -> comp.code = create('CodeableConcept') as cc, cc.coding as c,\n      c.system = 'http://loinc.org', c.code = '8480-6' \"sbpNvCode\";\n    nv -> comp.dataAbsentReason = create('CodeableConcept') as cc then {\n      nv -> cc.coding as c, c.system = 'http://terminology.hl7.org/CodeSystem/data-absent-reason',\n        c.code = translate(nv, 'https://emsinterop.com/fhir/ConceptMap/cm-nemsis-nv', 'code') \"sbpDarStd\";\n      nv -> cc.coding as c2, c2.system = 'https://profiles.ihe.net/PCC/mPSC/CodeSystem/NEMSIS',\n        c2.code = nv \"sbpDarNemsis\";\n    } \"sbpDar\";\n  } \"sbpAbsent\";\n\n  grp.eVitals_07 as v -> tgt.component as comp then {\n    v -> comp.code = create('CodeableConcept') as cc, cc.coding as c,\n      c.system = 'http://loinc.org', c.code = '8462-4' \"dbpCode\";\n    v -> comp.value = create('Quantity') as q, q.value = cast(v, \"decimal\"),\n      q.unit = 'mmHg', q.system = 'http://unitsofmeasure.org', q.code = 'mm[Hg]' \"dbpValue\";\n  } \"dbp\";\n\n  grp.eVitals_07_nv as nv -> tgt.component as comp then {\n    nv -> comp.code = create('CodeableConcept') as cc, cc.coding as c,\n      c.system = 'http://loinc.org', c.code = '8462-4' \"dbpNvCode\";\n    nv -> comp.dataAbsentReason = create('CodeableConcept') as cc then {\n      nv -> cc.coding as c, c.system = 'http://terminology.hl7.org/CodeSystem/data-absent-reason',\n        c.code = translate(nv, 'https://emsinterop.com/fhir/ConceptMap/cm-nemsis-nv', 'code') \"dbpDarStd\";\n      nv -> cc.coding as c2, c2.system = 'https://profiles.ihe.net/PCC/mPSC/CodeSystem/NEMSIS',\n        c2.code = nv \"dbpDarNemsis\";\n    } \"dbpDar\";\n  } \"dbpAbsent\";\n}\n"
}