Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack Overflow exception while parsing Hl7 message using NHapi V28 model #109

Closed
swapnilspande27 opened this issue Jan 28, 2019 · 1 comment · Fixed by #136
Closed

Stack Overflow exception while parsing Hl7 message using NHapi V28 model #109

swapnilspande27 opened this issue Jan 28, 2019 · 1 comment · Fixed by #136
Assignees
Labels
bug The result of a coding Error duplicate
Milestone

Comments

@swapnilspande27
Copy link

Hi,
I was trying to import HL7 message using Nhapi v28 based dlls but i was getting error while trying to access PID segment fields such as Address (XAD datatype) and telephone numbers (XTN datatype). I did debug the Nhapi v28 model code that is available on github and compared it with V25 code which was working fine and found some difference in the way constructors of type XAD and XTN are built.
XTN.cs file has constructor which initiliazes properties required for accessing the telephone number. See below property
data[0] = new XTN(message,"Telephone Number");
i'm guessing this was causing the stack overflow exception while trying to parse telephone number from HL7 message as above statement itself calling constructor of XTN repetitively. IN V25 it was

data[0] = new ST(message,"Telephone Number");

because of which it was working without any issue. Same is the case with XAD.cs which has below field in it's constructor
data[11] = new XAD(message,"Address Validity Range"); causing stackoverflow exception
as compared to XAD.cs of V25

   data[11] = new DR(message,"Address Validity Range");

Is this the know issue or i'm missing something here?
Could anyone please help me in this case?

Thanks.

@milkshakeuk milkshakeuk added this to the v3.0.0.0 milestone Jan 28, 2021
@milkshakeuk milkshakeuk added the bug The result of a coding Error label Jan 28, 2021
@milkshakeuk milkshakeuk self-assigned this Jan 28, 2021
@milkshakeuk
Copy link
Member

milkshakeuk commented Jan 28, 2021

@swapnilspande27 I have replicated this, it's caused my infinite recursion in some of the data types it also effects hl7 versions 2.7 and above.

Duplicate of #86.

milkshakeuk added a commit that referenced this issue Jan 30, 2021
The datatype for OBX-5 is specified in OBX-2, the first commit fixes an issue when the specified datatype from OBX-2 could not be constructed for OBX-5 because the required constructors were missing.
fixes #62, fixes #85, fixes #133

XAD, XON, XTN datatypes for hl7 v2.7.1 up to 2.8.1 have incorrect recursive datatypes leading to StackOverflowException.
The second commit fixes this by correcting those datatypes.
fixes #86, fixes #109

The OBX-5 datatype for hl7 v2.1 is incorrectly set to ST when it should be Varies. The last commit fixes this.
fixes #45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The result of a coding Error duplicate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants