This document is commercial-in-confidence. The recipient of this document agrees to hold all information presented within as confidential and agree not to use or disclose, or allow to use or disclosure of the said information to unauthorized parties, directly or indirectly, irrespective of the acceptance or rejection of the presentation or at any time before, during or after an agreement has been reached, without prior written consent.
Version | Date | Who | Notes |
---|---|---|---|
v0.1 - Draft | 11th Jan 2021 | Lee Dyson | First Draft for Review - Scottish TrakCare |
v0.2 - Draft | 11th Jan 2021 | Lee Dyson | Updated for generic (non-Trakcare) referrals |
v0.3 - Draft | 9th May 2021 | Lee Dyson | Updated for Lorenzo mappings |
v1.0 - Release | 28th June 2021 | Robert McNaught | Consistency updates |
v1.1 - Release | 30th June 2021 | Robert McNaught | PID-13 and PID-14 clarity, consolidated from ADT message handling doc |
v1.2 - Release | 16th Jul 2021 | Robert McNaught | Disclaimer |
v1.3 - Release | 29th Sept 2021 | Robert McNaught | Formatting and fixes |
v1.31 - Draft | 1st November 2021 | Lee Dyson | Added note re: MSH:8 Security key |
v1.32 - Release | 4th January 2022 | Lee Dyson | Clarified use of phone numbers in PID-13/ PID-14 |
This document describes the content of common HL7 segments for messages in and out of EMS. These are the base definitions for these segments. More detailed specifications per message type (e.g. REF
, SIU
etc.) may supercede or extend these definitions.
EMS’s interfaces are based on the Open Source HAPI Libraries for all HL7 message handling, both traditional “caret-and-pipe” and FHIR. HAPI is considered a reference standard implementation of the HL7 standards and applies detailed contraints and requirements on both message format and content. Some of these common constraints are described below.
ALL dates must be presented in a HL7-compliant format. YYYYMMDDhhmmss
YYYYMMDDHHmmss.sss
etc are VALID see Caristix.
Any message containing a non-compliant date/time value will raise an exception, and will NOT be processed.
DateTime values which DO NOT include a timezone offset (e.g. YYYYMMDDhhmmss+0000
) are assumed to be local or “clock on the wall” time.
Special characters present in HL7 messages MUST be escaped. See HL7 Escape Sequences
The following tables show the expected mapping of message INBOUND to EMS. e.g. Demographics, Referrals, Orders, Scheduling.
Field | Name | Required | Example | Notes |
---|---|---|---|---|
2 | Delimiters | Y | ^~&\ |
standard delimiters |
3 | Sending Application | Y | PAS |
|
4 | Sending Facility | Y | RJ7 |
ODS code of sending org. |
5 | Receiving Application | Y | EMS |
|
6 | Receiving Facility | Y | RJ7 |
ODS code of receiving Org. |
7 | MsgDate | Y | 20191013013444 |
YYYYHHMMddhhmmss |
8 | Security | Y | XXXXX |
site specific interface key |
9 | Message Type | Y | ADT^A28 |
|
10 | Message ID | Y | A37GB45E1 |
Any alpha-numeric up to 30 chars |
11 | Processing ID | N | P |
|
12 | Version | Y | 2.4 |
Note:
Security - MSH:8
- MEDILOGIK will provide a site-specific key value which must be present in all messages sent in to EMS. In TEST this value must be set to EMS
. Messages NOT containing the MSH:8
key value will be NAK’d by EMS with an Unsupported Message Type
NAK message.
Version number - MSH-12
- version number MUST be present, and followed with a trailing pipe if it’s the last field present. HAPI libraries do parse the version number in order to validate message contents.
Field | Name | Required | Example | Notes |
---|---|---|---|---|
1 | Ack Code | Y | AA |
AE ,AR |
2 | Msg Control Id | Y | ||
3 | Text Message | N | Descriptive Error Text |
Field | Name | Required | Example | Notes |
---|---|---|---|---|
0 | Segment Type | Y | EVN |
|
1 | Event Type Code | N | A04 |
not required |
2 | Recorded Date Time | Y | 20191012140001 |
YYYYMMDDhhmmss |
3 | Date/Time planned event | N | 20191012140001 |
YYYYMMDDhhmmss |
4 | Event Reason Code | N | OUT-C |
Can be used to inform message routing |
Field | Name | Required | Example | Notes |
---|---|---|---|---|
1 | Set ID | N | 1 |
not used |
2 | Patient Identifiers | N | See PID-3 |
|
3 | Patient Identifiers | Y | 12345^^^RJ7^MR~1234567890^^^NHS^NH |
A repeating collection of identifiers. See note below. |
3.4 | Assigning Authority | Y | RJ7 |
Use ODS code of assigning authority |
3.5 | Identifier Type Code | Y | NH ,MRN |
|
4 | Identifiers | N | NOT used | |
5 | Patient Name | Y | EMS |
|
5.1 | Surname | Y | Smith |
|
5.2 | Given Name | Y | Jack |
|
5.3 | Other name | N | EMS |
|
5.5 | Title | N | ||
7 | DoB | Y | 19690402 |
‘YYYYMMDD’ format |
8 | Sex | Y | M |
‘M’,’F’ or ‘U’ see Default Reference Data |
11 | Patient Address | N | Only first repeat of patient address is parsed. Four lines plus postcode. | |
11.1 | Street | N | ||
11.2 | Other Designations | N | ||
11.3 | City | N | ||
11.4 | County | N | ||
11.5 | Postcode | N | ||
13 | Home Phone | N | Repeating. Contains phone numbers & email addresses | |
13.1 | Telephone Number | 0115874245 |
||
13.2 | Use Code | N | HOME , WORK , MOBILE |
How the number is to be used |
13.3 | System Code | N | PHONE , FAX , EMAIL MOBILE |
The apparatus / equipment used (e.g. for SMS) |
13.4 | Email Address | EMAIL^support@medilogik.co.uk |
||
14 | Business Phone | N | Repeating. Contains phone numbers & email addresses - format as per PID-13 | |
16 | Marital Status | N | M |
|
22 | Ethnic Group | N | See NHS data dictionary | |
29 | Date of Death | N | YYYYMMDD |
Only parsed if PID-30 = Y |
30 | Deceased | N | Must be explicitly set to Y - all other values indicate no |
Note:
PID-3.4
, and PID-3.5
) see example belowPID-2
and PID-3
MRN
identifierPID-13
and PID-14
into a single list of contact details see example belowPID-13.3
and PID-14-4
identify the contact type see example below1111111111
12345^^^RJ7^MR~1234567890^^^NHS^NH
0115874243^HOME^PHONE^~^WORK^EMAIL^support@medilogik.co.uk~0116874245^WORK^FAX
This segment is used to communciate patient’s registered GP details.
Field | Name | Required | Example | Notes |
---|---|---|---|---|
3 | Patient Primary Facility | Y | GP Practice Code & Address | |
3.1 | Practice Name | |||
3.3 | Practice Code | |||
4 | Primary Care provider Name & ID Number | Y | GP Code & Name | |
4.1 | GP Code | |||
4.2 | GP Surname | |||
4.3 | Given Name | |||
4.4 | GP Initials | |||
4.6 | Title | |||
4.13 | Identifier Type Code | |||
4.14 | Assigning Authority |
Note:
PD1
segment is optional, but MUST be provided in message inbound to EMS if GP details are to be sent to EMS.PD1