public void TestGetPregnancies()
        {
            using (RpcBroker broker = this.GetConnectedBroker())
            {
                this.SignonToBroker(broker, 2);

                DsioGetPregDetailsCommand command = new DsioGetPregDetailsCommand(broker);

                command.AddCommandArguments(TestConfiguration.DefaultPatientDfn, "");

                RpcResponse response = command.Execute();

                Assert.AreEqual(RpcResponseStatus.Success, response.Status);
            }
        }
        public void TestGetPregnanciesBadPatient()
        {
            using (RpcBroker broker = this.GetConnectedBroker())
            {
                this.SignonToBroker(broker, 2);

                DsioGetPregDetailsCommand command = new DsioGetPregDetailsCommand(broker);

                command.AddCommandArguments("100099", "");

                RpcResponse response = command.Execute();

                Assert.AreEqual(RpcResponseStatus.Success, response.Status);
                Assert.IsTrue(command.PregnancyList.Count == 0);
            }
        }
        public PregnancyListResult GetPregnancies(string patientDfn, string pregnancyIen)
        {
            PregnancyListResult result = new PregnancyListResult();

            // *** Create the command ***
            DsioGetPregDetailsCommand command = new DsioGetPregDetailsCommand(this.broker);

            // *** Add arguments...gets all ***
            command.AddCommandArguments(patientDfn, pregnancyIen);

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

            // *** Add response to result ***
            result.SetResult(response.Status == RpcResponseStatus.Success, response.InformationalMessage);

            // *** Check for success ***
            if (result.Success)
            {
                // *** Loop through the list and create strongly typed pregnancy list ***
                if (command.PregnancyList != null)
                {
                    foreach (DsioPregnancy dsioPreg in command.PregnancyList)
                    {
                        if (result.Pregnancies == null)
                        {
                            result.Pregnancies = new List <PregnancyDetails>();
                        }

                        PregnancyDetails tempPregnancy = CreatePregnancy(dsioPreg);

                        result.Pregnancies.Add(tempPregnancy);
                    }
                }

                // *** If no pregnancies, then nothing found ***
                if (result.Pregnancies == null)
                {
                    result.SetResult(true, "No Pregnancy Data Found");
                }
            }

            return(result);
        }
        protected DsioPregnancy GetAnyPregnancy(IRpcBroker broker, string patientDfn)
        {
            DsioPregnancy returnVal = null;

            DsioGetPregDetailsCommand command = new DsioGetPregDetailsCommand(broker);

            command.AddCommandArguments(patientDfn, "");

            RpcResponse response = command.Execute();

            if (response.Status == RpcResponseStatus.Success)
            {
                if (command.PregnancyList != null)
                {
                    if (command.PregnancyList.Count > 0)
                    {
                        returnVal = command.PregnancyList[0];
                    }
                }
            }

            return(returnVal);
        }
예제 #5
0
        public void TestGetPregnancies()
        {
            using (RpcBroker broker = this.GetConnectedBroker())
            {
                this.SignonToBroker(broker, 2);

                DsioGetPregDetailsCommand command = new DsioGetPregDetailsCommand(broker);

                //command.AddCommandArguments("715", "7");
                //command.AddCommandArguments("10", "");
                //command.AddCommandArguments("100010", "");
                //command.AddCommandArguments("144", "");
                //command.AddCommandArguments("100007", "");
                //command.AddCommandArguments("766", "41");
                //command.AddCommandArguments("367", "58");
                //command.AddCommandArguments("643", "68");
                command.AddCommandArguments("126", "");

                RpcResponse response = command.Execute();

                Assert.AreEqual(RpcResponseStatus.Success, response.Status);
            }
        }
        public void TestCreateAndRetrieveHistoricalPregnancy()
        {
            using (RpcBroker broker = this.GetConnectedBroker())
            {
                this.SignonToBroker(broker, 2);

                DsioSavePregDetailsCommand createCommand = new DsioSavePregDetailsCommand(broker);

                DsioPregnancy preg = new DsioPregnancy();
                preg.PatientDfn       = TestConfiguration.DefaultPatientDfn;
                preg.Ien              = "";
                preg.RecordType       = "HISTORICAL";
                preg.FatherOfFetusIen = "U";
                preg.EDD              = "";
                preg.StartDate        = "";
                preg.EndDate          = "05/05/2011";
                preg.ObstetricianIen  = "";
                preg.LDFacilityIen    = "";

                preg.GestationalAgeAtDelivery = "145";
                preg.LengthOfLabor            = "12";
                preg.TypeOfDelivery           = "Caesarean";
                preg.Anesthesia      = "Epidural";
                preg.PretermDelivery = "YES";
                preg.Outcome         = "PretermDelivery";

                preg.Comment  = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
                preg.HighRisk = "1";

                preg.HighRiskDetails = "eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";

                createCommand.AddCommandArguments(preg, false);

                RpcResponse response = createCommand.Execute();

                Assert.IsNotNull(response);
                Assert.AreEqual(RpcResponseStatus.Success, response.Status);
                Assert.IsFalse(string.IsNullOrWhiteSpace(createCommand.Ien));

                string ien = createCommand.Ien;

                DsioGetPregDetailsCommand getCommand = new DsioGetPregDetailsCommand(broker);

                getCommand.AddCommandArguments(TestConfiguration.DefaultPatientDfn, ien);

                response = getCommand.Execute();

                Assert.AreEqual(RpcResponseStatus.Success, response.Status);
                Assert.IsNotNull(getCommand.PregnancyList);
                Assert.IsTrue(getCommand.PregnancyList.Count > 0);
                Assert.IsTrue(getCommand.PregnancyList.Count == 1);

                DsioPregnancy returnedPreg = getCommand.PregnancyList[0];

                Assert.AreEqual(preg.PatientDfn, returnedPreg.PatientDfn);
                Assert.AreNotEqual(preg.Ien, returnedPreg.Ien);
                Assert.AreEqual(preg.RecordType, returnedPreg.RecordType);
                Assert.IsTrue(preg.FatherOfFetusIen.Equals(returnedPreg.FatherOfFetusIen, StringComparison.InvariantCultureIgnoreCase));
                Assert.AreEqual(preg.EDD, returnedPreg.EDD);
                Assert.AreEqual(preg.StartDate, returnedPreg.StartDate);
                Assert.AreEqual(preg.EndDate, returnedPreg.EndDate);

                Assert.AreEqual(preg.GestationalAgeAtDelivery, returnedPreg.GestationalAgeAtDelivery);
                Assert.AreEqual(preg.LengthOfLabor, returnedPreg.LengthOfLabor);
                Assert.AreEqual(preg.Anesthesia, returnedPreg.Anesthesia);
                Assert.AreEqual(preg.Comment, returnedPreg.Comment);
                Assert.AreEqual(preg.HighRiskDetails, returnedPreg.HighRiskDetails);

                Assert.AreEqual(preg.HighRisk, returnedPreg.HighRisk);
                Assert.AreEqual(preg.TypeOfDelivery, returnedPreg.TypeOfDelivery);
                Assert.AreEqual(preg.PretermDelivery, returnedPreg.PretermDelivery);
                Assert.AreEqual(preg.Outcome, returnedPreg.Outcome);
            }
        }