Concatenating Arbitrary Set of Sub-Components into One Field
Some systems represent HL7 data for lab results using the sub-component separator '^' character to separate each line of a report that is stored in a single field.
The following Python code can be used to deal with this:
value = ''for LineIndex in range(0, field.count_of_subfield()):
value = value + field.subfield(LineIndex).value + '\r\n'
Remember to correctly indent the loop since Python has indentation rules.