3 Datatypes

3 Datatypes

 

This section covers the datatypes in use in Australia. It omits datatypes that are deprecated from earlier versions of the standard as these should not be used in the Australian context. All data in an HL7 V2 message is encoded as text and every field required escaping/unescaping of HL7 delimiters and care should be taken to ensure that producers and consumers of this data ensure this is performed.

Datatypes can occur at several levels in a message. When a datatype is used in a field it will use the component separator (^), but when the datatype is embedded in another datatype a sub-component separator (&) may be used. Some datatypes are conceptually a combination of other datatypes e.g. an EI data type is a combination of a string (ST) identifier and a Hierarchical Designator (HD). This allows for an organization to provide a unique identifier within their namespace. In messages the HD component of an EI datatype will appear in other places in the message as a HD data type to identify the organization uniquely. If binary or non ASCII data is used it will be encoded, usually using base64  encoding.

 

3.1 Introduction

The following data types are those used in the Australian context.

Figure 3-1  HL7 data types by category

Data Type Category /

Data type

Data Type Name

LEN

Notes / Format

Examples

Alphanumeric

 

 

 

 

ST

String

199

 

Text: |almost any data at all|
URL encoded in an ST component: ^http://www.pacs.poupon.edu/wado.jsp^
ISO OID encoded in an ST subcomponent: &2.16.840.1.113883.1.1&

TX

Text data

65536

TX SHALL NOT be used for a standalone field value. Use ST or FT instead. TX may be used in a component of a more complex datatype where the standard specifies, e.g. TQ

 

FT

Formatted text

65536

 May contain formatting commands enclosed in escape characters. 

 |\.sp\(skip one vertical line)| 

Numerical

 

 

 

 

NA

Numeric array

65536

For waveform data only
This data type is used to represent a series (array) of numeric values, each one having a data type of NM.  A field of this type may contain a one-dimensional array (vector or row) of numbers.  

|125^34^-22^-234^569^442^-212^6|                                        
vector of 8 numbers

|1.2^-3.5^5.2~2.0^3.1^-6.2~3.5^7.8^-1.3|                                 
3 x 3 array of numbers

|^2^3^4~5^^^8~9^10~~17^18^19^20|                                         
5 x 4 array of numbers with the values in positions
(1,1), (2,2), (2,3), (3,3), (3,4), (4,1), (4,2), (4,3),
and (4,4) not present

NM

Numeric

 

 

|999| 

|-123.792|

SI

Sequence ID

 

A non-negative integer in the form of a NM field.
This data type is used in the "Set-ID" fields of PID, PV1, IN1, GT1, OBR and OBX fields. 

Used to number OBX segments in a report.

OBX|9|CE|11475-1^Culture^LN|1|3092008^Staphylococcus aureus^SCT|||A|||F

SN

Structured numeric

 

<comparator (ST)> ^ <num1 (NM)> ^ <separator/suffix (ST)> ^ <num2 (NM)>

|>^100|                   (greater than 100)

|^100^-^200|              (equal to range of 100 through 200)

|^1^:^128|        (ratio of 1 to 128, e.g., the results of a serological test)

|^2^+|                    (categorical response, e.g., occult blood positivity)

Identifier

 

 

 

 

ID

Coded values for HL7 tables

 

The value of such a field follows the formatting rules for an ST field except that it is drawn from a table of legal values.  There shall be an HL7 table number associated with ID data types.  

ID field is OBR-25-result status (HL7 table 0123): |F|.

IS

Coded value for user-defined tables

 

The value of such a field follows the formatting rules for a ST field except that it is drawn from a site-defined (or user-defined) table of legal values. 

PID-8 Administrative sex: |M|

VID

Version identifier

 

<version ID (ID)> ^ <internationalization code (CE)> ^ <international version ID (CE).

Used to identify the HL7 version. 

MSH-12 : |2.4^AUS|

HD

Hierarchic designator

 

<namespace ID (IS)> ^ <universal ID  (ST)> ^ <universal ID type (ID)>

The HD is designed to be used either as a local identifier (with only the <namespace ID> valued) or a publicly-assigned identifier, a UID (<universal ID> and <universal ID type> both valued). 

MSH-4 : |LAB^3456^AUSNATA|

ISO example with only the 2nd and 3rd components valued: |^2.16.840.1.113883.19^ISO|

A UUID example : |^478A0114-EBF0-7701-A023-6841FF05731A^UUID|

A DNS example : |^falcon.iupui.edu^DNS|

Local use only: a HD that looks like an IS data type :

  • |LAB1|

  • |RX.PIMS.SystemB.KP.CA.SCA|

EI

Entity identifier

 

<entity identifier (ST)> ^  <namespace ID (IS)> ^ <universal ID (ST)> ^ <universal ID type (ID)>

The entity identifier defines a given entity within a specified series of identifiers.  

ORC-2: |L12345^LOCAL GP SURGERY^RX123456789^L|

RP

Reference pointer

 

<pointer (ST) > ^ < application ID (HD)> ^ <type of data (ID)> ^  <subtype (ID)>

This data type transmits information about data stored on another system. 

An image on a web server at:
http://testsite/neurologicalstudy.asp?path=/All%20Studies/AccessionNumber=2016F0001100-1

|?path=/All%20Studies/AccessionNumber=2016F0001100-1^

http://testsite/neurologicalstudy.asp&URI^IMAGE^JPEG|

PL

Person location

 

<point of care  (IS )> ^ <room (IS )> ^ <bed (IS)> ^ <facility (HD)> ^ < location status  (IS )> ^ <person location type (IS)> ^ <building (IS )> ^ <floor (IS )> ^ <location description (ST)>

This data type is used to specify a patient location within a healthcare institution.  

A nursing unit at Community Hospital: 4 East, room 136, bed B :
4E^136^B^CommunityHospital^^N^^^

 

A clinic at University Hospitals: Internal Medicine Clinic located in the Briones building, 3rd floor :
InternalMedicine^^^UniversityHospitals^^C^Briones^3^

 

Date/Time

 

 

 

 

 DR

 Date/Time range

 

YYYY[MM[DD[HHMM[SS[.S[S[S[S]]]]]]]][+/-ZZZZ]

 

 

DT

Date

 

YYYY[MM[DD]]

By site-specific agreement, YYYYMMDD may be used where backward compatibility must be maintained. 

PV1-25: |20150808|

Month only: |201503|

TM

Time

 

HH[MM[SS[.S[S[S[S]]]]]][+/-ZZZZ]

Generally not used in the Australian context. TS is used instead.

|0800|  = Eight AM, local time of the sender.

|0000| = midnight

|13| = 1pm (with a precision of hours), local time of sender.

|093544.2312| = 44.2312 seconds after Nine thirty-five AM, local time of sender.

|235959+1100| = 1 second before midnight in a time zone eleven hours ahead of Universal Coordinated Time (i.e., East of Greenwich).

TS

Time stamp

 

YYYY[MM[DD[HHMM[SS[.S[S[S[S]]]]]]]][+/-ZZZZ]

ORC-7: |20160704010159+1000|

Code Values

 

 

 

 

CE

Coded element

250

<identifier (ST)> ^ <text (ST)> ^ <name of coding system (IS)> ^ <alternate identifier (ST)> ^ <alternate text (ST)> ^ <name of alternate coding system (IS)>

This data type transmits codes and the text associated with the code. 

OBX-3: |22664-7^UREA^LN^Cr^UREA^NATA3456-008|.

CNE

Coded with no exceptions

250

<identifier (ST)> ^ <text (ST)> ^ <name of coding system (IS)> ^ <alternate identifier (ST)> ^ <alternate text (ST)> ^ <name of alternate coding system (IS)> ^ <coding system version ID (ST)> ^ alternate coding system version ID (ST)> ^ <original text (ST) >

IAM-6

CWE

Coded with exceptions

250

<identifier (ST)> ^ <text (ST)> ^ <name of coding system (IS)> ^ <alternate identifier (ST)> ^ <alternate text (ST)> ^ <name of alternate coding system (IS)> ^ <coding system version ID (ST)> ^ alternate coding system version ID (ST)> ^ <original text (ST) >

OBR-25

CX

Extended composite ID with check digit

250

<ID (ST)> ^ <check digit (ST)> ^ <code identifying the check digit scheme employed (ID)> ^ < assigning authority (HD)> ^ <identifier type code (ID)> ^ < assigning facility (HD) ^ <effective date (DT)> ^ <expiration date (DT)>

This data type is used for specifying an identifier with its associated administrative detail. 

PID-3:

  • |8003608833357361^^^AUSHIC^NI|

  • |P0057804^^^^PN~4009887514^^^AUSHIC^MC~SMIAL001^^^^PI|

  • |1234567^4^M11^ADT01^MR^University Hospital|

XCN

Extended composite ID number and name

250

Replaces CN data type as of v 2.3. 

<ID number (ST)> ^ <family name (FN)> ^ <given name (ST)> ^ <second and further given names or initials thereof  (ST)> ^ <suffix (e.g., JR or III) (ST)> ^ <prefix (e.g., DR) (ST)> ^ <degree (e.g., MD) (IS)> ^ <source table (IS)> ^ <assigning authority (HD)> ^ <name type code (ID)>  ^ <identifier check digit (ST)> ^ <code identifying the check digit scheme employed (ID)> ^ <identifier type code (IS)> ^ <assigning facility (HD)> ^ <name representation code (ID)> ^ <name context (CE)> ^ <name validity range (DR)> ^ < name assembly order (ID)>

This data type is used extensively appearing in the PV1, ORC, RXO, RXE, OBR and SCH segments , as well as others, where there is a need to specify the ID number and name of a person.   

PV1-7:

  • |8003619900015717^Smith^John^S^^DR^MD^^AUSHIC^^^^NPI|

  • |045678AB^HANDY^JOHN^^^DR^^^AUSHICPR|

Generic

 

 

 

 

CM

Composite

 

A field that is a combination of other meaningful data fields.  Each portion is called a component.  No new CM’s are allowed after HL7 Version 2.2. The CM data type is maintained strictly for backward compatibility and may not be used for the definition of new fields.

PRD-7: |8003619900015717^NPI^AUSHIC|

Demographics

 

 

 

 

XAD

Extended address

250

Replaces the AD data type as of v 2.3. 

<street address (SAD)> ^ <other designation (ST)> ^ <city (ST)> ^ <state or province (ST)> ^ <zip or postal code (ST)> ^ <country (ID)> ^ < address type (ID)> ^ <other geographic designation (ST)> ^ <county/parish code (IS)> ^ <census tract (IS)> ^ <address representation code (ID)> ^ <address validity range (DR)>

Countries typically have a standard method of formatting addresses. This data type does not specify the formatting usages, only the components of a postal address.

PID-11: |14th Floor^50 Paterson St^Coorparoo^QLD^4151| 

XPN

Extended person name

250

Replaces PN data type as of v 2.3. 

<family name (FN)> ^ <given name (ST)> ^ <second and further given names or initials thereof (ST)> ^ <suffix (e.g., JR or III) (ST)> ^ <prefix (e.g., DR) (ST)> ^ <degree (e.g., MD) (IS)> ^ <name type code (ID) > ^ <name representation code (ID)> ^ <name context (CE)> ^ <name validity range (DR)> ^ <name assembly order (ID)>

|Smith^John^J^III^DR^PHD^L|

XON

Extended composite name and ID number for organizations

250

<organization name (ST)> ^ <organization name type code (IS)> ^ <ID number (NM)> ^ <check digit (NM)> ^ <code identifying the check digit scheme employed (ID)> ^ <assigning authority  (HD)> ^ <identifier type code (IS)> ^ <assigning facility ID (HD)> ^ <name representation code (ID)>

 ORC-21:  |ABC Medical Group^^1234567|

HPI-O:  |ABCD Organisation^L^8003621566684455^^^AUSHIC^NOI|

XTN

Extended telecommunications number

250

Replaces TN data type as of v 2.3 

[NNN] [(999)]999-9999 [X99999] [B99999] [C any text] ^  <telecommunication use code (ID)> ^ <telecommunication equipment type (ID)> ^ <email address (ST)> ^ <country code (NM)> ^ <area/city code (NM)> ^ <phone number (NM)> ^ <extension (NM)> ^ <any text (ST)>

Note: Components five through nine reiterate the basic function of the first component in a delimited form that allows the expression of both local and international telephone numbers. As of 2.3, the recommended form for the telephone number is to use the delimited form rather than the unstructured form supported by the first component (which is left in for backward compatibility only). 

International phone number: |^WPN^PH^^61^7^32615492| 

Interstate/intrastate phone number: |^WPN^PH^^^07^32615492|

Local area’ phone number: |^WPN^PH^^^^32615492|

Mobile phone number: |^WPN^CP^^^^0412545585|

Email address: |^NET^Internet^J.Smith@work.com|

 

Specialty/Chapter Specific

 

 

 

 

Waveform

 

 

 

 

CD

Channel definition

 

For waveform data only e.g. graphs, echo cardiographs.
<channel identifier (CM)> ^ <waveform source (CM)> ^ <channel sensitivity/units (CM) > ^ <channel calibration parameters (CM)> ^ <sampling frequency (NM)> ^ <minimum/maximum data values (CM)>

 

Multiplexed array

 

Multiplexed array
Components: <sample 1 from channel 1 (NM)> ^ <sample 1 from channel 2 (NM)> ^ <sample 1 from
channel 3 (NM)> ...~<sample 2 from channel 1 (NM)> ^ <sample 2 from channel 2 (NM)> ^
<sample 2 from channel 3 (NM)> ...~
...
This data type is used to represent channel-multiplexed waveform data, (e.g., the digitized values from an
analog-to-digital converter or other digital data source).

 

NA

Numeric array

 

For waveform data only

<value1 (NM)> ^  <value2 (NM)> ^  <value3 (NM)> ^  <value4 (NM)> ^ ...

 

 

ED

Encapsulated data

 

Supports ASCII MIME-encoding of binary data.  <source application (HD) > ^ <type of data (ID)> ^ <data subtype (ID)> ^ <encoding (ID)> ^ <data (ST)>

This data type transmits encapsulated data from a source system to a destination system.

 OBX|16|ED|HTML^Display Segment as HTML^AUSPDI||^text^HTML^A^<?xml

version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" ><html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> Content .......|

Patient Administration /Financial Information

 

 

 

 

FC

Financial class

 

 

<financial class (IS)> ^ <effective date (TS)>

This component contains the financial class assigned to a person.

PV1-20

Time Series:

 

 

 

 

TQ

Timing/quantity

 

For timing/quantity specifications for orders, see HL7 International Standard Chapter 4, Section 4.3.  <quantity (CQ)> ^ <interval (*)> ^ <duration (*)> ^ <start date/time (TS)> ^ <end date/time (TS)> ^ <priority (ST)> ^ <condition (ST)> ^ <text (TX)> ^ <conjunction (ID)> ^ <order sequencing (*)> ^ <occurrence duration (CE)> ^ <total occurrences (NM)>

Note: only components 4 and 6 used.

Urgent : |^^^199710230915^^S|

Routine :|^^^199711071020|

 

 

*  for subcomponents of these elements please refer to the definition in the text.

3.1.1   USE OF ESCAPE SEQUENCES IN TEXT FIELDS

3.1.1.1 Formatting codes

When a field of type TX, FT, or CF is being encoded, the escape character may be used to signal certain special characteristics of portions of the text field. The character \ will be used to represent the character so designated in a message. An escape sequence consists of the escape character followed by an escape code ID of one character, zero (0) or more data characters, and another occurrence of the escape character. The following escape sequences are defined:

\H\

start highlighting

\N\

normal text (end highlighting)

\F\

field separator