Fix for issue: StringIndexOutOfBoundsException is thrown while converting NTE segments with additional dash #512
In HL7ToFHIRConverter class, Method 'getHl7Message' has code for logging HL7 message structure. In order to optimize the content. It takes subset of each line based on first occurrence of "-" and 5 chars more. Issue occurs when there are multiple repeating segments like NTE and HL7Message.printStructure does not follow {Segment} - start prefix on these repeating segments. and these sgement has "-" in content.
For now added fail-safe check if indexof Dash + 5 chars is more then length of line then take line length as input.
Fix for issue: StringIndexOutOfBoundsException is thrown while converting NTE segments with additional dash #512
In HL7ToFHIRConverter class, Method 'getHl7Message' has code for logging HL7 message structure. In order to optimize the content. It takes subset of each line based on first occurrence of "-" and 5 chars more. Issue occurs when there are multiple repeating segments like NTE and HL7Message.printStructure does not follow {Segment} - start prefix on these repeating segments. and these sgement has "-" in content.
For now added fail-safe check if indexof Dash + 5 chars is more then length of line then take line length as input.