Esempio n. 1
0
        public virtual void TestWrapperNull()
        {
            IVL_TSImpl hl7DataType = null;
            string     result      = new IvlTsR2PropertyFormatter().Format(GetContext("name"), hl7DataType);

            Assert.AreEqual(string.Empty, result);
        }
Esempio n. 2
0
        public virtual void TestIntervalNull()
        {
            DateInterval dateInterval = null;
            IVL_TSImpl   hl7DataType  = new IVL_TSImpl(dateInterval);

            hl7DataType.DataType = StandardDataType.IVL_TS;
            string result = new IvlTsR2PropertyFormatter().Format(GetContext("name"), hl7DataType);

            AssertXml("result", "<name nullFlavor=\"NI\"/>", result);
        }
Esempio n. 3
0
        public virtual void TestCustomUnit()
        {
            Interval <PlatformDate> interval = IntervalFactory.CreateWidth <PlatformDate>(new DateDiff(1, IvlTsR2PropertyFormatterTest.CustomUnit
                                                                                                       .SANDWICH));
            DateInterval dateInterval = new DateInterval(interval);
            IVL_TSImpl   hl7DataType  = new IVL_TSImpl(dateInterval);

            hl7DataType.DataType = StandardDataType.IVL_TS;
            string result = new IvlTsR2PropertyFormatter().Format(GetContext("name"), hl7DataType);

            AssertXml("result", "<name><width unit=\"SANDWICH\" value=\"1\"/></name>", result);
        }
Esempio n. 4
0
        public virtual void TestNullable()
        {
            Interval <PlatformDate> interval = IntervalFactory.CreateWidth <PlatformDate>(new DateDiff(Ca.Infoway.Messagebuilder.Domainvalue.Nullflavor.NullFlavor
                                                                                                       .OTHER));
            DateInterval dateInterval = new DateInterval(interval);
            IVL_TSImpl   hl7DataType  = new IVL_TSImpl(dateInterval);

            hl7DataType.DataType = StandardDataType.IVL_TS;
            string result = new IvlTsR2PropertyFormatter().Format(GetContext("name"), hl7DataType);

            AssertXml("result", "<name><width nullFlavor=\"OTH\"/></name>", result);
        }
Esempio n. 5
0
        public virtual void TestBasic()
        {
            TimeZoneInfo            timeZone = TimeZoneUtil.GetTimeZone("America/Toronto");
            Interval <PlatformDate> interval = IntervalFactory.CreateLowHigh <PlatformDate>(DateUtil.GetDate(2006, 11, 25, 11, 12, 13,
                                                                                                             0, timeZone), DateUtil.GetDate(2007, 0, 2, 10, 11, 12, 0, timeZone));
            DateInterval dateInterval = new DateInterval(interval);
            IVL_TSImpl   hl7DataType  = new IVL_TSImpl(dateInterval);

            hl7DataType.DataType = StandardDataType.IVL_TS;
            string result = new IvlTsR2PropertyFormatter().Format(new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl
                                                                      (this.result, null, "name", "IVL<TS>", Ca.Infoway.Messagebuilder.Xml.ConformanceLevel.POPULATED, null, false, SpecificationVersion
                                                                      .V02R02, timeZone, timeZone, null, false), hl7DataType);

            Assert.IsTrue(this.result.IsValid());
            AssertXml("result", "<name><low value=\"20061225111213.0000-0500\"/><high value=\"20070102101112.0000-0500\"/></name>", result
                      );
        }