Пример #1
0
        public void UpdateEpisodeOfCare(Entities.EpisodeOfCare episodeOfCare)
        {
            if (episodeOfCare.ReferringDoctorId != null)
            {
                _UpdateRefferingDr(episodeOfCare);
            }
            if (episodeOfCare.AttendingDoctorId != null)
            {
                _UpdateAttendingDr(episodeOfCare);
            }



            Execute("[EPONS].[UpdateEpisodeOfCare]", new
            {
                EpisodeOfCareId             = episodeOfCare.EpisodeOfCareId,
                PatientId                   = episodeOfCare.PatientId,
                FacilityId                  = episodeOfCare.FacilityId,
                ReasonForAdmissionId        = episodeOfCare.ReasonForAdmissionId,
                ReasonForAdmissionTimestamp = episodeOfCare.ReasonForAdmissionTimestamp,
                AllocationNumber            = episodeOfCare.AllocationNumber,
                ImpairmentGroupId           = episodeOfCare.ImpairmentGroupId,
                AdmissionTypeId             = episodeOfCare.AdmissionTypeId,
                ReferringDoctorId           = episodeOfCare.ReferringDoctorId,
                AttendingDoctorId           = episodeOfCare.AttendingDoctorId,
                DischargeTypeId             = episodeOfCare.DischargeTypeId,
                deallocationTimestamp       = episodeOfCare.DeallocationTimestamp
            });
            // TODO
            //_UpdateEpisodeOfCare(episodeOfCare);
        }
Пример #2
0
        public Entities.EpisodeOfCare GetEpisodeOfCare(Guid episodeofcareID)
        {
            Entities.EpisodeOfCare episodeOfCare = _patientRepository.FindEpisodeOfCareById(episodeofcareID);

            episodeOfCare.EpisodeOfCareId = episodeOfCare == null ? Guid.Empty : episodeOfCare.EpisodeOfCareId;

            return(episodeOfCare);
        }
Пример #3
0
        public Entities.EpisodeOfCare FindEpisodeOfCareById(Guid episodeOfCareId)
        {
            Entities.EpisodeOfCare episodeOfCare = QueryOne <Entities.EpisodeOfCare>("[EPONS].[FindEpisodeOfCareById]", new
            {
                episodeOfCareId = episodeOfCareId
            });

            //string reasonForAdmissionName = null;
            //if (episodeOfCare.AdmissionTypeId != Guid.Empty)
            //{
            //    ListRepository _listRepository  = new ListRepository(GetConnection()); ;
            //    IList<ValueObjects.ListItem> icd10Codes = _listRepository.GetICD10CodesByCodes(episodeOfCare.AdmissionTypeId.ToString());
            //    reasonForAdmissionName = icd10Codes.FirstOrDefault().Name;
            //}
            //episodeOfCare.ReasonForAdmissionName = reasonForAdmissionName;
            var refDrID = episodeOfCare.ReferringDoctorId;

            if (refDrID != null)
            {
                Entities.Doctor refDr = QueryOne <Entities.Doctor>("[EPONS].[FindDoctorById]", new
                {
                    doctorid = episodeOfCare.ReferringDoctorId
                });
                episodeOfCare.ReferringDoctor             = refDr;
                episodeOfCare.ReferringDoctorName         = refDr.Name;
                episodeOfCare.ReferringDoctorNumber       = refDr.ContactNumber;
                episodeOfCare.ReferringDoctorEmail        = refDr.Email;
                episodeOfCare.ReferringDoctorPracticeName = refDr.PracticeName;
                episodeOfCare.ReferringDoctorHPCSANumber  = refDr.HPCSANumber;
            }

            var attDrId = episodeOfCare.AttendingDoctorId;

            if (attDrId != null)
            {
                Entities.Doctor attDr = QueryOne <Entities.Doctor>("[EPONS].[FindDoctorById]", new
                {
                    doctorid = episodeOfCare.AttendingDoctorId
                });
                episodeOfCare.AttendingDoctor             = attDr;
                episodeOfCare.AttendingDoctorName         = attDr.Name;
                episodeOfCare.AttendingDoctorNumber       = attDr.ContactNumber;
                episodeOfCare.AttendingDoctorEmail        = attDr.Email;
                episodeOfCare.AttendingDoctorPracticeName = attDr.PracticeName;
                episodeOfCare.AttendingDoctorHPCSANumber  = attDr.HPCSANumber;
            }

            return(episodeOfCare);
        }