48 lines
1.2 KiB
C++
48 lines
1.2 KiB
C++
#ifndef DOCTOR_SERVICE_H
|
||
#define DOCTOR_SERVICE_H
|
||
|
||
#include <functional>
|
||
#include <string>
|
||
|
||
#include "core/his_context.h"
|
||
|
||
namespace core {
|
||
|
||
class DoctorService {
|
||
public:
|
||
explicit DoctorService(HisContext& ctx);
|
||
|
||
size_t doctorCount() const;
|
||
|
||
const Doctor* findDoctor(const std::string& doctorId) const;
|
||
Doctor* findDoctor(const std::string& doctorId);
|
||
|
||
void for_eachDoctor(
|
||
const std::function<void(const std::string&, const Doctor&)>& visitor) const;
|
||
|
||
// 按科室遍历医生(方便 doctor list dept)
|
||
void for_eachDoctorInDept(
|
||
const std::string& deptId,
|
||
const std::function<void(const std::string&, const Doctor&)>& visitor) const;
|
||
|
||
// 模糊搜索医生:支持姓名、科室、坐班时间、职称
|
||
void searchDoctors(
|
||
const std::string& keyword,
|
||
const std::function<void(const std::string&, const Doctor&)>& visitor) const;
|
||
|
||
bool addDoctor(const Doctor& d);
|
||
bool removeDoctor(const std::string& doctorId);
|
||
|
||
// 创建新医生(自动生成UUID)
|
||
Doctor createDoctor(const std::string& name, const std::string& departmentId,
|
||
DoctorTitle title, const std::string& schedule);
|
||
|
||
private:
|
||
HisContext& ctx_;
|
||
};
|
||
|
||
} // namespace core
|
||
|
||
#endif
|
||
|