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)); }
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()); }
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()); }
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); }