iNTERFACEWARE Products Manual > Installing and Using Chameleon > Tutorials and Exercises > HL7 to Application > Step 7 - Repeated Segments |
|
Looking for Iguana v.5 or v.6? Learn More or see the Help Center.
This section of the tutorial discusses a commonly encountered problem: suppose that you want to extract data from a segment type that occurs more than once in a message. How do you define the tables and the table mappings in this situation? For instance, look again at the sample message that you have been using throughout this tutorial:
As you can see, this message contains two NK1 (Next of Kin) segments. If you want to extract information about the patient's next of kin, you would probably want to extract it from all such segments. Moreover, the number of such segments may vary from message to message. When you defined the Table Grammar for your message, recall that you specified the data elements you wanted to extract and which HL7 segment field to associate with each element. But if a segment occurs more than once, how will this mapping be applied? The solution to this problem is to define a new table for each segment type that may repeat, and then to specify a mapping from the repeating segment into that table. The table mapping will be applied for each occurrence of the segment - just as, in your previous examples, the table mapping was applied for each occurrence of the message. As an example of how to handle repeated segments, suppose that you want to extract the following information from each NK1 segment in the sample message:
In the following sections, you will take the VMD file that you have previously constructed, and you will modify it to extract this information. To do this, you must:
The following sections of this tutorial describe how to perform these tasks.
|