Here is my code:
from hl7apy.parser import parse_message
hl7 = open("hl7.txt", "r").read()
msg = parse_message(hl7)
print(msg.children)
result:
[<Segment MSH>]
It shows only the first segment, seems simple but I don't know what i'm doing wrong.
I've tried from a text file, passing the message directly or even with another HL7 message, but always got same results.
Here is the message:
MSH|^~\&|SendingAPP|TEST|||20080617143943||ORU^R01|1|P|2.3.1||||||UNICODE
PID|1||7393670^^^^MR||Joan^JIang||19900804000000|Female
PV1|1||nk^^001
OBR|1||20071207011|00001^Automated Count^99MRC||20080508140600|20080508150616|||John||||20080508150000||||||||||HM||||||||TEST
Here is my message in notepad++ where all characters are shown: 
from How to parse an HL7 message using python HL7Apy?
No comments:
Post a Comment