コード例 #1
0
        public DeletePatientUtilizationResponse Delete(DeletePatientUtilizationRequest request)
        {
            DeletePatientUtilizationResponse response = null;
            ValidateTokenResponse result = null;

            try
            {
                request.Token = base.Request.Headers["Token"] as string;
                result = Security.IsUserValidated(request.Version, request.Token, request.ContractNumber);
                if (result.UserId.Trim() != string.Empty)
                {
                    request.UserId = result.UserId;
                    response = UtilManager.DeletePatientUtilization(request);
                }
                else
                    throw new UnauthorizedAccessException();
            }
            catch (Exception ex)
            {
                CommonFormatter.FormatExceptionResponse(response, base.Response, ex);
                if ((ex is WebServiceException) == false)
                    UtilManager.LogException(ex);
            }
            finally
            {
                List<string> patientIds = new List<string>();

                if (response.Success)
                    patientIds.Add(request.PatientId);

                if (result != null)
                    AuditHelper.LogAuditData(request, result.SQLUserId, patientIds, HttpContext.Current.Request, request.GetType().Name);
            }
            return response;
        }
コード例 #2
0
ファイル: UtilizationManager.cs プロジェクト: rotovibe/engage
        public DeletePatientUtilizationResponse DeletePatientUtilization(DeletePatientUtilizationRequest request)
        {
            try
            {
                var result = new DeletePatientUtilizationResponse();

                //[Route("/{Context}/{Version}/{ContractNumber}/Patient/{PatientId}/Notes/Utilization/{Id}", "GET")]
                IRestClient client = new JsonServiceClient();
                var         url    = Helper.BuildURL(string.Format("{0}/{1}/{2}/{3}/Patient/{4}/Notes/Utilizations/{5}",
                                                                   DdPatientNoteUrl,
                                                                   "NG",
                                                                   request.Version,
                                                                   request.ContractNumber,
                                                                   request.PatientId,
                                                                   request.Id), request.UserId);

                DeletePatientUtilizationDataResponse ddResponse = client.Delete <DeletePatientUtilizationDataResponse>(url);

                if (ddResponse != null)
                {
                    result.Success = true;
                }

                return(result);
            }
            catch (WebServiceException ex) { throw ex; }
        }