예제 #1
0
        private PatientAppointmentDisplay MapBluecardappointments(BlueCardAppointment bluecardAppointment)
        {
            ILookupManager mgr = (ILookupManager)ObjectFactory.CreateInstance("BusinessProcess.CCC.BLookupManager, BusinessProcess.CCC");
            string         appointmentDescription = String.Empty;
            string         serviceArea            = String.Empty;
            string         appointmentReason      = String.Empty;

            if (bluecardAppointment.Description != null)
            {
                appointmentDescription = bluecardAppointment.Description;
            }

            if (bluecardAppointment.ServiceArea != null)
            {
                serviceArea = bluecardAppointment.ServiceArea;
            }

            if (bluecardAppointment.Reason != null)
            {
                appointmentReason = bluecardAppointment.Reason;
            }

            PatientAppointmentDisplay appointment = new PatientAppointmentDisplay()
            {
                ServiceArea        = serviceArea,
                Reason             = appointmentReason,
                AppointmentDate    = bluecardAppointment.AppointmentDate,
                Description        = appointmentDescription,
                Status             = bluecardAppointment.AppointmentStatus,
                DifferentiatedCare = " "
            };

            return(appointment);
        }
예제 #2
0
        public PatientAppointmentDisplay GetExistingPatientAppointment(string patientId, DateTime appointmentDate, int serviceAreaId, int reasonId)
        {
            PatientAppointmentDisplay appointmentDisplay = new PatientAppointmentDisplay();
            PatientAppointment        appointment        = new PatientAppointment();

            try
            {
                var patientAppointment = new PatientAppointmentManager();
                int id = Convert.ToInt32(patientId);
                appointment = patientAppointment.GetByPatientId(id).FirstOrDefault(n => n.AppointmentDate.Date == appointmentDate.Date && n.ServiceAreaId == serviceAreaId && n.ReasonId == reasonId);
                if (appointment != null)
                {
                    appointmentDisplay = Mapappointments(appointment);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception e)
            {
                Msg = e.Message;
            }
            return(appointmentDisplay);
        }
예제 #3
0
        public IEnumerable <PatientAppointmentDisplay> GetPatientAppointments(string patientId)
        {
            List <PatientAppointmentDisplay>        appointmentsDisplay = new List <PatientAppointmentDisplay>();
            IEnumerable <PatientAppointmentDisplay> listAppointments    = new List <PatientAppointmentDisplay>();
            var appointments         = new List <PatientAppointment>();
            var bluecardAppointments = new List <BlueCardAppointment>();

            try
            {
                var patientAppointment = new PatientAppointmentManager();
                int id = Convert.ToInt32(patientId);
                appointments         = patientAppointment.GetByPatientId(id);
                bluecardAppointments = patientAppointment.GetBluecardAppointmentsByPatientId(id);
                foreach (var appointment in appointments)
                {
                    PatientAppointmentDisplay appointmentDisplay = Mapappointments(appointment);
                    appointmentsDisplay.Add(appointmentDisplay);
                }

                foreach (var appointment in bluecardAppointments)
                {
                    PatientAppointmentDisplay appointmentDisplay = MapBluecardappointments(appointment);
                    appointmentsDisplay.Add(appointmentDisplay);
                }

                listAppointments = appointmentsDisplay.OrderByDescending(n => n.AppointmentDate);
            }
            catch (Exception e)
            {
                Msg = e.Message;
            }
            return(listAppointments);
        }
예제 #4
0
        private PatientAppointmentDisplay Mapappointments(PatientAppointment a)
        {
            ILookupManager        mgr                = (ILookupManager)ObjectFactory.CreateInstance("BusinessProcess.CCC.BLookupManager, BusinessProcess.CCC");
            string                status             = "";
            string                reason             = "";
            string                serviceArea        = "";
            string                differentiatedCare = "";
            List <LookupItemView> statuses           = mgr.GetLookItemByGroup("AppointmentStatus");
            var s = statuses.FirstOrDefault(n => n.ItemId == a.StatusId);

            if (s != null)
            {
                status = s.ItemDisplayName;
            }
            List <LookupItemView> reasons = mgr.GetLookItemByGroup("AppointmentReason");
            var r = reasons.FirstOrDefault(n => n.ItemId == a.ReasonId);

            if (r != null)
            {
                reason = r.ItemDisplayName;
            }
            List <LookupItemView> areas = mgr.GetLookItemByGroup("ServiceArea");
            var sa = areas.FirstOrDefault(n => n.ItemId == a.ServiceAreaId);

            if (sa != null)
            {
                serviceArea = sa.ItemDisplayName;
            }
            List <LookupItemView> care = mgr.GetLookItemByGroup("DifferentiatedCare");
            var dc = care.FirstOrDefault(n => n.ItemId == a.DifferentiatedCareId);

            if (dc != null)
            {
                differentiatedCare = dc.ItemDisplayName;
            }
            PatientAppointmentDisplay appointment = new PatientAppointmentDisplay()
            {
                ServiceArea        = serviceArea,
                Reason             = reason,
                AppointmentDate    = a.AppointmentDate,
                Description        = a.Description,
                Status             = status,
                DifferentiatedCare = differentiatedCare
            };

            return(appointment);
        }