Diagnostic data: standard messages
HL7 inbound message types
Standard HL7 messages from the provider to Somnoware for diagnostic data are through:
ORM (Order Request Message)
Used to communicate information about diagnostic study orders, such as sleep studies or home sleep tests.
SIU (Scheduling Information Unsolicited)
Used to send appointment data for diagnostic studies, such as sleep tests.
To see what data is extracted from each type of HL7 message (ADT, SIU, ORM) and how it feeds into downstream processes in Somnoware, see Appendix 1: HL7 inbound message components.
To see how each message type is processed internally in Somnoware, including decision points and lookups, see Appendix 3: HL7 inbound ADT, AIU and ORM flow.
ORM message segments
To process inbound messages, see the following table for mapping details. All segments are required.
Category | Expected value/Contents | ORM segment |
|---|---|---|
Patient | Clinic/Location | PV1-3.4 |
Patient | DOB | PID-7 |
Patient | Last name | PID-5.1 |
Patient | First name | PID-5.2 |
Patient | Middle name | PID-5.3 |
Patient | Gender | PID-8 |
Patient | Address | PID-11.1 |
Patient | City | PID-11.3 |
Patient | State | PID-11.4 |
Patient | Zip | PID-11.5 |
Patient | Phone (home) | PID-13 |
Patient | Phone (work) | PID-13 |
Patient | Phone (mobile) | PID-13 |
Patient | PID-13 | |
Patient | Primary MRN | PID-3.1 |
Patient | Alternate MRN | PID-4.1 |
Patient | SSN | PID-19.1 |
Patient | Account number | PID-18.1 |
Patient | Billing reference/Account number | PID-18.1 |
Patient vitals | Height | OBX[@3.1='HT'], height = OBX-5.1 unit = OBX-6.1 |
Patient vitals | Weight | OBX[@3.1='WT'], weight = OBX-5.1 unit = OBX-6.1 |
Patient diagnosis | Coding method | DG1-2.1 |
Patient diagnosis | Code | DG1-3.1 |
Patient diagnosis | Description | DG1-4.1 |
Patient diagnosis | Date | DG1-5.1 |
Patient diagnosis | Type | DG1-6.1 |
Patient insurance | Company ID | IN1-3.1 |
Patient insurance | Company name | IN1-4.1 |
Patient insurance | Company address | IN1-5.1 + IN1-5.2 |
Patient insurance | Company city | IN1-5.3 |
Patient insurance | Company state | IN1-5.4 |
Patient insurance | Company zip | IN1-5.5 |
Patient insurance | Company contact | IN1-6.1 |
Patient insurance | Company phone | IN1-7.1 |
Patient insurance | Plan ID | IN1-2.1 |
Patient insurance | Plan type | IN1-15.1 |
Patient insurance | Group name | IN1-9.1 |
Patient insurance | Policy number | IN1-36.1 |
Patient insurance | Group number | IN1-8.1 |
Patient insurance | Policy holder name | IN1-16.2 + IN1-16.1 |
Patient insurance | Start date | IN1-12.1 |
Patient insurance | End date | IN1-13.1 |
Patient insurance | Policy holder relationship with patient | IN1-17.1 |
Patient insurance | Policy deductible | IN1-37.1 |
Patient visit | Location | PV1-3.4 |
Physician | Interpreting physician last name | PV1-7.2 |
Physician | Interpreting physician first name | PV1-7.3 |
Physician | Interpreting physician middle name | PV1-7.4 |
Physician | Interpreting physician NPI | PV1-7.1 |
Physician | Ordering physician last name | OBR-16.2 |
Physician | Ordering physician first name | OBR-16.3 |
Physician | Ordering physician middle name | OBR-16.4 |
Physician | Ordering physician NPI | OBR-16.1 |
Physician | Referring physician last name | PV1-8.2 |
Physician | Referring physician first name | PV1-8.3 |
Physician | Referring physician middle name | PV1-8.4 |
Physician | Referring physician NPI | PV1-8.1 |
Physician | Primary physician last name | PV1-9.2 |
Physician | Primary physician first name | PV1-9.3 |
Physician | Primary physician middle name | PV1-9.4 |
Physician | Primary physician NPI | PV1-9.1 |
Order | Place order number | ORC-2.1 |
Order | Order status | ORC-1 |
Order | Order namespace ID | OBR-2.2 |
Order | Universal service ID | OBR-4.1 |
Order | Universal service text | OBR-4.2 |
Order | Universal service coding system | OBR-4.3 |
Order | Visit number | PV1-19.1 |
MSH|^~\&|EHR|CLIENTNAME|SOMNOWARE|SOMNOWARE|20250424201640||ORM^O01|20170104123958.14|P|2.3 PID|1||MRN123|ALTMRN345|TESTY^TEST^MIDDLENAME||19360406|MALE|||ADDRESS^^LOWELL^MA^01851|| PHONE||||||SSN5 PV1|1||^^^CLINICA||||1234567890^McCoy^Interp^Leonard|1234567891^Bones^Referring^Leo| 1234567892^Mcvoy^Primary^Len|||||||1234567893^McCaffee^Ordering^Lego|||20170102 ORC|NW|16244692986^EPC||10613416538 OBR|1|16244692986^EPC|105360555463^|SLEEP103^POLYSOMNOGRAPHY 4 OR MORE PARAMETERS|||||||||||| 1124883749^LANG^LINDY^E^^^^^NPI^^^^NPI NTE|1||Split night for AHI>5|Order comments| DG1|1||161^Consultation^HRV|Consultation||^CC|||||||||||||||||||| DG1|2||100^Sleep Problem^HRV|Sleep Problem||^CC|||||||||||||||||||| DG1|3||1622^Video Visit^HRV|Video Visit||^CC|||||||||||||||||||
SIU message segments
The supported trigger events within Somnoware for the import of schedules or appointments are:
SIU S12 - Notification of new appointment booking
SIU S13 - Notification of appointment rescheduling
SIU S14 - Notification of appointment modification
SIU S15 - Notification of appointment cancellation
To process inbound messages, see the following table for mapping details. All segments are required.
Category | Expected value/Contents | SIU segment |
|---|---|---|
Patient | Clinic/Location | PV1-3.4 |
Patient | DOB | PID-7 |
Patient | Last name | PID-5.1 |
Patient | First name | PID-5.2 |
Patient | Middle name | PID-5.3 |
Patient | Gender | PID-8 |
Patient | Address | PID-11.1 |
Patient | City | PID-11.3 |
Patient | State | PID-11.4 |
Patient | Zip | PID-11.5 |
Patient | Phone (home) | PID-13 |
Patient | Phone (work) | PID-13 |
Patient | Phone (mobile) | PID-13 |
Patient | PID-13 | |
Patient | Primary MRN | PID-3.1 |
Patient | Alternate MRN | PID-4.1 |
Patient | SSN | PID-19.1 |
Patient | Account number | PID-18.1 |
Patient | Billing reference/Account number | PID-18.1 |
Patient vitals | Height | OBX[@3.1='HT'], height = OBX-5.1 unit = OBX-6.1 |
Patient vitals | Weight | OBX[@3.1='WT'], weight = OBX-5.1 unit = OBX-6.1 |
Patient diagnosis | Coding method | DG1-2.1 |
Patient diagnosis | Code | DG1-3.1 |
Patient diagnosis | Description | DG1-4.1 |
Patient diagnosis | Date | DG1-5.1 |
Patient diagnosis | Type | DG1-6.1 |
Patient insurance | Company ID | IN1-3.1 |
Patient insurance | Company name | IN1-4.1 |
Patient insurance | Company address | IN1-5.1 + IN1-5.2 |
Patient insurance | Company city | IN1-5.3 |
Patient insurance | Company state | IN1-5.4 |
Patient insurance | Company Zip | IN1-5.5 |
Patient insurance | Company contact | IN1-6.1 |
Patient insurance | Company phone | IN1-7.1 |
Patient insurance | Plan ID | IN1-2.1 |
Patient insurance | Plan type | IN1-15.1 |
Patient insurance | Group name | IN1-9.1 |
Patient insurance | Policy number | IN1-36.1 |
Patient insurance | Group number | IN1-8.1 |
Patient insurance | Policy holder name | IN1-16.2 + IN1-16.1 |
Patient insurance | Start date | IN1-12.1 |
Patient insurance | End date | IN1-13.1 |
Patient insurance | Policy holder relationship with patient | IN1-17.1 |
Patient insurance | Policy deductible | IN1-37.1 |
Patient visit | Location | PV1-3.4 |
Physician | Interpreting physician last name | PV1-7.2 |
Physician | Interpreting physician first name | PV1-7.3 |
Physician | Interpreting physician middle name | PV1-7.4 |
Physician | Interpreting physician NPI | PV1-7.1 |
Physician | Ordering physician last name | N/A |
Physician | Ordering physician first name | N/A |
Physician | Ordering physician middle name | N/A |
Physician | Ordering physician NPI | N/A |
Physician | Referring physician last name | PV1-8.2 |
Physician | Referring physician first name | PV1-8.3 |
Physician | Referring physician middle name | PV1-8.4 |
Physician | Referring physician NPI | PV1-8.1 |
Physician | Primary physician last name | PV1-9.2 |
Physician | Primary physician first name | PV1-9.3 |
Physician | Primary physician middle name | PV1-9.4 |
Physician | Primary physician NPI | PV1-9.1 |
Schedule | Appointment code | SCH-7.1 |
Schedule | Start date time | SCH-11.4 |
Schedule | Duration | SCH-9 |
Schedule | Visit number | PV1-19.1 |
MSH|^~&\|EHR|CLIENTNAME|SOMNOWARE|SOMNOWARE|20170104123958||SIU^S12|20170104123958.14|P|2.3 PID|1||MRN123|ALTMRN345|TESTY^TEST^MIDDLENAME||19360406|MALE|||ADDRESS^^LOWELL^MA^01851||PHONE ||||||SSN5 PV1|1||^^^CLINICA||||1234567890^McCoy^Interp^Leonard|1234567891^Bones^Referring^Leo| 1234567892^Mcvoy^Primary^Len||||||||||20170102 SCH|1|10613332855||||Sch|SPLIT NIGHT CPAP^SPLIT NIGHT CPAP Study||30| MIN|^^30^20250506203000^20250506210000|
HL7 outbound message types
Standard HL7 messages sent from Somnoware are through:
ORU (Observation Result Unsolicited)
Used to send diagnostic study results from Somnoware, such as sleep study summaries, discrete data points (for example, AHI, oxygen levels) and PDF reports.
Observation result message (ORU)
The HL7 ORU message transmits observations and results from Somnoware to the external EHR. The ORU message is a structured report where each observation is separated into an individual entity, and then separated into fields.
All results message
The following table outlines the HL7 segments and fields used to send all results from Somnoware.
HL7 segment/Field | Description | Logic | Notes |
|---|---|---|---|
MSH-1 | Field separator | I | Constant |
MSH-2 | Encoding characteristics | ^~\& | Constant |
MSH-3.1 | Sending application | SOMNOWARE | Constant |
MSH-4.1 | Sending facility | SOMNOWARE | Constant |
MSH-5.1 | Receiving application | ||
MSH-6.1 | Receiving facility | ||
MSH-7.1 | Date and time of message | Current date yyyyMMddHHmmss | |
MSH-9 | Message type | For study result, "ORU^R01" For DFT result, "DFT^P03" | |
MSH-10 | Message control ID | Current date (yyyyMMddHHmmss) | |
MSH-11.1 | Processing environment | P | Constant P - production T - training |
MSH-12.1 | Version ID | 2.3 | Constant |
PID-1.1 | Set ID | 1 | Constant |
PID-3.1 | Patient MRN | Value from Patient data set | |
PID-5.1 | Patient last name | Value from Patient data set | |
PID-5.2 | Patient first name | Value from Patient data set | |
PID-5.3 | Patient middle name | Value from Patient data set | |
PID-7.1 | Patient date of birth | Value from Patient data set | |
PID-8.1 | Patient gender | Value from Patient data set | |
PID-11.1 | Patient address | Value from Patient data set | |
PID-11.3 | Patient city | Value from Patient data set | |
PID-11.4 | Patient state | Value from Patient data set | |
PID-11.5 | Patient zip code | Value from Patient data set | |
PID-18.1 | Encounter ID/Visit number | Value from Patient data set | |
PV1-1.1 | Set ID | 1 | Constant |
PV1-7.1 | Attending physician NPI | Value from Physician data set | |
PV1-7.2 | Attending physician last name | Value from the Physician data set | |
PV1-7.3 | Attending physician first name | Value from the Physician data set | |
PV1-19.1 | Encounter ID/Visit number | Value from the Schedule data set | |
ORC-1 | Order control | RE | Constant |
ORC-2.1 | Order number | Value from Order data set | |
ORC-2.2 | Order namespace ID | Value from Order data set | |
ORC-9 | Transaction date time | Current date yyyyMMddHHmmss | |
OBR-1 | Set ID | 1 | Constant |
OBR-2.1 | Order number | Value from Order data set | |
OBR-2.2 | Order namespace ID | Value from Order data set | |
OBR-4.1 | Universal service ID | Value from Order data set | |
OBR-4.2 | Universal service text | Value from Order data set | |
OBR-4.3 | Universal service coding system | Value from Order data set | |
OBR-7.1 | Observation date time | Current date yyyyMMddHHmmss | |
OBR-16.1 | Attending physician NPI | Value from Physician data set | |
OBR-16.2 | Attending physician last name | Value from Physician data set | |
OBR-16.3 | Attending physician first name | Value from Physician data set | |
OBR-25 | Result status | P | P - Preliminary (Default) F - Finalized C - Correction |
Discrete data (flowsheet) message: OBX fields
The discrete data is sent using an OBX segment in the HL7 message. Each OBX segment includes the following fields:
OBX field | Field description | Logic | Notes |
|---|---|---|---|
OBX-1 | Set ID | OBX sequence number | |
OBX-2 | Value type | "NM" for numeric, "ST" for string. Based on observation value. | |
OBX-3.1 | Identifier | Discrete data identifier | |
OBX-3.2 | Text | Discrete data description | |
OBX-5 | Observation value | ||
OBX-11 | Observation result status | P | P - Preliminary (default) F - Finalized C - Correction |
MSH|^~\&|SOMNOWARE|SOMNOWARE|CLIENTA|POST_MEDIA|20250424214658||ORU^R01| a5a92971af4544d7845ff0764d4d250b|P|2.3 PID|1||MRN123|ALTMRN345|TESTY^TEST^MIDDLENAME||19360406|MALE|||ADDRESS^^LOWELL^MA^01851|| PHONE||||||SSN5 PV1|1||^^^CLINICA||||1234567890^McCoy^Interp^Leonard|1234567891^Bones^Referring^Leo| 1234567892^Mcvoy^Primary^Len||||||||||20170102 ORC||16244692986^EPC||10613416538|||||202504101244 OBR|1|16244692986^EPC|105360555463^|SLEEP103^POLYSOMNOGRAPHY 4 OR MORE PARAMETERS^123||| 202504101244|||||||||1124883749^LANG^LINDY^E^^^^^ NPI^^^^NPI|||||||||P OBX|1|ST|PSGDIAG_STYPE^Study type^||AST NPSG||||||F OBX|2|NM|PSGDIAG_DEVICE^Device (PSG,WatchPAT, Nox T3,other)^||PSG||||||F
PDF report: OBX fields
The PDF report is sent as a Base64-encoded string in the OBX segment of the HL7 message. The OBX segment includes the following components:
OBX field | Field description | Logic | Notes |
|---|---|---|---|
OBX-1 | Set ID | OBX sequence number | |
OBX-2 | Value type | RP | Constant |
OBX-3.1 | Identifier | SLPRPT | Constant |
OBX-3.2 | Text | Sleep report | Constant |
OBX-5 | Observation value | PDF as Base64-encoded string | |
OBX-11 | Observation result status | P | P - Preliminary (default) F - Finalized C - Correction |
MSH|^~\&|SOMNOWARE|SOMNOWARE|CLIENTA|POST_MEDIA|20250424214658||ORU^R01| a5a92971af4544d7845ff0764d4d250b|P|2.3 PID|1||MRN123|ALTMRN345|TESTY^TEST^MIDDLENAME||19360406|MALE|||ADDRESS^^LOWELL^MA^01851|| PHONE||||||SSN5 PV1|1||^^^CLINICA||||1234567890^McCoy^Interp^Leonard|1234567891^Bones^Referring^Leo| 1234567892^Mcvoy^Primary^Len||||||||||20170102 ORC||16244692986^EPC||10613416538|||||202504101244 OBR|1|16244692986^EPC|105360555463^|SLEEP103^POLYSOMNOGRAPHY 4 OR MORE PARAMETERS^123||| 202504101244|||||||||1124883749^LANG^LINDY^E^^^^^ NPI^^^^NPI|||||||||P OBX|2|ED|REPORT TEXT^^LRR||PDF^Base64^PDF^Base64^BASE64 Encoded Document||||||F