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|||";

            ca.uhn.hl7v2.parser.PipeParser parser = new ca.uhn.hl7v2.parser.PipeParser();

            ca.uhn.hl7v2.model.Message m = parser.parse(message);

            ca.uhn.hl7v2.model.v231.message.QRY_R02 qryR02 = m as ca.uhn.hl7v2.model.v231.message.QRY_R02;

            Assert.IsNotNull(qryR02);
            Assert.AreEqual("38923", qryR02.QRD.getWhoSubjectFilter(0).IDNumber.Value);
        }
        public void ParseXMLToHL7()
        {
            string message = GetQRYR02XML();

            ca.uhn.hl7v2.parser.XMLParser xmlParser = new ca.uhn.hl7v2.parser.DefaultXMLParser();
            ca.uhn.hl7v2.model.Message    m         = xmlParser.parse(message);

            ca.uhn.hl7v2.model.v231.message.QRY_R02 qryR02 = m as ca.uhn.hl7v2.model.v231.message.QRY_R02;

            Assert.IsNotNull(qryR02);

            ca.uhn.hl7v2.parser.PipeParser pipeParser = new ca.uhn.hl7v2.parser.PipeParser();

            string pipeOutput = pipeParser.encode(qryR02);

            Assert.IsNotNull(pipeOutput);
            Assert.IsFalse(string.Empty.Equals(pipeOutput));
        }