Read from HL7 File
The Read from HL7 File stage 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, visit http://www.hl7.org.
HL7 Message Format
Data in an HL7 message is organized hierarchically as follows:
message
segment
field
component
subcomponent
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.
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
- Copy and paste the sample text into a new document using any text editing software.
- Make the required content changes.
- Configure the settings to view EOL (End of Line) on the text. In your text editor, go to .
- Change the EOL (End of Line) Conversion format to
CR
(Carriage Return). In your text editor, go to . - Save the HL7 file after making this format change.
File Properties Tab
Field Name |
Description |
---|---|
Server name | Indicates whether the file you select as input is located on the computer running Spectrum 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 access the file you want. Note: If the Spectrum Technology Platform server is running on 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 |
Character encoding | The text file encoding. For more information, see Character Encodings. |
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 Spectrum Enterprise Designer under ) or for the system (in Spectrum Management Console) will take effect.
|
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 Spectrum Enterprise Designer. For example, consider this custom message schema:
And this data:
In this case the segment Messages that contain elements in unexpected positions are treated as malformed records and the malformed record options specified for the job (in Spectrum Enterprise Designer under ) or for the system (in Spectrum Management Console) take effect.By default all the Ignore unexpected options are enabled to allow as many records as possible to be processed successfully.
|
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 http://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 this table.
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. |