crs4 / hl7apy

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

v2.3 NK1 Attribute Definitions - Incorrect Repeating Attributes? #116

Closed techboss closed 3 weeks ago

techboss commented 4 months ago

I was reviewing the attribute cardinality definitions against the HL7 spec and came across this which has me scratching my head. The definition of Marital Status appears to say that Marital Status is repeating (If I understand the parser) but the spec says it isn't. I looked at the 2.3.1 definition in the code and it has been changed to cardinality 1.

Can anyone confirm this is an issue and that I'm not misinterpreting how the parser works?

If it is an issue, there are other attributes in the NK1 definition that are also improperly defined with respect to them being repeating.

'NK1': ('sequence',
        (...
         ('NK1_14', FIELDS['NK1_14'], (0, **-1**), 'FIE'),
jgarciaroca commented 1 month ago

Are you checking the correct file? 2.3.1 in hl7apy states 0, 1: https://github.com/crs4/hl7apy/blob/b7d85a3a0a68c1731854bd11b44ad2c712b5563e/hl7apy/v2_3_1/segments.py#L778

jgarciaroca commented 1 month ago

2.3: 0, -1: https://github.com/crs4/hl7apy/blob/b7d85a3a0a68c1731854bd11b44ad2c712b5563e/hl7apy/v2_3/segments.py#L774

Both cases hl7apy definition matches the standard

svituz commented 3 weeks ago

Hi @techboss, I think you're right. There is a discrepancy between the spec and XSD that we used to generate the structures. In the XSD it is unbounded so we converted it to -1. I changed it in develop branch