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); }
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; } }
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); } }
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); }