Beispiel #1
0
        public void GetAllowedObservationStates_CorrectType_Test()
        {
            GetAllowedStatesDataRequest request = new GetAllowedStatesDataRequest {
                Context = context, ContractNumber = contractNumber, UserId = userId, Version = 1
            };
            PatientObservationDataManager cm = new PatientObservationDataManager {
                Factory = new PatientObservationRepositoryFactory()
            };
            GetAllowedStatesDataResponse response = cm.GetAllowedStates(request);

            Assert.IsTrue(response.StatesData.Count > 0);
        }
Beispiel #2
0
 public GetAllowedStatesDataResponse GetAllowedStates(GetAllowedStatesDataRequest request)
 {
     try
     {
         GetAllowedStatesDataResponse  response = new GetAllowedStatesDataResponse();
         IPatientObservationRepository repo     = Factory.GetRepository(request, RepositoryType.Observation);
         response.StatesData = repo.GetAllowedObservationStates();
         return(response);
     }
     catch (Exception ex)
     {
         throw new Exception("DD.DataPatientObservationManager:GetAllowedStates()::" + ex.Message, ex.InnerException);
     }
 }
        public GetAllowedStatesDataResponse Get(GetAllowedStatesDataRequest request)
        {
            GetAllowedStatesDataResponse response = new GetAllowedStatesDataResponse();

            try
            {
                if (string.IsNullOrEmpty(request.UserId))
                {
                    throw new UnauthorizedAccessException("PatientObservationDD:Get()::Unauthorized Access");
                }

                response         = Omgr.GetAllowedStates(request);
                response.Version = request.Version;
            }
            catch (Exception ex)
            {
                CommonFormatter.FormatExceptionResponse(response, base.Response, ex);

                string aseProcessID = ConfigurationManager.AppSettings.Get("ASEProcessID") ?? "0";
                Common.Helper.LogException(int.Parse(aseProcessID), ex);
            }
            return(response);
        }