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); }
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)); }
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)); }
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); }