Exemple #1
0
        public void TestUpdateNonVAItem()
        {
            using (RpcBroker broker = GetConnectedBroker())
            {
                this.SignonToBroker(broker, 3);

                string newIen = SaveNewNonVAItem(broker);

                DsioGetExternalEntityCommand getCommand = new DsioGetExternalEntityCommand(broker);

                getCommand.AddCommandArguments(newIen, 1, 10);

                RpcResponse response = getCommand.Execute();

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

                DsioSaveExternalEntityCommand command = new DsioSaveExternalEntityCommand(broker);

                Assert.IsNotNull(getCommand.NonVAEntities);
                Assert.IsTrue(getCommand.NonVAEntities.Count == 1);

                DsioNonVAItem nonVAEntity = getCommand.NonVAEntities[0];

                nonVAEntity.EntityName = string.Format("Updated {0} Hospital", GetRandom());

                command.AddCommandArguments(nonVAEntity);

                response = command.Execute();

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

                DsioGetExternalEntityCommand command = new DsioGetExternalEntityCommand(broker);

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

                RpcResponse response = command.Execute();

                Assert.AreEqual(RpcResponseStatus.Success, response.Status);
            }
        }
Exemple #3
0
        public void TestUpdateNonVAItem()
        {
            using (RpcBroker broker = GetConnectedBroker())
            {
                this.SignonToBroker(broker, 3);

                DsioGetExternalEntityCommand getCommand = new DsioGetExternalEntityCommand(broker);

                getCommand.AddCommandArguments("7", 1, 10);

                RpcResponse response = getCommand.Execute();

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

                DsioSaveExternalEntityCommand command = new DsioSaveExternalEntityCommand(broker);

                Assert.IsNotNull(getCommand.NonVAEntities);
                Assert.IsTrue(getCommand.NonVAEntities.Count == 1);

                DsioNonVAItem nonVAEntity = getCommand.NonVAEntities[0];

                nonVAEntity.EntityName = "Smallest Hospital Four";

                //nonVAEntity.Ien = "";
                //nonVAEntity.EntityName = "Smallish Hospital Four";
                //nonVAEntity.EntityType = "F";
                //nonVAEntity.Address.StreetLine1 = "789 Test Street";
                //nonVAEntity.Address.StreetLine2 = "Suite XFD";
                //nonVAEntity.Address.City = "Sacramento";
                //nonVAEntity.Address.State = "CA";
                //nonVAEntity.Address.ZipCode = "93939";
                //nonVAEntity.TelephoneList.Add(new DsioTelephone() { Number = "8009008000", Usage = DsioTelephone.WorkPhoneUsage });
                //nonVAEntity.TelephoneList.Add(new DsioTelephone() { Number = "8887776666", Usage = DsioTelephone.FaxUsage });

                //nonVAEntity.PrimaryContact = "Extra Important";
                //nonVAEntity.Inactive = "0";

                command.AddCommandArguments(nonVAEntity);

                response = command.Execute();

                Assert.AreEqual(RpcResponseStatus.Success, response.Status);
            }
        }
        private NonVACareItemsResult GetList(string commandArgument, int page, int itemsPerPage, bool includeInactive)
        {
            // *** Get a list of all non va items ***

            NonVACareItemsResult result = new NonVACareItemsResult();

            // *** Create the command ***
            DsioGetExternalEntityCommand command = new DsioGetExternalEntityCommand(broker);

            // *** Add the arguments ***
            command.AddCommandArguments(commandArgument, page, itemsPerPage);

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

            // *** Gather the results ***
            result.Success = (response.Status == RpcResponseStatus.Success);
            result.Message = response.InformationalMessage;

            // *** Check for success ***
            if (result.Success)
            {
                result.TotalResults = command.TotalResults;

                if (result.TotalResults > 0)
                {
                    // *** Go through each returned item ***
                    foreach (DsioNonVAItem dsioItem in command.NonVAEntities)
                    {
                        NonVACareItem item = GetNonVACareItem(dsioItem);

                        // *** Add if active or including inactive ***
                        if ((item.Inactive == false) || (includeInactive))
                        {
                            result.Items.Add(item);
                        }
                    }
                }
            }

            return(result);
        }
Exemple #5
0
        public void TestSaveNewNonVAItem()
        {
            using (RpcBroker broker = GetConnectedBroker())
            {
                this.SignonToBroker(broker, 2);

                DsioSaveExternalEntityCommand command = new DsioSaveExternalEntityCommand(broker);

                DsioNonVAItem nonVAEntity = new DsioNonVAItem();

                string randomName = string.Format("{0} Hospital", GetRandom());

                nonVAEntity.Ien                 = "";
                nonVAEntity.EntityType          = "P";
                nonVAEntity.EntityName          = randomName;
                nonVAEntity.Address.StreetLine1 = "789 Test Street";
                nonVAEntity.Address.StreetLine2 = "Suite XFD";
                nonVAEntity.Address.City        = "Sacramento";
                nonVAEntity.Address.State       = "CA";
                nonVAEntity.Address.ZipCode     = "93939";
                nonVAEntity.TelephoneList.Add(new DsioTelephone()
                {
                    Number = "(800)900-8000", Usage = DsioTelephone.WorkPhoneUsage
                });
                nonVAEntity.TelephoneList.Add(new DsioTelephone()
                {
                    Number = "(888)777-6666", Usage = DsioTelephone.FaxUsage
                });

                nonVAEntity.PrimaryContact = "Extra Important";
                nonVAEntity.Inactive       = "0";

                command.AddCommandArguments(nonVAEntity);

                RpcResponse response = command.Execute();

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

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

                DsioGetExternalEntityCommand getCommand = new DsioGetExternalEntityCommand(broker);

                getCommand.AddCommandArguments(command.Ien, 1, 100);

                response = getCommand.Execute();

                Assert.AreEqual(RpcResponseStatus.Success, response.Status);
                Assert.IsNotNull(getCommand.NonVAEntities);
                Assert.AreEqual(1, getCommand.NonVAEntities.Count);

                DsioNonVAItem item = getCommand.NonVAEntities[0];

                Assert.IsTrue(nonVAEntity.EntityName.Equals(item.EntityName, StringComparison.InvariantCultureIgnoreCase));
                //Assert.AreEqual(nonVAEntity.EntityType, item.EntityType);
                Assert.AreEqual(nonVAEntity.Address.StreetLine1, item.Address.StreetLine1);
                Assert.AreEqual(nonVAEntity.Address.StreetLine2, item.Address.StreetLine2);
                Assert.AreEqual(nonVAEntity.Address.City, item.Address.City);
                Assert.AreEqual(nonVAEntity.Address.State, item.Address.State);
                Assert.AreEqual(nonVAEntity.Address.ZipCode, item.Address.ZipCode);

                Assert.IsNotNull(item.TelephoneList);
                Assert.AreEqual(nonVAEntity.TelephoneList.Count, item.TelephoneList.Count);

                Assert.AreEqual(nonVAEntity.TelephoneList[0].Usage, item.TelephoneList[0].Usage);
                Assert.AreEqual(nonVAEntity.TelephoneList[0].Number, item.TelephoneList[0].Number);

                Assert.AreEqual(nonVAEntity.TelephoneList[1].Usage, item.TelephoneList[1].Usage);
                Assert.AreEqual(nonVAEntity.TelephoneList[1].Number, item.TelephoneList[1].Number);

                Assert.AreEqual(nonVAEntity.PrimaryContact, item.PrimaryContact);
                Assert.AreEqual(nonVAEntity.Inactive, item.Inactive);
            }
        }