Skip to content

HL7 Conformance Statement ​

1 Cover Page ​

  • Product Name: DICOM7
  • Vendor: Flux Inc.
  • HL7 Standard: HL7 Version 2.x messaging over the Minimal Lower Layer Protocol (MLLP)
  • Message versions:
    • Outbound messages carry the version written in the message template. The default ORM template declares 2.3; the default ORU template declares 2.5.1.
    • Inbound messages are not checked against a specific version.
    • Acknowledgements from ORM2DICOM, ORU2DICOM and ORU2REPORT declare 2.3. Acknowledgements from HL72HL7 repeat the inbound MSH-12 value, or 2.3 when MSH-12 is empty.

© Flux Inc. All rights reserved.

2 Conformance Statement Overview ​

DICOM7 is a suite of six independent Windows services that connect DICOM systems with HL7 v2 systems. Each service has its own configuration, listener ports and cache. This page covers each service's HL7 behaviour. The DICOM side of the same services is covered in the DICOM Conformance Statement.

Table 2-1: HL7 messages per service

ServiceMessage / Trigger EventRoleAcknowledgement
DICOM2ORMORM^O01 (from template)SenderResponse is read; see 5.4
DICOM2ORUORU^R01 (from template)SenderResponse is read and logged only; see 6.4
ORM2DICOMORM (any trigger event)ReceiverOriginal-mode ACK (AA / AE / AR)
ORU2DICOMORU^R01 (message type not checked)ReceiverOriginal-mode ACK (AA / AE / AR)
ORU2REPORTORU^R01 (message type not checked)ReceiverOriginal-mode ACK (AA / AE / AR)
HL72HL7Configured list, default ORM^O01 and ORU^R01Receiver and sender (forwarding)Inbound: original-mode ACK after durable storage. Outbound: requires MSA-1 = AA and MSA-2 = outbound MSH-10

Table 2-2: Conversions

ServiceInputOutput
DICOM2ORMModality Worklist C-FIND resultsHL7 ORM over MLLP
DICOM2ORUDICOM C-STORE instancesHL7 ORU over MLLP
ORM2DICOMHL7 ORM over MLLPModality Worklist entries served by C-FIND
ORU2DICOMHL7 ORU over MLLPBasic Text SR and, when present, Encapsulated PDF sent by C-STORE
ORU2REPORTHL7 ORU over MLLPPDF, PNG or HTML report files, or passthrough PDF attachments
HL72HL7HL7 v2 over MLLPThe same HL7 v2 messages forwarded over MLLP to configured destinations

3 Table of Contents ​

4 Introduction ​

4.1 Scope ​

This page describes how the current DICOM7 services exchange HL7 v2 messages. It covers which messages each service sends and receives, which segments and fields it writes or reads, how it frames messages on the network, how it acknowledges messages and handles acknowledgements, how it rejects invalid input, and how it handles duplicates and retries.

Most of the HL7 content that DICOM2ORM and DICOM2ORU send comes from editable templates. The field tables in sections 5 and 6 describe the default templates that each service writes on first start. Sites that edit their templates will send different fields. See Templates.

4.2 Audience ​

This page is for interface analysts, integration engineers and system administrators who connect DICOM7 to a RIS, HIS, interface engine or reporting system. It assumes a working knowledge of HL7 v2 segments, fields, components and acknowledgement rules.

4.3 Remarks ​

This statement supports a first-level check of interoperability between DICOM7 and other HL7 v2 systems. It does not replace testing with the actual systems a site connects. Settings that change HL7 behaviour are listed in Configuration and on each service's page.

4.4 Field Notation ​

  • SEG-n is field n of segment SEG, for example PID-3.
  • SEG-n.c is component c of that field, for example PV1-3.4.
  • (gggg,eeee) is a DICOM attribute tag.
  • #{gggg,eeee} is a DICOM tag placeholder in a DICOM2ORM or DICOM2ORU template.

4.5 Abbreviations ​

AbbreviationDefinition
ACKGeneral acknowledgement message
AA / AE / ARApplication Accept / Application Error / Application Reject (MSA-1)
CA / CE / CRCommit Accept / Commit Error / Commit Reject (enhanced mode MSA-1)
EDEncapsulated Data (HL7 data type)
FSFile Separator, byte 0x1C
MLLPMinimal Lower Layer Protocol
MSAMessage Acknowledgement segment
MSHMessage Header segment
MWLModality Worklist
SPSScheduled Procedure Step
SRStructured Report
VTVertical Tab, byte 0x0B

5 DICOM2ORM ​

DICOM2ORM queries a Modality Worklist SCP on a fixed interval, builds one ORM message for each worklist item it has not sent before, and sends it to a single HL7 receiver.

5.1 Supported Messages ​

MessageDirectionSource
ORM^O01, version 2.3 (default template)OutboundormTemplate.hl7 in the service data folder

If no template exists on first start, the service writes the default template. If a template cannot be parsed, the service logs the error and exits.

5.2 Message Construction ​

For each worklist result, the service fills the template as follows.

  1. Special placeholders. #{CurrentDateTime} becomes the current local time as yyyyMMddHHmmss. #{ScheduledDateTime} becomes Scheduled Procedure Step Start Date (0040,0002) followed by Start Time (0040,0003); if either is missing, it becomes the current time plus 24 hours. #{ScheduledProcedureStepID} becomes (0040,0009) from the first item of the Scheduled Procedure Step Sequence (0040,0100).
  2. DICOM tag placeholders. Each #{gggg,eeee} becomes the first value of that attribute. The service looks in the top-level dataset first, then in nested sequences, and uses the first match. Missing attributes become empty. Any | in a value is replaced with ^. No other HL7 escaping is applied.
  3. Header substitution at send time. In MSH, a literal DICOM7 in MSH-3 becomes HL7.SenderName. A literal RECEIVER_APPLICATION is replaced with HL7.ReceiverName only when it is in MSH-4, and RECEIVER_FACILITY with HL7.ReceiverFacility only when it is in MSH-5. The default template has these literals in MSH-5 and MSH-6, so they are sent unchanged. Write the receiving application and facility directly into MSH-5 and MSH-6 of the template. In other segments, any whole field holding one of the three literals is replaced.

Segments are separated by a carriage return (0x0D).

5.3 Default ORM Template Fields ​

Table 5-1: Default ORM^O01 content

FieldNameValue
MSH-3Sending ApplicationHL7.SenderName (default DICOM7)
MSH-4Sending FacilityEmpty
MSH-5Receiving ApplicationRECEIVER_APPLICATION (sent as written; edit the template)
MSH-6Receiving FacilityRECEIVER_FACILITY (sent as written; edit the template)
MSH-7Date/Time of MessageTimestamp written when the default template file was created (see 14)
MSH-9Message TypeORM^O01
MSH-10Message Control IDStudy Instance UID (0020,000D)
MSH-11Processing IDP
MSH-12Version ID2.3
PID-1Set ID1
PID-2Patient IDPatient ID (0010,0020)
PID-3Patient Identifier ListPatient ID (0010,0020)
PID-5Patient NamePatient's Name (0010,0010)
PID-7Date of BirthPatient's Birth Date (0010,0030)
PID-8SexPatient's Sex (0010,0040)
PV1-1Set ID1
PV1-2Patient ClassO
PV1-19Visit NumberAccession Number (0008,0050)
PV1-44Admit Date/TimeSPS Start Date (0040,0002) + SPS Start Time (0040,0003)
ORC-1Order ControlNW
ORC-2Placer Order NumberAccession Number (0008,0050)
ORC-3Filler Order NumberStudy Instance UID (0020,000D)
ORC-4Order StatusSC
OBR-1Set ID1
OBR-2Placer Order NumberAccession Number (0008,0050)
OBR-4Universal Service IDStudy Description (0008,1030)
OBR-6Requested Date/TimeSPS Start Date (0040,0002) + SPS Start Time (0040,0003)

The worklist query requests Patient's Name, Patient ID, Birth Date, Sex, Study Instance UID, Accession Number, Referring Physician's Name, Study Description, Study Date, Study Time, Requested Procedure ID and Requested Procedure Description. Inside the Scheduled Procedure Step Sequence it requests Start Date, Start Time, Modality, Scheduled Station AE Title, Scheduled Performing Physician's Name, SPS Description, SPS ID, Scheduled Station Name and SPS Location. Templates can use any of these.

5.4 Acknowledgement Handling ​

DICOM2ORM decides whether a send succeeded as follows.

ConditionResult
Connection not established within 5 secondsFailed; queued for retry
Response text contains the substring AA or ACK anywhereSuccess
Response is empty (receiver closed without data)Success, with a warning
No response within 5 seconds (read timeout)Success, with a warning
Any other responseFailed; queued for retry

The service does not parse the response as HL7. It does not check MSA-1 as a field and does not compare MSA-2 with the outbound MSH-10. A negative acknowledgement whose text contains ACK (for example in MSH-9) is therefore treated as a success.

5.5 Duplicates and Retries ​

  • A worklist item is sent once per Study Instance UID. Once the item is sent, later query cycles skip it for as long as the item stays in the cache.
  • Failed messages are saved to a retry queue. Before each query cycle the service resends queued messages older than Retry.RetryIntervalMinutes. There is no limit on the number of attempts.
  • The query interval is set by Query.IntervalSeconds (default 60).

6 DICOM2ORU ​

DICOM2ORU receives DICOM instances by C-STORE, builds one ORU message per SOP Instance, saves it to an outgoing folder and sends it to a single HL7 receiver.

6.1 Supported Messages ​

MessageDirectionSource
ORU^R01 (MSH-9 ORU^R01^ORU_R01), version 2.5.1 (default template)OutboundoruTemplate.hl7 in the service data folder

Template loading works as in DICOM2ORM: the default is written on first start, and a template that cannot be parsed stops the service.

6.2 Message Construction ​

  • #{CurrentDateTime} becomes the current local time as yyyyMMddHHmmss. #{StudyDateTime} becomes Study Date (0008,0020) followed by Study Time (0008,0030), with the time normalised to six digits; if either is missing, it becomes the current time.
  • DICOM tag placeholders are resolved as in DICOM2ORM (5.2).
  • The service then fills OBX-5 of the OBX segment whose OBX-3 is exactly 47045-0^Study report^LN:
Received SOP ClassOBX-5 (ED)
Encapsulated PDF Storage^Application^PDF^Base64^<Base64 of Encapsulated Document (0042,0011)>
Secondary Capture Image Storage^AP^Octet-stream^Base64^<Base64 of the first frame's pixel data as stored>
Any other SOP ClassUnchanged from the template (data component empty)
  • HL7.SenderName, HL7.ReceiverName and HL7.ReceiverFacility are not applied to ORU messages. MSH-3 to MSH-6 are sent exactly as written in the template.
  • Before sending, line endings are normalised to a carriage return, leading and trailing spaces are trimmed from each segment, and empty lines are removed.

6.3 Default ORU Template Fields ​

Table 6-1: Default ORU^R01 content

FieldNameValue
MSH-3Sending ApplicationDICOM7_DICOM2ORU
MSH-4Sending FacilityFLUXINC
MSH-5Receiving ApplicationFLUX^fluxinc.co^DNS
MSH-6Receiving Facilityfluxinc^2.16.840.1.113883.3.8873^ISO
MSH-7Date/Time of MessageTimestamp written when the default template file was created
MSH-9Message TypeORU^R01^ORU_R01
MSH-10Message Control IDStudy Instance UID (0020,000D)
MSH-11Processing IDP
MSH-12Version ID2.5.1
PID-1Set ID1
PID-2Patient IDPatient ID (0010,0020)
PID-3Patient Identifier ListPatient ID (0010,0020)
PID-5Patient NamePatient's Name (0010,0010)
PID-7Date of BirthPatient's Birth Date (0010,0030)
PID-8SexPatient's Sex (0010,0040)
PV1-1Set ID1
PV1-2Patient ClassO
PV1-3Assigned Patient LocationInstitution Name (0008,0080)
PV1-19Visit NumberAccession Number (0008,0050)
PV1-44Admit Date/TimeCurrent date/time
ORC-1Order ControlRE
ORC-2Placer Order NumberAccession Number (0008,0050)
ORC-3Filler Order NumberStudy Instance UID (0020,000D)
ORC-4Order StatusCM
OBR-1Set ID1
OBR-2Placer Order NumberAccession Number (0008,0050)
OBR-3Filler Order NumberStudy Instance UID (0020,000D)
OBR-4Universal Service IDStudy Description (0008,1030)
OBR-7Observation Date/TimeStudy Date (0008,0020) + Study Time (0008,0030)
OBR-8Observation End Date/TimeCurrent date/time
OBR-16Ordering ProviderOperators' Name (0008,1070)
OBR-25Result StatusF
OBX-1Set ID1
OBX-2Value TypeED
OBX-3Observation Identifier47045-0^Study report^LN
OBX-4Observation Sub-ID1
OBX-5Observation ValueSee 6.2
OBX-11Observation Result StatusF

6.4 Acknowledgement Handling ​

When HL7.WaitForAck is true (the default), the service reads one response of up to 4096 bytes after sending and writes it to the log. The response is not parsed or validated. MSA-1 and MSA-2 are not checked, so AE and AR acknowledgements are treated as successful delivery. WaitForAck controls only whether the service waits for and logs a response. It does not turn on acknowledgement validation.

ConditionResult
Connection refused or failedFailed; queued for retry
Error while writing, or while reading the responseFailed; queued for retry
Any response received, including AE or ARSuccess
Receiver closes the connection without respondingSuccess
WaitForAck: falseSuccess as soon as the message is written

No read timeout applies while the service waits for a response. The connection attempt uses the operating system's default connect timeout.

6.5 Duplicates and Retries ​

  • One ORU is generated per SOP Instance UID. If the same instance is received again after its ORU was generated, or while that ORU is waiting in the retry queue, the C-STORE is accepted and no new ORU is generated.
  • Generated messages are sent from the outgoing folder once per processing cycle. The cycle repeats every Retry.RetryIntervalMinutes (default 1).
  • Failed messages go to a retry queue and return to the outgoing folder after Retry.RetryIntervalMinutes. There is no limit on the number of attempts.
  • A message file that cannot be read is moved to the error folder.

7 ORM2DICOM ​

ORM2DICOM receives ORM messages, stores them, and serves them as Modality Worklist entries to DICOM modalities.

7.1 Supported Messages ​

MessageDirectionNotes
ORM, any trigger event (MSH-9 starts with ORM)InboundOther message types receive AR
ACKOutbound responseSee 7.4

7.2 Message Validation ​

CheckOutcome on failure
First segment starts with MSH and contains at least nine fields, with MSH-9 not emptyAR, Invalid HL7 message format
MSH-9 starts with ORM (case-insensitive)AR, Unsupported message type <MSH-9>
Message can be parsed as HL7 v2AE
MSH segment presentAE
PID segment presentAE
Unexpected processing errorAR, with the error text

Segments must be separated by carriage returns (0x0D). The service does not check MSH-11, MSH-12, ORC-1, or whether order or patient identifiers are present.

7.3 HL7 to Worklist Mapping ​

Each stored ORM becomes one worklist entry with the following attributes. The first occurrence of each segment is used.

Table 7-1: ORM to Modality Worklist mapping

HL7 SourceDICOM AttributeNotes
PID-3Patient ID (0010,0020)Field value as received; truncated to 64 characters
PID-5 (XPN)Patient's Name (0010,0010)Components 1, 2, 3, 5 and 4 (family, given, middle, prefix, suffix) joined with ^; empty components are skipped; truncated to 64 characters
PID-7Patient's Birth Date (0010,0030)Copied as received
PID-8Patient's Sex (0010,0040)Copied as received
PID-11Patient's Address (0010,1040)Only when present; truncated to 64 characters
PV1-3.4Institution Name (0008,0080)Only when present
PV1-7 (XCN)Scheduled Performing Physician's Name (0040,0006), in SPS SequenceComponents 2, 3, 4, 6, 5 joined with ^; empty components are skipped
PV1-8 (XCN)Referring Physician's Name (0008,0090)As PV1-7
ORC-2.1Accession Number (0008,0050)Truncated to 16 characters
ORC-12 (XCN)Requesting Physician (0032,1032)As PV1-7
OBR-4Scheduled Procedure Step Description (0040,0007), in SPS SequenceEntire field; truncated to 64 characters
OBR-7Scheduled Procedure Step Start Date (0040,0002), in SPS SequenceFirst 8 characters, when at least 8 are present

No other HL7 fields are used. Worklist matching and the DICOM attributes returned to modalities are described in the DICOM Conformance Statement.

7.4 Acknowledgement ​

ORM2DICOM sends one original-mode acknowledgement on the same connection for each received message.

Table 7-2: ACK content

FieldValue
MSH-3 / MSH-4Inbound MSH-5 / MSH-6
MSH-5 / MSH-6Inbound MSH-3 / MSH-4
MSH-7Current local time, yyyyMMddHHmmss
MSH-9ACK
MSH-10ACK followed by the inbound MSH-10
MSH-11P
MSH-122.3
MSA-1AA, AE or AR
MSA-2Inbound MSH-10 (empty when the message has no usable MSH)
MSA-3Error text, for AE and AR only
  • AA is returned when the message was converted to a worklist entry. A failure to write the message to the cache is logged and does not change the code.
  • AE is returned when the message cannot be converted (see 7.2). The message is not stored.
  • AR is returned for a missing or unusable MSH, an unsupported message type, or an unexpected processing error.
  • If the message has no usable MSH, MSH-3 to MSH-6 of the ACK are empty and MSH-10 is ACK followed by a numeric timestamp.
  • | characters in MSA-3 text are written as \|.
  • No ERR segment is sent. MSH-15 and MSH-16 are ignored, and enhanced-mode (commit) acknowledgements are not sent.

7.5 Order Lifecycle and Duplicates ​

  • Each message's identity is a hash of its full text. A byte-identical resend is not stored again; it refreshes the existing entry's timestamp.
  • A message that differs in any byte, for example a new MSH-7 or MSH-10, is stored as a separate worklist entry.
  • ORC-1 is not used. Cancel, discontinue and change messages do not remove or update earlier entries; they are stored as additional entries.
  • Entries are deleted Order.ExpiryHours (default 72) after their last update. Cleanup runs at startup and every Cache.CleanupIntervalMinutes while Cache.AutoCleanup is enabled.
  • HL7.MaxORMsPerPatient is present in the configuration, but the current release does not apply it.

8 ORU2DICOM ​

ORU2DICOM receives ORU messages, converts each one to a DICOM Basic Text SR and, when the message carries an embedded PDF, an Encapsulated PDF. It sends them to one DICOM destination by C-STORE.

8.1 Supported Messages ​

MessageDirectionNotes
ORU^R01InboundMSH-9 is not checked. Any message that can be parsed is processed as a result
ACKOutbound responseSee 8.4

8.2 HL7 Fields Read ​

The first occurrence of each segment is used.

Table 8-1: ORU to DICOM mapping (both generated objects)

HL7 SourceDICOM AttributeNotes
PID-3.1, else PID-2.1, else PID-2.2 (first repetition)Patient ID (0010,0020)If all are empty, the message identity is used
PID-5 (XPN)Patient's Name (0010,0010)Components 1, 2, 3, 5, 4 joined with ^; empty components skipped; UNKNOWN if empty
PID-7Patient's Birth Date (0010,0030)First 8 characters, when at least 8 are present
PID-8Patient's Sex (0010,0040)
PID-11Patient's Address (0010,1040)Entire field
PV1-3.4Institution Name (0008,0080)
PV1-8 (XCN)Referring Physician's Name (0008,0090)Components 2, 3, 4, 6, 5
OBR-16 (XCN), else PV1-7 (XCN)Performing Physician's Name (0008,1050)
OBR-3.1, else OBR-2.1Accession Number (0008,0050)Truncated to 16 characters
OBR-2.1Study ID (0020,0010)Truncated to 16 characters
OBR-4.2 (first repetition)Study Description (0008,1030), Series Description (0008,103E)Falls back to Dicom.DefaultStudyDescription
OBR-7Study, Content Date/TimeParsed as an HL7 date/time; the current time if absent or unparseable
OBR-3.1, else OBR-2.1, else MSH-10Study Instance UID (0020,000D)The first value that, with all characters other than digits and . removed, is a valid UID of at most 64 characters. Otherwise a UID is derived from the message identity
—Series and SOP Instance UIDsDerived deterministically from the message identity, so a retry produces the same UIDs

Table 8-2: Additional SR content

HL7 SourceDICOM Content
PV1-7 (XCN)Scheduled Performing Physician's Name, in SPS Sequence
OBR-7 (first 8 characters)SPS Start Date, in SPS Sequence
OBR-4 (entire field)SPS Description, in SPS Sequence
All OBX segmentsTEXT content item ORU_SUMMARY (scheme 99FLUX): one numbered line per OBX with a non-empty OBX-5, in the form label: value units (ref range) [status]. The label is OBX-3.2 or OBX-3.1, units are OBX-6.1, the range is OBX-7, the status is OBX-11
Whole messageTEXT content item ORU_RAW containing the received message, when it is shorter than 32,000 characters

Embedded PDF detection. The service uses the first OBX that meets all of the following:

  • OBX-2 is ED.
  • OBX-5.4 is Base64 or B64.
  • OBX-5.5 contains data.
  • OBX-5.3 or OBX-5.2 contains pdf (case-insensitive).
  • The data decodes as Base64.

Document Title is taken from OBX-3.2, else OBX-3.1, else the default study description.

8.3 Processing and Validation ​

ConditionProcessing statusMSA-1
Message cannot be parsedFailureAE, Unable to parse ORU message
Conversion to DICOM fails (including an invalid embedded PDF)Failure; message moved to errorAE
Already processed (see 8.5)Already processedAA
Every generated object accepted by the DICOM destinationSuccessAA
DICOM send failsDeferred; queued for retryHL7.DeferredAckCode (default AA)
Unexpected error—AE, with the error text

The acknowledgement is sent after the first DICOM send attempt finishes, so the time to acknowledge includes the DICOM transfer. With the default DeferredAckCode: AA, an AA means the message was stored and will be delivered or retried. It does not confirm that the DICOM destination accepted it.

8.4 Acknowledgement ​

The ACK has the same layout as ORM2DICOM's (Table 7-2): swapped MSH-3 to MSH-6, MSH-9 ACK, MSH-10 ACK followed by the inbound MSH-10, MSH-12 2.3, MSA-2 equal to the inbound MSH-10, and MSA-3 for AE and AR only. HL7.SenderName, HL7.ReceiverName and HL7.ReceiverFacility are not used in ACKs.

8.5 Duplicates and Retries ​

  • Message identity is MSH-10 with every character other than letters, digits, _ and - removed. If that leaves nothing, the identity is a hash of the message text.
  • A message whose identity has already been processed successfully receives AA and is not converted again, even if its content differs.
  • Deferred messages are retried every Retry.RetryIntervalMinutes (default 2) up to Retry.MaxAttempts (default 10). After that they are moved to the error folder. A value of 0 means unlimited retries.

9 ORU2REPORT ​

ORU2REPORT receives ORU messages and produces report files in an output folder. It can render a report from an HTML template, pass through a PDF carried in or referenced by the message, or both.

9.1 Supported Messages ​

MessageDirectionNotes
ORU^R01InboundMSH-9 is not checked. Any message that can be parsed is processed
ACKOutbound responseSame layout as ORU2DICOM (8.4)

9.2 HL7 Fields Read ​

Report templates and output file names use tokens. Named tokens come from these fields:

Table 9-1: Named report tokens

TokenHL7 Source
MessageControlIdMSH-10
SendingApplicationMSH-3
SendingFacility, FacilityIdentifierMSH-4
ReceivingApplicationMSH-5
ReceivingFacilityMSH-6
PatientIdPID-3.1, else PID-2.1, else PID-2.2 (first repetition)
PatientName, PatientNameDisplayPID-5
DateOfBirthPID-7
GenderPID-8
AccessionNumberOBR-3.1, else OBR-2.1
PlacerOrderNumberOBR-2.1
ProcedureCodeOBR-4.1 (first repetition)
ProcedureDescription, StudyDescriptionOBR-4.2 (first repetition)
ProcedureDescriptionShortFirst three characters of OBR-4.2; empty if it starts with ***
ObservationDateTime, ExamDate, ExamDateDisplayOBR-7
ResultStatusOBR-25
OrderingPhysicianOBR-16, else ORC-12
ReportTextOBX-5 of every OBX, one per line
ObservationSummarySummary of every OBX, as in ORU2DICOM's ORU_SUMMARY
UUIDMessage identity

Any field can also be addressed directly by path, for example {PV1-19}, {OBR-7}, {PID-3.1}, {OBX[2]-5} or {OBX[*]-5} (all occurrences). In ReportText and ObservationSummary, <br> tags in OBX-5 become line breaks and HTML entities are decoded. Token filters and formats are described in Templates.

PDF attachments. When Report.SourceMode is Attachment, Auto or Both, the service looks for a PDF in one of two forms:

  • Embedded: found as in ORU2DICOM (8.2).
  • Referenced: the first OBX where OBX-2 is one of Report.Attachment.ReferenceValueTypes (default RP, ST) and OBX-3.1 or OBX-3.2 matches ReferenceObservationIdentifiers. If no identifiers are configured, OBX-5 must contain pdf. The OBX-5 value is used as a file path, after PathMappings are applied.

9.3 Processing and Acknowledgement ​

ConditionProcessing statusMSA-1
Message cannot be parsedFailureAE, Unable to parse ORU message
Already processedAlready processedAA
Output writtenSuccessAA
Rendering or output fails, or a referenced file is not yet readableDeferred; queued for retryHL7.DeferredAckCode (default AA)
No PDF attachment found or delivered in Attachment or Both mode, with DeferOnMissing: falseFailure; message moved to errorAE
Unexpected error—AE, with the error text

The acknowledgement is sent after the first processing attempt finishes, so rendering time adds to the time to acknowledge. Duplicate identity and retry limits work as in ORU2DICOM (8.5).

10 HL72HL7 ​

Availability

This section describes HL72HL7 2.5.2. HL7.ControlIdReuse, the content hash in message identity, Cache.ReceiptRetentionDays, and ordered delivery (Ordered) are unreleased and not in 2.5.1. In 2.5.1, a message that reuses a stored identity with different content receives AE, receipts are kept indefinitely, and destinations are not delivered strictly in arrival order. See HL72HL7.

HL72HL7 is a store-and-forward HL7 broker. It accepts configured message types, writes each message durably to disk before acknowledging it, and forwards it to the destinations whose rules match.

10.1 Supported Messages ​

MessageDirectionNotes
Types in AcceptedMessageTypes (default ORM^O01, ORU^R01)InboundMatched on MSH-9.1 and MSH-9.2; MSH-9.3 is ignored
The same messagesOutbound, per destinationByte-for-byte as received, unless the destination defines transforms or correlation
ACKOutbound response to the sender; inbound response from each destinationSee 10.4 and 10.7

In CaptureOnly mode (the shipped default), messages are stored and acknowledged but not forwarded. In RouteAndDeliver mode, stored messages are forwarded.

10.2 Inbound Validation ​

CheckMSA-1 on failure
MLLP frame starts with VT as the first byte, ends with FS followed by CR, and is no larger than HL7.MaxMessageBytesAR, Invalid MLLP frame; the connection is then closed
Payload is at least 10 bytes and starts with MSHAR
MSH-1 is a printable ASCII character; MSH-2 has at least four ASCII characters; all five delimiters are distinctAR
MSH has at least 10 fields; MSH-9 has a type and a trigger event; MSH-10 is not blankAR
MSH-3, MSH-4, MSH-5, MSH-6, MSH-9, MSH-10, MSH-12 and MSH-18 contain printable ASCII onlyAR
Every segment is non-empty, has a three-character name of A–Z or 0–9, and is followed by the MSH-1 separatorAR
No VT, FS, NUL or line-feed (0x0A) bytes inside the message (segments must end with CR only)AR
MSH-9 type and trigger are in AcceptedMessageTypesAR, Message type is not accepted: <type>
Message was durably written to the spoolAE, Unable to commit message to durable storage
MSH-10 identity conflict (see 10.5)AE

Segment content beyond MSH is not otherwise validated.

10.3 Message Identity ​

A message's identity is built from MSH-9 (type and trigger), MSH-3, MSH-4 and MSH-10. When HL7.ControlIdReuse is Accept (the default), a hash of the exact message bytes is included as well.

10.4 Inbound Acknowledgement ​

The ACK is sent only after the message is written to disk with write-through.

Table 10-1: HL72HL7 ACK content

FieldValue
MSH-1 / MSH-2| / ^~\&
MSH-3 / MSH-4Inbound MSH-5 / MSH-6
MSH-5 / MSH-6Inbound MSH-3 / MSH-4
MSH-7Current UTC time, yyyyMMddHHmmss
MSH-9ACK^<inbound trigger event>, or ACK^U01 if the header could not be read
MSH-10ACK followed by a numeric timestamp
MSH-11P
MSH-12Inbound MSH-12, or 2.3
MSA-1AA, AE or AR
MSA-2Inbound MSH-10 (empty if the header could not be read)
MSA-3Error text for AE and AR. |, CR and LF are replaced with spaces, and the text is limited to 200 characters
  • AA: the message was stored, or is an exact duplicate of a stored message.
  • AE: storage failed, or an identity conflict occurred. The sender may retry.
  • AR: the frame or header is invalid, or the message type is not accepted.

No ERR segment is sent. MSH-15 and MSH-16 are ignored, and enhanced-mode acknowledgements are not sent.

10.5 Duplicates and Control ID Reuse ​

  • A resend whose bytes exactly match a stored message receives AA and is not forwarded again. Receipts of completed messages are kept for Cache.ReceiptRetentionDays (default 365), so a late resend is still recognised after the completed record has been cleaned up.
  • HL7.ControlIdReuse: Accept (default): a message that reuses an earlier MSH-10 with different content is stored as a new message.
  • HL7.ControlIdReuse: Reject: such a message receives AE, and a copy is kept in the quarantine folder.

10.6 Outbound Delivery ​

  • Routing. A destination receives a message when MSH-9 matches one of its MessageTypes, every Match rule passes (case-insensitive value list or regular expression on a field selector such as PV1-3.4), and, when DeliverMessagesReceivedAfterUtc is set, the message arrived after that time. A message that matches no destination stays in the active spool.
  • Transforms. A destination can copy or set fields (SEG-n or SEG-n.c), optionally Base64-encode the value as UTF-8, and create a missing segment after a named segment. MSH-1, MSH-2, MSH-9, MSH-10 and MSH-12 cannot be targets. If the result no longer parses as a valid header, or MSH-10 has changed, the transform is refused and retried.
  • Correlation. A destination can copy fields from an earlier stored message of a From type whose CandidateField equals the outbound message's Field. Only messages received between LookbackHours before and HoldMinutes after this message are considered. Candidates that would copy identical values count as one match. Candidates that disagree are never chosen between. While there is no single match, the message is held, then forwarded without enrichment after HoldMinutes. A message whose key field is empty is forwarded without enrichment immediately. A target field that the message already fills keeps its own value. The stored original is never modified.
  • Ordering. With Ordered: true (default), each destination receives messages in arrival order. While an earlier message waits for a retry, later messages to that destination wait behind it. Messages held for correlation do not block others.
  • Connections. Each attempt opens a new TCP connection, sends one frame (VT, message, FS, CR), reads one ACK frame and closes the connection. Connect and ACK timeouts are Retry.ConnectTimeoutSeconds (default 5) and Retry.AckTimeoutSeconds (default 10).
  • Schedule. The delivery cycle runs every Retry.IntervalSeconds (default 30). After a failed attempt, the next attempt for that destination waits IntervalSeconds × 2^(attempts−1), up to Retry.MaxIntervalSeconds (default 900). Retries continue with no attempt limit until the message is accepted or rejected with a terminal code.
  • A message is complete when every matching destination has accepted it. It moves to the rejected folder when every destination has either accepted it or returned a terminal rejection.

10.7 Outbound Acknowledgement Validation ​

Table 10-2: Destination response handling

Destination responseResult
Bytes before VT, an FS not followed by CR, or a frame larger than Retry.MaxAckBytesRetryable failure
Connection closed before a complete ACK, or no ACK within AckTimeoutSecondsRetryable failure. The attempt is marked as possibly delivered
ACK contains bytes other than printable ASCII, CR or LFRetryable failure
ACK does not start with MSH, or has no MSA segmentRetryable failure
MSA-1 is exactly AA and MSA-2 equals the outbound MSH-10Accepted
MSA-1 is AA but MSA-2 does not matchRetryable failure
MSA-1 is in Retry.TerminalAckCodes (default AR, CR) and MSA-2 matchesTerminal rejection; not retried for this destination
Any other MSA-1, including AE, CA and CERetryable failure

Only the first MSA segment is evaluated. CA (commit accept) is not treated as acceptance. AA and CA cannot be configured as terminal codes. If a destination rejects a message after an earlier attempt went unanswered, the rejection is logged as a likely duplicate of a copy that was already delivered.

11 Transport ​

All services use MLLP over plain TCP: a start byte VT (0x0B), the HL7 message, then FS (0x1C) and CR (0x0D).

Table 11-1: Transport behaviour per service

BehaviourDICOM2ORMDICOM2ORUORM2DICOM / ORU2DICOM / ORU2REPORTHL72HL7
RoleClientClientListenerListener (inbound), client (outbound)
Default portSends to HL7.ReceiverPort (7777)Sends to HL7.ReceiverPort (7777)HL7.ListenPort: 7777 / 7777 / 7778HL7.ListenPort 7777; destination ports per destination
Bind address——HL7.ListenIP. 0.0.0.0 listens on loopback and each IPv4 address of the hostHL7.ListenIP. 0.0.0.0 listens on all IPv4 interfaces
ConnectionsNew connection per messageNew connection per messageSeveral messages per connection; no connection limitPersistent inbound connections; at most HL7.MaxConnections (default 32), extra connections closed. New outbound connection per message
Inbound framing——Bytes before VT are ignored; the message ends at FS; the trailing CR is not requiredStrict: VT must be first, FS must be followed by CR; several frames received together are each processed and acknowledged in order
Size limit——NoneHL7.MaxMessageBytes (default 64 MiB)
TimeoutsConnect 5 s; response read 5 sNo explicit connect or read timeoutRead and write 30 s; a connection with no data for 30 s is closedPartial frame HL7.ClientTimeoutSeconds (30 s); idle HL7.IdleConnectionTimeoutSeconds (300 s); outbound per Retry settings
Response readOne read of up to 4096 bytesOne read of up to 4096 bytes—Full MLLP frame up to Retry.MaxAckBytes

ORM2DICOM, ORU2DICOM and ORU2REPORT process at most one message for each block of data received. Senders should wait for each ACK before sending the next message, which is the normal original-mode MLLP pattern.

12 Character Sets and Encoding ​

ServiceReadingWriting
DICOM2ORM, DICOM2ORU—Messages are encoded as UTF-8. The default templates do not set MSH-18
ORM2DICOM, ORU2DICOM, ORU2REPORTInbound bytes are decoded as UTF-8. MSH-18 is not consultedACKs are encoded as UTF-8. ORU2DICOM writes DICOM objects with Specific Character Set ISO_IR 192 (UTF-8)
HL72HL7Messages are stored and forwarded as the exact received bytes. MSH-18 is used only to decode a message for routing rules, transforms and correlation. When MSH-18 is empty, HL7.DefaultCharacterSet (default Windows-1252) is usedForwarded messages keep their original bytes. Transformed messages are re-encoded in the same character set. ACKs are encoded as UTF-8; their header values are ASCII

Table 12-1: MSH-18 values that HL72HL7 can decode

MSH-18 or DefaultCharacterSet valueEncoding
ASCII, ISO IR6US-ASCII
8859/1, ISO-8859-1, ISO IR100ISO 8859-1
UTF-8, UNICODE UTF-8UTF-8
Windows-1252, CP1252Windows-1252

HL72HL7 decodes strictly: a byte that is invalid for the declared character set causes an error rather than being replaced. A message whose MSH-18 is not in Table 12-1 is still captured and acknowledged, but it cannot be decoded for field routing, transforms or correlation.

13 Security ​

  • HL7 traffic is not encrypted; no service supports TLS for MLLP. Use network-level protection, such as a VPN or a restricted network segment, where required.
  • No service authenticates HL7 peers or filters them by address. Access is limited only by the configured bind address and by host or network firewalls.
  • HL72HL7 limits concurrent inbound connections and message size, and closes stalled or idle connections.

14 Known Limitations ​

These are observed behaviours of the current release.

  1. DICOM2ORM success detection. Any response that contains AA or ACK anywhere in its text, an empty response, and a read timeout are all treated as successful delivery. MSA-1 and MSA-2 are not evaluated.
  2. DICOM2ORU does not validate acknowledgements. The response is only read and logged. WaitForAck: true means waiting for a response, not checking it, and no read timeout applies while waiting.
  3. DICOM2ORU header settings. HL7.SenderName, HL7.ReceiverName and HL7.ReceiverFacility do not affect ORU messages. Set MSH-3 to MSH-6 in the template instead.
  4. DICOM2ORM receiver settings. HL7.ReceiverName and HL7.ReceiverFacility only replace placeholders in MSH-4 and MSH-5, not MSH-5 and MSH-6 where the default template has them. Set MSH-5 and MSH-6 in the template instead (see 5.2).
  5. Default template MSH-7. The default templates contain a fixed MSH-7 timestamp from the time the template file was created. To stamp each message with its send time, put #{CurrentDateTime} in MSH-7.
  6. Default template MSH-10. The default templates use the Study Instance UID as MSH-10. All ORU messages for instances of the same study therefore share one MSH-10.
  7. Escaping. Values substituted from DICOM have | replaced with ^. No other HL7 escape sequences are applied, so values that contain ^, ~, \ or & are sent unescaped.
  8. ORM2DICOM order control. ORC-1 is ignored. Cancellations and changes do not update earlier worklist entries, and every message that differs by even one byte creates a new entry. HL7.MaxORMsPerPatient is not applied.
  9. ORU2DICOM and ORU2REPORT message type. MSH-9 is not checked. Any message that can be parsed is processed as a result.
  10. ORU2DICOM and ORU2REPORT identity. Duplicates are detected by MSH-10 alone. After a message has been processed, a different message with the same MSH-10 receives AA and is not processed.
  11. Deferred acknowledgement. By default, ORU2DICOM and ORU2REPORT return AA when processing is deferred for retry. AA means the message was stored, not that it reached its final destination. Set HL7.DeferredAckCode to change this.
  12. Character sets on receiving services. ORM2DICOM, ORU2DICOM and ORU2REPORT decode all input as UTF-8 regardless of MSH-18. Characters sent in another 8-bit encoding may not be decoded correctly.
  13. One message per data block. ORM2DICOM, ORU2DICOM and ORU2REPORT process at most one message for each block of data received. A sender that sends several messages without waiting for each ACK may have later messages processed late or not at all.
  14. Acknowledgement modes. Only original-mode acknowledgements are produced; MSH-15 and MSH-16 are ignored. ACKs carry error text in MSA-3 and contain no ERR segment. HL72HL7 does not accept CA from a destination as successful delivery.
  15. ACK header format. ORM2DICOM, ORU2DICOM and ORU2REPORT send MSH-9 as ACK without a trigger event and MSH-12 as 2.3, whatever version the inbound message declares. | in MSA-3 is written as \|, not \F\.
  16. Transport security. MLLP traffic is not encrypted (see 13).