简单门诊管理信息系统python
时间: 2023-10-15 22:24:54 浏览: 147
门诊管理信息系统是一个用于管理门诊流程和病人信息的系统。下面是一个简单的门诊管理信息系统的Python代码示例:
```python
class Patient:
def __init__(self, name, age, gender):
self.name = name
self.age = age
self.gender = gender
class Clinic:
def __init__(self):
self.patients = []
def add_patient(self, patient):
self.patients.append(patient)
def remove_patient(self, patient):
self.patients.remove(patient)
def display_patients(self):
for patient in self.patients:
print(f"Name: {patient.name}, Age: {patient.age}, Gender: {patient.gender}")
clinic = Clinic()
while True:
print("1. Add Patient \n2. Remove Patient \n3. Display Patients \n4. Exit")
choice = int(input("Enter your choice: "))
if choice == 1:
name = input("Enter patient name: ")
age = input("Enter patient age: ")
gender = input("Enter patient gender: ")
patient = Patient(name, age, gender)
clinic.add_patient(patient)
print("Patient added successfully!")
elif choice == 2:
name = input("Enter patient name to remove: ")
for patient in clinic.patients:
if patient.name == name:
clinic.remove_patient(patient)
print("Patient removed successfully!")
break
else:
print("Patient not found!")
elif choice == 3:
clinic.display_patients()
elif choice == 4:
break
else:
print("Invalid choice!")
```
这是一个简单的门诊管理信息系统,可以通过输入菜单选项来添加,删除和显示病人信息。注意,这只是一个示例,并不包含完整的功能和界面。你可以根据自己的需求进行修改和扩展。
阅读全文