Exemplo n.º 1
0
        internal static PatientObservationData GetAdditionalObservationItemRequest(GetAdditionalObservationItemRequest request)
        {
            try
            {
                PatientObservationData result = null;
                IRestClient            client = new JsonServiceClient();

                string url = Common.Helper.BuildURL(string.Format("{0}/{1}/{2}/{3}/Observation/{4}/Additional/",
                                                                  DDPatientObservationsServiceUrl,
                                                                  "NG",
                                                                  request.Version,
                                                                  request.ContractNumber,
                                                                  request.ObservationId), request.UserId);

                GetAdditionalObservationDataItemResponse dataDomainResponse = client.Post <GetAdditionalObservationDataItemResponse>(
                    url, new GetAdditionalObservationDataItemRequest
                {
                    UserId    = request.UserId,
                    PatientId = request.PatientId
                });

                if (dataDomainResponse != null)
                {
                    result = dataDomainResponse.Observation;
                }

                return(result);
            }
            catch (WebServiceException ex)
            {
                throw new WebServiceException("AD:GetAdditionalObservationsRequest()::" + ex.Message, ex.InnerException);
            }
        }
Exemplo n.º 2
0
        internal static PatientObservation GetAdditionalObservationItemForPatient(GetAdditionalObservationItemRequest request, PatientObservationData o)
        {
            PatientObservation result = new PatientObservation();

            try
            {
                result = new PatientObservation
                {
                    ObservationId    = o.ObservationId,
                    EndDate          = o.EndDate,
                    GroupId          = o.GroupId,
                    Id               = o.Id,
                    PatientId        = o.PatientId,
                    Name             = o.Name,
                    Standard         = o.Standard,
                    TypeId           = o.TypeId,
                    Units            = o.Units,
                    Values           = GetValues(o.Values),
                    StartDate        = o.StartDate,
                    DisplayId        = o.DisplayId,
                    StateId          = o.StateId,
                    DataSource       = o.DataSource,
                    ExternalRecordId = o.ExternalRecordId
                };
                return(result);
            }
            catch (Exception ex)
            {
                throw new Exception("AD:GetAdditionalObservationItemForPatient()::" + ex.Message, ex.InnerException);
            }
        }
Exemplo n.º 3
0
 public GetAdditionalObservationItemResponse GetAdditionalObservationsRequest(GetAdditionalObservationItemRequest request)
 {
     try
     {
         GetAdditionalObservationItemResponse response = new GetAdditionalObservationItemResponse();
         PatientObservationData po = (PatientObservationData)ObservationEndpointUtil.GetAdditionalObservationItemRequest(request);
         response.PatientObservation = ObservationsUtil.GetAdditionalObservationItemForPatient(request, po);
         response.Version            = request.Version;
         return(response);
     }
     catch (Exception ex)
     {
         throw new Exception("AD:GetAdditionalObservationsRequest()::" + ex.Message, ex.InnerException);
     }
 }
Exemplo n.º 4
0
        public GetAdditionalObservationItemResponse Get(GetAdditionalObservationItemRequest request)
        {
            GetAdditionalObservationItemResponse response = new GetAdditionalObservationItemResponse();
            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.GetAdditionalObservationsRequest(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);
        }