Пример #1
0
        public string GetInitialInterventionRequest(GetInitializeInterventionRequest request)
        {
            try
            {
                string result = string.Empty;

                IRestClient client = new JsonServiceClient();

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

                PutInitializeInterventionResponse response = client.Put <PutInitializeInterventionResponse>(
                    url,
                    new PutInitializeInterventionRequest() as object);

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

                return(result);
            }
            catch (WebServiceException ex)
            {
                throw new WebServiceException("AD:GetInitialInterventionRequest()::" + ex.Message, ex.InnerException);
            }
        }
Пример #2
0
 public GetInitializeInterventionResponse GetInitialIntervention(GetInitializeInterventionRequest request)
 {
     try
     {
         GetInitializeInterventionResponse itr = new GetInitializeInterventionResponse();
         string id = GoalsEndpointUtil.GetInitialInterventionRequest(request);
         itr.Id      = id;
         itr.Version = request.Version;
         return(itr);
     }
     catch (Exception ex)
     {
         throw new Exception("AD:GetInitialIntervention()::" + ex.Message, ex.InnerException);
     }
 }
Пример #3
0
        public GetInitializeInterventionResponse Get(GetInitializeInterventionRequest request)
        {
            GetInitializeInterventionResponse 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.GetInitialIntervention(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);
        }
Пример #4
0
 public string GetInitialInterventionRequest(GetInitializeInterventionRequest request)
 {
     throw new NotImplementedException();
 }