MSH Segment Generator

Create a valid MSH (Message Header) segment.

Save

Calculator

Inputs

MSH-3 sending application, such as EMR.

MSH-4 sending facility, such as MAIN.

MSH-5 receiving application, such as LAB.

MSH-6 receiving facility.

MSH-9 message type and trigger event.

Live output

Results

MSH Segment
MSH|^~\&|EPIC|HOSP|LIS|LAB|202609231914||ADT^A01|123456|P|2.5

Report

Export and share

Document

Copy and share

Assumptions

  • This builder generates a basic MSH shell using standard delimiters and a browser-generated local timestamp.
  • The processing ID is fixed to `P` in the output, and the tool does not validate whether the chosen message type and version are correct for your local interface.
  • Only the header segment is produced here; downstream segments, acknowledgements, and implementation-specific requirements still need separate review.

Sensitivity preview

No numeric sensitivity scenarios are available.

Related Tools

View All

About this MSH Builder

Every HL7 v2 message starts with an MSH segment that tells the receiver who sent the message, who should receive it, what kind of event it represents, and which version to expect. This builder gives you a fast way to produce a basic header shell for testing and message examples.

Who this calculator is for

  • Interface analysts and developers assembling sample HL7 messages from scratch.
  • Teams documenting common sender, receiver, message type, and version combinations for an interface.
  • Students learning which MSH fields drive routing, acknowledgement matching, and event identification.

When to use it

  • Use it when you need a quick MSH header for a sample ADT, ORM, ORU, or other HL7 v2 message.
  • Use it to generate test values for MSH-3 through MSH-12 before adding other message segments.
  • Use it to check the basic placement of message type, control ID, and version fields during troubleshooting.

How to use this calculator

  1. Enter the Sending Application and Facility.
  2. Enter the Receiving Application and Facility.
  3. Specify the Message Type (e.g., ADT^A01) and Control ID.
  4. Click Generate to create the MSH segment.

Key assumptions

  • This builder generates a basic MSH shell using standard delimiters and a browser-generated local timestamp.
  • The processing ID is fixed to `P` in the output, and the tool does not validate whether the chosen message type and version are correct for your local interface.
  • Only the header segment is produced here; downstream segments, acknowledgements, and implementation-specific requirements still need separate review.

Accuracy and testing

Review formula sources, default test cases, assumptions, unit handling, rounding rules, and changelog for this calculator.

View accuracy page

How this calculator works

The tool concatenates the inputs using the standard delimiters (`|` and `^`). It automatically generates the current timestamp for `MSH-7`.

Inputs explained

Sending/Receiving

Identifies the systems involved (e.g., EMR -> LIS).

Message Type (MSH-9)

The Trigger Event. ADT is for Admit/Discharge/Transfer. ORU is for Observation Results. ORM is for Orders.

Control ID (MSH-10)

A unique ID for this specific message instance. Used for tracking and acknowledgement.

Understanding your results

The output is a complete `MSH|...` string that you can paste at the top of your HL7 message.

Example scenarios

Admission

MSH|^~\&|EPIC|HOSP|LIS|LAB|...|ADT^A01|...|P|2.5

Key Features

  • Auto Timestamp
  • Standard Delimiters
  • Version Control

Glossary of Terms

MSH
Message Header Segment.
Trigger Event
The real-world event (like a patient admission) that initiated the message.

Frequently Asked Questions

Why is MSH-1 not a normal field?
MSH-1 is the Field Separator itself (usually |). It is the only field that defines its own delimiter.
What is MSH-10?
Message Control ID. It must be unique for every message to handle acknowledgements correctly.
What is ADT^A01?
ADT stands for Admission, Discharge, Transfer. A01 is the trigger event for admitting a patient.
What is ORU^R01?
ORU stands for Observation Result (Unsolicited). R01 is the trigger event for sending lab or radiology results.
Does this support custom versions?
Yes, you can enter any version number in MSH-12, though 2.3 and 2.5.1 are most common.