Adding Z-Segments to HL7 Mapping Components
When mapping HL7 EDI components, it is often necessary to add locally-defined information, or z-segments, to accommodate additional fields not included in the standard. Following is a simple walkthrough that will demonstrate how to add z-segments to the HL7 configuration files that are available as a free download with MapForce.
In the example below we will be adding a ZLR segment to an HL7 2.3 Observation Results Unsolicited (ORU) message. The ZLR segment is commonly used for adding additional information for legacy laboratory-based reporting.
ZLR attributes are provided below:
|SEQ||LENGTH||OPT||DATA TYPE||ELEMENT NAME|
|1||106||true||XAD||Ordering Provider's Address|
|2||90||true||XON||Ordering Facility Name|
|3||106||true||XAD||Ordering Facility Address|
|4||40||true||XTN||Ordering Facility Phone|
|6||40||true||XPN||Next of Kin/Associated Party Name|
|7||40||true||CE||Next of Kin/Associated Party Relationship|
|8||106||true||XAD||Next of Kin/Associated Party Address|
|9||40||true||XTN||Next of Kin/Associated Party Phone|
The ZLR segment must follow each OBR (Observation Request) segment, and there can only be one ZLR per OBR.
- 1. Go to C:\Program Files\Altova\MapForce2009\MapForceEDI\HL7.v230 to access the MapForce configuration files for HL7 version 2.3.
- 2. First, create a new file to contain any user-defined z-segments that your implementation might require. We'll call this file User.Segment and populate it as shown below.*
- 3. Save this file as User.Segment.*
- 4. Now locate the HL7 message in question, ORU_R01, and open it in XMLSpy - or any text editor.
Add <Include href="User.Segment"/> to the top - to let the processor know to include the new data that we created in User.Segment.*
- 5. Save this file as ORU_R01_ZLR (or any unique name you choose).*
- 6. Next, simply add a reference to the ZLR segment just below OBR in the same file so that MapForce knows where to place this information in the UI mapping component.*
- 7. Now open the EDI collection file and add the new message to the list.*
- 8. Finally, let's access our newly customized HL7 EDI mapping component in MapForce. Open MapForce and choose Insert > EDI. In the Browse EDI collections dialog, select HL7.v230 and scroll down to select ORU_R01.
Press OK to insert.
- 9. Your new mapping component will appear in the MapForce design pane with the new ZLR segment included.
Now you can complete your data integration design by inserting another source or target data structure(s) and dragging lines to connect nodes. MapForce supports mapping to/from XML, databases, flat files, EDI, XBRL, and Web services.
* If you are working in XP, you will have to unclick "read-only" in the Properties dialog. Vista users will need to copy the file to another location before editing - you can then copy the file back to the appropriate HL7 collection directory.