Example #1
0
        public void DeleteCohortPatientView_Test()
        {
            //[Route("/{Context}/{Version}/{ContractNumber}/PatientUser/Patient/{PatientId}/Delete", "DELETE")]
            string url = Common.Helper.BuildURL(string.Format("{0}/{1}/{2}/{3}/CohortPatientView/Patient/{4}/Delete",
                                                              ddUrl,
                                                              context,
                                                              version,
                                                              contractNumber,
                                                              patientId), userId);
            DeleteCohortPatientViewDataResponse response = client.Delete <DeleteCohortPatientViewDataResponse>(url);

            Assert.IsNotNull(response);
        }
Example #2
0
        public DeleteCohortPatientViewDataResponse DeleteCohortPatientViewByPatientId(DeleteCohortPatientViewDataRequest request)
        {
            DeleteCohortPatientViewDataResponse response = null;

            try
            {
                response = new DeleteCohortPatientViewDataResponse();

                IPatientRepository    cpvRepo = Factory.GetRepository(request, RepositoryType.CohortPatientView);
                CohortPatientViewData cpvData = cpvRepo.FindCohortPatientViewByPatientId(request.PatientId);
                if (cpvData != null)
                {
                    request.Id = cpvData.Id;
                    cpvRepo.Delete(request);
                    response.DeletedId = request.Id;
                }
                response.Success = true;
                return(response);
            }
            catch (Exception ex) { throw ex; }
        }
Example #3
0
 public void Execute()
 {
     try
     {
         //[Route("/{Context}/{Version}/{ContractNumber}/CohortPatientView/Patient/{PatientId}/Delete", "DELETE")]
         string cpvUrl = Common.Helper.BuildURL(string.Format("{0}/{1}/{2}/{3}/CohortPatientView/Patient/{4}/Delete",
                                                              DDPatientServiceURL,
                                                              "NG",
                                                              request.Version,
                                                              request.ContractNumber,
                                                              request.Id), request.UserId);
         DeleteCohortPatientViewDataResponse cpvDDResponse = client.Delete <DeleteCohortPatientViewDataResponse>(cpvUrl);
         if (cpvDDResponse != null && cpvDDResponse.Success)
         {
             deletedId = cpvDDResponse.DeletedId;
         }
     }
     catch (Exception ex)
     {
         throw new Exception("AD: CohortPatientViewCommand Execute::" + ex.Message, ex.InnerException);
     }
 }
Example #4
0
        public DeleteCohortPatientViewDataResponse Delete(DeleteCohortPatientViewDataRequest request)
        {
            DeleteCohortPatientViewDataResponse response = new DeleteCohortPatientViewDataResponse();

            try
            {
                if (string.IsNullOrEmpty(request.UserId))
                {
                    throw new UnauthorizedAccessException("PatientDD:DeleteCohortPatientView()::Unauthorized Access");
                }

                response         = PatientManager.DeleteCohortPatientViewByPatientId(request);
                response.Version = request.Version;
            }
            catch (Exception ex)
            {
                CommonFormatterUtil.FormatExceptionResponse(response, base.Response, ex);

                string aseProcessID = ConfigurationManager.AppSettings.Get("ASEProcessID") ?? "0";
                Helpers.LogException(int.Parse(aseProcessID), ex);
            }
            return(response);
        }