iNTERFACEWARE Products Manual > Installing and Using Chameleon > Using Python Scripting > Chameleon Python API > Field Object > Field Object Usage Examples > Concatenating Fields |
|
Looking for Iguana v.5 or v.6? Learn More or see the Help Center.
For an example of how concatenating fields can be useful, consider a problem often encountered in the PACS industry, which is converting an HL7 name to a DICOM name. In DICOM, a patient name is typically defined as one field delimited with ^ characters:
In HL7, this is an XPN composite. To map a name into a single table entry, create the following segment inbound script for the field containing the name:
The resulting patient name can then be mapped to a single column of the table. Another common issue that arises in HL7 is dealing with a Date Time field in an illegal format. For example, you might be receiving your date times in HHMM^CCYYMMDD format:
To convert this date time to the legal CCYYMMDDHHMM format, create the following segment inbound script for the field containing the illegal date time:
Here, the first subfield contains the HHMM component of the date time, and the second subfield contains the CCYYMMDD component. In this script, the two subfields of the field are concatenated in reverse order, and the resulting string is assigned to value, which represents the first subfield of the field. value now contains the date time in CCYYMMDDHHMM format. You can use Chameleon's Message Grammar window to map this updated field from the segment to your data table. |