Example #1
0
        public void TestSaveNewPatientChecklistItem()
        {
            using (RpcBroker broker = this.GetConnectedBroker())
            {
                this.SignonToBroker(broker, 2);

                DsioSaveMccPatChecklistCommand command = new DsioSaveMccPatChecklistCommand(broker);

                DsioPatientChecklistItem item = new DsioPatientChecklistItem()
                {
                    PatientDfn          = "28",
                    PregnancyIen        = "4",
                    Category            = "First Trimester Requirements",
                    Description         = "Friday Tests",
                    ItemType            = DsioChecklistItemType.Lab,
                    DueCalculationType  = DsioChecklistCalculationType.None,
                    DueCalculationValue = "0",
                    CompletionStatus    = DsioChecklistCompletionStatus.Complete,
                    Link            = "12345",
                    SpecificDueDate = Util.GetFileManDate(new DateTime(2014, 9, 1)),
                    CompletionLink  = "54321",
                    Note            = "Checklist Item Note Text",
                    InProgress      = "1",
                    EducationIen    = "8"
                };

                command.AddCommandArguments(item);

                RpcResponse response = command.Execute();

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

                broker.Disconnect();
            }
        }
Example #2
0
        public void TestDeletePatientChecklistItem()
        {
            using (RpcBroker broker = this.GetConnectedBroker())
            {
                this.SignonToBroker(broker, 2);

                DsioPregnancy preg = this.GetOrCreatePregnancy(broker, TestConfiguration.DefaultPatientDfn);

                Assert.IsNotNull(preg);

                DsioSaveMccPatChecklistCommand saveCommand = new DsioSaveMccPatChecklistCommand(broker);

                DsioPatientChecklistItem item = new DsioPatientChecklistItem()
                {
                    PatientDfn          = TestConfiguration.DefaultPatientDfn,
                    PregnancyIen        = preg.Ien,
                    Category            = "First Trimester Requirements",
                    Description         = "Friday Tests",
                    ItemType            = DsioChecklistItemType.Lab,
                    DueCalculationType  = DsioChecklistCalculationType.None,
                    DueCalculationValue = "0",
                    CompletionStatus    = DsioChecklistCompletionStatus.Complete,
                    Link            = "12345",
                    SpecificDueDate = Util.GetFileManDate(new DateTime(2014, 9, 1)),
                    CompletionLink  = "54321",
                    Note            = "Checklist Item Note Text",
                    InProgress      = "1"
                };

                saveCommand.AddCommandArguments(item);

                RpcResponse response = saveCommand.Execute();

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

                Assert.IsFalse(string.IsNullOrWhiteSpace(saveCommand.Ien));

                DsioDeleteMccPatChklstCommand delCommand = new DsioDeleteMccPatChklstCommand(broker);

                delCommand.AddCommandArguments(TestConfiguration.DefaultPatientDfn, saveCommand.Ien);

                response = delCommand.Execute();

                Assert.AreEqual(RpcResponseStatus.Success, response.Status);
            }
        }
Example #3
0
        public IenResult SavePregnancyItem(PregnancyChecklistItem item)
        {
            IenResult result = new IenResult();

            if (this.broker != null)
            {
                DsioSaveMccPatChecklistCommand command = new DsioSaveMccPatChecklistCommand(broker);

                DsioChecklistItem dsioItem = GetDsioChecklistItem(item);

                DsioPatientChecklistItem patItem = new DsioPatientChecklistItem(dsioItem);

                patItem.PatientDfn   = item.PatientDfn;
                patItem.PregnancyIen = item.PregnancyIen;
                if (item.SpecificDueDate != DateTime.MinValue)
                {
                    patItem.SpecificDueDate = Util.GetFileManDate(item.SpecificDueDate);
                }
                patItem.CompletionStatus = item.CompletionStatus;
                patItem.CompleteDate     = Util.GetFileManDate(item.CompleteDate);
                patItem.CompletionLink   = item.CompletionLink;
                patItem.CompletedBy      = item.CompletedBy;
                patItem.Note             = item.StoredNote;
                patItem.InProgress       = (item.InProgress) ? "1" : "0";

                // *** These items not saved - generated internally ***
                //patItem.User = item.User;
                //patItem.ItemDate = Util.GetFileManDate(item.ItemDate);

                command.AddCommandArguments(patItem);

                RpcResponse response = command.Execute();

                result.SetResult(response.Status == RpcResponseStatus.Success, response.InformationalMessage);

                if (result.Success)
                {
                    result.Ien = command.Ien;
                }
            }

            return(result);
        }