public void GetAllPatientGoals() { GetAllPatientGoalsDataRequest request = new GetAllPatientGoalsDataRequest { PatientId = "52f55860072ef709f84e60f7" }; GetAllPatientGoalsDataResponse response = m.GetPatientGoalList(request); Assert.IsNotNull(response.PatientGoalsData); }
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); }
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; } }