Пример #1
0
        public void GetInitializeProblem_Test()
        {
            GetInitializeProblemRequest request = new GetInitializeProblemRequest {
                ContractNumber = contract, Token = "", PatientId = "5325da03d6a4850adcbba4fe", ObservationId = "533ed16dd4332307bc592bae", UserId = userId, Version = version
            };

            ObservationsManager          oManager = new ObservationsManager();
            GetInitializeProblemResponse response = oManager.GetInitializeProblem(request);

            Assert.IsNotNull(response.PatientObservation);
        }
Пример #2
0
        public GetInitializeProblemResponse Get(GetInitializeProblemRequest request)
        {
            GetInitializeProblemResponse response = new GetInitializeProblemResponse();
            ObservationsManager          om       = new ObservationsManager();
            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       = om.GetInitializeProblem(request);
                }
                else
                {
                    throw new UnauthorizedAccessException();
                }
            }
            catch (Exception ex)
            {
                CommonFormatter.FormatExceptionResponse(response, base.Response, ex);
                if ((ex is WebServiceException) == false)
                {
                    om.LogException(ex);
                }
            }
            finally
            {
                List <string> patientIds = new List <string>();
                patientIds.Add(request.PatientId);

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