诊所信息管理系统源程序
时间: 2023-12-13 17:33:26 浏览: 132
诊所信息管理系统是一种用于管理医疗机构信息的软件系统,它可以帮助医疗机构实现患者信息管理、医生排班管理、药品库存管理、财务管理等功能。以下是一个简单的诊所信息管理系统的源程序示例:
```
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class Patient {
public:
string name;
int age;
string gender;
string phone;
string address;
};
class Doctor {
public:
string name;
string specialty;
vector<string> schedule;
};
class Medicine {
public:
string name;
int quantity;
double price;
};
class Clinic {
public:
vector<Patient> patients;
vector<Doctor> doctors;
vector<Medicine> medicines;
void addPatient(Patient patient) {
patients.push_back(patient);
}
void addDoctor(Doctor doctor) {
doctors.push_back(doctor);
}
void addMedicine(Medicine medicine) {
medicines.push_back(medicine);
}
void printPatients() {
for (int i = 0; i < patients.size(); i++) {
cout << "Name: " << patients[i].name << endl;
cout << "Age: " << patients[i].age << endl;
cout << "Gender: " << patients[i].gender << endl;
cout << "Phone: " << patients[i].phone << endl;
cout << "Address: " << patients[i].address << endl;
cout << endl;
}
}
void printDoctors() {
for (int i = 0; i < doctors.size(); i++) {
cout << "Name: " << doctors[i].name << endl;
cout << "Specialty: " << doctors[i].specialty << endl;
cout << "Schedule: ";
for (int j = 0; j < doctors[i].schedule.size(); j++) {
cout << doctors[i].schedule[j] << " ";
}
cout << endl << endl;
}
}
void printMedicines() {
for (int i = 0; i < medicines.size(); i++) {
cout << "Name: " << medicines[i].name << endl;
cout << "Quantity: " << medicines[i].quantity << endl;
cout << "Price: " << medicines[i].price << endl;
cout << endl;
}
}
};
int main() {
Clinic clinic;
Patient patient1 = {"John Smith", 35, "Male", "123-456-7890", "123 Main St"};
Patient patient2 = {"Jane Doe", 25, "Female", "987-654-3210", "456 Oak St"};
Doctor doctor1 = {"Dr. Johnson", "Cardiology", {"Monday", "Wednesday", "Friday"}};
Doctor doctor2 = {"Dr. Lee", "Dermatology", {"Tuesday", "Thursday"}};
Medicine medicine1 = {"Aspirin", 100, 0.5};
Medicine medicine2 = {"Tylenol", 50, 0.8};
clinic.addPatient(patient1);
clinic.addPatient(patient2);
clinic.addDoctor(doctor1);
clinic.addDoctor(doctor2);
clinic.addMedicine(medicine1);
clinic.addMedicine(medicine2);
clinic.printPatients();
clinic.printDoctors();
clinic.printMedicines();
return 0;
}
```
这个源程序实现了一个简单的诊所信息管理系统,包括了患者、医生和药品的信息管理功能。你可以根据自己的需求进行修改和扩展。如果你需要更详细的诊所信息管理系统源程序,可以在网上搜索相关资源。
阅读全文