Written by

Question Mark OReilly · Feb 4, 2025

How to use DTL remove property for a repeating segment in for each loop for target using copy

When removing a segment in DTL for hl7 using foreach the segment doesn't actually get removed and leaves a blank segment. 

i.e. 

MSH|^~\&|SendingSystem|ReceivingSystem|202301241000||ADT^A01|12345|P|2.4
EVN|S|202301241000
PID|1|MRN12345|1^^^^KEEP~2^^^^Remove~3^^^^Keep|M|19800101|  
PD1|PatientAddress^Street^City^State^Zip
PV1|I|INPATIENT|BED123|DoctorID|202301241000|202301241000

This blank segment to be removed

I read the notes and thought it might be about swizzling at https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cl… but it wasn't an example i could understand. 

Product version: IRIS 2024.3

Comments

Jeffrey Drumm · Feb 4, 2025

Another way is to clear the target field, then copy over only the repeating values you want to keep:

The desired result:

Note that the trailing parentheses were removed from the field name in the clear rule. If you don't do that, it clears the individual repetitions but leaves the delimiters in place.

0