-
Notifications
You must be signed in to change notification settings - Fork 155
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
HL7 2.1 Fails to parse ORU^R01 ORC segment #84
Comments
@jsdratm Did you ever find a solution to get nHapi to parse your message? |
There's a number of validation errors on that message e.g. MSH|^~&|LCS|LCA|LI... I suspect that's just a copy and paste error in to github comment requires backslash to be escaped. There are other fields missing, for example mandatory dates in the OBR segment and CE datatype Ensure that's resolved first try installing Hapi test panel and ensure hl7 is well formatted |
@slartibartfast3000 Thanks for the tip, interestingly enough, the messages works fine in hapi test panel, but errors out with this same error in nHapi |
- This small patch fixes errors thrown in nHapiNET#63 as well as nHapiNET#84 Applying these fixes as per inbound HIE data found in a real use case. - taken from nHapiNET#108
This was fixed by #136, and is available in the latest preview v3.0.0-preview.2. I wrote a quick test just to make sure [Test]
public void Test()
{
var input =
@"MSH|^~\&|LCS|LCA|LIS|TEST9999|199807311532||ORU^R01|3629|P|2.1
PID|2|2161348462|20809880170|1614614|20809880170^TESTPAT||19760924|M|||^^^^00000-0000|||||||86427531^^^03|SSN# HERE
ORC|NW|8642753100012^LIS|20809880170^LCS||||||19980727000000|||HAVILAND
OBR|1|8642753100012^LIS|20809880170^LCS|008342^UPPER RESPIRATORY CULTURE^L|||19980727175800||||||SS#634748641 CH14885 SRC:THROA SRC:PENI|19980727000000||||||20809880170||19980730041800||BN|F
OBX|1|ST|008342^UPPER RESPIRATORY CULTURE^L||FINALREPORT|||||N|F||| 19980729160500|BN
ORC|NW|8642753100012^LIS|20809880170^LCS||||||19980727000000|||HAVILAND
OBR|2|8642753100012^LIS|20809880170^LCS|997602^.^L|||19980727175800||||G|||19980727000000||||||20809880170||19980730041800|||F|997602|||008342
OBX|2|CE|997231^RESULT 1^L||M415|||||N|F|||19980729160500|BN
NTE|1|L|MORAXELLA (BRANHAMELLA) CATARRHALIS
NTE|2|L| HEAVY GROWTH
NTE|3|L| BETA LACTAMASE POSITIVE
OBX|3|CE|997232^RESULT 2^L||MR105|||||N|F|||19980729160500|BN
NTE|1|L|ROUTINE RESPIRATORY FLORA";
var parser = new PipeParser();
var message = parser.Parse(input);
var oru = (ORU_R01)message;
var placerorder = oru.GetPATIENT_RESULT().GetORDER_OBSERVATION().ORC.PLACERORDER;
var orc2Rep0 = ((GenericPrimitive)((Varies)placerorder.Components.GetValue(0)).Data).Value;
Assert.AreEqual("8642753100012", orc2Rep0);
} |
Error: Can't instantiate class NHapi.Model.V21.Datatype.CM
(System.NullReferenceException): Object reference not set to an instance of an object.: Segment: ORC (rep 0) Field #2
Message:
The text was updated successfully, but these errors were encountered: