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

HL7 2.1 Fails to Parse ORM^O01 ORC segment #81

Closed
jsdratm opened this issue Apr 27, 2017 · 2 comments · Fixed by #136
Closed

HL7 2.1 Fails to Parse ORM^O01 ORC segment #81

jsdratm opened this issue Apr 27, 2017 · 2 comments · Fixed by #136
Labels
bug The result of a coding Error

Comments

@jsdratm
Copy link

jsdratm commented Apr 27, 2017

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

Test Message:
MSH|^~&|HIS|MedCenter|LIS|MedCenter|20060307110114||ORM^O01|MSGID20060307110114|P|2.1
PID|||12001||Jones^John^^^Mr.||19670824|M|||123 West St.^^Denver^CO^80020^USA|||||||
PV1||O|OP^PAREG^||||2342^Jones^Bob|||OP|||||||||2|||||||||||||||||||||||||20060307110111|
ORC|NW|20060307110114
OBR|1|20060307110114||003038^Urinalysis^L|||20060307110114

@gberkheiser
Copy link

On my recent projects we used ORC-2 as EI. Have you tried that?

@milkshakeuk milkshakeuk linked a pull request Apr 15, 2021 that will close this issue
@milkshakeuk milkshakeuk added the bug The result of a coding Error label Apr 15, 2021
@milkshakeuk
Copy link
Member

this was fixed as part of #136.

did a quick test.

[Test]
public void Parse_V21_ORM_O01()
{
    var message =
        "MSH|^~\\&|HIS|MedCenter|LIS|MedCenter|20060307110114||ORM^O01|MSGID20060307110114|P|2.1\r"
        + "PID|||12001||Jones^John^^^Mr.||19670824|M|||123 West St.^^Denver^CO^80020^USA|||||||\r"
        + "PV1||O|OP^PAREG^||||2342^Jones^Bob|||OP|||||||||2|||||||||||||||||||||||||20060307110111|\r"
        + "ORC|NW|20060307110114\r"
        + "OBR|1|20060307110114||003038^Urinalysis^L|||20060307110114";

    var parser = new PipeParser();

    var result = parser.Parse(message);

    var ormO01 = result as NHapi.Model.V21.Message.ORM_O01;

    Assert.IsNotNull(ormO01);
    Assert.AreEqual("20060307110114", ((Base.Model.GenericPrimitive)((Base.Model.Varies)ormO01.GetORDER().ORC.PLACERORDER[0]).Data).Value);
}

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants