Beispiel #1
0
        public virtual void TestFormatPhysicalQuantityNull()
        {
            string result = new PqPropertyFormatterTest.TestablePqPropertyFormatter().Format(CreateContext("PQ.BASIC"), new PQImpl());

            // a null value for PQ elements results in a nullFlavor attribute (but not via calling getAttributeNameValuePairs, only through format() itself)
            Assert.AreEqual("<name nullFlavor=\"NI\"/>", result.Trim(), "map size");
            Assert.IsTrue(this.result.IsValid());
        }
Beispiel #2
0
        public virtual void TestFormatPhysicalQuantityNullMissingOriginalText()
        {
            PQImpl dataType = new PQImpl(Ca.Infoway.Messagebuilder.Domainvalue.Nullflavor.NullFlavor.NOT_APPLICABLE);
            string result   = new PqPropertyFormatterTest.TestablePqPropertyFormatter().Format(CreateContext("PQ.LAB"), dataType);

            Assert.AreEqual("<name nullFlavor=\"NA\"/>", result.Trim(), "map size");
            Assert.IsFalse(this.result.IsValid());
            Assert.AreEqual(1, this.result.GetHl7Errors().Count);
        }
Beispiel #3
0
        public virtual void TestFormatPhysicalQuantityNotNullWithNullFlavorMissingOriginalText()
        {
            PhysicalQuantity pq = new PhysicalQuantity(null, Ca.Infoway.Messagebuilder.Domainvalue.Basic.UnitsOfMeasureCaseSensitive.
                                                       CENTIMETRE);
            PQImpl dataType = new PQImpl(Ca.Infoway.Messagebuilder.Domainvalue.Nullflavor.NullFlavor.NOT_APPLICABLE);

            dataType.Value = pq;
            string result = new PqPropertyFormatterTest.TestablePqPropertyFormatter().Format(CreateContext("PQ.LAB"), dataType);

            Assert.AreEqual("<name nullFlavor=\"NA\"/>", result.Trim(), "map size");
            Assert.IsFalse(this.result.IsValid());
            Assert.AreEqual(2, this.result.GetHl7Errors().Count);
        }