コード例 #1
0
        private List <DsioSearchPatient> TestMockPatientSearch(string searchParam)
        {
            IRpcBroker broker = MockRpcBrokerFactory.GetDsioFemalePatientSearchBroker();

            //DsioPatientSearchCommand patSearchCommand = new DsioPatientSearchCommand(broker);
            //DsioFemalePatientSearchCommand patSearchCommand = new DsioFemalePatientSearchCommand(broker);
            DsioPatientListCommand patSearchCommand = new DsioPatientListCommand(broker);

            RpcResponse response = patSearchCommand.Execute();

            Assert.AreEqual(RpcResponseStatus.Success, response.Status);

            return(patSearchCommand.MatchingPatients);
        }
コード例 #2
0
        private void TestPatientSearch(string searchParam)
        {
            using (RpcBroker broker = GetConnectedBroker())
            {
                this.SignonToBroker(broker, 2);

                DsioPatientListCommand command = new DsioPatientListCommand(broker);

                command.AddCommandArguments(searchParam, 1, 10);

                RpcResponse response = command.Execute();

                Assert.AreEqual(RpcResponseStatus.Success, response.Status);

                broker.Disconnect();
            }
        }
コード例 #3
0
        public void TestPatientFind()
        {
            using (RpcBroker broker = GetConnectedBroker())
            {
                this.SignonToBroker(broker, 2);

                DsioPatientListCommand command = new DsioPatientListCommand(broker);

                command.AddCommandArguments(TestConfiguration.PatientSearchILast4[0], -1, -1);

                RpcResponse response = command.Execute();

                Assert.AreEqual(RpcResponseStatus.Success, response.Status);

                broker.Disconnect();
            }
        }
コード例 #4
0
        public void TestPatientSearch2()
        {
            using (RpcBroker broker = GetConnectedBroker())
            {
                this.SignonToBroker(broker, 2);

                //DsioFemalePatientSearchCommand command = new DsioFemalePatientSearchCommand(broker);
                DsioPatientListCommand command = new DsioPatientListCommand(broker);

                command.AddCommandArguments("Ay", 1, 10);

                RpcResponse response = command.Execute();

                Assert.AreEqual(RpcResponseStatus.Success, response.Status);

                broker.Disconnect();
            }
        }
コード例 #5
0
        public PatientSearchResult Search(string searchParam, int page, int itemsPerPage)
        {
            // *** Gets female patients matching search criteria ***

            PatientSearchResult result = new PatientSearchResult();

            //DsioFemalePatientSearchCommand patSearchCommand;

            //if (Regex.IsMatch(searchParam, @"^[a-zA-Z]\d{4}$"))
            //{
            //    // *** Use Find command ***
            //    DsioFemalePatientFindCommand tempCommand = new DsioFemalePatientFindCommand(broker);

            //    tempCommand.AddCommandArguments(searchParam.ToUpper());

            //    patSearchCommand = tempCommand;
            //}
            //else
            //{
            //    // *** Use Search command ***
            //    patSearchCommand = new DsioFemalePatientSearchCommand(broker);

            //    // *** Set arguments/parameters ***
            //    if (string.IsNullOrWhiteSpace(searchParam))
            //        patSearchCommand.AddCommandArguments("", page, itemsPerPage);
            //    else
            //        patSearchCommand.AddCommandArguments(searchParam.ToUpper(), page, itemsPerPage);
            //}

            // *** Execute command ***
            //RpcResponse response = patSearchCommand.Execute();

            DsioPatientListCommand patSearchCommand = new DsioPatientListCommand(broker);

            patSearchCommand.AddCommandArguments(searchParam, page, itemsPerPage);

            RpcResponse response = patSearchCommand.Execute();

            // *** Set return values ***
            result.Success = (response.Status == RpcResponseStatus.Success);
            result.Message = response.InformationalMessage;

            // *** If we have patients, then add them to return ***
            if (response.Status == RpcResponseStatus.Success)
            {
                if (patSearchCommand.MatchingPatients != null)
                {
                    if (patSearchCommand.MatchingPatients.Count > 0)
                    {
                        foreach (DsioSearchPatient commandPatient in patSearchCommand.MatchingPatients)
                        {
                            SearchPatient uiPatient = GetSearchPatient(commandPatient);

                            if (uiPatient != null)
                            {
                                result.Patients.Add(uiPatient);
                            }
                        }
                    }
                }
                result.TotalResults = patSearchCommand.TotalResults;
            }

            return(result);
        }