HL7 Data Types

PreviousNext

Adding / Editing HL7 data types

(c) 2007-2008 Hermetech International Ltd.

To edit HL7 data types click the 'View HL7 Data Types' button in the HL7 Segment Elements window. If you just need to quickly see a definition of an HL7 data type open the EasyHL7 Reports window and choose 'Miscellaneous' reports. See explanation below or advance to 'Editing Data Types' for more info.

 

All fields (and indeed all components of fields) are assigned a particular HL7 Data Type. The HL7 data type determines how many components the field contains and (somewhat recursively) what the Data Type of each component is. The HL7 Data Type will also contain the 'Description' of each component which in turn is displayed in the EasyHL7 Reports.

 

Data types fall into 2 categories:

 

1.Simple: Contain only one (1) component (Example: ST [string] or NM [numeric])
2.Compound: Contains multiple components (Example: XAD [extended address] or CE [coded element]), with each component being defined either as a SIMPLE data type or as a short compound data type (Example: TS [Timestamp]) of which only the first component is ever used.

 

Most HL7 segment fields are COMPOUND data types.

 

An example of a short HL7 Segment Definition

This extract was taken directly from an EasyHL7 Vendor Definition Report

HL7 Segment: ACC-Accident segment

This segment has 6 HL7 Fields

 

#   Description                         Len   DataType   Table  #Comp

 

1   Accident Date/Time                   26      TS      0       2  

2   Accident Code                        60      CE      50      6  

3   Accident Location                    25      ST      0       1  

4   Auto Accident State                  60      CE      347     6  

5   Accident Job Related Indicator       1       ID      136     1  

6   Accident Death Indicator             12      ID      136     1  

 

ACC-Accident segment - Field Data Types

 

Type: CE - Coded element  (6 components)

Category: Code Values

       Component 1 [ST] identifier

       Component 2 [ST] text

       Component 3 [ST] name of coding system

       Component 4 [ST] alternate identifier

       Component 5 [ST] alternate text

       Component 6 [ST] name of alternate coding system

 

Type: ID - Coded Values (1 component)

Category: Identifier

       Component 1 [ST] Coded value for HL7 Tables

 

Type: ST - String  (1 component)

Category: Alphanumeric

       Component 1 [ST] string data

 

Type: TS - Time stamp  (2 components)

Category: Date/Time

Instructions: 2.8.44  YYYY[MM[DD[HHMM[SS[.S[S[S[S]]]]]]]][+/-ZZZZ] ^ <degree of precision>

       Component 1 [ST] Time stamp data

       Component 2 [ST] degree of precision (optional)

 

 

 

Component Descriptions and HL7 Reports

 

The HL7 data type contains the description which will show up in EasyHL7 segment definition reports. A frequently asked question comes from users who want more specific descriptions to show up in their reports.

 

SCENARIO: In HL7 Version 2.3 the patient name (field 5 of the PID segment) is defined as an XPN data type (see below)

 

Type: XPN - Extended person name  (7 components)

Category: Demographics

Instructions: 2.8.51  replaces the PN data type.  <family name (ST)> ^ <given name (ST)> & <last_name_prefix (ST)> ^ <middle initial or name (ST)> ^ <suffix (e.g., JR or III) (ST)> ^ <prefix (e.g., DR) (ST)> ^ <degree (e.g., MD) (IST)> ^ <name type code>

       Component 1 [ST] family name (last name)

       Component 2 [ST] given name (first name)

       Component 3 [ST] middle initial or name

       Component 4 [ST] suffix (jr, sr, etc)

       Component 5 [ST] prefix (Mr, Mrs, Dr etc)

       Component 6 [ST] degree (MD, PHD etc)

       Component 7 [ID] name type code

 

 

When viewing an HL7 message in the HL7 reports window the PID section would then look like this.

 

PID-Patient identification segment  (30 fields)

 

PID-01: Set ID - PID  (1 component)

       Value: 1

......

......

PID-05: Patient Name  (7 components)

       family name (last name): Eriksson

       given name (first name): Elizabeth

       middle initial or name: M

       suffix (jr, sr, etc):

       prefix (mr, mrs, dr etc):

       degree (md, phd etc):

       name type code:

......

......

PID-30: Patient Death Indicator  (1 component)

       Value:

 

 

If you wanted the individual components to reflect other values (such as 'Patient Last Name', 'Patient First Name' etc) you would NOT edit the XPN data type and change the component descriptions! Remember that the XPN data type is used for MANY HL7 fields, not the patient. In fact it's used for just about every person's name in any HL7 segment (like Doctors, Relatives, Staff Members, Next of Kin etc). So if you changed 'family name (last name)' to 'Patient Last Name' in the XPN data type then yes your report would now look like this:

 

PID-Patient identification segment  (30 fields)

 

PID-01: Set ID - PID  (1 component)

       Value: 1

......

......

PID-05: Patient Name  (7 components)

       Patient Last Name: Eriksson

       given name (first name): Elizabeth

       middle initial or name: M

       suffix (jr, sr, etc):

       prefix (mr, mrs, dr etc):

       degree (md, phd etc):

       name type code:

......

......

PID-30: Patient Death Indicator  (1 component)

       Value:

 

 

BUT so would every other field defined as an XPN data type, like so:

 

GT1-Guarantor segment  (55 fields)

 

GT1-01: Set ID - GT1  (1 component)

       Value: 0001

.....

.....

GT1-03: Guarantor Name  (7 components)

       Patient Last Name: Harris

       given name (first name): Dominic

       middle initial or name: M

       suffix (jr, sr, etc):

       prefix (mr, mrs, dr etc):

       degree (md, phd etc):

       name type code:

GT1-04: Guarantor Spouse Name  (7 components)

       Patient Last Name: Harris

       given name (first name): Julie

       middle initial or name: A

       suffix (jr, sr, etc):

       prefix (mr, mrs, dr etc): Ms

       degree (md, phd etc):

       name type code:

.....

.....

 

The Proper Solution

 

To get the desired result you would CREATE A NEW HL7 data type with the same definition as XPN (called XPN2 or similar) and make the desired changes to that data type, then edit the HL7 Segment definition for the PID segment (see HL7 Segment Elements) and change the data type for the PID field #5 from XPN to XPN2.