模擬醫院掛號系統功能
1. 科室管理:新增科室,刪除科室(如果有醫生在,則不能刪除該科室),修改科室
2. 醫生管理:錄入醫生信息以及科室信息,修改醫生信息(主要是修改個人信息和科室)
3. 坐診信息設置:可以設置醫生當天和未來6天的坐診情況,包括上午和下午的坐診時間段和可預約數量,系統將自動保存到該醫生的坐診信息列表中
4. 全部信息展示:按照科室,展示每個醫生七天的坐診情況,需要按照科室歸類展示
5. 預約功能:用戶可以選擇要預約的科室,醫生、日期和時間段,并輸入患者的個人信息,系統將激動判斷該時間段是否還有預約名額,并保存預約信息
6. 搜索功能:用戶可以輸入搜索日期和時間段,系統將自動搜索未來七天內在該時間段坐診的醫生信息,并按照科室分類展示
7. 可以查詢某個醫生未來7天,病人對他的預約情況
//App
public class App {public static void main(String[] args) {//創建一個醫院管理對象HospitalManager h = new HospitalManager();h.start();}
}
//Doctor
//醫生類
public class Doctor {private String doctorId; //編號(唯一)private String name; //姓名private String departmentName; //科室名稱private String gender; //性別private int age; //年齡private String specialty; //主治方向private LocalDate joinDate; //入職時間private ArrayList<Schedule> schedules = new ArrayList<>(); //7天坐診情況public Doctor() {}public Doctor(String doctorId, String name, String departmentName, String gender, int age, String specialty, LocalDate joinDate, ArrayList<Schedule> schedules) {this.doctorId = doctorId;this.name = name;this.departmentName = departmentName;this.gender = gender;this.age = age;this.specialty = specialty;this.joinDate = joinDate;this.schedules = schedules;}public String getDoctorId() {return doctorId;}public void setDoctorId(String doctorId) {this.doctorId = doctorId;}public String getName() {return name;}public void setName(String name) {this.name = name;}public String getDepartmentName() {return departmentName;}public void setDepartmentName(String departmentName) {this.departmentName = departmentName;}public String getGender() {return gender;}public void setGender(String gender) {this.gender = gender;}public int getAge() {return age;}public void setAge(int age) {this.age = age;}public String getSpecialty() {return specialty;}public void setSpecialty(String specialty) {this.specialty = specialty;}public LocalDate getJoinDate() {return joinDate;}public void setJoinDate(LocalDate joinDate) {this.joinDate = joinDate;}public ArrayList<Schedule> getSchedules() {return schedules;}public void setSchedules(ArrayList<Schedule> schedules) {this.schedules = schedules;}
}
//Department
//科室類
public class Department {private String name;private ArrayList<Doctor> doctors = new ArrayList<>();public Department() {}public Department(String name, ArrayList<Doctor> doctors) {this.name = name;this.doctors = doctors;}public String getName() {return name;}public void setName(String name) {this.name = name;}public ArrayList<Doctor> getDoctors() {return doctors;}public void setDoctors(ArrayList<Doctor> doctors) {this.doctors = doctors;}
}
//Schedule
//醫生坐診情況類
public class Schedule {private LocalDate today; //當天日期private boolean update = false; //是否排班(默認未排班false)//上午private boolean morning; //是否看診private LocalTime mStart; //上午開始時間private LocalTime mEnd; //上午結束時間private int mTotalNum; //上午可預約人數private int mAppointNum; //上午已預約人數//下午private boolean afternoon; //是否看診private LocalTime aStart; //下午開始時間private LocalTime aEnd; //下午結束時間private int aTotalNum; //下午可預約人數private int aAppointNum; //下午已預約人數public Schedule() {}public Schedule(LocalDate today, boolean update, boolean morning, LocalTime mStart, LocalTime mEnd, int mTotalNum, int mAppointNum, boolean afternoon, LocalTime aStart, LocalTime aEnd, int aTotalNum, int aAppointNum) {this.today = today;this.update = update;this.morning = morning;this.mStart = mStart;this.mEnd = mEnd;this.mTotalNum = mTotalNum;this.mAppointNum = mAppointNum;this.afternoon = afternoon;this.aStart = aStart;this.aEnd = aEnd;this.aTotalNum = aTotalNum;this.aAppointNum = aAppointNum;}public boolean isUpdate() {return update;}public void setUpdate(boolean update) {this.update = update;}public LocalDate getToday() {return today;}public void setToday(LocalDate today) {this.today = today;}public boolean isMorning() {return morning;}public void setMorning(boolean morning) {this.morning = morning;}public LocalTime getmStart() {return mStart;}public void setmStart(LocalTime mStart) {this.mStart = mStart;}public LocalTime getmEnd() {return mEnd;}public void setmEnd(LocalTime mEnd) {this.mEnd = mEnd;}public int getmTotalNum() {return mTotalNum;}public void setmTotalNum(int mTotalNum) {this.mTotalNum = mTotalNum;}public int getmAppointNum() {return mAppointNum;}public void setmAppointNum(int mAppointNum) {this.mAppointNum = mAppointNum;}public boolean isAfternoon() {return afternoon;}public void setAfternoon(boolean afternoon) {this.afternoon = afternoon;}public LocalTime getaStart() {return aStart;}public void setaStart(LocalTime aStart) {this.aStart = aStart;}public LocalTime getaEnd() {return aEnd;}public void setaEnd(LocalTime aEnd) {this.aEnd = aEnd;}public int getaTotalNum() {return aTotalNum;}public void setaTotalNum(int aTotalNum) {this.aTotalNum = aTotalNum;}public int getaAppointNum() {return aAppointNum;}public void setaAppointNum(int aAppointNum) {this.aAppointNum = aAppointNum;}
}
//Appointment
//患者預約信息類
public class Appointment {private String userName; //患者姓名private String sex; //患者性別private int age; //患者年齡private String tel; //患者電話private String desc; //病情描述private String departmentName; //掛號科室private String doctorId; //看診醫生idprivate LocalDateTime appointDateTime; //預約時間public Appointment() {}public String getUserName() {return userName;}public void setUserName(String userName) {this.userName = userName;}public String getSex() {return sex;}public void setSex(String sex) {this.sex = sex;}public int getAge() {return age;}pu