Exemplo n.º 1
0
 public static Slot GetSlot(string odsCode, int slotId)
 {
     return(AppointmentSessions
            .Where(t => t.Organisation.Organisation.nationalPracticeCode == odsCode)
            .SelectMany(t => t.Slots)
            .FirstOrDefault(t => t.SlotId == slotId));
 }
Exemplo n.º 2
0
 public static Session[] GetSessions(string odsCode, DateTime from, DateTime to)
 {
     return(AppointmentSessions
            .Where(t => t.Organisation.Organisation.nationalPracticeCode == odsCode &&
                   t.Date >= from.Date &&
                   t.Date <= to.Date.AddHours(23).AddMinutes(59).AddSeconds(59).AddMilliseconds(999))
            .ToArray());
 }
Exemplo n.º 3
0
 public static Slot[] GetSlotsForPatient(string odsCode, Guid patientGuid, DateTime fromDate, DateTime toDate)
 {
     return(AppointmentSessions
            .Where(t => t.Organisation.Organisation.nationalPracticeCode == odsCode &&
                   t.Date.Date >= fromDate.Date && t.Date.Date <= toDate.Date)
            .SelectMany(t => t.Slots)
            .Where(t => t.Patient != null)
            .Where(t => new Guid(t.Patient.Patient.id) == patientGuid)
            .ToArray());
 }
Exemplo n.º 4
0
        public static Slot[] GetSlots(string odsCode, int sessionId)
        {
            Session session = AppointmentSessions
                              .FirstOrDefault(t => t.SessionId == sessionId &&
                                              t.Organisation.Organisation.nationalPracticeCode == odsCode);

            if (session == null)
            {
                return(null);
            }

            return(session.Slots);
        }