iNTERFACEWARE Products Manual > Installing and Using Chameleon > Using Python Scripting > Python Scripting Examples > String Manipulation > Using an Array To Build a Long String Value |
|
Looking for Iguana v.5 or v.6? Learn More or see the Help Center.
If you are using Python to process large HL7 messages and you need to build a long string value for a table field from the values contained in one or more segments of your message, it is best to use an array to build the string. To use an array to build a string, start by defining a array variable in your Global Inbound script:
Next, add the following Segment Inbound script in every field that you want to append to the string:
This creates a new element of the myArrayVariable array variable. (Recall that the value variable contains the value of a field of a segment.) Finally, in the Table Inbound script for the table field, create your long string value by joining all of the elements of myArrayVariable together:
This efficiently creates the long string value for your table field.
|