Esempio n. 1
0
        public void ParseORRo02ToXml()
        {
            string Message = @"MSH|^~\&|INVISION|DHC|SUNQUEST LAB||200607100719||ORR^O02|ORDR|T|2.3.1|LAB
PID|0001||3017864||HILBERT^MARY||19440823|F||W||||||||40244246
PV1|0001|O|LW||||888883^DOCTOR, UNASSIGNED||||||||||888883|O|000000031540
ORC|NA|00003^00001|F1492|||||||||888883
OBR||00003^00001|F1492|RESPC^CULTURE RESPIRATORY ROUTINE|||||||L|||||||||F1492|||||||^ONCE&ONCE^^200607070600^200607070600^ROUTINE
";

            NHapi.Base.Parser.PipeParser Parser = new NHapi.Base.Parser.PipeParser();

            NHapi.Base.Model.IMessage m = Parser.Parse(Message);

            NHapi.Model.V231.Message.ORR_O02 msg = m as NHapi.Model.V231.Message.ORR_O02;

            NHapi.Base.Parser.XMLParser xmlParser = new NHapi.Base.Parser.DefaultXMLParser();

            string recoveredMessage = xmlParser.Encode(msg);

            Assert.AreNotEqual(string.Empty, recoveredMessage);

            System.Xml.XmlDocument orrDoc = new System.Xml.XmlDocument();
            orrDoc.LoadXml(recoveredMessage);
            Assert.IsNotNull(orrDoc);
        }
Esempio n. 2
0
        public void ParseORMwithOBXToXML()
        {
            string Message = @"MSH|^~\&|INVISION|DHC|SUNQUEST LAB||200606191615||ORM^O01|ORDR|P|2.3.1|LAB
PID|0001||3020956||TRAINONLYPOE^ONE||19770903|F||W||||||||40230443
PV1|0001|I|MICU^W276^01||||045716^ABAZA, MONA M|||MED|||||||045716|F|000000030188
ORC|NW|01444^00001|||||||||||L
OBR||01444^00001||CAI^CALCIUM IONIZED|||200606191614||||L|||||045716^STEELE, ANDREW W|||||||||||00001&UNITS^ONCE&ONCE^000^200606191614^200606191614^ROUTINE
OBX||NM|||999||||||
OBX||NM|||999||||||
OBX||NM|||999||||||";

            NHapi.Base.Parser.PipeParser Parser = new NHapi.Base.Parser.PipeParser();

            NHapi.Base.Model.IMessage m = Parser.Parse(Message);

            NHapi.Model.V231.Message.ORM_O01 msgObj = m as NHapi.Model.V231.Message.ORM_O01;

            Assert.IsNotNull(msgObj);

            NHapi.Base.Parser.XMLParser xmlParser = new NHapi.Base.Parser.DefaultXMLParser();

            string recoveredMessage = xmlParser.Encode(msgObj);

            Assert.IsNotNull(recoveredMessage);
            Assert.IsFalse(string.Empty.Equals(recoveredMessage));
        }
Esempio n. 3
0
        public void ParseORMo01ToXml()
        {
            string Message = @"MSH|^~\&|INVISION|DHC|SUNQUEST LAB||200606191615||ORM^O01|ORDR|P|2.3.1|LAB
PID|0001||3020956||TRAINONLYPOE^ONE||19770903|F||W||||||||40230443
PV1|0001|I|MICU^W276^01||||045716^ABAZA, MONA M|||MED|||||||045716|F|000000030188
ORC|NW|01444^00001|||||||||||L
OBR||01444^00001||CAI^CALCIUM IONIZED|||200606191614||||L|||||045716^STEELE, ANDREW W|||||||||||00001&UNITS^ONCE&ONCE^000^200606191614^200606191614^ROUTINE
";

            NHapi.Base.Parser.PipeParser Parser = new NHapi.Base.Parser.PipeParser();

            NHapi.Base.Model.IMessage m = Parser.Parse(Message);

            NHapi.Model.V231.Message.ORM_O01 ormo01 = m as NHapi.Model.V231.Message.ORM_O01;

            NHapi.Base.Parser.XMLParser xmlParser = new NHapi.Base.Parser.DefaultXMLParser();

            string recoveredMessage = xmlParser.Encode(ormo01);

            Assert.AreNotEqual(string.Empty, recoveredMessage);

            System.Xml.XmlDocument ormDoc = new System.Xml.XmlDocument();
            ormDoc.LoadXml(recoveredMessage);
            Assert.IsNotNull(ormDoc);
        }
Esempio n. 4
0
        public void ParseORFR04ToXmlNoNTE()
        {
            string Message = @"MSH|^~\&|Query Result Locator|Query Facility Name|Query Application Name|ST ELSEWHERE HOSPITAL|20051024074506||ORF^R04|432|P|2.3.1|
MSA|AA|123456789|
QRD|20060228160421|R|I||||10^RD&Records&0126|38923^^^^^^^^&TCH|||
QRF||20050101000000||
PID|||38923^^^ST ELSEWHERE HOSPITAL Medical Record Numbers&              MEDIC              AL RECORD NUMBER&ST ELSEWHERE HOSPITAL^MR^ST ELSEWHERE HOSPITAL||Bombadill^Tom||19450605|M|||1&Main Street^^Littleton^CO^80122||^^^^^303^4376329^22|
OBR|1|0015566|DH2211223|83036^HEMOGLOBIN A1C^^83036^HEMOGLOBIN A1C|||20040526094000|||||||20040526094000||J12345^JENS^JENNY^^^DR^MD^^^^^^^112233&TCH|||||          TP QUEST DIAGNOSTICS-TAMPA 4225 E. FOWLER AVE TAMPA          FL 33617|20030622070400|||F|
OBX|1|NM|50026400^HEMOGLOBIN A1C^^50026400^HEMOGLOBIN A1C||12|^% TOTAL HGB|4.0 - 6.0|H|||F|||20040510094000|TP^^L|";

            NHapi.Base.Parser.PipeParser Parser = new NHapi.Base.Parser.PipeParser();

            NHapi.Base.Model.IMessage m = Parser.Parse(Message);

            NHapi.Model.V231.Message.ORF_R04 orfR04 = m as NHapi.Model.V231.Message.ORF_R04;

            Assert.IsNotNull(orfR04);

            NHapi.Base.Parser.XMLParser xmlParser = new NHapi.Base.Parser.DefaultXMLParser();

            string recoveredMessage = xmlParser.Encode(orfR04);

            Assert.IsNotNull(recoveredMessage);
            Assert.IsFalse(recoveredMessage.IndexOf("NTE") > -1, "Returned Message added ORC segment.");
        }
Esempio n. 5
0
        public void ParseORMwithCompleteOBXToXML()
        {
            string Message = @"MSH|^~\&|INVISION|DHC|SUNQUEST LAB||200606191615||ORM^O01|ORDR|P|2.3.1|LAB
PID|0001||3020956||TRAINONLYPOE^ONE||19770903|F||W||||||||40230443
PV1|0001|I|MICU^W276^01||||045716^ABAZA, MONA M|||MED|||||||045716|F|000000030188
ORC|NW|01444^00001|||||||||||L
OBR||01444^00001||CAI^CALCIUM IONIZED|||200606191614||||L|||||045716^STEELE, ANDREW W|||||||||||00001&UNITS^ONCE&ONCE^000^200606191614^200606191614^ROUTINE
OBX|1|TX|SDES||Blood, peripheral||||||Z
OBX|2|TX|SREQ||LEFT ANTECUBITAL||||||Z
OBX|3|TX|CULT||Beta hemolytic Streptococcus Group A||||||Z
OBX|4|TX|CULT||Critical result(s) called to and verification ";

            Message += "\"read-back\"";
            Message += @" received from: Nu~||||||Z
";

            NHapi.Base.Parser.PipeParser Parser = new NHapi.Base.Parser.PipeParser();

            NHapi.Base.Model.IMessage m = Parser.Parse(Message);

            NHapi.Model.V231.Message.ORM_O01 msgObj = m as NHapi.Model.V231.Message.ORM_O01;

            Assert.IsNotNull(msgObj);

            NHapi.Base.Parser.XMLParser xmlParser = new NHapi.Base.Parser.DefaultXMLParser();

            string recoveredMessage = xmlParser.Encode(msgObj);

            Assert.IsNotNull(recoveredMessage);
            Assert.IsFalse(string.Empty.Equals(recoveredMessage));
        }
Esempio n. 6
0
        public HL7Handler(string fileText)
        {
            PipeParser parser = new PipeParser();

            HapiModel.IMessage m = parser.Parse(fileText);

            orm001 = m as ORM_O01;
        }
Esempio n. 7
0
        public void ParseQRYR02()
        {
            string Message = @"MSH|^~\&|CohieCentral|COHIE|Clinical Data Provider|TCH|20060228155525||QRY^R02^QRY_R02|1|P|2.3.1|
QRD|20060228155525|R|I||||10^RD&Records&0126|38923^^^^^^^^&TCH|||";

            NHapi.Base.Parser.PipeParser Parser = new NHapi.Base.Parser.PipeParser();

            NHapi.Base.Model.IMessage m = Parser.Parse(Message);

            NHapi.Model.V231.Message.QRY_R02 qryR02 = m as NHapi.Model.V231.Message.QRY_R02;

            Assert.IsNotNull(qryR02);
            Assert.AreEqual("38923", qryR02.QRD.GetWhoSubjectFilter(0).IDNumber.Value);
        }
Esempio n. 8
0
        /// <summary>   Tests dh patient 1111111. </summary>
        public void TestDHPatient1111111()
        {
            NHapi.Base.Parser.PipeParser Parser = new NHapi.Base.Parser.PipeParser();

            NHapi.Base.Model.IMessage m = Parser.Parse(GetDHPatient1111111());

            NHapi.Model.V231.Message.ORF_R04 orfR04 = m as NHapi.Model.V231.Message.ORF_R04;

            Assert.IsNotNull(orfR04);
            object range = orfR04.GetQUERY_RESPONSE().GetORDER().GetOBSERVATION().OBX.GetObservationValue(1);

            NHapi.Base.Parser.XMLParser xmlParser = new NHapi.Base.Parser.DefaultXMLParser();

            string recoveredMessage = xmlParser.Encode(orfR04);

            Assert.IsNotNull(recoveredMessage);
            Assert.IsFalse(recoveredMessage.IndexOf("NTE") > -1, "Returned Message added ORC segment.");
        }
Esempio n. 9
0
        public void ParseXMLToHL7()
        {
            string Message = GetQRYR02XML();

            NHapi.Base.Parser.XMLParser xmlParser = new NHapi.Base.Parser.DefaultXMLParser();
            NHapi.Base.Model.IMessage   m         = xmlParser.Parse(Message);

            NHapi.Model.V231.Message.QRY_R02 qryR02 = m as NHapi.Model.V231.Message.QRY_R02;

            Assert.IsNotNull(qryR02);

            NHapi.Base.Parser.PipeParser pipeParser = new NHapi.Base.Parser.PipeParser();

            string pipeOutput = pipeParser.Encode(qryR02);

            Assert.IsNotNull(pipeOutput);
            Assert.IsFalse(string.Empty.Equals(pipeOutput));
        }
Esempio n. 10
0
        public void ParseORFR04()
        {
            string Message = @"MSH|^~\&|Query Result Locator|Query Facility Name|Query Application Name|ST ELSEWHERE HOSPITAL|20051024074506||ORF^R04|432|P|2.3.1|
MSA|AA|123456789|
QRD|20060228160421|R|I||||10^RD&Records&0126|38923^^^^^^^^&TCH|||
QRF||20050101000000||
PID|||38923^^^ST ELSEWHERE HOSPITAL Medical Record Numbers&              MEDIC              AL RECORD NUMBER&ST ELSEWHERE HOSPITAL^MR^ST ELSEWHERE HOSPITAL||Bombadill^Tom||19450605|M|||1&Main Street^^Littleton^CO^80122||^^^^^303^4376329^22|
OBR|1|0015566|DH2211223|83036^HEMOGLOBIN A1C^^83036^HEMOGLOBIN A1C|||20040526094000|||||||20040526094000||J12345^JENS^JENNY^^^DR^MD^^^^^^^112233&TCH|||||          TP QUEST DIAGNOSTICS-TAMPA 4225 E. FOWLER AVE TAMPA          FL 33617|20030622070400|||F|
OBX|1|NM|50026400^HEMOGLOBIN A1C^^50026400^HEMOGLOBIN A1C||12|^% TOTAL HGB|4.0 - 6.0|H|||F|||20040510094000|TP^^L|";

            NHapi.Base.Parser.PipeParser Parser = new NHapi.Base.Parser.PipeParser();

            NHapi.Base.Model.IMessage m = Parser.Parse(Message);

            NHapi.Model.V231.Message.ORF_R04 orfR04 = m as NHapi.Model.V231.Message.ORF_R04;
            Assert.IsNotNull(orfR04);
            Assert.AreEqual("12", orfR04.GetQUERY_RESPONSE().GetORDER().GetOBSERVATION().OBX.GetObservationValue()[0].Data.ToString());
        }
Esempio n. 11
0
        private static void WriteMessageFile(ParserBase parser, NHapi.Base.Model.IMessage hl7Message, string outputDirectory, string outputFileName)
        {
            if (!Directory.Exists(outputDirectory))
            {
                Directory.CreateDirectory(outputDirectory);
            }

            var fileName = Path.Combine(outputDirectory, outputFileName);

            LogToDebugConsole("Writing data to file...");

            if (File.Exists(fileName))
            {
                File.Delete(fileName);
            }
            File.WriteAllText(fileName, parser.Encode(hl7Message));
            LogToDebugConsole($"Wrote data to file {fileName} successfully...");
        }
Esempio n. 12
0
        public void ParseORUr01LongToXml()
        {
            string Message = @"MSH|^~\$|LAB|DHC|LCR|DH|200511291403||ORU^R01|52780002432|P|2.3.1
PID|0001|3013839|40206609||BARNES^TEST||19551005|F|||||||||||258452152
OBR||00009^001|W442|CBC^CBC|||200509210520||||||||CBC^CBC|117564^STEEL||||||||DAH
OBX|1|NM|WBC||20.0|k/uL|4.5-10.0|H|||Z
OBX|1|TX|WBC|1|(Ref Range: 4 k/uL)|k/uL|4.5-10.0||||Z
OBX|2|NM|RBC||4.00|M/uL|4.20-5.40|L|||Z
OBX|2|TX|RBC|1|(Ref Range: 4 M/uL)|M/uL|4.20-5.40||||Z
OBX|3|NM|HGB||12.0|g/dL|14.0-24.0|L|||Z
OBX|3|TX|HGB|1|(Ref Range: 1 g/dL)|g/dL|14.0-24.0||||Z
OBX|4|NM|HCT||41.0|%|37.0-47.0||||Z
OBX|4|TX|HCT|1|(Ref Range: 3 %)|%|37.0-47.0||||Z
OBX|5|NM|MCV||80.9|fl|80.0-100.0||||Z
OBX|5|TX|MCV|1|(Ref Range: 8 fl)|fl|80.0-100.0||||Z
OBX|6|NM|MCH||31.0|pg|27.0-31.0||||Z
OBX|6|TX|MCH|1|(Ref Range: 2 pg)|pg|27.0-31.0||||Z
OBX|7|NM|MCHC||32.0|g/dL|32.0-36.0||||Z
OBX|7|TX|MCHC|1|(Ref Range: 3 g/dL)|g/dL|32.0-36.0||||Z
OBX|8|NM|RDW||19.0|%|11.5-14.5|H|||Z
OBX|8|TX|RDW|1|(Ref Range: 1 %)|%|11.5-14.5||||Z
OBX|9|NM|PLTC||45|k/uL|150-400|PL^Y|||Z
OBX|9|TX|PLTC|1|(Ref Range: 1 k/uL)|k/uL|150-400||||Z
OBX|10|NM|MPV||10.0|fL|6.2-10.0||||Z
OBX|10|TX|MPV|1|(Ref Range: 6 fL)|fL|6.2-10.0||||Z
";

            NHapi.Base.Parser.PipeParser Parser = new NHapi.Base.Parser.PipeParser();

            NHapi.Base.Model.IMessage m = Parser.Parse(Message);

            NHapi.Model.V231.Message.ORU_R01 msg = m as NHapi.Model.V231.Message.ORU_R01;

            NHapi.Base.Parser.XMLParser xmlParser = new NHapi.Base.Parser.DefaultXMLParser();

            string recoveredMessage = xmlParser.Encode(msg);

            Assert.AreNotEqual(string.Empty, recoveredMessage);

            System.Xml.XmlDocument orrDoc = new System.Xml.XmlDocument();
            orrDoc.LoadXml(recoveredMessage);
            Assert.IsNotNull(orrDoc);
        }
Esempio n. 13
0
        public void ParseORMo01PIDSegment()
        {
            string Message = @"MSH|^~\&|INVISION|DHC|SUNQUEST LAB||200606191615||ORM^O01|ORDR|P|2.3.1|LAB
PID|0001||3020956||TRAINONLYPOE^ONE||19770903|F||W||||||||40230443
PV1|0001|I|MICU^W276^01||||045716^ABAZA, MONA M|||MED|||||||045716|F|000000030188
ORC|NW|01444^00001|||||||||||L
OBR||01444^00001||CAI^CALCIUM IONIZED|||200606191614||||L|||||045716^STEELE, ANDREW W|||||||||||00001&UNITS^ONCE&ONCE^000^200606191614^200606191614^ROUTINE
";

            NHapi.Base.Parser.PipeParser Parser = new NHapi.Base.Parser.PipeParser();

            NHapi.Base.Model.IMessage m = Parser.Parse(Message);

            NHapi.Model.V231.Message.ORM_O01 ormo01 = m as NHapi.Model.V231.Message.ORM_O01;

            Assert.IsNotNull(ormo01);
            Assert.AreEqual("TRAINONLYPOE", (ormo01.PATIENT.PID.GetPatientName()[0]).FamilyLastName.FamilyName.Value);
            Assert.AreEqual("19770903", ormo01.PATIENT.PID.DateTimeOfBirth.TimeOfAnEvent.Value);
            Assert.AreEqual("F", ormo01.PATIENT.PID.Sex.Value);
            Assert.AreEqual("W", ((ormo01.PATIENT.PID.GetRace()[0]).Identifier.Value));

            Assert.AreEqual("ABAZA, MONA M", ormo01.PATIENT.PATIENT_VISIT.PV1.GetAttendingDoctor(0).FamilyLastName.FamilyName.Value);
        }
Esempio n. 14
0
        public void ParseORFR04FromDHTest()
        {
            string Message = @"MSH|^~\&|Clinical Data Provider|DHHA|COHIECentral|COHIE|200609221408||ORF^R04||P|2.3.1
MSA|AA|
PID|2019877||2019877^^^DH^MR||LOPEZ1^JAMES^TRISTAN||19740804|M
OBR||00677^001|M428|CBC^CBC|||200511071505||||||||CBC^CBC|045716^STEELE||||||||DAH
OBX|1|NM|WBC||1.1|k/uL|5.0-16.0|L|||C
OBX|1|TX|WBC|1|(Ref Range: 5 k/uL)|k/uL|5.0-16.0||||C
OBX|1|TX|WBC||Result(s) called to and verification read-back received from:  NURSE NAN M~||||||C
OBX|1|TX|WBC||ICU 13:39 11  19  05||||||C
OBX|1|TX|WBC||Corrected on 11/29 AT 1337: Previously reported as: 1.1||||||C
OBX|2|NM|RBC||3.99|M/uL|3.80-5.40||||Z
OBX|2|TX|RBC|1|(Ref Range: 3 M/uL)|M/uL|3.80-5.40||||Z
OBX|3|NM|HGB||13.0|g/dL|14.0-24.0|L|||Z
OBX|3|TX|HGB|1|(Ref Range: 1 g/dL)|g/dL|14.0-24.0||||Z
OBX|4|NM|HCT||40.0|%|31.0-43.0||||Z
OBX|4|TX|HCT|1|(Ref Range: 3 %)|%|31.0-43.0||||Z
OBX|5|NM|MCV||80.0|fl|70.0-90.0||||Z
OBX|5|TX|MCV|1|(Ref Range: 7 fl)|fl|70.0-90.0||||Z
OBX|6|NM|MCH||32.0|pg|27.0-31.0|H|||Z
OBX|6|TX|MCH|1|(Ref Range: 2 pg)|pg|27.0-31.0||||Z
OBX|7|NM|MCHC||32.0|g/dL|32.0-36.0||||Z
OBX|7|TX|MCHC|1|(Ref Range: 3 g/dL)|g/dL|32.0-36.0||||Z
OBX|8|NM|RDW||17.0|%|11.5-14.5|H|||Z
OBX|8|TX|RDW|1|(Ref Range: 1 %)|%|11.5-14.5||||Z
OBX|9|NM|PLTC||2|k/uL|150-400|PL^Y|||Z
OBX|9|TX|PLTC|1|(Ref Range: 1 k/uL)|k/uL|150-400||||Z
OBX|10|NM|MPV||10.0|fL|6.2-10.0||||Z
OBX|10|TX|MPV|1|(Ref Range: 6 fL)|fL|6.2-10.0||||Z
OBR||00677^001|M428|CBC^CBC|||200511071505||||||||CBC^CBC|045716^STEELE||||||||DAH
OBX|1|NM|WBC||1.1|k/uL|5.0-16.0|L|||C
OBX|1|TX|WBC|1|(Ref Range: 5 k/uL)|k/uL|5.0-16.0||||C
OBX|1|TX|WBC||Result(s) called to and verification read-back received from:  NURSE NAN M~||||||C
OBX|1|TX|WBC||ICU 13:39 11  19  05||||||C
OBX|1|TX|WBC||Corrected on 11/29 AT 1337: Previously reported as: 1.1||||||C
OBX|2|NM|RBC||3.99|M/uL|3.80-5.40||||Z
OBX|2|TX|RBC|1|(Ref Range: 3 M/uL)|M/uL|3.80-5.40||||Z
OBX|3|NM|HGB||13.0|g/dL|14.0-24.0|L|||Z
OBX|3|TX|HGB|1|(Ref Range: 1 g/dL)|g/dL|14.0-24.0||||Z
OBX|4|NM|HCT||40.0|%|31.0-43.0||||Z
OBX|4|TX|HCT|1|(Ref Range: 3 %)|%|31.0-43.0||||Z
OBX|5|NM|MCV||80.0|fl|70.0-90.0||||Z
OBX|5|TX|MCV|1|(Ref Range: 7 fl)|fl|70.0-90.0||||Z
OBX|6|NM|MCH||32.0|pg|27.0-31.0|H|||Z
OBX|6|TX|MCH|1|(Ref Range: 2 pg)|pg|27.0-31.0||||Z
OBX|7|NM|MCHC||32.0|g/dL|32.0-36.0||||Z
OBX|7|TX|MCHC|1|(Ref Range: 3 g/dL)|g/dL|32.0-36.0||||Z
OBX|8|NM|RDW||17.0|%|11.5-14.5|H|||Z
OBX|8|TX|RDW|1|(Ref Range: 1 %)|%|11.5-14.5||||Z
OBX|9|NM|PLTC||2|k/uL|150-400|PL^Y|||Z
OBX|9|TX|PLTC|1|(Ref Range: 1 k/uL)|k/uL|150-400||||Z
OBX|10|NM|MPV||10.0|fL|6.2-10.0||||Z
OBX|10|TX|MPV|1|(Ref Range: 6 fL)|fL|6.2-10.0||||Z
OBR||00677^001|M428|CBC^CBC|||200511071505||||||||CBC^CBC|045716^STEELE||||||||DAH
OBX|1|NM|WBC||1.1|k/uL|5.0-16.0|L|||C
OBX|1|TX|WBC|1|(Ref Range: 5 k/uL)|k/uL|5.0-16.0||||C
OBX|1|TX|WBC||Result(s) called to and verification read-back received from:  NURSE NAN M~||||||C
OBX|1|TX|WBC||ICU 13:39 11  19  05||||||C
OBX|1|TX|WBC||Corrected on 11/29 AT 1337: Previously reported as: 1.1||||||C
OBX|2|NM|RBC||3.99|M/uL|3.80-5.40||||Z
OBX|2|TX|RBC|1|(Ref Range: 3 M/uL)|M/uL|3.80-5.40||||Z
OBX|3|NM|HGB||13.0|g/dL|14.0-24.0|L|||Z
OBX|3|TX|HGB|1|(Ref Range: 1 g/dL)|g/dL|14.0-24.0||||Z
OBX|4|NM|HCT||40.0|%|31.0-43.0||||Z
OBX|4|TX|HCT|1|(Ref Range: 3 %)|%|31.0-43.0||||Z
OBX|5|NM|MCV||80.0|fl|70.0-90.0||||Z
OBX|5|TX|MCV|1|(Ref Range: 7 fl)|fl|70.0-90.0||||Z
OBX|6|NM|MCH||32.0|pg|27.0-31.0|H|||Z
OBX|6|TX|MCH|1|(Ref Range: 2 pg)|pg|27.0-31.0||||Z
OBX|7|NM|MCHC||32.0|g/dL|32.0-36.0||||Z
OBX|7|TX|MCHC|1|(Ref Range: 3 g/dL)|g/dL|32.0-36.0||||Z
OBX|8|NM|RDW||17.0|%|11.5-14.5|H|||Z
OBX|8|TX|RDW|1|(Ref Range: 1 %)|%|11.5-14.5||||Z
OBX|9|NM|PLTC||2|k/uL|150-400|PL^Y|||Z
OBX|9|TX|PLTC|1|(Ref Range: 1 k/uL)|k/uL|150-400||||Z
OBX|10|NM|MPV||10.0|fL|6.2-10.0||||Z
OBX|10|TX|MPV|1|(Ref Range: 6 fL)|fL|6.2-10.0||||Z";

            NHapi.Base.Parser.PipeParser Parser = new NHapi.Base.Parser.PipeParser();

            NHapi.Base.Model.IMessage m = Parser.Parse(Message);

            NHapi.Model.V231.Message.ORF_R04 orfR04 = m as NHapi.Model.V231.Message.ORF_R04;

            Assert.IsNotNull(orfR04);

            NHapi.Base.Parser.XMLParser xmlParser = new NHapi.Base.Parser.DefaultXMLParser();

            string recoveredMessage = xmlParser.Encode(orfR04);

            Assert.IsNotNull(recoveredMessage);
            Assert.IsFalse(recoveredMessage.IndexOf("NTE") > -1, "Returned Message added ORC segment.");
        }