Beispiel #1
0
        public GetPatientDataResponse GetPatientDataByNameDOB(GetPatientDataByNameDOBRequest request)
        {
            GetPatientDataResponse result = new GetPatientDataResponse();

            IPatientRepository repo = Factory.GetRepository(request, RepositoryType.Patient);

            result.Patient = repo.FindByNameDOB(request.FirstName, request.LastName, request.DOB) as DTO.PatientData;

            return(result);
        }
Beispiel #2
0
        public void GetPatientData()
        {
            GetPatientDataByNameDOBRequest patientDataRequest = new GetPatientDataByNameDOBRequest
            {
                FirstName = "Wendell_01",
                LastName  = "Pickering",
                DOB       = "03/11/1960"
            };
            GetPatientDataResponse patientDataResponse = import.GetPatientData(patientDataRequest);

            Assert.IsNotNull(patientDataResponse.Patient);
        }
Beispiel #3
0
        public GetPatientDataResponse GetPatientData(GetPatientDataByNameDOBRequest request)
        {
            //[Route("/{Context}/{Version}/{ContractNumber}/Patient/PatientData", "GET")]
            Uri theUriPS = new Uri(string.Format("{0}/Patient/{1}/{2}/{3}/Patient/PatientData?UserId={4}&FirstName={5}&LastName={6}&DOB={7}",
                                                 Url,
                                                 Context,
                                                 Version,
                                                 ContractNumber,
                                                 HeaderUserId,
                                                 request.FirstName, request.LastName, request.DOB));
            HttpClient client = GetHttpClient(theUriPS);

            DataContractJsonSerializer modesJsonSer = new DataContractJsonSerializer(typeof(GetPatientDataByNameDOBRequest));
            MemoryStream ms = new MemoryStream();

            modesJsonSer.WriteObject(ms, request);
            ms.Position = 0;

            //use a Stream reader to construct the StringContent (Json)
            StreamReader  modesSr      = new StreamReader(ms);
            StringContent modesContent = new StringContent(modesSr.ReadToEnd(), System.Text.Encoding.UTF8, "application/json");

            ms.Dispose();

            //Post the data
            var response        = client.GetStringAsync(theUriPS);
            var responseContent = response.Result;

            string modesResponseString = responseContent;
            GetPatientDataResponse getPatientDataResponse = null;

            using (var memStream = new MemoryStream(Encoding.Unicode.GetBytes(modesResponseString)))
            {
                var modesSerializer = new DataContractJsonSerializer(typeof(GetPatientDataResponse));
                getPatientDataResponse = (GetPatientDataResponse)modesSerializer.ReadObject(memStream);
            }
            return(getPatientDataResponse);
        }
Beispiel #4
0
        public GetPatientDataResponse Get(GetPatientDataByNameDOBRequest request)
        {
            GetPatientDataResponse response = new GetPatientDataResponse();

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

                response         = PatientManager.GetPatientDataByNameDOB(request);
                response.Version = request.Version;
            }
            catch (Exception ex)
            {
                CommonFormatterUtil.FormatExceptionResponse(response, base.Response, ex);

                string aseProcessID = ConfigurationManager.AppSettings.Get("ASEProcessID") ?? "0";
                Helpers.LogException(int.Parse(aseProcessID), ex);
            }
            return(response);
        }
 public GetPatientDataResponse GetPatientDataByNameDOB(GetPatientDataByNameDOBRequest request)
 {
     throw new NotImplementedException();
 }