系统共有五大功能:增加医生;删除医生;增加患者;删除患者;查询患者信息。
医生的属性有姓名,性别,科室;患者的属性有姓名,性别,科室,医生。
系统可以通过控制台进行人机交互,选择功能,并管理医生和患者的信息。
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map.Entry;
import java.util.Scanner;
public class Hospital {
public static void main(String[] args) {
LinkedHashMap<String, Doctor> mapDoctors = new LinkedHashMap<String, Doctor>();
LinkedHashMap<String, Patient> mapPatients = new LinkedHashMap<String, Patient>();
initDoctorsAndPatients(mapDoctors, mapPatients);
System.out.println("医院信息系统上线");
System.out.println("=========医生信息========");
printDoctor(mapDoctors);
System.out.println("=========患者信息========");
printPatient(mapPatients);
playSystem(mapDoctors, mapPatients);
}
// 初始信息
public static void initDoctorsAndPatients(LinkedHashMap<String, Doctor> mapDoctors,
LinkedHashMap<String, Patient> mapPatients) {
mapDoctors.put("李敏", new Doctor("李敏", "女", "心脏科"));
mapDoctors.put("王磊", new Doctor("王磊", "男", "皮肤科"));
mapPatients.put("王华", new Patient("王华", "男", "心脏科", new Doctor("李敏", "女", "心脏科")));
mapPatients.put("陆天赐", new Patient("陆天赐", "男",