コード例 #1
0
        public void ParseQRYR02()
        {
            string message = @"MSH|^~\&|CohieCentral|COHIE|Clinical Data Provider|TCH|20060228155525||QRY^R02^QRY_R02|1|P|2.4|
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.V24.Message.QRY_R02 qryR02 = m as NHapi.Model.V24.Message.QRY_R02;

            Assert.IsNotNull(qryR02);
            Assert.AreEqual("38923", qryR02.QRD.GetWhoSubjectFilter(0).IDNumber.Value);
        }
コード例 #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.V24.Message.QRY_R02 qryR02 = m as NHapi.Model.V24.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));
        }