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

PV1-41 fields and following are generated into wrong field (one field offset) (v2.7) #93

Closed sebastiankahlsh closed 3 years ago

sebastiankahlsh commented 3 years ago

Code snippet: elif field_no == 41 and minor_version >= 7: field = group.pv1.addfield('pv1' + str(field_no)) group.pv1.pv1_41.pv1_41_16 = "19061209132144+0100" group.pv1.pv1_41.pv1_41_19 = "19071209132144+0100" group.pv1.pv1_41.pv1_41_22 = "19071209132144+0100" Comes out to be in PV1-40: PV1|1|B||||||||||||P|||||||||||||||||||||||||^^^^^^^^^^^^^^^19061209132144+0100^^^19071209132144+0100^^PV1-^19071209132144+0100|

svituz commented 3 years ago

Hi @sebastiankahlsh, you're right, there was a problem with the structure of PV1 segment in versions from 2.7. I fixed it in the develop branch so if you want you can use that until we release a new version