コード例 #1
0
  @Override
  public Doctor findSpeciality(String speciality, Long staffNumber) {

    Staff staff = staffCrudService.findById(staffNumber);
    List<OperationStaff> opStaff = staff.getOpStaff();
    Doctor doctor = new Doctor();
    List<Surgeon> surgeon = doctor.getSurgeon();
    for (Surgeon surg : surgeon) {

      if (speciality.equals(surg.getSpeciality())) {

        System.out.println("The doctor specialises with" + surg.getSpeciality());
      }
    }

    return doctor;
  }
コード例 #2
0
  @Override
  public String CheckAvailability(String status, Long staffNumber) {

    Staff staff = staffCrudService.findById(staffNumber);
    List<OperationStaff> opStaff = staff.getOpStaff();

    List<Doctor> doctor = new ArrayList<Doctor>();

    for (Doctor doc : doctor) {

      if (status.equals(doc)) {

        return "The doctor is vailable for appointments";
      } else return "The doctor is not available for appointments";
    }
    return status;
  }