Exemplo n.º 1
0
        public void GetAllPatientGoals()
        {
            GetAllPatientGoalsDataRequest request = new GetAllPatientGoalsDataRequest {
                PatientId = "52f55860072ef709f84e60f7"
            };

            GetAllPatientGoalsDataResponse response = m.GetPatientGoalList(request);

            Assert.IsNotNull(response.PatientGoalsData);
        }
Exemplo n.º 2
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);
            }
        }
Exemplo n.º 3
0
        public GetAllPatientGoalsDataResponse Get(GetAllPatientGoalsDataRequest request)
        {
            GetAllPatientGoalsDataResponse response = new GetAllPatientGoalsDataResponse();

            try
            {
                if (string.IsNullOrEmpty(request.UserId))
                {
                    throw new UnauthorizedAccessException("PatientGoalDD:Get()::Unauthorized Access");
                }

                response         = Manager.GetPatientGoalList(request);
                response.Version = request.Version;
            }
            catch (Exception ex)
            {
                CommonFormatter.FormatExceptionResponse(response, base.Response, ex);

                string aseProcessID = ConfigurationManager.AppSettings.Get("ASEProcessID") ?? "0";
                Common.Helper.LogException(int.Parse(aseProcessID), ex);
            }
            return(response);
        }
Exemplo n.º 4
0
        public GetAllPatientGoalsDataResponse GetPatientGoalList(GetAllPatientGoalsDataRequest request)
        {
            GetAllPatientGoalsDataResponse result = null;

            try
            {
                result = new GetAllPatientGoalsDataResponse();
                IGoalRepository goalRepo = Factory.GetRepository(request, RepositoryType.PatientGoal);

                List <PatientGoalViewData> goalViewDataList = goalRepo.Find(request.PatientId) as List <PatientGoalViewData>;
                List <PatientGoalViewData> goalDataView     = null;
                if (goalViewDataList != null && goalViewDataList.Count > 0)
                {
                    goalDataView = new List <PatientGoalViewData>();
                    foreach (PatientGoalViewData p in goalViewDataList)
                    {
                        string contractNumber = request.ContractNumber;
                        string context        = request.Context;

                        PatientGoalViewData view = new PatientGoalViewData();
                        view = p;

                        //Barriers
                        List <ChildViewData>      barrierChildView = null;
                        List <PatientBarrierData> barrierData      = getBarriersByPatientGoalId(request, p.Id);
                        if (barrierData != null && barrierData.Count > 0)
                        {
                            barrierChildView = new List <ChildViewData>();
                            foreach (PatientBarrierData b in barrierData)
                            {
                                barrierChildView.Add(new ChildViewData {
                                    Id = b.Id, PatientGoalId = b.PatientGoalId, Name = b.Name, StatusId = ((int)(b.StatusId))
                                });
                                barrierChildView = barrierChildView.OrderBy(o => o.Name).ToList();
                            }
                        }
                        view.BarriersData = barrierChildView;

                        //Tasks
                        List <ChildViewData>   taskChildView = null;
                        List <PatientTaskData> taskData      = getTasksByPatientGoalId(request, p.Id);
                        if (taskData != null && taskData.Count > 0)
                        {
                            taskChildView = new List <ChildViewData>();
                            foreach (PatientTaskData b in taskData)
                            {
                                taskChildView.Add(new ChildViewData {
                                    Id = b.Id, PatientGoalId = b.PatientGoalId, Description = b.Description, StatusId = ((int)(b.StatusId))
                                });
                                taskChildView = taskChildView.OrderBy(o => o.Description).ToList();
                            }
                        }
                        view.TasksData = taskChildView;

                        //Interventions
                        List <ChildViewData>           interChildView = null;
                        List <PatientInterventionData> interData      = getInterventionsByPatientGoalId(request, p.Id);
                        if (interData != null && interData.Count > 0)
                        {
                            interChildView = new List <ChildViewData>();
                            foreach (PatientInterventionData b in interData)
                            {
                                interChildView.Add(new ChildViewData {
                                    Id = b.Id, PatientGoalId = b.PatientGoalId, Description = b.Description, StatusId = ((int)(b.StatusId))
                                });
                                interChildView.OrderBy(o => o.Description).ToList();
                            }
                        }
                        view.InterventionsData = interChildView;
                        goalDataView.Add(view);
                    }
                }

                result.PatientGoalsData = goalDataView;
                result.Version          = request.Version;
                return(result);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }