public virtual void TestNullCase() { ANYImpl <object> urgImpl = new ANYImpl <object>(null, null, StandardDataType.AD); string result = new AnyR2PropertyFormatter().Format(new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl (this.result, null, "name", "ANY", null, null, false), urgImpl, 0); AssertXml("result", "<name nullFlavor=\"NI\"/>", result); }
public virtual void TestPn() { PersonName name = PersonName.CreateFirstNameLastName("John", "Smith"); ANYImpl <object> pnImpl = new ANYImpl <object>(name, null, StandardDataType.PN); string result = new AnyR2PropertyFormatter().Format(new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl (this.result, null, "name", "ANY", null, null, false, SpecificationVersion.R02_04_02, null, null, null, false), pnImpl, 0); AssertXml("result", "<name use=\"L\" xsi:type=\"PN\"><given>John</given><family>Smith</family></name>", result); }
public virtual void TestPq() { object quantity = CreateQuantity("12", Ca.Infoway.Messagebuilder.Domainvalue.Basic.UnitsOfMeasureCaseSensitive.GRAM); ANYImpl <object> pqImpl = new ANYImpl <object>(quantity, null, StandardDataType.PQ); string result = new AnyR2PropertyFormatter().Format(new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl (this.result, null, "name", "ANY", null, null, false, SpecificationVersion.R02_04_02, null, null, null, false), pqImpl, 0); AssertXml("result", "<name unit=\"g\" value=\"12\" xsi:type=\"PQ\"/>", result); }
public virtual void TestTs() { PlatformDate date = DateUtil.GetDate(2003, 2, 27); DateWithPattern dateWithPattern = new DateWithPattern(date, "yyyyMMdd"); ANYImpl <object> tsImpl = new ANYImpl <object>(new MbDate(dateWithPattern), null, StandardDataType.TS); string result = new AnyR2PropertyFormatter().Format(new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl (this.result, null, "name", "ANY", null, null, false, SpecificationVersion.R02_04_02, null, null, null, false), tsImpl, 0); AssertXml("result", "<name value=\"20030327\" xsi:type=\"TS\"/>", result); }
public virtual void TestSt() { string myString = "some value"; ANYImpl <object> stImpl = new ANYImpl <object>(myString, null, StandardDataType.ST); stImpl.Language = "en-CA"; string result = new AnyR2PropertyFormatter().Format(new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl (this.result, null, "name", "ANY", null, null, false, SpecificationVersion.R02_04_02, null, null, null, false), stImpl, 0); AssertXml("result", "<name language=\"en-CA\" xsi:type=\"ST\">some value</name>", result); }
public virtual void TestFormatStWithCdataValue() { AnyR2PropertyFormatter formatter = new AnyR2PropertyFormatter(); FormatContext context = GetContext("name", "ANY"); ANYImpl <object> dataType = new ANYImpl <object>("something", null, StandardDataType.ST); dataType.IsCdata = true; string result = formatter.Format(context, dataType); Assert.AreEqual(AddLineSeparator("<name xsi:type=\"ST\"><![CDATA[something]]></name>"), result, "something in text node"); Assert.IsTrue(this.result.IsValid()); }
public virtual void TestPqWithNullFlavor() { ANYImpl <object> pqImpl = new ANYImpl <object>(null, Ca.Infoway.Messagebuilder.Domainvalue.Nullflavor.NullFlavor.UNKNOWN, StandardDataType .PQ); pqImpl.OriginalText = "orig text"; string result = new AnyR2PropertyFormatter().Format(new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl (this.result, null, "name", "ANY", null, null, false, SpecificationVersion.R02_04_02, null, null, null, false), pqImpl, 0); AssertXml("result", "<name nullFlavor=\"UNK\"/>", result); Assert.IsTrue(this.result.IsValid()); }