Files
HIS-GUI/include/core/check_service.h
2026-04-05 20:11:43 +08:00

49 lines
1.2 KiB
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#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