Standard HL7 Segments


MSH: Message Header

Definition

Segment Field Component Description Example
MSH

Message header

MSH-3
Sending application. Note that for inbound ORU^R01 messages this field is used to determine whether the message contains radiology information. See the test results specification for more information.


MSH-3.1 Sending application name PAS

MSH-4
Sending facility. If you configure org and/or team aliases with PKB, the values in this field will be mapped to whitelisted organization or teams in PKB, and this message will be treated as coming from that organization or team. If aliases are configured, this field value is required and must match a defined alias.


MSH-4.1 Sending facility name MyFacility

MSH-5
Receiving application. We do not use this field; you are welcome to send through whatever is convenient. There is only one PKB instance behind the HL7 endpoint, so no routing is required.

MSH-6
Receiving facility. We do not use this field; you are welcome to send through whatever is convenient. There is only one PKB instance behind the HL7 endpoint, so no routing is required.

MSH-7
Message timestamp


MSH-7.1 Message timestamp 201508011314

MSH-9
Message type


MSH-9.1 Message type QRY


MSH-9.2 Trigger event A19

MSH-10
Message control ID. This must be unique for all messages sent to PKB by each sender. However, PKB does not currently detect or reject duplicate messages based on this value, so it is important that each sender enforces this themselves.


MSH-10.1 Message control ID ABC0000000001

MSH-11
Processing ID


MSH-11.1 Processing ID. This must be P for our production server. P

MSH-12
Version ID. We do not use this field. Our message definitions are not dependent on version number.

PID: Patient Identification

Definition

Segment Field Component Description Example Data Model Blank Ignored On Update
PID

Patient identification
   

[ PID-2 ]
Patient identifier. See here for more information about acceptable identifiers.
   


PID-2.1 Patient ID 5555555555 If National ID:
[[Patient.National ID.Value]]

If Organisation Level ID:
[[Patient.Organisation Level ID.Value]]

If Team Level ID:
[[Patient.Team Level ID.Value]]
Y - for National IDs

N/A - for local IDs


PID-2.4 Patient ID assigning authority (e.g "NHS" for the UK) NHS If National ID:
[[Patient.National ID.National ID Type.HL7 Assigning Authority]]

If Organisation Level ID:
[[Patient.Organisation Level ID.Organisation Level ID Type.HL7 Assigning Authority]]

If Team Level ID:
[[Patient.Team Level ID.Team Level ID Type.HL7 Assigning Authority]]
N/A


PID-2.5 Patient ID type code. If an NHS number status code is being provided, it must be appended without a space in the format given in the example. NH{status:01} If National ID:
[[Patient.National ID.National ID Type.HL7 Type Code]]

If Organisation Level ID:
[[Patient.Organisation Level ID.Organisation Level ID Type.HL7 Type Code]]

If Team Level ID:
[[Patient.Team Level ID.Team Level ID Type.HL7 Type Code]]
N/A

{ [ PID-3 ] }
Patient identifier. See here for more information about acceptable identifiers.
   


PID-3.1 Patient ID 5555555555 As PID-2.1 As PID-2.1


PID-3.4 Patient ID assigning authority (e.g "NHS" for the UK) NHS As PID-2.4 As PID-2.4


PID-3.5 Patient ID type code NH{status:01} As PID-2.5 As PID-2.5

[ PID-5 ]
Name. Each component is optional by default, but any that have been configured for soft matching must be provided.
   


[ PID-5.1 ] Family name Smith [[Patient.Family Name]] Y


[ PID-5.2 ] Given name John [[Patient.Given Name]] Y


[ PID-5.3 ] Middle names Joe [[Patient.Middle Names]] Y


[ PID-5.5 ] Title Mr [[Patient.Title]] Y

[ PID-7 ]
Date of birth
   


PID-7.1 Date of birth. Note that this timestamp will be accepted even if it contains time information. 19700101 [[Patient.Date of Birth]] Y

[ PID-8 ]
Gender
   


PID-8.1 Gender. Allowed values are defined in Code Set PKBCS01. M [[Patient.Gender]] Y

[ PID-11 ]
Address. Each component is optional by default, but any that have been configured for soft matching must be provided.
   


[ PID-11.1 ] Address Line 1 My flat name [[Patient.Address Line 1]] Y


[ PID-11.2 ] Address Line 2 1, The Road [[Patient.Address Line 2]] Y


[ PID-11.3 ] City London [[Patient.City]] Y


[ PID-11.4 ] State London [[Patient.State]] Y


[ PID-11.5 ] Postal code SW1A 1AA [[Patient.Postal Code]] Y


[ PID-11.6 ] Country code GBR [[Patient.Country]] Y

{ [ PID-13 ] }
Home contact information.

Note that an email address cannot be added via HL7 to an existing medical record which does not already have an email address. See here for more details.

   


PID-13.1 Contact value john.smith@hotmail.com [[Patient.Contact.Value]]

if PID-13.2 was NET and PID-13.4 was not provided.

Phone numbers compete to be stored in

[[Patient.Phone]]
Y - for phone numbers

N/A - for email addresses


PID-13.2 Contact use code. Allowed values are defined in Code Set PKBCS02. NET If this is NET then 

[[Patient.Contact.Type]]

will be set to EMAIL.
N/A


PID-13.4 Email address. When receiving data where PID-13.2 is NET, PKB will pull the email address from PID-13.4. If this field is not provided, then PID-13.1 will be used instead. john.smith@hotmail.com [[Patient.Contact.Value]]

if PID-13.2 was NET.
N/A

{ [ PID-14 ] }
Work contact information.

Note that an email address cannot be added via HL7 to an existing medical record which does not already have an email address. See here for more details.

   


PID-14.1 Contact value 01234 098765 [[Patient.Contact.Value]]

if PID-14.2 was NET and PID-14.4 was not provided.

Phone numbers compete to be stored in

[[Patient.Phone]]
Y - for phone numbers

N/A - for email addresses


PID-14.2 Contact use code. Allowed values are defined in Code Set PKBCS03. WPN If this is NET then 

[[Patient.Contact.Type]]

will be set to EMAIL.
N/A


PID-14.4 Email address. When receiving data where PID-14.2 is NET, PKB will pull the email address from PID-14.4. If this field is not provided, then PID-14.1 will be used instead. john.smith@hotmail.com [[Patient.Contact.Value]]

if PID-14.2 was NET.
N/A

[ PID-15 ]
Primary language. If no language is specified the default of English will be used.
   


PID-15.1 Primary language en [[Patient.Language]] Y


PID-15.4 Alternative primary language. This is only checked if PID-15.1 is not provided. en [[Patient.Language]] Y

[ PID-29 ]
Death timestamp. If the death timestamp is set, then "Y" is inferred for death indicator in PID-30, regardless of it's actual value.
   


PID-29.1 Death timestamp 201508011638 [[Patient.Death Timestamp]] Y

[ PID-30 ]
Death indicator. If this is "Y" but no date of death is provided in PID-29, we change the patient's status but don't record a date of death.
   


PID-30.1 Death indicator. Y = Yes, N = No.
Y [[Patient.Status]] Y


Comments