iNTERFACEWARE Products Manual > Installing and Using Chameleon > Using Python Scripting > Python Scripting Examples > Message Manipulation > Concatenating a Lab Report |
|
Looking for Iguana v.5 or v.6? Learn More or see the Help Center.
One common editing operation is to take a lab result message where all the lines are displayed in separate OBX segments, and then concatenate them together into an easy-to-read report. The following message provides you with an example of this problem:
Each OBX segment has one line of the report that you would like to treat as a single report. By using Python, you can concatenate them all together and map the result into a single column. To hold the report data you must define a Python variable called LabText in the Global Inbound Script window:
Then for field 5 of the OBX segment, you use the following piece of Python code:
Finally we have a LabResult table which has one field called LabResult. In the incoming script for this field, you assign the value of the column to the LabText variable:
You can test out this functionality yourself by:
|