Beispiel #1
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);
        }
Beispiel #2
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));
        }