EDIFACT to HL7 Debatching in Rule or DTL
I am receiving batched results in an EDIFACT file. I need to debatch and send individual HL7 out. I have built a DTL to read the first instance of a result from EDIFACT and that generates an ORU^R01 as desired, but I have no idea how to make the DTL loop and send multiple HL7 messages outbound.
I did go down the path of stripping the first instance of a result from the EDIFACT, then sending the now truncated EDIFACT data back to itself. This works well in theory but I then need a while loop in the Rule Editor, and I cannot seem to access the source.RawContent property of the virtual doc in the rule condition...which would allow me to search (string matching) on whether there is another result message to parse and transform to HL7.
Here is the pseudo rule, which hopefully shows what I am trying to achieve. Any thoughts welcomed.