예제 #1
0
        public virtual void TestMissingValues()
        {
            PeriodicIntervalTime frequency = PeriodicIntervalTime.CreateFrequency(null, null);
            string result = new PivlTsPropertyFormatter().Format(GetContext("periodicInterval", "PIVL<TS.DATETIME>"), new PIVLImpl(frequency
                                                                                                                                   ));

            AssertXml("result", "<periodicInterval></periodicInterval>", result);
            Assert.IsFalse(this.result.IsValid());
            Assert.AreEqual(1, this.result.GetHl7Errors().Count);
        }
예제 #2
0
        public virtual void TestBasicCase()
        {
            PhysicalQuantity quantity = new PhysicalQuantity(new BigDecimal(1), Ca.Infoway.Messagebuilder.Domainvalue.Basic.DefaultTimeUnit
                                                             .DAY);
            PeriodicIntervalTime frequency = PeriodicIntervalTime.CreateFrequency(3, quantity);
            string result = new PivlTsPropertyFormatter().Format(GetContext("periodicInterval", "PIVL<TS.DATETIME>"), new PIVLImpl(frequency
                                                                                                                                   ));

            Assert.IsTrue(this.result.IsValid());
            AssertXml("result", "<periodicInterval><frequency><numerator value=\"3\"/><denominator unit=\"d\" value=\"1\"/></frequency></periodicInterval>"
                      , result);
        }
예제 #3
0
        public virtual void TestBasicFreqAsMR2009()
        {
            GeneralTimingSpecification gts = new GeneralTimingSpecification(IntervalFactory.CreateLowWidth <PlatformDate>(DateUtil.GetDate
                                                                                                                              (1969, 11, 31), new DateDiff(CreateQuantity("3", Ca.Infoway.Messagebuilder.Domainvalue.Basic.DefaultTimeUnit.DAY))), PeriodicIntervalTime
                                                                            .CreateFrequency(3, CreateQuantity("3", Ca.Infoway.Messagebuilder.Domainvalue.Basic.DefaultTimeUnit.DAY)));
            string result = new GtsBoundedPivlFormatter().Format(new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl
                                                                     (this.result, null, "name", "GTS.BOUNDEDPIVL", null, null, false, SpecificationVersion.R02_04_02, null, null, null, false
                                                                     ), new GTSImpl(gts));

            AssertXml("result", "<name specializationType=\"GTS.BOUNDEDPIVL\" xsi:type=\"SXPR_TS\">" + "<comp specializationType=\"IVL_TS.FULLDATE\" xsi:type=\"IVL_TS\">"
                      + "<low value=\"19691231\"/>" + "<width unit=\"d\" value=\"3\"/></comp>" + "<comp operator=\"I\" specializationType=\"PIVL_TS.DATETIME\" xsi:type=\"PIVL_TS\">"
                      + "<frequency><numerator specializationType=\"INT.NONNEG\" value=\"3\" xsi:type=\"INT\"/>" + "<denominator specializationType=\"PQ.TIME\" unit=\"d\" value=\"3\" xsi:type=\"PQ\"/>"
                      + "</frequency></comp></name>", result);
            Assert.IsTrue(this.result.IsValid());
        }
예제 #4
0
        public virtual void TimeZoneHandling()
        {
            GeneralTimingSpecification gts = new GeneralTimingSpecification(IntervalFactory.CreateLowHigh <PlatformDate>(DateUtil.GetDate
                                                                                                                             (1969, 11, 31), DateUtil.GetDate(1969, 11, 31)), PeriodicIntervalTime.CreateFrequency(2, new PhysicalQuantity(BigDecimal
                                                                                                                                                                                                                                           .TEN, Ca.Infoway.Messagebuilder.Domainvalue.Basic.UnitsOfMeasureCaseSensitive.DAY)));
            string result = new GtsBoundedPivlFormatter().Format(new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl
                                                                     (this.result, null, "name", "GTS.BOUNDEDPIVL", null, null, false, SpecificationVersion.V01R04_3, TimeZoneUtil.GetTimeZone
                                                                         ("GMT-7"), null, null, false), new GTSImpl(gts));

            AssertXml("result", "<name xsi:type=\"SXPR_TS\">" + "<comp operator=\"I\" xsi:type=\"IVL_TS\">" + "<low value=\"19691230\"/>"
                      + "<high value=\"19691230\"/></comp>" + "<comp xsi:type=\"PIVL_TS\">" + "<frequency><numerator value=\"2\"/><denominator unit=\"d\" value=\"10\"/></frequency></comp></name>"
                      , result);
            Assert.IsTrue(this.result.IsValid());
        }