Closed omarserenity closed 1 year ago
In Message.cs, method public bool HasRepetitions(string strValueFormat)
(line 448), there is a call to this.getField(segment, allComponents[1]);
In Message.cs, method private Field getField(Segment segment, string index)
, it will never return all repetitions of a field, if it has repetitions (line 703-704):
if (field.HasRepetitions)
return field.RepetitionList[repetition];
Thus, when control returns to Message.cs, HasRepetitions, line 448, var field now contains just the first repetition, so when it checks field.HasRepetitions on line 450, there is no repetition character in the field, so HasRepetitions incorrectly returns false.
In contrast, calling
hl7.Segments("PID")[0].Fields(3).HasRepetitions;
returns all repetitions of the field in hl7.Segments("PID")[0].Fields(3)
, so the field returned contains the repetition character and so HasRepetitions correctly returns True.
Hi, thanks for reviewing. Can you post a Pull Request?
This is solved in the last commit, nuget version 2.34
Example Message:
Example Code: