74 lines
2.2 KiB
C++
74 lines
2.2 KiB
C++
#ifndef PATIENT_CASE_SERVICE_H
|
|
#define PATIENT_CASE_SERVICE_H
|
|
|
|
#include <functional>
|
|
#include <string>
|
|
|
|
#include "core/his_context.h"
|
|
#include "models/patient_case.h"
|
|
|
|
namespace core {
|
|
|
|
/**
|
|
* 患者病例服务
|
|
* 负责管理所有患者的病例数据
|
|
*/
|
|
class PatientCaseService {
|
|
public:
|
|
explicit PatientCaseService(HisContext& ctx);
|
|
|
|
// 获取或创建病例
|
|
PatientCase* getOrCreateCase(const std::string& patientId);
|
|
const PatientCase* getCase(const std::string& patientId) const;
|
|
PatientCase* getCase(const std::string& patientId);
|
|
|
|
// 添加病例(返回是否成功)
|
|
bool addPatientCase(const std::string& patientId);
|
|
|
|
// 诊断记录操作
|
|
bool addDiagnosisRecord(const std::string& patientId,
|
|
const DiagnosisRecord& record);
|
|
|
|
// 药房记录操作
|
|
bool addMedicineRecord(const std::string& patientId,
|
|
const MedicineRecord& record);
|
|
|
|
bool addCheckRecord(const std::string& patientId,
|
|
const CheckRecord& record);
|
|
|
|
// 预约记录操作
|
|
bool addAppointmentRecord(const std::string& patientId,
|
|
const AppointmentRecord& record);
|
|
|
|
// 住院记录操作
|
|
bool addAdmissionRecord(const std::string& patientId,
|
|
const AdmissionRecord& record);
|
|
bool dischargePatient(const std::string& patientId,
|
|
const std::string& dischargeSummary);
|
|
|
|
// 手术记录操作
|
|
bool addSurgeryRecord(const std::string& patientId,
|
|
const SurgeryRecord& record);
|
|
|
|
// 查询操作
|
|
size_t caseCount() const;
|
|
void for_eachCase(
|
|
const std::function<void(const std::string&, const PatientCase&)>& visitor) const;
|
|
|
|
// 统计操作
|
|
double getTotalMedicineCost(const std::string& patientId) const;
|
|
size_t getDiagnosisRecordCount(const std::string& patientId) const;
|
|
size_t getMedicineRecordCount(const std::string& patientId) const;
|
|
size_t getAdmissionRecordCount(const std::string& patientId) const;
|
|
|
|
// 删除病例
|
|
bool removeCase(const std::string& patientId);
|
|
|
|
private:
|
|
HisContext& ctx_;
|
|
};
|
|
|
|
} // namespace core
|
|
|
|
#endif
|