Beispiel #1
0
        public void GetPaitentGoal_Test()
        {
            GetPatientGoalRequest request = new GetPatientGoalRequest();

            request.ContractNumber = "InHealth001";
            request.UserId         = "AD_TestHarness";
            request.Version        = 1;
            request.Id             = "543c2eb284ac0509803de12a";
            request.PatientId      = "543c2e6b84ac050980224c50";
            request.UserId         = "Snehal";

            GoalsManager           gManager = new GoalsManager();
            GetPatientGoalResponse response = gManager.GetPatientGoal(request);

            Assert.IsNotNull(response);
        }
Beispiel #2
0
        public GetPatientGoalResponse Get(GetPatientGoalRequest request)
        {
            GetPatientGoalResponse response = new GetPatientGoalResponse();
            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.GetPatientGoal(request);
                }
                else
                {
                    throw new UnauthorizedAccessException();
                }
            }
            catch (Exception ex)
            {
                CommonFormatter.FormatExceptionResponse(response, base.Response, ex);
                if ((ex is WebServiceException) == false)
                {
                    gm.LogException(ex);
                }
            }
            finally
            {
                List <string> patientIds = null;

                if (response.Goal != null)
                {
                    patientIds = new List <string>();
                    patientIds.Add(response.Goal.PatientId);
                }

                if (result != null)
                {
                    AuditHelper.LogAuditData(request, result.SQLUserId, patientIds, System.Web.HttpContext.Current.Request, request.GetType().Name);
                }
            }
            return(response);
        }