NHAPI C# 3.5 parsing orm_001 2.3

735 views Asked by At

I am having trouble putting a structure on this message. It is an order message. When it casts it stays null so orm001 is always null. I used some other hl7 types and it went in ok. I and thinking it may be the OBR line but it still does the same thing when we take it out.

 static void Main(string[] args)
    {
        string message =
        @"MSH|^~\&|lab1|WEDGE|Lab2|1|20180910045317||ORM^O01|20180910045317|P|2.3
PID|1|WEDGE-15453|WEDGE-15453||Wolfe^Test^K||19560801|F|||122 
futh^^Rogersville^MO^65742||(417) 444-4444~|||||||||U
PV1||N|||||1326334459^SUPPORO^OSAKAE^^^^M.D
IN1|1||NULL|Medicare B|^^^^|||||||||||^||||||||||||||||||||2151584A
IN1|2||NULL|AARP Medicare Supplement Plan 
F|^^^^|||||||||||^||||||||||||||||||||1234564-22
GT1|1||^||^^^^|
ORC|NW|0698892|||||1||20180910
OBR|1|1271|0698892|CLIN^CYP1A2, CYP2B6, CYP2C9, CYP2C19, CYP2D6, CYP3A4, 
CYP3A5,  DRD2/ANKK1, APOE, COMT, Factor II, Factor V Leiden, MTHFR, OPRM1,  
SLCO1B1, VKORC1^^CLIN^CYP1A2, CYP2B6, CYP2C9, CYP2C19, CYP2D6, CYP3A4, 
CYP3A5,  DRD2/ANKK1, APOE, COMT, Factor II, Factor V Leiden, MTHFR, OPRM1,  
SLCO1B1, VKORC1|||20180910||||||||4N6FLOQ||||||||||||1
DG1|1||F90.2^Attention-deficit hyperactivity disorder, combined type|||W
DG1|2||Z13.79^Encounter for other screening for genetic and chromosomal 
anomalies|||W
OBX|1|TX|Drug^Drug Information||00002751001^Humalog Vial 100u/Ml||||||X";
        // Get a new instance of the PipeParser to parse this piped message
        PipeParser parser = new PipeParser();
        // Parsing it will return an abstract message
        IMessage m = parser.Parse(message);
        // Cast the abstract message to the right type
        // Other examples will show how to determine the type
        // of message if this is unknown
        ORM_O01 orm001 = m as ORM_O01;
        // Output one of the field values to the console
        Console.WriteLine(orm001.Message);
        Console.ReadLine();

        }
    }
1

There are 1 answers

0
sqlab On BEST ANSWER

In ORM_O01 repetition of IN1 is not allowed, OBR is not allowed