51 lines
1.3 KiB
C++
51 lines
1.3 KiB
C++
#ifndef PATIENT_H
|
|
#define PATIENT_H
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
class JsonValue;
|
|
|
|
enum class PatientStatus {
|
|
Unregistered, // 未挂号
|
|
Outpatient, // 门诊
|
|
Emergency, // 急诊
|
|
Inpatient, // 住院
|
|
Discharged, // 已出院
|
|
Visited // 已就诊(门诊已就诊,包含诊断和用药记录)
|
|
};
|
|
|
|
class Patient {
|
|
public:
|
|
std::string PatientID; // 唯一主键
|
|
std::string Name;
|
|
int Age;
|
|
std::string Gender;
|
|
std::string Contact;
|
|
PatientStatus Status;
|
|
|
|
Patient();
|
|
Patient(const std::string& patientID,
|
|
const std::string& name,
|
|
int age,
|
|
const std::string& gender,
|
|
const std::string& contact,
|
|
PatientStatus status = PatientStatus::Outpatient);
|
|
|
|
bool updateBasicInfo(const std::string& name,
|
|
int age,
|
|
const std::string& gender,
|
|
const std::string& contact);
|
|
|
|
bool canBeRemoved() const; // 住院中禁止删除
|
|
bool nameMatches(const std::string& keyword) const; // 模糊匹配
|
|
|
|
// Generate UUID for new patient
|
|
static std::string generateUniqueId();
|
|
|
|
JsonValue toJson() const;
|
|
static Patient fromJson(const JsonValue& v);
|
|
};
|
|
|
|
#endif
|