Ejemplo n.º 1
0
        public static bool SavePatientGoalTasks(PostPatientGoalRequest request)
        {
            bool result = false;

            try
            {
                if (request.Goal.Tasks != null && request.Goal.Tasks.Count > 0)
                {
                    List <PatientTaskData> ptd = new List <PatientTaskData>();
                    request.Goal.Tasks.ForEach(t =>
                    {
                        PatientTaskData data = ConvertToPatientTaskData(t);
                        ptd.Add(data);
                    });

                    ptd.ForEach(td =>
                    {
                        GoalsEndpointUtil.PostUpdateTaskRequest(request, td);
                    });
                }
                else if (request.Goal.Tasks.Count == 0)
                {
                    PatientTaskData pbd = new PatientTaskData {
                        Id = "0", PatientGoalId = request.PatientGoalId
                    };
                    result = GoalsEndpointUtil.PostUpdateTaskRequest(request, pbd);
                }
                return(result);
            }
            catch (Exception ex)
            {
                throw new Exception("AD:SavePatientGoalTasks()::" + ex.Message, ex.InnerException);
            }
        }
Ejemplo n.º 2
0
 public PostPatientTaskResponse SavePatientTask(PostPatientTaskRequest request)
 {
     try
     {
         PostPatientTaskResponse response = new PostPatientTaskResponse();
         response.Task    = GoalsEndpointUtil.PostUpdateTaskRequest(request);
         response.Version = request.Version;
         return(response);
     }
     catch (Exception ex)
     {
         throw new Exception("AD:SavePatientTask()::" + ex.Message, ex.InnerException);
     }
 }