Ejemplo n.º 1
0
        public void GetAllPatientGoal_Test()
        {
            GetAllPatientGoalsRequest request = new GetAllPatientGoalsRequest();

            request.ContractNumber = "InHealth001";
            request.UserId         = "531f2df5072ef727c4d2a3bc";
            request.Version        = 1;
            request.PatientId      = "543c2e6b84ac050980224c50";

            GoalsManager gManager = new GoalsManager();
            GetAllPatientGoalsResponse response = gManager.GetAllPatientGoals(request);

            Assert.IsNotNull(response);
        }
Ejemplo n.º 2
0
 public GetAllPatientGoalsResponse GetAllPatientGoals(GetAllPatientGoalsRequest request)
 {
     try
     {
         GetAllPatientGoalsResponse response = new GetAllPatientGoalsResponse();
         response.Goals   = GoalsEndpointUtil.GetAllPatientGoals(request);
         response.Version = request.Version;
         return(response);
     }
     catch (Exception ex)
     {
         throw new Exception("AD:GetAllPatientGoals()::" + ex.Message, ex.InnerException);
     }
 }
Ejemplo n.º 3
0
        public static List <PatientGoalView> GetAllPatientGoals(GetAllPatientGoalsRequest request)
        {
            try
            {
                List <PatientGoalView> result = null;
                //[Route("/{Context}/{Version}/{ContractNumber}/Patient/{PatientId}/Goals", "GET")]
                IRestClient client = new JsonServiceClient();

                string url = Common.Helper.BuildURL(string.Format("{0}/{1}/{2}/{3}/Patient/{4}/Goals",
                                                                  DDPatientGoalsServiceUrl,
                                                                  "NG",
                                                                  request.Version,
                                                                  request.ContractNumber,
                                                                  request.PatientId), request.UserId);

                GetAllPatientGoalsDataResponse ddResponse = client.Get <GetAllPatientGoalsDataResponse>(
                    url);

                if (ddResponse != null && ddResponse.PatientGoalsData != null && ddResponse.PatientGoalsData.Count > 0)
                {
                    result = new List <PatientGoalView>();
                    List <PatientGoalViewData> gdvList = ddResponse.PatientGoalsData;
                    foreach (PatientGoalViewData gdv in gdvList)
                    {
                        PatientGoalView gv = new PatientGoalView();
                        gv.Id            = gdv.Id;
                        gv.PatientId     = gdv.PatientId;
                        gv.FocusAreaIds  = gdv.FocusAreaIds;
                        gv.Name          = gdv.Name;
                        gv.StatusId      = gdv.StatusId;
                        gv.TemplateId    = gdv.TemplateId;
                        gv.Barriers      = GoalsUtil.GetChildView(gdv.BarriersData);
                        gv.Tasks         = GoalsUtil.GetChildView(gdv.TasksData);;
                        gv.Interventions = GoalsUtil.GetChildView(gdv.InterventionsData);
                        result.Add(gv);
                    }
                }

                return(result);
            }
            catch (WebServiceException ex)
            {
                throw new WebServiceException("AD:GetAllPatientGoals()::" + ex.Message, ex.InnerException);
            }
        }
Ejemplo n.º 4
0
        public GetAllPatientGoalsResponse Get(GetAllPatientGoalsRequest request)
        {
            GetAllPatientGoalsResponse response = new GetAllPatientGoalsResponse();
            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.GetAllPatientGoals(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.Goals != null)
                {
                    patientIds = response.Goals.Select(x => x.PatientId).ToList();
                }

                if (result != null)
                {
                    AuditHelper.LogAuditData(request, result.SQLUserId, patientIds, System.Web.HttpContext.Current.Request, request.GetType().Name);
                }
            }
            return(response);
        }
Ejemplo n.º 5
0
 public List <PatientGoalView> GetAllPatientGoals(GetAllPatientGoalsRequest request)
 {
     throw new NotImplementedException();
 }