Exemple #1
0
        public virtual void TestBasicPhase()
        {
            GeneralTimingSpecification gts = new GeneralTimingSpecification(IntervalFactory.CreateLowHigh <PlatformDate>(DateUtil.GetDate
                                                                                                                             (1969, 11, 31), DateUtil.GetDate(1969, 11, 31)), PeriodicIntervalTime.CreatePhase(IntervalFactory.CreateLowHigh <PlatformDate
                                                                                                                                                                                                                                              >(DateUtil.GetDate(1969, 11, 31), DateUtil.GetDate(1969, 11, 31))));
            string result = new GtsBoundedPivlFormatter().Format(GetContext("name"), 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\"/>" + "<high value=\"19691231\"/></comp>" + "<comp operator=\"I\" specializationType=\"PIVL_TS.DATETIME\" xsi:type=\"PIVL_TS\">"
                      + "<phase><low value=\"19691231\"/><high value=\"19691231\"/></phase></comp></name>", result);
            Assert.IsTrue(this.result.IsValid());
        }
Exemple #2
0
        public virtual void TestBasicFreq()
        {
            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(GetContext("name"), 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());
        }
Exemple #3
0
        public virtual void TestBasicAsCeRx()
        {
            GeneralTimingSpecification gts = new GeneralTimingSpecification(IntervalFactory.CreateLowHigh <PlatformDate>(DateUtil.GetDate
                                                                                                                             (1969, 11, 31), DateUtil.GetDate(1969, 11, 31)), PeriodicIntervalTime.CreatePeriod(new DateDiff(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.V01R04_3, null, null, null, false
                                                                     ), new GTSImpl(gts));

            AssertXml("result", "<name xsi:type=\"SXPR_TS\">" + "<comp operator=\"I\" xsi:type=\"IVL_TS\">" + "<low value=\"19691231\"/>"
                      + "<high value=\"19691231\"/>" + "</comp>" + "<comp xsi:type=\"PIVL_TS\">" + "<period unit=\"d\" value=\"3\"/>" + "</comp>"
                      + "</name>", result);
            Assert.IsTrue(this.result.IsValid());
        }
Exemple #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());
        }
Exemple #5
0
        public virtual void TestBasicPhaseAsMR2009()
        {
            GeneralTimingSpecification gts = new GeneralTimingSpecification(IntervalFactory.CreateLowHigh <PlatformDate>(DateUtil.GetDate
                                                                                                                             (1969, 11, 31), DateUtil.GetDate(1969, 11, 31)), PeriodicIntervalTime.CreatePhase(IntervalFactory.CreateLowHigh <PlatformDate
                                                                                                                                                                                                                                              >(DateUtil.GetDate(1969, 11, 31), DateUtil.GetDate(1969, 11, 31))));
            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\"/>" + "<high value=\"19691231\"/></comp>" + "<comp operator=\"I\" specializationType=\"PIVL_TS.DATETIME\" xsi:type=\"PIVL_TS\">"
                      + "<phase><low value=\"19691231\"/><high value=\"19691231\"/></phase></comp></name>", result);
            Assert.IsTrue(this.result.IsValid());
        }