Creating multiple Record Map Records from a single HL7 message
So I have an interesting problem. I am going to be using a process and rule to determine if an HL7 message qualifies to be sent out, then using a record map to write certain aspects of that HL7 message to disk (with an HL7 to record map DTL). This is simple enough but the recipient of this file is requiring a single record map entry per DG1 segment in the HL7 message.
For instance if said HL7 message for PATIENT^TEST has 3 DG1 segments, I would need to write three lines (or records) like so:
123^^^^MR|TEST|PATIENT|DG1(1) TEXT|DG1(1) CODE|DG1(1) DATE
123^^^^MR|TEST|PATIENT|DG1(2) TEXT|DG1(2) CODE|DG1(2) DATE
123^^^^MR|TEST|PATIENT|DG1(3) TEXT|DG1(3) CODE|DG1(3) DATE
Is there a way to do this? I know I can make repeating fields in the record map and can loop over repeating fields/segments in a DTL but I am not sure how to write multiple lines using one incoming message