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.png)
.png)
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.
Comments
Hi,
I think that this QA should resolve your problem Remove delimiters which hold not present values in a HL7 message, using a.
Another way is to clear the target field, then copy over only the repeating values you want to keep:
.png)
The desired result:.png)
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.