Ejemplo n.º 1
0
 public void DeletePatientMedSupp(DeletePatientMedSuppRequest request)
 {
     try
     {
         EndpointUtil.DeletePatientMedSupp(request);
     }
     catch (Exception ex) { throw ex; }
 }
Ejemplo n.º 2
0
 public void DeletePatientMedSupp(DeletePatientMedSuppRequest request)
 {
     try
     {
         IRestClient client = new JsonServiceClient();
         //[Route("/{Context}/{Version}/{ContractNumber}/PatientMedSupp/{Id}", "DELETE")]
         var url = Common.Helper.BuildURL(string.Format("{0}/{1}/{2}/{3}/PatientMedSupp/{4}",
                                                        DDMedicationUrl,
                                                        "NG",
                                                        request.Version,
                                                        request.ContractNumber,
                                                        request.Id), request.UserId);
         DeletePatientMedSuppDataResponse dataDomainResponse = client.Delete <DeletePatientMedSuppDataResponse>(url);
     }
     catch (WebServiceException ex) { throw ex; }
 }
Ejemplo n.º 3
0
        public DeletePatientMedSuppResponse Delete(DeletePatientMedSuppRequest request)
        {
            DeletePatientMedSuppResponse response = new DeletePatientMedSuppResponse();
            ValidateTokenResponse        result   = null;

            try
            {
                if (base.Request != null)
                {
                    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;
                    MedicationManager.DeletePatientMedSupp(request);
                }
                else
                {
                    throw new UnauthorizedAccessException();
                }
            }
            catch (Exception ex)
            {
                CommonFormatter.FormatExceptionResponse(response, base.Response, ex);
                if ((ex is WebServiceException) == false)
                {
                    MedicationManager.LogException(ex);
                }
            }
            finally
            {
                List <string> patientIds = null;
                if (request.PatientId != null)
                {
                    patientIds = new List <string>();
                    patientIds.Add(request.PatientId);
                }
                if (result != null)
                {
                    string browser     = (base.Request != null) ? base.Request.UserAgent : unknownBrowserType;
                    string hostAddress = (base.Request != null) ? base.Request.UserHostAddress : unknownUserHostAddress;
                    AuditUtil.LogAuditData(request, result.SQLUserId, patientIds, browser, hostAddress, request.GetType().Name);
                }
            }
            return(response);
        }