public GetPatientGoalResponse GetPatientGoal(GetPatientGoalRequest request) { try { GetPatientGoalResponse response = new GetPatientGoalResponse(); response.Goal = GoalsEndpointUtil.GetPatientGoal(request); response.Version = request.Version; return(response); } catch (Exception ex) { throw new Exception("AD:GetPatientGoal()::" + ex.Message, ex.InnerException); } }
public void GetPaitentGoal_Test() { GetPatientGoalRequest request = new GetPatientGoalRequest(); request.ContractNumber = "InHealth001"; request.UserId = "AD_TestHarness"; request.Version = 1; request.Id = "543c2eb284ac0509803de12a"; request.PatientId = "543c2e6b84ac050980224c50"; request.UserId = "Snehal"; GoalsManager gManager = new GoalsManager(); GetPatientGoalResponse response = gManager.GetPatientGoal(request); Assert.IsNotNull(response); }
public GetPatientGoalResponse Get(GetPatientGoalRequest request) { GetPatientGoalResponse response = new GetPatientGoalResponse(); 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.GetPatientGoal(request); } else { throw new UnauthorizedAccessException(); } } catch (Exception ex) { CommonFormatter.FormatExceptionResponse(response, base.Response, ex); if ((ex is WebServiceException) == false) { gm.LogException(ex); } } finally { List <string> patientIds = null; if (response.Goal != null) { patientIds = new List <string>(); patientIds.Add(response.Goal.PatientId); } if (result != null) { AuditHelper.LogAuditData(request, result.SQLUserId, patientIds, System.Web.HttpContext.Current.Request, request.GetType().Name); } } return(response); }
public static PatientGoal GetPatientGoal(GetPatientGoalRequest request) { try { PatientGoal result = null; //[Route("/{Context}/{Version}/{ContractNumber}/Patient/{PatientId}/Goal/{Id}", "GET")] IRestClient client = new JsonServiceClient(); string url = Common.Helper.BuildURL(string.Format("{0}/{1}/{2}/{3}/Patient/{4}/Goal/{5}", DDPatientGoalsServiceUrl, "NG", request.Version, request.ContractNumber, request.PatientId, request.Id), request.UserId); GetPatientGoalDataResponse ddResponse = client.Get <GetPatientGoalDataResponse>( url); if (ddResponse != null && ddResponse.GoalData != null) { //Make a call to AttributeLibrary to get attributes details for Goal and Task. List <CustomAttribute> goalAttributesLibrary = GoalsEndpointUtil.GetAttributesLibraryByType(request, 1); List <CustomAttribute> taskAttributesLibrary = GoalsEndpointUtil.GetAttributesLibraryByType(request, 2); result = GoalsUtil.ConvertToGoal(ddResponse.GoalData, goalAttributesLibrary); result.Barriers = GoalsUtil.ConvertToBarriers(ddResponse.GoalData.BarriersData); result.Tasks = GoalsUtil.ConvertToTasks(ddResponse.GoalData.TasksData, taskAttributesLibrary); result.Interventions = GoalsUtil.ConvertToInterventions(request, client, ddResponse.GoalData.InterventionsData); } return(result); } catch (WebServiceException ex) { throw new WebServiceException("AD:GetPatientGoal()::" + ex.Message, ex.InnerException); } }
public PatientGoal GetPatientGoal(GetPatientGoalRequest request) { throw new NotImplementedException(); }