Пример #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 ShouldWriteValidXml()
        {
            FindCandidatesQueryMessageBean query = new FindCandidatesQueryMessageBean();

            new MessageBeanFactory(new DefaultValueHolder()).Populate(query);
            string xml = this.transformer.TransformToHl7(MockVersionNumber.MOCK_NEWFOUNDLAND, query).GetXmlMessage();

            AssertIsValidXml(xml);
        }
Пример #3
0
        public virtual void ShouldCreateDefaultInteractionId()
        {
            FindCandidatesQueryMessageBean query = new FindCandidatesQueryMessageBean();

            new MessageBeanFactory(new DefaultValueHolder()).Populate(query);
            string xml = this.transformer.TransformToHl7(MockVersionNumber.MOCK_NEWFOUNDLAND, query).GetXmlMessage();

            Assert.IsTrue(xml.Contains(" extension=\"PRPA_IN101103CA\" "), "interaction id");
        }
Пример #4
0
        public virtual void ShouldCreateDefaultVersionCode()
        {
            FindCandidatesQueryMessageBean query = new FindCandidatesQueryMessageBean();

            new MessageBeanFactory(new DefaultValueHolder()).Populate(query);
            string xml = this.transformer.TransformToHl7(MockVersionNumber.MOCK_NEWFOUNDLAND, query).GetXmlMessage();

            Assert.IsTrue(xml.Contains("<versionCode code=\"V3-2007-05\"/>"), "version code");
        }
Пример #5
0
        public virtual void ShouldRenderCompleteSolution()
        {
            FindCandidatesQueryMessageBean message = new FindCandidatesQueryMessageBean();

            message.ControlActEventBean = new QueryControlActEventBean <FindCandidatesCriteria>(new FindCandidatesCriteria());
            message.ControlActEventBean.GetCriteria().BirthDate = DateUtil.GetDate(1966, 0, 5);
            XmlRenderingVisitor visitor = new XmlRenderingVisitor(MockVersionNumber.MOCK_NEWFOUNDLAND);

            new TealBeanRenderWalker(message, MockVersionNumber.MOCK_NEWFOUNDLAND, null, null, this.service).Accept(visitor);
            System.Console.Out.WriteLine(visitor.ToXml().GetXmlMessage());
        }
Пример #6
0
        public virtual void ShouldMapPatientReferralSummariesQueryResponseMessageBean()
        {
            XmlToModelResult xmlResult          = new Hl7SourceMapper().MapToTeal(this.messageSource);
            FindCandidatesQueryMessageBean teal = (FindCandidatesQueryMessageBean)xmlResult.GetMessageObject();

            Assert.IsNotNull(teal, "message Bean");
            Assert.AreEqual("1ee83ff1-08ab-4fe7-b573-ea777e9bad51", teal.MessageIdentifier.Root, "id");
            Assert.AreEqual("P", teal.ProcessingCode.CodeValue, "processingId");
            Assert.AreEqual("Panacea Pharmacy", teal.Sender.SoftwareName, "sender.softwareName");
            Assert.AreEqual("987.654.321.0", teal.Sender.TelecommunicationAddress.Address, "sender.telecommunicationAddress");
            Assert.IsNotNull(teal.Receiver.DeviceId, "receiver.deviceId");
            Assert.AreEqual("123.255.255.10", teal.Receiver.TelecommunicationAddress.Address, "receiver.telecommunicationAddress");
            Assert.AreEqual("PRPA_TE101103CA", teal.ControlActEventBean.Code.CodeValue, "controlActEvent.code");
            Assert.AreEqual("J", teal.ControlActEventBean.QueryByParameter.ParameterList.PersonNames[0].GivenName, "criteria first name"
                            );
            Assert.AreEqual("Smith", teal.ControlActEventBean.QueryByParameter.ParameterList.PersonNames[0].FamilyName, "criteria last name"
                            );
        }