Registry Mirror
Skip to content

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

Closed

Description

@jsdratm

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

Activity

  1. gberkheiser commented on Apr 27, 2017

    @gberkheiser

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

  2. linked a pull request that will close this issueVarious Issue fixes #136on Apr 15, 2021
  3. added
    bug
    on Apr 15, 2021
  4. milkshakeuk commented on Apr 15, 2021

    @milkshakeuk
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions