Skip to main content

HL7 v2 Input

FUME converts HL7 v2 ER7 messages to JSON before evaluation. The normalized JSON is keyed by segment id and uses dictionary-backed field names instead of raw field numbers.

Inspect normalized JSON

Use the root endpoint with fume: "$" to inspect the parsed message before you write mappings against it.

If you need the canonical endpoint guidance for POST /, saved mappings, or verbose execution, see Server API execution patterns.

{
"input": "MSH|^~\\&|...",
"contentType": "x-application/hl7-v2+er7",
"fume": "$"
}

For HL7 v2 requests, input is the original message string.

Original input file

Canonical HL7 v2 input

This compact ADT message is parsed to JSON before evaluation.

HL7 v2
MSH|^~\&|EXCARE|EXCARE-CLINIC|FUME|FUME|20260318091500||ADT^A01|msg-0001|P|2.5
EVN|A01|20260318091500
PID|1||rec-5001^^^EXCARE^MR||Reed^Avery||19900612|F
PV1|1|O|||||||||||||||||enc-1001^^^EXCARE^VN

Normalized JSON before evaluation

Normalized JSON

This is the parsed HL7 v2 structure that the mapping engine evaluates.

{
"MSH": {
"SegmentDescription": "Message Header",
"MessageLine": 1,
"FieldSeparator": "|",
"EncodingCharacters": "^~\\&",
"SendingApplication": {
"NamespaceID": "EXCARE"
},
"SendingFacility": {
"NamespaceID": "EXCARE-CLINIC"
},
"ReceivingApplication": {
"NamespaceID": "FUME"
},
"ReceivingFacility": {
"NamespaceID": "FUME"
},
"DateTimeOfMessage": {
"Time": "2026-03-18T09:15:00"
},
"MessageType": {
"MessageCode": "ADT",
"TriggerEvent": "A01"
},
"MessageControlID": "msg-0001",
"ProcessingID": {
"ProcessingID": "P"
},
"VersionID": {
"VersionID": "2.5"
}
},
"EVN": {
"SegmentDescription": "Event Type",
"MessageLine": 2,
"EventTypeCode": "A01",
"RecordedDateTime": {
"Time": "2026-03-18T09:15:00"
}
},
"PID": {
"SegmentDescription": "Patient Identification",
"MessageLine": 3,
"SetID": "1",
"PatientIdentifierList": {
"IDNumber": "rec-5001",
"AssigningAuthority": {
"NamespaceID": "EXCARE"
},
"IdentifierTypeCode": "MR"
},
"PatientName": {
"FamilyName": {
"Surname": "Reed"
},
"GivenName": "Avery"
},
"DateTimeOfBirth": {
"Time": "1990-06-12"
},
"AdministrativeSex": "F"
},
"PV1": {
"SegmentDescription": "Patient Visit",
"MessageLine": 4,
"SetID": "1",
"PatientClass": "O",
"VisitNumber": {
"IDNumber": "enc-1001",
"AssigningAuthority": {
"NamespaceID": "EXCARE"
},
"IdentifierTypeCode": "VN"
}
}
}
Parse embedded HL7 v2 mid-mapping

If part of your input still contains a raw HL7 v2 message string, use $v2json() to parse that message into the same normalized JSON shape during evaluation.

What to expect

  • Segment ids such as MSH, EVN, PID, and PV1 become top-level JSON keys.
  • Field and component names come from the HL7 dictionary-backed parser.
  • Date and time fields are normalized into JSON string values with a more usable timestamp shape where the datatype supports it.
  • Message shape depends on which segments and fields are present, so inspect the normalized JSON with fume: "$" before you write or debug a mapping.

A mapping that works against this normalized JSON also works when you send the original HL7 v2 message, because parsing happens before evaluation.