Read from HL7 File

Read from HL7 File reads Health Level Seven (HL7) data from a text file as input to a dataflow. HL7 is a messaging standard used in the healthcare industry to exchange data between systems. For more information about HL7, go to www.hl7.org.

HL7 Message Format

The following is an example of an HL7 message:

MSH|^~\&||.|||199908180016||ADT^A04|ADT.1.1698593|P|2.7
PID|1||000395122||LEVERKUHN^ADRIAN^C||19880517180606|M|||6 66TH AVE NE^^WEIMAR^DL^98052||(157)983-3296|||S||12354768|87654321
NK1|1|TALLIS^THOMAS^C|GRANDFATHER|12914 SPEM ST^^ALIUM^IN^98052|(157)883-6176
NK1|2|WEBERN^ANTON|SON|12 STRASSE MUSIK^^VIENNA^AUS^11212|(123)456-7890
IN1|1|PRE2||LIFE PRUDENT BUYER|PO BOX 23523^WELLINGTON^ON^98111|||19601||||||||THOMAS^JAMES^M|F|||||||||||||||||||ZKA535529776

Data in an HL7 message is organized hierarchically as follows:

Each line of an HL7 message is a segment. A segment is a logical grouping of fields. The first three characters in a segment identify the segment type. In the above message, there are five segments MSH (message header), PID (patient identification), two NK1 (next of kin) segments, and IN1 (insurance).

Each segment consists of fields. A field contains information related to the purpose of the segment, such as the name of the insurance company in the IN1 (insurance) segment. Fields are typically (but not always) delimited by a | character.

Fields can be divided into components. Components are typically indicated by a ^ character. In the above example, the PID (patient identification) segment contains a patient name field containing LEVERKUHN^ADRIAN^C which has three parts, last name (LEVERKUHN), first name (ADRIAN), and middle initial (C). Components can be divided into subcomponents. Subcomponents are typically indicated by a & character.

File Properties Tab

Field Name

Description

Server name

Indicates whether the file you select in the File name field is located on the computer running Enterprise Designer or on the Spectrum™ Technology Platform server. If you select a file on the local computer, the server name will be My Computer. If you select a file on the server the server name will be Spectrum™ Technology Platform.

File name

Specifies the path to the file. Click the ellipses button (...) to browse to the file you want.

Note: If the Spectrum™ Technology Platform server is running on Unix or Linux, remember that file names and paths on these platforms are case sensitive.

HL7 Version

The version of the HL7 standard used in the file you specified. For example, "2.7" means that the file uses HL7 version 2.7. The HL7 version is indicated by the 12th field in the MSH segment.

Character encoding

The text file's encoding. One of the following:

UTF-8
Supports all Unicode characters and is backwards-compatible with ASCII. For more information on UTF, see unicode.org/faq/utf_bom.html.
UTF-16
Supports all Unicode characters but is not backwards-compatible with ASCII. For more information on UTF, see unicode.org/faq/utf_bom.html.
US-ASCII
A character encoding based on the order of the English alphabet.
UTF-16BE
UTF-16 encoding with big endian byte serialization (most significant byte first).
UTF-16LE
UTF-16 encoding with little endian byte serialization (least significant byte first).
ISO-8859-1
An ASCII-based character encoding typically used for Western European languages. Also known as Latin-1.
ISO-8859-3
An ASCII-based character encoding typically used for Southern European languages. Also known as Latin-3.
ISO-8859-9
An ASCII-based character encoding typically used for Turkish language. Also known as Latin-5.
CP850
An ASCII code page used to write Western European languages.
CP500
An EBCDIC code page used to write Western European languages.
Shift_JIS
A character encoding for the Japanese language.

Validate

These options specify whether to check the file to ensure that it conforms to the HL7 2.7 standard. If any message in the file fails validation, it is treated as a malformed record and the malformed record options specified for the job (in Enterprise Designer under Edit > Job Options) or for the system (in Management Console) will take effect.

Required fields
Check this box if you want to make sure that each segment, field, component, and subcomponent contains the elements that are required by the HL7 2.7 standard.
Length
Check this box if you want to make sure that each element meets the minimum and maximum length requirements for the element as defined in the HL7 2.7 standard.

Ignore unexpected

Select these options if you want to allow messages to contain segments, fields, components, and subcomponents that are not in the expected position. The expected positions are defined in the HL7 standard or, in the case of custom message types, in the HL7 Schema Management tool in Enterprise Designer.

For example, consider the following custom message schema:

MSH
[PID]
{ZSS}
PV1
NK1
{[DG1]}

And this data:

MSH|^~\&|Pharm|GenHosp|CIS|GenHosp|198807050000||RAS^O17|RAS1234|P|2.7
ZSS|100|abc
PID|1234||PATID1234^5^M11^ADT1^MR^GOOD HEALTH HOSPITAL~123456789^^^USSSA^SS|
PV1||O|O/R||||0148^ADDISON,JAMES|0148^ADDISON,JAMES
NK1|Son|John

In this case the segment PID is unexpected because it is before the ZSS segment.

Messages that contain elements in unexpected positions are treated as malformed records and the malformed record options specified for the job (in Enterprise Designer under Edit > Job Options) or for the system (in Management Console) take effect.

By default all the Ignore unexpected options are enabled to allow as many records as possible to be processed successfully.

Segments
Check this box to allow messages to contain segments that are not defined in the HL7 2.7 standard. Unexpected segments are ignored and other segments in the message are processed.
Fields
Check this box to allow segments to contain fields that are not defined in the HL7 2.7 standard. Unexpected fields are ignored and other fields in the segment are processed.
Components
Check this box to allow fields to contain components that are not defined in the HL7 2.7 standard. Unexpected components are ignored and other components in the field are processed.
Subcomponents
Check this box to allow components to contain subcomponents that are not defined in the HL7 2.7 standard. Unexpected subcomponents in the component are ignored and other subcomponents are processed.

Fields Tab

The Fields tab displays the segments, fields, components, and subcomponents. Use the Fields tab to select the data you want to read into the dataflow.

Segment groups, which are collections of segments that are used together to contain a category of data, are displayed using a numbering system that shows where in the message schema the group appears. Each segment group is given a label "Group_n" where "n" is a number that corresponds to the group's position in the message schema. To illustrate how the number system works, consider this example:



This example shows the field list for the message RAS^017. This message has two segment groups: RAS_017_Group_1 and RAS_017_Group_2. The "Group_1" segment group refers to the first segment group in the RAS^017 schema and the second group, "Group_2", refers to the second group listed in the RAS^017 schema.

To determine which segment group is represented by "Group_1" and "Group_2", find the description of the message RAS^017 in the document HL7 Version 2.7 Standard. You can download a copy of this document from www.hl7.org.

In the description of the message, find the first group, which in the case of RAS^017 is the PATIENT group. The second group in the schema is the ORDER group.

Segment groups that are nested under a segment group have an additional number appended to their group number. For example, Group_21 represents the first group nested under the second group. Further subgroups have additional numbers appended to them, such as Group_221, which for message RAS^017 represents the segment group ORDER_DETAIL_SUPPLEMENT. An example of nested groups is shown here:



The controls on the Fields tab are described in the following table.

Table 1. Fields Tab

Option Name

Description

Regenerate

Click this button to populate the Fields tab with a list of all segments, fields, components, and subcomponents for the message type contained in the input file. All elements for the message type are displayed based on the HL7 schema regardless of whether the input file contains all the elements. For example, if the file contains an RAS message, the schema for the entire RAS message type will be displayed regardless of whether the input file actually contains data for all the segments, fields, components, and subcomponents.

If you have defined any custom elements using the HL7 Schema Management tool in Enterprise Designer, those elements are also listed.

Expand All

Expands all elements in the fields tab so you can view all segments, fields, components, and subcomponents of the message types contained in the file.

Collapse All

Closes all nodes in the view so that only the segments are displayed. Use this to easily see the segments for the message types in the file. You can then expand individual segments in order to view the fields, components, and subcomponents in a segment.

Select all

Check this box to create dataflow fields for all segments, fields, components, and subcomponents for all message types included in the file.