ADT^A31 v2.5 message gets parsed as ADT^A05 v2.5 #598
-
Describe the bug To Reproduce Expected behaviour Sample HL7
Environmental Details (please complete the following information):
Additional context
|
Beta Was this translation helpful? Give feedback.
Replies: 12 comments 1 reply
-
I've downloaded the sources to investigate this, and it's the NameValueCollection.Get() method that returns ADT_A05 even though ADT_A31 is in that collection of keys: |
Beta Was this translation helpful? Give feedback.
-
I've created a fork to investigate this issue: https://github.com/eloekset/nHapi/tree/feature/issue-597-investigate-parsing I had to upgrade .NET and various packages to be able to run tests in VS2022, so I did that in a separate commit before adding the unit test used to debug as shown in the screenshot above. |
Beta Was this translation helpful? Give feedback.
-
For some reason the NHapi.Model.V25 assembly has a mapping from ADT_A31 to ADT_A05. |
Beta Was this translation helpful? Give feedback.
-
@eloekset hello, thanks for raising an issue, have you read the wiki page about event mapping? The reason why is because this is how the Java hapi library works of which this is a port, they have a Faq with a question covering this here. the event mapping for 2.5 maps A31 to A05 accoring to the map Please let me know if I have missunderstood. |
Beta Was this translation helpful? Give feedback.
-
also you fork seems to be 135 commits behind the current nhapi master branch |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
there is a section in the wiki which explains how this can be done There is also a unit test showing this in action: |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
I created a new branch instead of rebasing, since the NUnit stuff was already updated for VS2022. I've pushed my latest attempt here: https://github.com/eloekset/nHapi/tree/feature/issue-597-investigate-parsing-2
|
Beta Was this translation helpful? Give feedback.
-
the |
Beta Was this translation helpful? Give feedback.
-
did you see this bit in the wiki when parsing? var parser = new PipeParser();
var parsed = parser.Parse(message, "2.2.CustomZ"); Notice the second argument, it tells the parser to use the custom version when parsing. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the help @milkshakeuk! |
Beta Was this translation helpful? Give feedback.
did you see this bit in the wiki when parsing?
Notice the second argument, it tells the parser to use the custom version when parsing.