예제 #1
0
        public static PatientTaskData GetInitialTaskRequest(GetInitializeTaskRequest request)
        {
            try
            {
                PatientTaskData result = null;

                IRestClient client = new JsonServiceClient();

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

                PutInitializeTaskResponse response = client.Put <PutInitializeTaskResponse>(url, new PutInitializeTaskRequest() as object);

                if (response != null)
                {
                    result = response.Task;
                }

                return(result);
            }
            catch (WebServiceException ex)
            {
                throw new WebServiceException("AD:GetInitialTaskRequest()::" + ex.Message, ex.InnerException);
            }
        }
예제 #2
0
        internal static PatientTask GetPatientTaskForInitialize(GetInitializeTaskRequest request, PatientTaskData ptd)
        {
            PatientTask pt = null;

            try
            {
                if (ptd != null)
                {
                    pt = new PatientTask
                    {
                        CustomAttributes = GoalsEndpointUtil.GetAttributesLibraryByType(request, 2),
                        Id          = ptd.Id,
                        StartDate   = ptd.StartDate,
                        StatusId    = ptd.StatusId,
                        TargetDate  = ptd.TargetDate,
                        TargetValue = ptd.TargetValue,
                        DeleteFlag  = ptd.DeleteFlag,
                        Details     = ptd.Details
                    };
                }
            }
            catch (Exception ex)
            {
                throw new Exception("AD:GetPatientTaskForInitialize()::" + ex.Message, ex.InnerException);
            }
            return(pt);
        }
예제 #3
0
 public GetInitializeTaskResponse GetInitialTask(GetInitializeTaskRequest request)
 {
     try
     {
         GetInitializeTaskResponse itr = new GetInitializeTaskResponse();
         PatientTaskData           ptd = (PatientTaskData)GoalsEndpointUtil.GetInitialTaskRequest(request);
         PatientTask task = GoalsUtil.GetPatientTaskForInitialize(request, ptd);
         itr.Task    = task;
         itr.Version = request.Version;
         return(itr);
     }
     catch (Exception ex)
     {
         throw new Exception("AD:GetInitialTask()::" + ex.Message, ex.InnerException);
     }
 }
예제 #4
0
        public GetInitializeTaskResponse Get(GetInitializeTaskRequest request)
        {
            GetInitializeTaskResponse response = null;
            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.GetInitialTask(request);
                }
                else
                {
                    throw new UnauthorizedAccessException();
                }
            }
            catch (Exception ex)
            {
                CommonFormatter.FormatExceptionResponse(response, base.Response, ex);
                if ((ex is WebServiceException) == false)
                {
                    gm.LogException(ex);
                }
            }
            finally
            {
                if (result != null)
                {
                    AuditHelper.LogAuditData(request, result.SQLUserId, null, System.Web.HttpContext.Current.Request, request.GetType().Name);
                }
            }

            return(response);
        }
예제 #5
0
 public PatientTaskData GetInitialTaskRequest(GetInitializeTaskRequest request)
 {
     throw new NotImplementedException();
 }