Passer au contenu

HL7 v2

Send HL7 v2 to EDFlow over HTTPS: supported versions and vendors (Epic Bridges, Oracle Health Millennium, MEDITECH), triggers and the events they produce, result and order status maps, the field map, character sets and escapes, the ACK table, and a worked example stream.

Cette page n'est pas encore offerte en français; elle est affichée en anglais.

EDFlow accepts HL7 v2 over HTTPS, not MLLP. Keep MLLP inside the hospital: your engine acknowledges the EHR as soon as it has persisted a message, and forwards to EDFlow from a separate, queued destination. A EDFlow slowdown can never back up your EHR's queues.

Endpoints and modes

ModeEndpointContent-TypeResponse
Raw (HL7 over HTTPS), recommendedPOST /v1/hl7v2application/hl7-v2, x-application/hl7-v2+er7, or text/plain (Mirth default), optional charset matching MSH-18One ACK per the table below, in the inbound message's version and character set; or 503/429 with Retry-After
JSON-wrapped batchPOST /v1/hl7v2application/json with { "messages": [{ "er7": "MSH…" }] } (up to 50)JSON with an ACK and the derived events per message
Signed profilePOST /ehr/v1/hl7v2JSON-wrappedAs the signed ingest profile

The site comes from ?site=, otherwise from MSH-4 through the mapping profile. Authenticate with a bearer token, an API key, or HTTP Basic with client_id:api_key.

printf '%s' 'MSH|^~\&|EPIC|KBSCS|EDFLOW|EDFLOW|20260914080214-0400||ADT^A04^ADT_A01|ADT000123|T|2.5.1||||||UNICODE UTF-8
EVN|A04|20260914080211-0400
PID|1||SYN0001^^^KB^MR||Synthetic^Pat
PV1|1|E|ED^WR^01' > body.jsoncurl -sS -X POST 'https://api.sandbox.edflow.space/v1/hl7v2' \  -H 'Content-Type: application/hl7-v2' \  -H "Authorization: Bearer $EDFLOW_ACCESS_TOKEN" \  --data-binary @body.json

Versions and vendors

Accepted MSH-12 versions: 2.3, 2.3.1, 2.4, 2.5, 2.5.1, 2.6, 2.7 and 2.8, with vendor profiles for Epic Bridges, Oracle Health Millennium (ESO/COI), MEDITECH Expanse and a generic profile. Before v2.5 there is no TQ1 or SPM; timing falls back to OBR-27/ORC-7 and OBR-7, specimen to OBR-15.

Processing id by environment

EnvironmentMSH-11 accepted
SandboxT or D only. P is refused with AR, ERR-3 202
Customer testT or P
LiveP only

Triggers

Message / triggerEvents produced
ADT^A04 Register (ED class and location)encounter.arrived; plus encounter.triaged if a CTAS OBX is present, careteam.snapshot if PV1-7 or ROL is present
ADT^A01 Admit/visitAs A04 for sites that use A01 for ED arrival; as A06 when an ED encounter becomes inpatient
ADT^A08 UpdateOnly the mappers whose fields are present: location (PV1-3), care team (PV1-7/9/52, ROL), triage (CTAS OBX), patient updates (PID-5/7/15, PD1-12, PV2-22)
ADT^A02 Transferencounter.location_changed; to an inpatient unit: encounter.departed (admit)
ADT^A03 Dischargeencounter.disposition_decided (if not yet recorded) + encounter.departed
ADT^A06encounter.disposition_decided (admit)
ADT^A11 Cancel visitencounter.cancelled, or left without being seen, per the profile's a11Semantics
ADT^A12 / A13Location restored / encounter.departure_cancelled
ADT^A14 / A27admission.status_changed bed requested / cancelled
ADT^A21 / A22Location out_of_department and back
ADT^A40 (A34/A18 in older versions)patient.merged
ORM^O01, OMG^O19, OML^O21, OMI^O23order.placed (NW, XO), order.status_changed (SC), cancelled (CA, OC, DC, OD, CR); consult codes become consult.status_changed; NPO diet codes become a diet order
ORU^R01order.status_changed per OBR from OBR-25 and OBR-22. OBX segments are ignored and never parsed for values
SIU^S12/S13/S14, S15Scheduled with scheduledFor; schedule removed
MDM, DFT, BAR, VXU, othersAcknowledged AA with an "ignored" warning. Filter them at the engine

Identifier-change triggers (A44, A45, A47, A50, A37, A35, A46, A49) are acknowledged with a warning and raise an alert so an analyst reconciles the visit.

Result status (OBR-25, table 0123)

OBR-25Status
Oplaced
Sscheduled
Ilab: in the lab; imaging: in progress
Rlab: in the lab; imaging: performed
A, Ppreliminary
Fresulted
Ccorrected
Xcancelled

Order status (ORC-5, table 0038, used only when OBR-25 is empty)

ORC-5Status
SCplaced (scheduled if a time is present)
IPin the lab or in progress
Apreliminary
CMresulted
CA, DCcancelled
HDunchanged, on hold

Order status only moves forward, unless the message is a correction, a cancellation or an explicit reversal (ORC-1 = CR, OBR-25 = X).

Field map

FieldTargetHandling
MSH-3/4Source system, feed, site
MSH-7recordedAt fallbackNo offset: the profile time zone
MSH-10Message id, part of the event id
EVN-2 / EVN-6recordedAt / occurredAt
PID-3 (type MR)Record numberHashed on receipt
PID-3 (type JHN, health card)Dropped
PID-5, PID-7Name, birth dateOnly for the sign-in match key, then discarded
PID-11, PID-13/14, PID-19DroppedAddress, phones, SIN
PID-15Preferred languageMapped to BCP-47
PD1-12, PV2-22Confidential flag
PV1-2FilterE = emergency
PV1-3Location → areaVia the profile
PV1-7/9/17/52, ROLCare teamROL-2 DE releases a member
PV1-19Visit identifierHashed at rest
PV1-36DispositionVia the profile
PV1-44 / PV1-45Arrived / departed
PV2-3Chief complaintDropped unless the site opts in
OBX in ADTCTAS, only for the profile's CTAS codesEvery other OBX ignored
ORC, OBR-4/7/14/22/24/25/27/36, TQ1-9, SPMOrder code, times, category, status, priorityOrder ids hashed
OBX in ORUNever read

An empty field means "no change"; "" means "clear". An A08 carries only the fields present, so it never releases a care-team member that arrived through ROL.

Character sets and escapes

  • MSH-18: ASCII, 8859/1 or UNICODE UTF-8. When empty, the mapping profile's required default applies. An HTTP charset that disagrees, or invalid bytes, return AE unsupported_encoding.
  • Escape sequences (\F\, \S\, \T\, \R\, \E\, \Xhh\, \.br\) are decoded and values normalized before mapping, so accented names produce the same match key in every encoding.
  • FHS/BHS batch files aren't supported. Send messages one by one, or up to 50 per JSON request.

Acknowledgements

Original mode only: every message gets one application ACK in the HTTP response.

OutcomeHTTPMSA-1What your engine does
All derived events accepted, duplicate, buffered or superseded200AANext message
Message type EDFlow doesn't use200AA with an "ignored" ERRNext message; filter it at the engine
Data problem (unknown code, invalid value)200AA with warning ERR segmentsNext message. Never hold the queue. The event goes to the dead-letter queue; the analyst fixes the mapping and replays it
Structural error (bad MSH, encoding, missing segment, batch)200AERoute to your error queue and alert. Don't resend unchanged
Environment or version mismatch (processing id, sandbox tripwire, version)200ARChannel configuration error: stop and fix. AR means only this
Transient failure503 or 429, Retry-After, no ACK—Keep it queued; retry after the delay. Already-committed events return duplicate
Authentication401 / 403—Fix the credential or re-authenticate
MSH|^~\&|DEST|DEST|EHR|HOSP|20260914080215.402-0400||ACK^A08^ACK|rid_01J8…|P|2.5.1
MSA|AA|ADT000124
ERR||PV1^1^3|103^Table value not found^HL70357|W|unknown_location^Location code not in the mapping profile^99LNT||||Location ED^HALL^7 is not mapped; the location update was dead-lettered.

Worked example (synthetic, sandbox)

MSH|^~\&|EHR|DEMOHOSP|DEST|DEST|20260914080214-0400||ADT^A04^ADT_A01|ADT000123|T|2.5.1|||||||UNICODE UTF-8
EVN|A04|20260914080214-0400||||20260914080211-0400
PID|1||SYN0000123^^^DEMOHOSP^MR||ZZTEST^BIRCH||19900101|U
PV1|1|E|EDWR^WR01^^DEMOHOSP|E|||||||||||||||SYN3000123^^^DEMOHOSP^VN|||||||||||||||||||||||||20260914080211-0400

produces encounter.arrived (waiting room, arrival 08:02:11). Then:

MSH|^~\&|EHR|DEMOHOSP|DEST|DEST|20260914081602-0400||ADT^A08^ADT_A01|ADT000131|T|2.5.1
EVN|A08|20260914081602-0400||||20260914081530-0400
PID|1||SYN0000123^^^DEMOHOSP^MR
PV1|1|E|EDWR^WR01^^DEMOHOSP|E|||||||||||||||SYN3000123^^^DEMOHOSP^VN
OBX|1|CWE|11283-9^Acuity assessment at first encounter^LN||3^CTAS 3^L||||||F|||20260914081530-0400

produces encounter.triaged (CTAS 3 at 08:15:30). An ORM^O01 for a urinalysis produces order.placed and the patient's urine-sample task; the ORU^R01 with OBR-25 = F produces order.status_changed resulted, and its OBX value is never read; the ADT^A03 produces the disposition and departure.

Try your own messages with Validate in the developer console or POST /v1/events/validate?input=hl7v2: you get the events, a field-by-field trace, the fields dropped, unmapped codes and the exact ACK.

Dernière mise à jour le

Cette page vous a-t-elle été utile?

Sur cette page