nHapiNET / nHapi

nHapi is the .Net port of the original Java project HAPI.
Mozilla Public License 2.0
277 stars 156 forks source link

Cannot get ODS segment using terser, when I write a full path #319

Closed zigh-code closed 2 years ago

zigh-code commented 2 years ago

Describe the bug

Cannot get ODS segments in ORDER_DIET group using terser, when I write a full path

Screenshots image

Sample HL7 /.ORDER_DIET(0)/DIET/ODS(0)-1

milkshakeuk commented 2 years ago

@zigh-code do you could you provide some more information? sample hl7, hl7v2 version, perhaps even a unit test or code example?

zigh-code commented 2 years ago

I'm using the last version of the package. The version of Hl7 in my case is 2.5 (string data),

image If I try for the TQ1 segment, it work

image But when I try with ODS, there is an issue

Data Test:

 string omdText = "MSH|^~\\&|EDITE|TEST|TEST|TEST|20210519141200||OMD^O03^OMD_O03|202105191412001|P|2.5|||||FRA|8859/1\r" +
        "PID|1|465 306 5961||407623|Wood^Patrick^^^MR||19700101|1|||High Street^^Oxford^^Ox1 4DP~George St ^^Oxford^^Ox1 5AP|||||||\r" +
        "ORC|NW|1254481^EDITEUR|||||^^^20210519143000||20210519143000|611014333^PRESCRIPTEUR^TEST1^^^^^^EDITEUR^^^^ADELI~10002129790^PRESCRIPTEUR^TEST1 ^^^^^^EDITEUR ^^^^RPPS~1027^PRESCRIPTEUR^TEST1^^^^^^EDITEUR^^^^EI||||||||||||||||||||\r" +
        "TQ1|1||||||20210519143000|\r" +
        "ODS|R||SANSSEL^Sans sel^EDITEUR|";
milkshakeuk commented 2 years ago

@zigh-code thanks for the extra info, will take a look when I can.

milkshakeuk commented 2 years ago

@zigh-code sorry for the long delay in getting back to you, I think I found the issue, its related to how java and dotnet use regex slightly differently so basically a bug in the port.

I will hopefully have a PR for this in the coming days.

milkshakeuk commented 2 years ago

@zigh-code I have put up a PR to fix this and included a unit test to prove it works. https://github.com/nHapiNET/nHapi/pull/340/files#diff-df1d6e800460c0e8224b40b0c6417ef59b0ab102f231d72a4f38e635921cbe4aR239 is the fix

milkshakeuk commented 2 years ago

@zigh-code this fix will go out in the next release, hoping to get a few more changes in first though

milkshakeuk commented 1 year ago

@zigh-code this change is in the latest 3.2.0 version.