Example #1
0
        public void SavePatientbarrier_Test()
        {
            PostPatientBarrierRequest request = new PostPatientBarrierRequest();

            request.ContractNumber = "InHealth001";
            request.Version        = 1;
            request.UserId         = "531f2df5072ef727c4d2a3bc";
            request.Id             = "543853ba84ac050d1cb13261";
            request.Barrier        = new PatientBarrier
            {
                Id            = "543853ba84ac050d1cb13261",
                CategoryId    = "52fa61bed433231dd077501c",
                Name          = "barr 4",
                PatientGoalId = "543853b184ac050d1cb13183",
                StatusDate    = DateTime.UtcNow,
                StatusId      = 2,
                Details       = "my barrier details 123"
            };
            request.PatientGoalId = "543853b184ac050d1cb13183";
            request.PatientId     = "5325db62d6a4850adcbba91e";

            GoalsManager gManager = new GoalsManager();
            PostPatientBarrierResponse response = gManager.SavePatientBarrier(request);

            Assert.IsNotNull(response);
        }
Example #2
0
 public PostPatientBarrierResponse SavePatientBarrier(PostPatientBarrierRequest request)
 {
     try
     {
         PostPatientBarrierResponse response = new PostPatientBarrierResponse();
         response.Barrier = GoalsEndpointUtil.PostUpdateBarrierRequest(request);
         response.Version = request.Version;
         return(response);
     }
     catch (Exception ex)
     {
         throw new Exception("AD:SavePatientBarrier()::" + ex.Message, ex.InnerException);
     }
 }
Example #3
0
        public PostPatientBarrierResponse Post(PostPatientBarrierRequest request)
        {
            PostPatientBarrierResponse response = new PostPatientBarrierResponse();
            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.SavePatientBarrier(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);
        }