模拟医院挂号系统功能
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