Class ConcreteShift

java.lang.Object
org.cswteams.ms3.entity.ConcreteShift

@Entity public class ConcreteShift extends Object
This class represents the concrete shift present in a schedule for a certain date. This class should be operated only by the planners. Instantiation of a shift, with some Doctors associated.
See Also:
  • Constructor Details

    • ConcreteShift

      protected ConcreteShift(Long id)
    • ConcreteShift

      public ConcreteShift(Long date, Shift shift)
      Create a concrete shift for a specific shift in a specific date.
      Parameters:
      date - The date of the concrete shift
      shift - The abstract shift from which this shift is created
    • ConcreteShift

      protected ConcreteShift(Long date, Shift shift, List<DoctorAssignment> doctorAssignmentList)
      Create a concrete shift for a specific shift in a specific date, with a specific list of Doctors assigned.
      Parameters:
      date - The date of the concrete shift
      shift - The abstract shift from which this shift is created
      doctorAssignmentList - List of Doctors assigned to this concrete shift.
    • ConcreteShift

      protected ConcreteShift()
      Default constructor needed by Lombok
  • Method Details

    • clone

      public ConcreteShift clone()
      Overrides:
      clone in class Object
    • getDoctorAssignmentStatus

      public ConcreteShiftDoctorStatus getDoctorAssignmentStatus(Doctor doctor)
      Given a Doctor, return the ConcreteShiftDoctorStatus for which he/she is assigned for this ConcreteShift. If the Doctor provided is not assigned to this ConcreteShift, null is returned.
      Parameters:
      doctor - doctor for which the lookup is to be done
      Returns:
      the ConcreteShiftDoctorStatus for the doctor, or null if not found for this ConcreteShift.
    • isDoctorAssigned

      public boolean isDoctorAssigned(Doctor doctor)
      Given a Doctor, check if he/she is actively assigned to this ConcreteShift, i.e. is either on duty or on call for it.

      If the Doctor is removed, it is not actively assigned.

      Parameters:
      doctor - doctor for which the lookup is to be done
      Returns:
      true if doctor is on duty or on call for this ConcreteShift, false elsewhere.