crs4 / hl7apy

Python library to parse, create and handle HL7 v2 messages.
http://crs4.github.io/hl7apy/
MIT License
231 stars 91 forks source link

HL7 ACK messages cannot be parsed #51

Closed sloria closed 5 years ago

sloria commented 5 years ago
from hl7apy.parser import parse_message

ack = """MSH|^~\&|LABADT|DH|EPICADT|DH|201301011228||ACK^A01^ACK |HL7ACK00001|P|2.3
MSA|AA|HL7MSG00001"""

parse_message(ack)

check_version raises an error

UnsupportedVersion: The version 2.3
MSA is not supported

It looks like the version is not being parsed correctly: version is 2.3\nMSA in hl7apy.check_version.

sloria commented 5 years ago

I think I was misunderstanding the ACK format. The MSA is a separate segment that is not part of the MSH, so it needs to be parsed separately. Sorry for the noise!