crs4 / hl7apy

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

2.6 segments bug #114

Closed cschwerdtner closed 6 months ago

cschwerdtner commented 7 months ago

with v2.6 I use this assignment:

hl7Version = "2.6"
m = Message("ADT_A01", version=hl7Version, validation_level=VALIDATION_LEVEL.TOLERANT)
m.in1.in1_49 = pat.PA_VERSNR

But the value is written into Field 46 and not 49. I checked it and found that in v2.6 the segments.py is missing some lines:

('IN1_36', FIELDS['IN1_36'], (0, 1), 'FIE'),
('IN1_37', FIELDS['IN1_37'], (0, 1), 'FIE'),
('IN1_39', FIELDS['IN1_39'], (0, 1), 'FIE'),
('IN1_42', FIELDS['IN1_42'], (0, 1), 'FIE'),
('IN1_43', FIELDS['IN1_43'], (0, 1), 'FIE'),
('IN1_44', FIELDS['IN1_44'], (0, -1), 'FIE'),

3 lines are missing, so field 49 is written to field 46 when using hl7_message = m.to_mllp()

svituz commented 6 months ago

Hi thanks, you're right. I fixed this in develop branch. I'll work on a release and it will be included