public PostDeletePatientGoalResponse DeletePatientGoal(PostDeletePatientGoalRequest request) { try { PostDeletePatientGoalResponse pgr = new PostDeletePatientGoalResponse(); bool result = false; // we can thread here if we want! // save goals GoalsEndpointUtil.DeleteGoalRequest(request); // save barriers GoalsUtil.DeletePatientGoalBarriers(request); // save tasks GoalsUtil.DeletePatientGoalTasks(request); // save interventions GoalsUtil.DeletePatientGoalInterventions(request); pgr.Result = result; return(pgr); } catch (Exception ex) { throw new Exception("AD:DeletePatientGoal()::" + ex.Message, ex.InnerException); } }
public void Post_PatientGoal_Delete_Test() { string contractNumber = "InHealth001"; string context = "NG"; double version = 1.0; string token = "5303ddbdd6a4850f14a7a83c"; string patientId = "52e26f0b072ef7191c111c4d"; string patientGoalId = "52e26f0b072ef7191c111234"; IRestClient client = new JsonServiceClient(); PostDeletePatientGoalResponse response = client.Post <PostDeletePatientGoalResponse>( string.Format(@"http://localhost:888/Nightingale/{0}/{1}/Patient/{2}/Goal/{3}/Delete/?Token={4}", version, contractNumber, patientId, patientGoalId, token), new PostDeletePatientGoalRequest { } as object); }
public PostDeletePatientGoalResponse Post(PostDeletePatientGoalRequest request) { PostDeletePatientGoalResponse response = null; GoalsManager gm = new GoalsManager(); 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 = gm.DeletePatientGoal(request); } else { throw new UnauthorizedAccessException(); } } catch (Exception ex) { CommonFormatter.FormatExceptionResponse(response, base.Response, ex); if ((ex is WebServiceException) == false) { gm.LogException(ex); } } finally { if (result != null) { AuditHelper.LogAuditData(request, result.SQLUserId, null, System.Web.HttpContext.Current.Request, request.GetType().Name); } } return(response); }