HL7 Data Types for

Athena Technologies

Data Type Descriptions

All HL7 datatypes are implemented as VB classes, thus each data type below has an associated class name. Data within fields is set and retrieve via properties of the data type class. Every class has the following properties:

In addition to the above properties, each data type may have additional properties which are specific to that data type, e.g. the PN (Person Name) data type has GivenName, FamilyName, etc.

Description Class
Address HL7AD
Coded element HL7CE
Coded element with formatted values HL7CF
Composite ID with check digit HL7CK
Composite HL7CM
Composite ID number and name HL7CN
Composite quantity with units HL7CQ
Date HL7DT
Formatted Text HL7FT
Coded Value HL7ID
Money HL7MO
Numeric HL7NM
Person Name HL7PN
Reference pointer HL7RP
Sequence ID HL7SI
String Data HL7ST
Time HL7TM
Telephone Number HL7TN
Timing Quantity HL7TQ
Time Stamp HL7TS
Text Data HL7TX
User Type HL7US

ST string data

String data is left justified with trailing blanks optional. Any displayable (printable) ACSII characters (hexadecimal values between 20 and 7E, inclusive). Example:

|almost any data at all|

To include any HL7 delimiter character (except the segment terminator) within a string data field, use the appropriate HL7 escape sequence (see section

TX text data

String data meant for user display (on a terminal or printer). Such data would not necessarily be left justified since leading spaces may contribute greatly to the clarity of the presentation to the user. Because this type of data is intended for display, it may contain certain escape character sequences designed to control the display. Escape sequence formatting is defined later in this chapter in Section 2.4.6. Leading spaces should be included. Trailing spaces should be removed. Example:

| leading spaces are allowed.|

Since TX data is intended for display purposes, the repeat delimiter, when used with a TX data field, implies a series of repeating lines to be displayed on a printer or terminal. Therefore, the repeat delimiters are regarded as paragraph terminators or hard carriage returns (e.g., they would display as though a CR/LF were inserted in the text).

A receiving system would word­wrap the text between repeat delimiters in order to fit it into an arbitrarily sized display window but start any line beginning with a repeat delimiter on a new line.

FT formatted text data

This data type is derived from the string data type by allowing the addition of embedded formatting instructions. These instructions are limited to those that are intrinsic and independent of the circumstances under which the field is being used. The actual instructions and their representation are described later in this chapter. The differences from a string data field and an FT field is of arbitrary length (up to 65k) and may contain formatting commands enclosed in escape characters. Example:

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

For additional examples of formatting commands see Section 2.4.6-use of escape sequences in text fields, below.

NM numeric

A number represented as a series of ASCII numeric characters consisting of an optional leading sign (+ or -), the digits and an optional decimal point. In the absence of a sign, the number is assumed to be positive. If there is no decimal point the number is assumed to be an integer. Examples:



Leading zeros, or trailing zeros after a decimal point, are not significant. The two values 01.20 and 1.2 are identical. Except for the optional leading sign (+ or -) and the optional decimal point (.), no non-numeric ASCII characters are allowed. Thus, the value <12 should be encoded as a string data type.

DT date

Always in the format YYYYMMDD. Example:


TM time

Always in the format HHMM[SS[.SSSS]][+/-ZZZZ] using a 24 hour clock notation. The seconds designation (SS) is optional. If not present it will be interpreted as 00. The fractional seconds designation is likewise optional. If not present it will be interpreted as .0000. The fractional seconds could be sent by a transmitter who requires greater precision than whole seconds. Fractional representations of minutes, hours or other higher orders units of time are not permitted. The time zone of the sender may be sent optionally as an offset from the coordinated universal time (previously known as Greenwich Mean Time.) Where the time zone is not present in a particular TM field but is included as part of the date/time field in the MSH segment, the MSH value will be used as the default time zone. Otherwise, the time is understood to refer to the local time of the sender. Midnight is represented as 0000. Examples:

|235959+1130| 1 second before midnight in a time zone eleven and half hours ahead of Universal Coordinated Time (i.e., east of Greenwich).

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

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

TS time stamp

Contains the exact time of an event, including the date and time. Time stamp fields are always in the format:

YYYYMMDD[HHMM[SS[.SSSS]]][+/-ZZZZ]^<degree of precision>

The date portion of a time stamp follows the rules of a date field and the time portion follows the rules of a time field. When used as a birthdate, the HHMM portion is optional. If not present the HHMM portion will default to 0000, i.e., midnight of the day just beginning. The specific data representations used in the HL7 encoding rules are compatible with ISO 8824-1987(E). An optional second component indicates the degree of precision of the date (Y = year, L = month, D = day, H = hour, M = minute, S = second). (Maximum length of field is 26). Examples:

|17760704010159-0600| 1:01:59 on July 4, 1776 in the Eastern Standard Time zone.

|17760704010159-0500| 1:01:59 on July 4, 1776 in the Eastern Daylight Saving Time zone.

|198807050000| Midnight of the night extending from July 4 to July 5, 1988 in the local time zone of the sender.

|198807050000^D| Same as prior example, but precision extends only to the day. Could be used for a birthdate.

The HL7 Standard strongly recommends that all systems routinely send the time zone offset but does not require it. All HL7 systems are required to accept the time zone offset, but its implementation is application specific. For many applications the time of interest is the local time of the sender. For example, an application in the Eastern Standard Time zone receiving notification of an admission that takes place at 11:00 PM in San Francisco on December 11 would prefer to treat the admission as having occurred on December 11 rather than advancing the date to December 12.

One exception to this rule would be a clinical system that processed patient data collected in a clinic and a nearby hospital that happens to be in a different time zone. Such applications may choose to convert the data to a common representation. Similar concerns apply to the transitions to and from daylight saving time. HL7 supports such requirements by requiring that the time zone information be present when the information is sent. It does not, however, specify which of the treatments discussed here will be applied by the receiving system.

PN person name

<family name> ^ <given name> ^ <middle initial or name> ^ <suffix (e.g., JR or III)> ^ <prefix (e.g., DR)> ^ <degree (e.g., MD)>

A name includes multiple free text components as listed above. The maximum length of a PN field is 48 characters including component separators. The sending system may send upper- and lowercase or all uppercase. The receiving system may convert to all uppercase if required. Example:


TN telephone number

For use in the United States and conforming countries, the telephone number is always in the form:

[NN] [(999)]999-9999[X99999][B99999][C any text]

The optional first two digits are the country code. The optional X portion gives an extension. The optional B portion gives a beeper code. The optional C portion may be used for comments like, After 6:00. While no explicit limit is placed on the text field, receiving systems may be expected to truncate values that are more than 10 characters long. To accommodate the variability of institutional phone systems, the length of the extension and beeper numbers may be extended by local agreement. Examples:



AD address

<street address> ^ < other designation> ^ <city> ^ <state or province> ^ <zip or postal code> ^ <country> ^ <type> ^ <other geographic designation>

All components are ST data type. The street or mailing address of a person or institution. For use within North America:

  1. state or province should be represented by the official US Postal service two-letter codes
  2. zip takes the form 99999[-9999], Canadian postal code is 6 alpha-numeric characters

c) the country code is assumed to be USA if null

d) other geographic designation includes county, bioregion, SMSA, etc.

Type is optional and defined by table 0190 - address type.


|10 ASH LN^#3^LIMA^OH^48132^""^|

Table 0190 Address type






current or temporary






ID coded value

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. Examples of ID fields include religion and sex.

SI sequence ID

A positive integer in the form of an NM field. The uses of this field are defined in the chapters defining the segments and messages in which it appears.

CM composite

A field that is a combination of other meaningful data fields. Each portion is called a component. The specific components of CM fields are defined within the field descriptions. Certain other composites have been separately identified and are described below. The use of this data type will be slowly phased out and new unique data types will be created.

Wherever a component of an HL7 field is itself an HL7 data type which contains components, its delimiters are demoted by one. Thus a component designated as a CE data type should be encoded as <identifier & text & name of coding system> (see section, below). Note that since HL7 delimiters are not recursive, an HL7 data type containing components cannot be a sub-component. When this level of detail is needed, each component of the HL7 data type can be encoded as a separate subcomponent. For an example of this, see the encoding of the filler order number in the order sequencing component of the Timing/Quantity data type, (figure 4-7, section, below).

CK composite ID with check digit

<ID number (NM)> ^ <check digit (NM)> ^ <code identifying the check digit scheme employed (ID)> ^ <assigning facility ID (ST)>

This data type is used for certain fields that commonly contain check digits, e.g., PID-3-Patient ID (Internal ID). If a site is not using check-digits for a particular CK field, the second and third components are not valued.

The check digit in this data type is not an add-on produced by the message processor. It is the check digit that is part of the identifying number used in the sending application. If the sending application does not include a self-generated check digit in the indentifying number, this component should be valued null.

The assigning facility ID is a unique name (up to six characters in length) of the system that stores the data. It is an ST data type. It is equivalent to the application ID of the placer or filler order number (see Chapter 4). Assigning facility ID's are unique across a given HL7 implementation.

The check digit scheme codes are defined in table 0061 - check digit scheme.

Table 0061 Check digit scheme


Mod 10 algorithm

Mod 11 algorithm



The algorithm for calculating a Mod10 check digit is as follows:

Assume you have an identifier = 12345. Take the odd digit positions, counting from the right, i.e., 531, multiply this number by 2 to get 1062. Take the even digit positions, starting from the right (i.e., 42), prepend these to the 1062 to get 421062. Add all of these six digits together to get 15. Subtract this number from the next highest multiple of 10, i.e., 20 ­ 15 to get 5. The Mod10 check digit is 5. The Mod10 check digit for 401 is 0; for 9999, it's 4; for 99999999, it's 7.

The algorithm for calculating a Mod11 check digit is as follows:


d = digit of number starting from units digit, followed by 10's position, followed by 100's position, etc.

w = weight of digit position starting with the units position, followed by 10's position, followed by 100's position etc. Values for w = 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7, etc. (repeats for each group of 6 digits)

c = check digit


(Step 1) m = sum of (d * w) for positions 1, 2, etc. starting with units digit

for d = digit value starting with units position to highest order

for w = weight value from 2 to 7 for every six positions starting with units digit

(Step 2) c1 = m mod 11

(Step 3) if c1 = 0 then reset c1 = 1

(Step 4) c = (11 - c1) mod 10


if the number is 1234567, then the mod 11 check digit = 6

The calculations are:

M = (7*2)+(6*3)+(5*4)+(4*5)+(3*6)+(2*7)+(1*2)

= 14 + 18 + 20 + 20 + 18 + 14 + 2

= 106

c1 = 106 mod 11

= 7

c = (11-c1) mod 10

= 4 mod 10

= 4

Other variants of these check digit algorithms exist and may be used by local bilateral site agreement.

CN composite ID number and name

<ID Number> ^ <family name> ^ <given name> ^ <middle initial or name> ^ <suffix (e.g., JR or III)> ^ <prefix (e.g., DR)> ^ <degree (e.g., MD)> ^ <source table>

All components are ST data type. A field identifying a person both as a coded value and with a text name. The first component is the coded ID according to a site-specific table. The second through the seventh components are the person's name as a PN field. The eighth component specifies the source table used for the first component. For specific fields, individual sites may elect to omit the ID or the name. Example:




CQ composite quantity with units

<quantity> ^ <units>

The first component is a quantity and the second is the units in which the quantity is expressed. Field by field, default units may be defined within the specifications. When the observation is measured in the default units, the units need not be transmitted. If the measure is recorded in units different from the default, the measurement units must be transmitted as the second component. If the units are ISO+ units, then units should be recorded as lowercase abbreviations as specified in Chapter 7. If the units are ANSI or local, the units and the source table must be recorded as specified in Chapter 7. But in these cases the component separator should be replaced by the subcomponent delimiter. Examples:

|123.7^kg| kilograms is an ISO unit

|150^lb&&ANS+|weight in pounds is a customary US unit defined within ANSI+.

In future versions, CQ fields will be used sparingly because the same data can usually be sent as two separate fields, one with the value and one with the units as a CE data type.

CE coded element

This data type transmits codes and the text associated with the code. This type has six components arranged in two groups as follows:

<identifier> ^ <text> ^ <name of coding system> ^ <alternate identifier> ^ <alternate text> ^ <name of alternate coding system>

To allow all six components of a CE data type to be valued, the minimum length of this data type is 60.

These are defined as follows:

  1. identifier: Sequence of characters (the code) that uniquely identifies the item being referenced by the <text>. Different coding schemes will have different elements here.
  1. text: Name or description of the item in question. E.g., myocardial infarction or x-ray impression. Its data type is string (ST).
  1. name of coding system: Each coding system will be assigned a unique identifier. This component will serve to identify the coding scheme being used in the identifier component. The combination of the identifier and name of coding system components will be a unique code for a data item. For backward compatibility, if this component is absent, it will be taken to mean the CPT-4 with ASTM extensions, i.e., AS4. Other coding systems that might appear here are ICD-9, ICD-10, SNOMED, etc. Each system will be given a unique identifying string. The current ASTM 1238-88 diagnostic/procedure/observation/drug ID/health outcomes coding systems are identified in the tables below. Others may be added as needed.
  1. alternate components: these three components are defined analogously to the above for the alternate or local coding system. If the Alternate Text component is absent, and the Alternate Identifier is present, the Alternate Text will be taken to be the same as the Text component. If the Alternate Coding System component is absent, it will be taken to mean the locally defined system.

Note: The presence of two sets of equivalent codes in this data type is semantically different from a repetition of a CE-type field. With repetition, several distinct codes (with distinct meanings) may be transmitted.



Figures 2-2 and 2-3 list many diagnostic, procedure, observation, drug, and health outcomes coding systems. Guidelines for their use are presented in Section 7.1.

Figure 2-2 Diagnostic coding schemes

(from ASTM 1238-94 Table 3)

American College of Radiology finding codes ACR Index for Radiological Diagnosis Revised, 3rd Edition 1986, American College of Radiology, Reston, VA.
CEN ECG diagnostic codes CE CEN PT007. A quite comprehensive set of ECG diagnostic codes (abbreviations) and descriptions published as a pre-standard by CEN TC251. Available from CEN TC251 secretariat, c/o Georges DeMoor, State University Hospital Gent, De Pintelaan 185-5K3, 9000 Gent, Belgium or Jos Willems, University of Gathuisberg, 49 Herestraat, 3000 Leuven, Belgium.
CLIPCLP Simon Leeming, Beth Israel Hospital, Boston MA. Codes for radiology reports.
EUCLIDES E Available from Euclides Foundation International nv, Excelsiorlaan 4A, B-1930 Zaventem, Belgium; Phone: 32 2 720 90 60.
Home Health Care




Home Health Care Classification System; Virginia Saba, EdD, RN; Geogetown University School of Nursing; Washington, DC.

World Health Publications, Albany, NY.

ICD9-CM I9C Commission on Professional and Hospital Activities, 1968 Green Rd., Ann Arbor, MI 48105.
ICD-10 I10 World Health Publications, Albany, NY.
Local general code 99zzz or L Locally defined codes for purpose of sender or receiver. Local codes can be identified by L (for backward compatibility) or 99zzz (where z is an alphanumeric character).
Local billing code LB Local billing codes/names (with extensions if needed).


Read Classification




Omaha Visiting Nurse Association, Omaha, NB.

North American Nursing Diagnosis Association, Philadelphia, PA.

The Read Clinical Classification of Medicine, Park View Surgery, 26 Leicester Rd., Loughborough LE11 2AG (includes drug procedure and other codes, as well as diagnostic codes).

Systemized Nomenclature of Medicine (SNOMED) SNMSystemized Nomenclature of Medicine, 2nd Edition 1984 Vols 1, 2, American College of Pathology, Skokie, IL.
SNOMED International SNM3 SNOMED International, 1993 Vols 1-4, American College of Pathology, Skokie, IL.
Unified Medical Language UMLNational Library of Medicine, 8600 Rockville Pike, Bethesda, MD 20894.

Figure 2-3 Procedure/observation/drug ID/health outcomescoding systems

(From ASTM 1238-88 Table 5)

Coding System
ASTM E1238/ E1467 Universal AS4 American Society for Testing & Materials and CPT4 (see Appendix X1 of Specification E1238 and Appendix X2 of Specification E1467).
CPT-4C4 American Medical Association, P.O. Box 10946, Chicago IL 60610.
CPT-5 C5 (under development - same contact as above)
EUCLIDES E AFP codes. Available from Euclides Foundation International nv, Excelsiorlaan 4A, B-1930 Zaventem, Belgium; Phone: 32 2 720 90 60.
FDA K10 FDK Dept. of Health & Human Services, Food & Drug Administration, Rockville, MD 20857. (device & analyte process codes).
Health Outcomes HI Health Outcomes Institute codes for outcome variables available (with responses) from Health Outcomes Institute, 2001 Killebrew Drive, Suite 122, Bloomington, MN 55425; (612) 858 9188. See examples in Appendix A.
HIBCC HB Health Industry Business Communications Council, 5110 N. 40th St., Ste 120, Phoenix, AZ 85018.
Home Health Care




Home Health Care Classification System; Virginia Saba, EdD, RN; Geogetown University School of Nursing; Washington, DC.

Commission on Professional and Hospital Activities, 1968 Green Road, Ann Arbor, MI 48105.

ICD-9CM I9C Commission on Professional and Hospital Activities, 1968 Green Road, Ann Arbor, MI 48105 (includes all procedures and diagnostic tests).
ICHPPC-2IC2 International Classification of Health Problems in Primary Care, Classification Committee of World Organization of National Colleges, Academies and Academic Associations of General Practitioners (WONCA), 3rd edition. An adaptation of ICD9 intended for use in General Medicine, Oxford University Press.
ISBT IBT International Society of Blood Transfusion. Blood Group Terminology 1990. VOX Sanquines 1990 58(2):152-169.

IUCRecommendations of Quantities and Units in Clinical Chemistry DRAFT (to be published in 1992). Henrik Olesen, M.D., D.M.Sc., Chairperson, Department of Clinical Chemistry, KK76.4.2, Rigshospitalet, University Hospital of Copenhagen, DK-2200, Copenhagen.
Japanese Chemistry JC8 Clinical examination classification code. Japan Association of Clinical Pathology. Version 8, 1990. A multiaxial code including a subject code (e.g., Rubella = 5f395, identification code (e.g., virus ab IGG), a specimen code (e.g., serum =023) and a method code (e.g., ELISA = 022)
Local 99zzz or L Locally defined codes for purpose of sender or receiver. If multiple local codes exist, the format should be 99zzz, where z is an alphanumeric character.
Medicare MCR Medicare billing codes/names.
Medicaid MCD Medicaid billing codes/names.
Nursing Interventions


Omaha System





Iowa Intervention Project, College of Nursing, University of Iowa, Iowa City, Iowa.

Omaha Visiting Nurse Association, Omaha, NB.

Uniform Clinical Data Systems. Ms. Michael McMullan, Office of Peer Review Health Care Finance Administration, The Meadows East Bldg., 6325 Security Blvd., Baltimore, MD 21207; (301) 966 6851.

Universal Product CodeUPC The Uniform Code Council. 8163 Old Yankee Road, Suite J, Dayton, OH 45458; (513) 435 3070
Euclides Lab method codes E6 Available from Euclides Foundation International nv, Excelsiorlaan 4A, B-1930 Zaventem, Belgium; Phone: 32 2 720 90 60.
Euclides Lab equipment codes E7 Available from Euclides Foundation International nv (see above)
Euclides quantity codes E5 Available from Euclides Foundation International nv (see above)

Drug codes:
Chemical abstract codes CAS These include unique codes for each unique chemical, including all generic drugs. The codes do not distinguish among different dosing forms. When multiple equivalent CAS numbers exist, use the first one listed in USAN. USAN 1990 and the USP dictionary of drug names, William M. Heller, Ph.D., Executive Editor, United States Pharmacopeial Convention, Inc., 12601 Twinbrook Parkway, Rockville, MD 20852.
National drug codes NDC These provide unique codes for each distinct drug, dosing form, manufacturer, and packaging. (Available from the National Drug Code Directory, FDA, Rockville, MD, and other sources.)
WHO rec# drug codes W1, W2 World Health organization record number code. A unique sequential number is assigned to each unique single component drug and to each multi-component drug. Eight digits are allotted to each such code, six to identify the active agent, and 2 to identify the salt, of single content drugs. Six digits are assigned to each unique combination of drugs in a dispensing unit. The six digit code is identified by W1, the 8 digit code by W2.
WHO rec# code with ASTM extension W4 With ASTM extensions (see appendix X1), the WHO codes can be used to report serum (and other) levels, patient compliance with drug usage instructions, average daily doses and more (see Appendix X1).

WHO ATC code WC WHO's ATC codes provide a hierarchial classification of drugs by therapeutic class. They are linked to the record number codes listed above.

WHO ATCWC WHO's ATC codes provide a hierarchical classification of drugs by therapeutic class. They are linked to the record number codes listed above.
Note: The Read and NLM (National Library of Medicine) codes in Table 3 also include drugs. A number of sources of unique drug names exist: British Approved Names (BAN), French-approved nonproprietary names (DCF), and International Nonproprietary name (INN). These sources are now being reviewed. Those that also provide unique codes will be added to the registry of coding systems, using the abbreviations given in parentheses.
Device Code
MDNS UMD Universal Medical Device Nomenclature System. ECRI, 5200 Butler Pike, Plymouth Meeting, PA 19462 USA. Phone: 215-825-6000, Fax: 215-834-1275.

CF coded element with formatted values

This data type transmits codes and the formatted text associated with the code. This data type can be used to transmit for the first time the formatted text for the canned text portion of a report, for example, a standard radiologic description for a normal chest x­ray. The receiving system can store this information and in subsequent messages only the identifier need be sent. Another potential use of this data type is transmitting master file records that contain formatted text.

This data type has six components arranged in two groups as follows:

<identifier> ^ <formatted text> ^ <name of coding system>^

<alternate identifier> ^ <alternate formatted text> ^ <name of alternate coding system>

The components, primary and alternate are defined exactly as in the CE data type with the exception of the second and fifth components which are of the formatted text data type. Example:


\H\Description:\N\\.sp\\ti+4\Heart is not enlarged. There is no evidence of

pneumonia, effusion, pneumothorax or any masses.\.sp+3\\H\Impression:

\N\\.sp\\.ti+4\Negative chest.^CPMC

RP reference pointer

This data type transmits information about data stored on another system. It contains a reference pointer that uniquely identifies the data on the other system, the identity of the other system, and the type of data. This information is transmitted in three components arranged as follows:

<pointer> ^ <application ID> ^ <type of data>

  1. pointer: A unique key assigned by the system that stores the data. The key, which is an ST data type, is used to identify and access the data.
  1. application ID: A unique name (up to 6 characters in length) of the system that stores the data. It is an ST data type. It is equivalent to the application ID of the placer or filler order number (see Chapter 4). Application ID's must be unique across a given HL7 implementation.
  1. type of data: A code that represents the type of data being stored. It is an ID data type.

Table 0191 Type of Data





Scanned image

Non-scanned image

Scanned document

Machine readable text document

Formatted text

Other types may be added as needed.



TQ timing quantity

Describes when a service should be performed and how frequently. See Chapter 4 (Section 4.4) for a complete specification.

MO money

<quantity> ^ <denomenation>

The first component is a quantity and the second is the denomination in which the quantity is expressed. The values for the denomination component are those specified in ISO-4217. If the denomination is not specified, MSH-17-country code is used to determine the default.



where USD is the ISO 4217 code for the U.S. American dollar.

US user

<AdmittedBy> ^ <RegisteredBy> ^ <ReviewedBy>

The first component is the admitted by name, the second is the registered by name and the third is the reviewed by name.


|John Doe^Jane Doe^Baby Doe|

For more Information please e-mail Eric Washburn.
Copyright © 1996, Athena Technologies. All rights reserved.