/// <summary>
 /// Basic constructor
 /// </summary>
 /// <param name="ID">Entity ID</param>
 /// <param name="input">Required input for the booking model</param>
 /// <param name="bookingModel">The booking model for the waiting list</param>
 public EntitySingleBookingModelWaitingList(
     int ID,
     IInputBookingModel input,
     IBookingModel bookingModel)
     : base(ID, input)
 {
     _bookingModel = bookingModel;
 } // end of EntityMultipleBookingWaitingListSchedule
Beispiel #2
0
        /// <summary>
        /// Basic functionality of a booking model to get the earliest available time for a slot request
        /// Obtained from the booking model that is responsible for the booking
        /// </summary>
        /// <param name="time">Time the request is made</param>
        /// <param name="earliestTime">The earliest time a slot can be booked</param>
        /// <param name="patient">Patient the slot is booked for</param>
        /// <param name="admissionType">The admission type corresponding to the request</param>
        /// <returns>The earliest available slot for the request</returns>
        public override Slot GetEarliestSlotTime(DateTime time, DateTime earliestTime, EntityPatient patient, Admission admissionType)
        {
            IBookingModel bookingModel = BookingModelsPerType[BookingModelReference(admissionType)];

            Slot earliestSlot = bookingModel.GetEarliestSlot(time,
                                                             new SlotRequest(earliestTime,
                                                                             InputData.GetSlotLengthPerAdmission(admissionType),
                                                                             admissionType,
                                                                             InputData.GetSlotCapacityPerAdmission(admissionType)));

            return(earliestSlot);
        } // end of GetEarliestSlotTime
Beispiel #3
0
        } // end of GetEarliestSlotTime

        #endregion

        #region GetAllSlotTimes

        /// <summary>
        /// Basic functionality of a booking model to get the all available times for a slot request
        /// Obtained from the booking model that is responsible for the booking
        /// </summary>
        /// <param name="time">Time the request is made</param>
        /// <param name="earliestTime">The earliest time a slot can be booked</param>
        /// <param name="latestTime">The latest time a slot can be booked</param>
        /// <param name="patient">Patient the slot is booked for</param>
        /// <param name="admissionType">The admission type corresponding to the request</param>
        /// <returns>All available slots for the request within the specified time window</returns>
        public override List <Slot> GetAllSlotTimes(DateTime time,
                                                    DateTime earliestTime,
                                                    DateTime latestTime,
                                                    EntityPatient patient,
                                                    Admission admission)
        {
            IBookingModel bookingModel = BookingModelsPerType[BookingModelReference(admission)];

            List <Slot> allSlots = bookingModel.GetAllSlotTimes(time,
                                                                new SlotRequest(earliestTime,
                                                                                InputData.GetSlotLengthPerAdmission(admission),
                                                                                admission,
                                                                                InputData.GetSlotCapacityPerAdmission(admission)), latestTime);

            return(allSlots);
        } // end of GetAllSlotTimes
Beispiel #4
0
        } // end of BookSlot

        #endregion

        #region CancelSlot

        /// <summary>
        /// Action to cancel a booking
        /// </summary>
        /// <param name="slot">Slot to cancel</param>
        /// <param name="admission">Corresponding admission</param>
        public override void CancelSlot(Slot slot, Admission admission)
        {
            IBookingModel bookingModel = BookingModelsPerType[BookingModelReference(admission)];

            bookingModel.CancelSlot(slot);
        } // end of CancelSlot