public virtual void TestFormatValueNonNull() { string result = new BagR2PropertyFormatter(this.formatterRegistry).Format(new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl (new ModelToXmlResult(), null, "telecom", "BAG<TEL>", Ca.Infoway.Messagebuilder.Xml.ConformanceLevel.OPTIONAL, Cardinality .Create("1-4"), false, SpecificationVersion.R02_04_03, null, null, null, false), (BareANY)LISTImpl <ANY <object>, object> . Create <TEL, TelecommunicationAddress>(typeof(TELImpl), CreateTelecommunicationAddressList())); AssertXml("non null", "<telecom value=\"+1-519-555-2345;ext=12345\"/>" + "<telecom value=\"+1-416-555-2345;ext=12345\"/>" , result); }
public virtual void TestFormatValueNonNull() { string result = new ListR2PropertyFormatter(this.formatterRegistry).Format(new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl (this.result, null, "ids", "LIST<II>", Ca.Infoway.Messagebuilder.Xml.ConformanceLevel.OPTIONAL, Cardinality.Create("0-4" ), false, SpecificationVersion.R02_04_03, null, null, null, false), (BareANY)LISTImpl <ANY <object>, object> .Create <II, Identifier >(typeof(IIImpl), CreateIdentifierList())); Assert.IsTrue(this.result.IsValid()); Assert.AreEqual(0, this.result.GetHl7Errors().Count); AssertXml("non null", "<ids extension=\"123\" root=\"1.2.3\"/>" + "<ids extension=\"256\" root=\"2.5.6\"/>", result); }
public virtual void TestFormatWithMissingConstraint() { Relationship rootConstraint = new Relationship(); rootConstraint.Name = "root"; rootConstraint.FixedValue = "1.22.33.44"; Relationship extConstraint = new Relationship(); extConstraint.Name = "extension"; extConstraint.FixedValue = "1223344"; ConstrainedDatatype constraints = new ConstrainedDatatype("iiConstraint", "II"); constraints.Relationships.Add(rootConstraint); constraints.Relationships.Add(extConstraint); string result = new ListR2PropertyFormatter(this.formatterRegistry).Format(new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl (this.result, null, "ids", "LIST<II>", null, Ca.Infoway.Messagebuilder.Xml.ConformanceLevel.OPTIONAL, Cardinality.Create ("0-4"), false, SpecificationVersion.R02_04_03, null, null, null, constraints, false), (BareANY)LISTImpl <ANY <object>, object > .Create <II, Identifier>(typeof(IIImpl), CreateIdentifierList())); Assert.IsTrue(this.result.IsValid()); Assert.AreEqual(1, this.result.GetHl7Errors().Count); Assert.AreEqual(ErrorLevel.INFO, this.result.GetHl7Errors()[0].GetHl7ErrorLevel()); Assert.AreEqual(Hl7ErrorCode.CDA_FIXED_CONSTRAINT_PROVIDED, this.result.GetHl7Errors()[0].GetHl7ErrorCode()); Assert.AreEqual("A fixed constraint was added for compliance: root={1.22.33.44},extension={1223344}", this.result.GetHl7Errors ()[0].GetMessage()); AssertXml("non null", "<ids extension=\"123\" root=\"1.2.3\"/>" + "<ids extension=\"256\" root=\"2.5.6\"/>" + "<ids extension=\"1223344\" root=\"1.22.33.44\"/>" , result); }
public virtual void TestFormatValueNonNull() { string result = new ListPropertyFormatter(this.formatterRegistry).Format(new Ca.Infoway.Messagebuilder.Marshalling.HL7.Formatter.FormatContextImpl (new ModelToXmlResult(), null, "name", "LIST<EN>", Ca.Infoway.Messagebuilder.Xml.ConformanceLevel.OPTIONAL, Cardinality. Create("0-4"), false, SpecificationVersion.R02_04_02, null, null, null, false), (BareANY)LISTImpl <ANY <object>, object> .Create <EN <EntityName>, EntityName>(typeof(ENImpl <EntityName>), CreateEntityNameList())); Assert.AreEqual("<name xsi:type=\"PN\"><family>Flinstone</family><given>Fred</given></name>" + SystemUtils.LINE_SEPARATOR + "<name xsi:type=\"PN\"><family>Flinstone</family><given>Wilma</given></name>" + SystemUtils.LINE_SEPARATOR, result, "non null" ); }