49 lines
1.2 KiB
C++
49 lines
1.2 KiB
C++
#ifndef CHECK_SERVICE_H
|
||
#define CHECK_SERVICE_H
|
||
|
||
#include <functional>
|
||
#include <string>
|
||
#include <vector>
|
||
|
||
#include "core/his_context.h"
|
||
|
||
namespace core {
|
||
|
||
class CheckService {
|
||
public:
|
||
explicit CheckService(HisContext& ctx);
|
||
|
||
size_t checkCount() const;
|
||
|
||
const Check* findCheck(const std::string& id) const;
|
||
Check* findCheck(const std::string& id);
|
||
|
||
void for_eachCheck(
|
||
const std::function<void(const std::string&, const Check&)>& visitor) const;
|
||
|
||
// 按名称模糊匹配
|
||
void searchByName(
|
||
const std::string& keyword,
|
||
const std::function<void(const std::string&, const Check&)>& visitor) const;
|
||
|
||
bool addCheck(const Check& c);
|
||
bool updateCheck(const std::string& id,
|
||
const std::string& name,
|
||
const std::string& dept,
|
||
double price);
|
||
bool removeCheck(const std::string& id, std::string& outError);
|
||
|
||
bool addOrUpdateCheck(const Check& c);
|
||
|
||
// 创建新检查项目(自动生成UUID)
|
||
Check createCheck(const std::string& name,
|
||
const std::string& dept,
|
||
double price);
|
||
|
||
private:
|
||
HisContext& ctx_;
|
||
};
|
||
|
||
} // namespace core
|
||
|
||
#endif |