public virtual void ShouldRenderASimpleMessageWithTemplates() { FindCandidatesQueryMessageBean tealBean = new FindCandidatesQueryMessageBean(); tealBean.ControlActEventBean = new QueryControlActEventBean <FindCandidatesCriteria>(); tealBean.ControlActEventBean.QueryByParameter.ParameterList = new FindCandidatesCriteria(); MessageBeanBuilderSupport.PopulateMoreBetterStandardValues(tealBean); tealBean.ControlActEventBean.Code = Ca.Infoway.Messagebuilder.Domainvalue.Transport.HL7TriggerEventCode.FIND_CANDIDATES_QUERY; this.walker = new TealBeanRenderWalker(tealBean, MockVersionNumber.MOCK_MR2009, null, null, new MockTestCaseMessageDefinitionService ()); AuthorBean author = new AuthorBean(); author.Time = new PlatformDate(); author.Id = new Identifier("1.2.3.4", "authorExtension"); tealBean.ControlActEventBean.Author = author; tealBean.ControlActEventBean.QueryId = new Identifier(UUID.RandomUUID().ToString()); tealBean.ControlActEventBean.EventId = new Identifier(UUID.RandomUUID().ToString()); tealBean.ControlActEventBean.GetCriteria().Gender = Ca.Infoway.Messagebuilder.Domainvalue.Payload.AdministrativeGender.MALE; XmlRenderingVisitor visitor = new XmlRenderingVisitor(MockVersionNumber.MOCK_MR2009); this.walker.Accept(visitor); string xml = visitor.ToXml().GetXmlMessage(); System.Console.Out.WriteLine(xml); AssertValidHl7Message(xml); }
public virtual void ShouldMapPatientChoice() { AuthorBean teal = (AuthorBean) new Hl7SourceMapper().MapPartSourceToTeal(this.partSource, null); Assert.IsNotNull(teal, "teal"); Assert.IsNotNull(teal.AuthorPerson, "patient"); Assert.IsTrue(teal.AuthorPerson is AssignedPersonBean, "patient type"); }
public virtual void ShouldMapChoiceWithNullFlavor() { AuthorBean bean = (AuthorBean)MapPartSourceToTeal(MockVersionNumber.MOCK_NEWFOUNDLAND, XML_CHOICE_WITH_NULL_FLAVOR, "MFMI_MT700751CA.Author_V02R02" ); Assert.IsNotNull(bean, "teal bean"); Assert.IsTrue(((AssignedPersonBean)bean.AuthorPerson).HasNullFlavor(), "choice has null flavor"); Assert.AreEqual(Ca.Infoway.Messagebuilder.Domainvalue.Nullflavor.NullFlavor.OTHER.CodeValue, ((AssignedPersonBean)bean.AuthorPerson ).NullFlavor.CodeValue, "choice null flavor"); }