Question

I guess this is fairly simple but I am struggling with it. I have a text file with multiple HL7 messages. I need to break this file apart and write each message to a separate file. The simplified structure is as follows with a blank line after the second (inbound) message. I have highlighted the message content in bold. Note, however that the messages can finish with a variety of characters

11:37:58:425 ----------------------------------------------------------->>> Outbound >>> MSH|^~\&|CERNERPM||ADT^A08||P|2.3 EVN|A08||||| PID|1||NK1|PV1| ZPD||SED 11:37:58:457 <<< Inbound <<<------------------------------------------------------------ MSH|^~\&|A|CA08

Any assistance would be appreciated!

Was it helpful?

Solution

Use library for HL7. It's easier.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top