コード例 #1
0
        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);
        }
コード例 #2
0
 public virtual void SetUp()
 {
     this.bridgeFactory             = new MockBridgeFactory();
     this.message                   = new MockMessageBean();
     this.walker                    = new TealBeanRenderWalker(this.message, null, null, null, this.bridgeFactory);
     this.visitor                   = new MockVisitor();
     this.bridgeFactory.interaction = new Interaction();
 }
コード例 #3
0
        public virtual void ShouldRenderASimpleHl7Message()
        {
            GenericResponseMessageBean tealBean = new GenericResponseMessageBean();

            MessageBeanBuilderSupport.PopulateMoreBetterStandardValues(tealBean);
            tealBean.Acknowledgement.AcknowledgementDetails.Add(CreateDetail(Ca.Infoway.Messagebuilder.Domainvalue.Transport.AcknowledgementDetailCode
                                                                             .SYNTAX_ERROR, "I hate you", Ca.Infoway.Messagebuilder.Domainvalue.Transport.AcknowledgementDetailType.ERROR));
            tealBean.Acknowledgement.AcknowledgementDetails.Add(CreateDetail(Ca.Infoway.Messagebuilder.Domainvalue.Transport.AcknowledgementDetailCode
                                                                             .UNKNOWN_SENDER, "Unauthorized user", Ca.Infoway.Messagebuilder.Domainvalue.Transport.AcknowledgementDetailType.ERROR));
            XmlRenderingVisitor visitor = new XmlRenderingVisitor(MockVersionNumber.MOCK_MR2009);

            this.walker = new TealBeanRenderWalker(tealBean, MockVersionNumber.MOCK_MR2009, null, null, new MockTestCaseMessageDefinitionService
                                                       ());
            this.walker.Accept(visitor);
            string xml = visitor.ToXml().GetXmlMessage();

            System.Console.Out.WriteLine(xml);
            AssertValidHl7Message(xml);
        }