We count tool runs to improve these tools, without message contents or visitor IDs. Privacy and opt-out

← Developer guides
DEVELOPER GUIDE

Read HL7 delimiters and field positions

Explore connected message inspection, precise workspace paths, MSH numbering, repetitions and custom separators with a synthetic HL7 v2 message.

Workspace 0.8.2 · Analyzer 0.1.1, formatter 0.1.0, checker 0.1.0 · Updated September 17, 2026

Start with the header

Open the HL7 Message Analyzer and paste the synthetic message below. It is an inspection fixture, not a complete clinical message or proof of conformance.

MSH-1 is the field separator itself. MSH-2 contains the encoding characters; MSH-3 is the sending application. Counting every pipe-separated item as an ordinary field shifts the header. The HL7 MSH reference identifies those positions.

MSH|^~\&|SYNTHETIC|LOCAL|RECEIVER|LOCAL|202609140900||ADT^A01|GUIDE-001|T|2.5.1
PID|1||SYN-001^^^LOCAL^MR~SYN-002^^^OTHER^MR||EXAMPLE^SYNTHETIC
NTE|1||Encoded separator: \F\

Inspect a repeated field

Choose PID, then expand PID#1-3. With these delimiters, ~ separates repetitions, ^ separates components and & separates subcomponents. Empty components still occupy positions: the second identifier has OTHER in component 4. Expected observations:

MSH-1: |
MSH-2: ^~\&
MSH-3: SYNTHETIC
PID-3 repetitions: 2
PID-3[2].4: OTHER
NTE-3: Encoded separator: \F\

Workspace addresses include segment occurrences: PID#1-3[2].4 means component 4 of repetition 2 in field 3 of the first PID. OBX#2-5[1].1 identifies the second OBX. Search every segment by path, name, or value; selecting a result opens that location.

Hierarchy selections highlight exact positions in the read-only normalized message; selecting a text position opens its inspection. Empty values retain positions. Long lists are paged. The original editor remains separate; analyze again after edits.

In module code, call inspectField(segment, 3) with the original segment returned by analyzeHL7. Its one-based paths describe repetitions, components and subcomponents. Re-analyze a serialized or cloned result before inspecting it.

Core paths remain PID-3[2].4 for compatibility; the segment object disambiguates repeated segments. Workspace occurrence-qualified addresses are a separate navigation aid.

The header summary shows message type/event, declared version, sending/receiving systems, and parser notes. Component guidance covers only declared 2.5.1 MSH-9 (MSG), PID-3 (CX), and PID-5 (XPN): HAPI reference. Other fields and versions retain numeric labels. This is not a complete dictionary or conformance check.

Read separators from the message

The analyzer accepts distinct visible ASCII punctuation separators. This equivalent inspection fixture declares a field separator of *; MSH-2 declares component, repetition, escape and subcomponent separators in that order.

MSH*$%!@*SYNTHETIC*LOCAL*RECEIVER*LOCAL*202609140900**ADT$A01*GUIDE-002*T*2.5.1
PID*1**SYN-001$$$LOCAL$MR%SYN-002$$$OTHER$MR**EXAMPLE$SYNTHETIC
Delimiters: field=* component=$ repetition=% escape=! subcomponent=@
PID-3 repetitions: 2
PID-5[1].1: EXAMPLE

Keep encoding and transport limits in view

  • Escape text remains encoded: \F\ stays \F\. Paired escapes protect embedded delimiters from splitting; the analyzer does not decode escapes or check their full grammar. Unmatched escapes produce a warning.
  • A fifth MSH-2 truncation character is retained with a warning; truncation semantics are not interpreted.
  • One message with CR, LF or CRLF breaks is accepted, including a single MLLP frame. Multiple messages, batch wrappers and prefixed log text are rejected.
  • Copy and Download use normalized message text: supported framing and blank lines are removed, segments use CR, and one final CR is added. This does not preserve original transport bytes.
  • Limits are 1 MiB of UTF-8 input, 2,000 segments and 50,000 structural parts. Header checks and common field labels do not establish message structure, datatype, terminology or profile conformance.

All examples are synthetic. Use the linked tool to reproduce the result.

Browse all developer guides · Open HL7 analyzer