Пример #1
0
        public void ElementSegmentTextReturnsCorrectSegment()
        {
            HL7Enumerator.HL7Message msg = Example1;
            string segment = msg.Element("MSH");

            Assert.Equal(MSH2, segment);

            string obx4 = msg.Element("OBX[2]");

            Assert.Equal(OBX4, obx4);
        }
Пример #2
0
        public void TestHL7Enumerator_Element_Simple_Linq_expression_returns_rows()
        {
            HL7Enumerator.HL7Message mesg = Example1;
            var OBXTestNames = mesg.AllSegments("OBX").Select(o => o.Element("*.3.2").ToString());

            Console.WriteLine("Found Tests:");
            var i = 0;

            string[] expected = { "Glucose Lvl", "Alanine Aminotransferase" };
            foreach (string obx in OBXTestNames)
            {
                Console.WriteLine(string.Format("  {0}", obx));
                Assert.Equal(expected[i++], obx);
            }
        }