Пример #1
0
        public async Task <PatientResponse> GetPatientAsync(GetPatientRequest request)
        {
            if (request?.Id == null)
            {
                throw new ArgumentNullException();
            }

            var entity = await _patientRepository.GetAsync(request.Id);

            return(_patientMapper.Map(entity));
        }
Пример #2
0
 public GetPatientResponse getById(GetPatientRequest request)
 {
     try
     {
         var response = new GetPatientResponse();
         var bc       = new PatientComponent();
         response.Result = bc.Find(request.Patient.Id);
         return(response);
     }
     catch (Exception ex)
     {
         var httpError = new HttpResponseMessage()
         {
             StatusCode   = (HttpStatusCode)422,
             ReasonPhrase = ex.Message
         };
         throw new HttpResponseException(httpError);
     }
 }
Пример #3
0
        public void Post_Test()
        {
            ISecurityManager ism  = SecurityManagerFactory.Get();
            INGManager       ingm = NGManagerFactory.Get();

            NGService ngs = new NGService {
                Security = ism, NGManager = ingm
            };

            GetPatientRequest request = new GetPatientRequest
            {
                ContractNumber = "NG",
                PatientID      = "",
                Token          = "dsafgsdfgdafg",
                UserId         = "",
                Version        = 1.0
            };
            //((ServiceStack.ServiceInterface.Service)ngs).
            GetPatientResponse response = ngs.Get(request);

            Assert.Fail();
        }
Пример #4
0
        public void GetPatientByID_Test()
        {
            // Arrange
            double    version        = 1.0;
            string    contractNumber = "InHealth001";
            string    token          = "1234";
            NGManager ngManager      = new NGManager()
            {
                PlanElementUtils = new PlanElementUtils()
            };
            GetPatientRequest request = new GetPatientRequest
            {
                ContractNumber = contractNumber,
                Token          = token,
                Version        = version,
                PatientID      = "5325db50d6a4850adcbba8e6",
                UserId         = "5325c821072ef705080d3488"
            };
            // Act
            GetPatientResponse response = ngManager.GetPatient(request);

            //Assert
            Assert.IsTrue(response.Patient != null);
        }