Exemplo n.º 1
0
        internal static PatientObservation GetInitializeProblem(GetInitializeProblemRequest request, PatientObservationData o)
        {
            PatientObservation result = new PatientObservation();

            try
            {
                result = new PatientObservation
                {
                    Id               = o.Id,
                    PatientId        = o.PatientId,
                    ObservationId    = o.ObservationId,
                    TypeId           = o.TypeId,
                    StartDate        = o.StartDate,
                    EndDate          = o.EndDate,
                    Name             = o.Name,
                    DisplayId        = o.DisplayId,
                    StateId          = o.StateId,
                    Source           = o.Source,
                    DeleteFlag       = o.DeleteFlag,
                    DataSource       = o.DataSource,
                    ExternalRecordId = o.ExternalRecordId
                };
                return(result);
            }
            catch (Exception ex)
            {
                throw new Exception("AD:GetInitializeProblem()::" + 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
        internal static PatientObservationRecordData CreatePatientObservationRecord(PatientObservation po, ObservationValue ov)
        {
            try
            {
                PatientObservationRecordData pord = new PatientObservationRecordData
                {
                    GroupId          = po.GroupId,
                    StartDate        = po.StartDate,
                    TypeId           = po.TypeId,
                    Units            = po.Units,
                    DisplayId        = po.DisplayId,
                    StateId          = po.StateId,
                    DeleteFlag       = po.DeleteFlag,
                    DataSource       = po.DataSource,
                    ExternalRecordId = po.ExternalRecordId
                };

                // Populate Values for Labs and Vitals
                if (ov != null)
                {
                    pord.Id = ov.Id;
                    double dVal = 0;
                    if (double.TryParse(ov.Value, out dVal))
                    {
                        pord.Value = dVal;
                    }
                    else
                    {
                        pord.NonNumericValue = ov.Value;
                    }
                    // Set the End date to start date for Labs and Vitals
                    pord.EndDate = po.StartDate;
                }
                else //  Populate Values for Problems.
                {
                    pord.Id = po.Id;
                    // If the status for PatientObservation(problem) is changed to Resolved or Inactive, then set EndDate to Today.
                    if (IsResolvedOrInactivated(po.StateId))
                    {
                        pord.EndDate = DateTime.UtcNow;
                    }
                    else
                    {
                        pord.EndDate = po.EndDate;
                    }
                }

                return(pord);
            }
            catch (Exception ex)
            {
                throw new Exception("AD:CreatePatientObservationRecord()::" + ex.Message, ex.InnerException);
            }
        }
Exemplo n.º 4
0
        public UpdateSpawnProblemCode(PlanElementEventArg e, SpawnElement rse, PatientObservation ppd, bool active)
        {
            _e      = e;
            _se     = rse;
            _pod    = ppd;
            _active = active;

            if (AppHostBase.Instance != null)
            {
                AppHostBase.Instance.Container.AutoWire(this);
            }
        }
Exemplo n.º 5
0
        public PatientObservation GetPatientProblem(string probId, PlanElementEventArg e, string userId)
        {
            try
            {
                PatientObservation result = null;

                IRestClient client = new JsonServiceClient();

                //Patient/{PatientId}/Observation/{ObservationID}
                var url = Common.Helper.BuildURL(string.Format("{0}/{1}/{2}/{3}/Patient/{4}/Observation/{5}",
                                                               DDPatientObservationServiceUrl,
                                                               "NG",
                                                               e.DomainRequest.Version,
                                                               e.DomainRequest.ContractNumber,
                                                               e.PatientId,
                                                               probId), userId);

                GetPatientObservationResponse dataDomainResponse =
                    client.Get <GetPatientObservationResponse>(
                        url);

                if (dataDomainResponse.PatientObservation != null)
                {
                    result = new PatientObservation
                    {
                        Id      = dataDomainResponse.PatientObservation.Id,
                        StateId = dataDomainResponse.PatientObservation.StateId
                    };
                }

                return(result);
            }
            catch (WebServiceException ex)
            {
                throw new Exception("AD:PlanElementEndpointUtil:GetPatientProblem()::" + ex.Message, ex.InnerException);
            }
        }
Exemplo n.º 6
0
        internal static PatientObservation GetPatientObservation(PatientObservationData po)
        {
            PatientObservation result = null;

            try
            {
                if (po != null)
                {
                    result = new PatientObservation
                    {
                        ObservationId    = po.ObservationId,
                        Id               = po.Id,
                        PatientId        = po.PatientId,
                        StartDate        = po.StartDate,
                        EndDate          = po.EndDate,
                        Units            = po.Units,
                        Values           = GetValues(po.Values),
                        StateId          = po.StateId,
                        DisplayId        = po.DisplayId,
                        Source           = po.Source,
                        GroupId          = po.GroupId,
                        Name             = po.Name,
                        Standard         = po.Standard,
                        TypeId           = po.TypeId,
                        DeleteFlag       = po.DeleteFlag,
                        DataSource       = po.DataSource,
                        ExternalRecordId = po.ExternalRecordId
                    };
                }
            }
            catch (Exception ex)
            {
                throw new Exception("AD:GetPatientObservation()::" + ex.Message, ex.InnerException);
            }
            return(result);
        }
Exemplo n.º 7
0
 public PutUpdateObservationDataResponse UpdatePatientProblem(string patientId, string userId, string elementId, PatientObservation pod, bool _active, IAppDomainRequest request)
 {
     return(new PutUpdateObservationDataResponse {
         Result = true
     });
 }
Exemplo n.º 8
0
        public PutUpdateObservationDataResponse UpdatePatientProblem(string patientId, string userId, string elementId, PatientObservation pod, bool _active, IAppDomainRequest request)
        {
            try
            {
                //register call to remote serivce.
                IRestClient client = new JsonServiceClient();

                string url = Common.Helper.BuildURL(string.Format("{0}/{1}/{2}/{3}/Patient/{4}/Observation/Update",
                                                                  DDPatientObservationServiceUrl,
                                                                  "NG",
                                                                  request.Version,
                                                                  request.ContractNumber,
                                                                  patientId), request.UserId);

                PatientObservationRecordData pdata = new PatientObservationRecordData
                {
                    Id         = pod.Id,
                    StateId    = pod.StateId,
                    DeleteFlag = false
                };

                PutUpdateObservationDataRequest purequest = new PutUpdateObservationDataRequest
                {
                    PatientObservationData = pdata,
                    Context        = "NG",
                    ContractNumber = request.ContractNumber,
                    UserId         = request.UserId,
                };

                PutUpdateObservationDataResponse dataDomainResponse =
                    client.Put <PutUpdateObservationDataResponse>(
                        url, purequest as object);

                return(dataDomainResponse);
            }
            catch (Exception ex)
            {
                throw new Exception("AD:PlanElementEndpointUtil:UpdatePatientProblem()::" + ex.Message, ex.InnerException);
            }
        }