#ifndef DOCTOR_SERVICE_H #define DOCTOR_SERVICE_H #include #include #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& visitor) const; // 按科室遍历医生(方便 doctor list dept) void for_eachDoctorInDept( const std::string& deptId, const std::function& visitor) const; // 模糊搜索医生:支持姓名、科室、坐班时间、职称 void searchDoctors( const std::string& keyword, const std::function& 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