Esempio n. 1
0
        /// <summary>
        /// Por el momento representa Turnos otorgados a un Patient determinado por patientId
        /// </summary>
        /// <param name="startDate">Puede ser nula . Fecha de inicio para la busqueda</param>
        /// <param name="status"></param>
        /// <param name="patientId"></param>
        /// <returns>Patient_Appointments_ViewList, Appointment con ProfesionalAppointment</returns>
        public static Patient_Appointments_ViewList Retrive_Appointment(int patientId, DateTime?startDate, int?status)
        {
            Patient_Appointments_ViewList list = new Patient_Appointments_ViewList();

            if (startDate.HasValue)
            {
                startDate = Fwk.HelperFunctions.DateFunctions.GetStartDateTime(startDate.Value);
            }

            using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities))
            {
                var appointment_db = dc.Patient_Appointments_View.Where <Patient_Appointments_View>(p =>
                                                                                                    (!startDate.HasValue || p.Start.Value >= startDate.Value) &&
                                                                                                    (!status.HasValue || status.Value.Equals(p.Status.Value)) &&
                                                                                                    (p.PatientId.Equals(patientId))
                                                                                                    );

                foreach (Patient_Appointments_View r in appointment_db)
                {
                    Patient_Appointments_ViewBE wAppoimentBE = (Patient_Appointments_ViewBE)r;
                    wAppoimentBE = (Patient_Appointments_ViewBE)r;
                    list.Add(wAppoimentBE);
                }
            }
            return(list);
        }
Esempio n. 2
0
        /// <summary>
        /// Por el momento representa Turnos otorgados a un Patient determinado por patientId
        /// </summary>
        /// <param name="startDate">Puede ser nula . Fecha de inicio para la busqueda</param>
        /// <param name="status"></param>
        /// <param name="patientId"></param>
        /// <returns>Patient_Appointments_ViewList, Appointment con ProfesionalAppointment</returns>
        public static Patient_Appointments_ViewList Retrive_Appointment(int patientId, DateTime? startDate, int? status)
        {
            Patient_Appointments_ViewList list = new Patient_Appointments_ViewList();
            if (startDate.HasValue)
                startDate = Fwk.HelperFunctions.DateFunctions.GetStartDateTime(startDate.Value);

            using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities))
            {
                var appointment_db = dc.Patient_Appointments_View.Where<Patient_Appointments_View>(p =>
                    (!startDate.HasValue || p.Start.Value >= startDate.Value)
                    && (!status.HasValue || status.Value.Equals(p.Status.Value))
                    && (p.PatientId.Equals(patientId))
                    );

                foreach (Patient_Appointments_View r in appointment_db)
                {
                    Patient_Appointments_ViewBE wAppoimentBE = (Patient_Appointments_ViewBE)r;
                    wAppoimentBE = (Patient_Appointments_ViewBE)r;
                    list.Add(wAppoimentBE);
                }
            }
            return list;
        }