public virtual void TestBasic() { UncertainRange <PlatformDate> urg = UncertainRangeFactory.CreateLowHigh(DateUtil.GetDate(2010, 0, 20), DateUtil.GetDate(2011 , 1, 21)); string result = new UrgTsPropertyFormatter().Format(GetContext("name", "URG<TS.DATE>"), new URGImpl <TS, PlatformDate>(urg )); Assert.IsTrue(this.result.IsValid()); AssertXml("result", "<name><low value=\"20100120\"/><high value=\"20110221\"/></name>", result); }
public virtual void TestUrg() { UncertainRange <PhysicalQuantity> urg = UncertainRangeFactory.CreateLowHigh(CreateQuantity("55", Ca.Infoway.Messagebuilder.Domainvalue.Basic.UnitsOfMeasureCaseSensitive .MILLIMETER), CreateQuantity("60", Ca.Infoway.Messagebuilder.Domainvalue.Basic.UnitsOfMeasureCaseSensitive.MILLIMETER)); ANYImpl <object> urgImpl = new ANYImpl <object>(urg, null, StandardDataType.URG_PQ_BASIC); string result = new AnyPropertyFormatter().Format(new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl (new ModelToXmlResult(), null, "name", "ANY.LAB", null, null, false, SpecificationVersion.R02_04_02, null, null, null, false ), urgImpl, 0); AssertXml("result", "<name specializationType=\"URG_PQ.BASIC\" xsi:type=\"URG_PQ\"><low unit=\"mm\" value=\"55\"/><high unit=\"mm\" value=\"60\"/></name>" , result); }
public virtual void TestBasic() { UncertainRange <PhysicalQuantity> urg = UncertainRangeFactory.CreateLowHigh(CreateQuantity("55", CeRxDomainTestValues.MILLIMETER ), CreateQuantity("60", CeRxDomainTestValues.MILLIMETER)); urg.HighInclusive = true; urg.LowInclusive = false; string result = new UrgPqPropertyFormatter().Format(GetContext("name", "URG<PQ.BASIC>"), new URGImpl <PQ, PhysicalQuantity >(urg)); AssertXml("result", "<name><low inclusive=\"false\" unit=\"mm\" value=\"55\"/><high inclusive=\"true\" unit=\"mm\" value=\"60\"/></name>" , result); Assert.IsTrue(this.result.IsValid()); }
public virtual void TestBasicWithInvalidInclusiveUsage() { UncertainRange <PlatformDate> urg = UncertainRangeFactory.CreateLowHigh(DateUtil.GetDate(2010, 0, 20), DateUtil.GetDate(2011 , 1, 21)); urg.HighInclusive = true; string result = new UrgTsPropertyFormatter().Format(GetContext("name", "URG<TS.DATE>"), new URGImpl <TS, PlatformDate>(urg )); Assert.IsFalse(this.result.IsValid()); Assert.AreEqual(1, this.result.GetHl7Errors().Count); // should not use inclusive fields with this datatype AssertXml("result", "<name><low value=\"20100120\"/><high value=\"20110221\"/></name>", result); }