Skip to content

HL7 & FHIR mapping guide

HL7 Message Structure: MSH, Segments and Field Inspection

HL7 v2 ER7 messages organize data into ordered segments and fields. The separators are visible, but field meaning comes from the declared version, datatype and message profile. Learning to inspect the structure is useful before attempting conversion, especially when a vendor adds local fields or an old interface differs from a newer guide.

Distinguish fields, repetitions and components

With the supported standard encoding declaration, a pipe separates fields, a caret separates components, a tilde separates repetitions, an ampersand separates subcomponents and a backslash delimits escape sequences. An empty field still occupies a position. Flattening all of those boundaries into one string can hide the structure that a typed mapping requires.

V2Lift accepts the standard separators and an optional fifth MSH-2 truncation declaration. An actual declared truncated value is rejected because the complete clinical source value is unavailable. Alternate separator sets, batch envelopes and XML input are outside the documented conversion scope.

Keep segment order and groups intact

Segments belong to message structures and repeating groups. A PID identifies a patient context; a later OBR begins an order context for supported ORU results. A flat list of segment names is not enough to establish which patient owns which observation. Required order, occurrence counts and supported group boundaries must be assessed.

V2Lift normalizes supported line endings and complete MLLP frames for parsing. That does not make the web endpoint an MLLP network listener. Its hosted conversion interface receives an HTTP request containing a bounded message.

Use the version-specific field layout

The same segment name can contain fields that differ by version. Later fields may not exist in an older native model, while older fields may be withdrawn in a later definition. Preserving raw data is different from assigning a datatype or claiming that a source requirement was satisfied.

Version 2.0 can be inspected without invented datatypes, but clinical conversion is unavailable until an authoritative original layout is verified. For supported conversion versions, use the coverage page to check the actual event range; a parser recognizing a type does not guarantee that the clinical conversion endpoint implements it.

Inspect local fields and explicit nulls carefully

Local Z-segments and additional fields may be meaningful to a vendor, but their clinical target is not established by their position alone. The parser preserves supported raw structure and the workspace exposes unmapped data. Human-approved scoped rules can address eligible fields without turning arbitrary source text into a trusted instruction.

Whole explicit-null markers are preserved and reported rather than copied into FHIR as ordinary literal text. An empty field, an explicit null and an unsupported value describe different source situations; an integration policy must decide what they mean for a receiving system.

Inspect first, then convert within the supported profile

Load a synthetic sample in the workspace and choose Inspect fields to review segments, positions, repetitions and available datatype information. Compare the declared source version and event with the coverage catalog. If conversion is supported, run it and inspect both the source findings and the FHIR output.

Do not fix a failing message by arbitrarily changing its version or trigger. A structure conflict, missing required group or truncated value needs a source correction or a verified mapping extension. An inspection result alone is not proof of guide conformance or clinical validity.

Common questions

Can the web demo receive messages over an MLLP socket?

It accepts supported complete MLLP-framed content inside its HTTP input normalization. It is not an MLLP network listener.

Can HL7 2.0 be inspected?

Yes, as untyped source structure. That does not provide verified 2.0 clinical datatypes or enable FHIR conversion for that version.

Source references and implementation scope

These guides explain the implemented V2Lift subset. Source specifications and guide requirements must be checked for the actual interface; the hosted workspace is a synthetic demonstration.

Follow the mapping in the workspace.

Inspect a synthetic message, review field origins and compare source findings with FHIR R4 checks.

Open the converter →

Continue reading

Related mapping guides.