public GetPatientGoalDataResponse GetPatientGoal(GetPatientGoalDataRequest request) { GetPatientGoalDataResponse result = null; try { result = new GetPatientGoalDataResponse(); IGoalRepository repo = Factory.GetRepository(request, RepositoryType.PatientGoal); PatientGoalData patientGoalData = repo.FindByID(request.Id) as PatientGoalData; if (patientGoalData != null) { //Get all barriers for a given goal patientGoalData.BarriersData = getBarriersByPatientGoalId(request, patientGoalData.Id); //Get all tasks for a given goal patientGoalData.TasksData = getTasksByPatientGoalId(request, patientGoalData.Id); //Get all interventions for a given goal patientGoalData.InterventionsData = getInterventionsByPatientGoalId(request, patientGoalData.Id); } result.GoalData = patientGoalData; result.Version = request.Version; return(result); } catch (Exception ex) { throw ex; } }
public void GetPatientGoalByID() { GetPatientGoalDataRequest request = new GetPatientGoalDataRequest { Id = "5304d677d6a4850f14e4cc93" }; GetPatientGoalDataResponse response = m.GetPatientGoal(request); Assert.IsNotNull(response.GoalData); }
public GetPatientGoalDataResponse Get(GetPatientGoalDataRequest request) { GetPatientGoalDataResponse response = new GetPatientGoalDataResponse(); try { if (string.IsNullOrEmpty(request.UserId)) { throw new UnauthorizedAccessException("PatientGoalDD:Get()::Unauthorized Access"); } response = Manager.GetPatientGoal(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); }