47 lines
1.2 KiB
C++
47 lines
1.2 KiB
C++
#ifndef CHECK_H
|
|
#define CHECK_H
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
#include <algorithm>
|
|
|
|
class JsonValue;
|
|
|
|
/**
|
|
* 检查项目 - 类似于药品但用于医学检查项目
|
|
*/
|
|
class Check {
|
|
public:
|
|
std::string CheckID; // 唯一主键
|
|
std::string Name; // 检查名称
|
|
std::string DepartmentID; // 所属科室ID
|
|
double Price; // 检查价格
|
|
|
|
// 构造函数
|
|
Check();
|
|
Check(const std::string& id, const std::string& name,
|
|
const std::string& dept, double price);
|
|
|
|
// 业务方法
|
|
bool updateBasicInfo(const std::string& name, const std::string& dept, double price);
|
|
bool nameMatches(const std::string& keyword) const;
|
|
|
|
// Generate UUID for new check
|
|
static std::string generateUniqueId();
|
|
|
|
// JSON 桥接接口
|
|
JsonValue toJson() const;
|
|
static Check fromJson(const JsonValue& v);
|
|
|
|
// 兼容旧代码
|
|
std::string getCheckID() const;
|
|
void setCheckID(const std::string& id);
|
|
std::string getName() const;
|
|
void setName(const std::string& name);
|
|
std::string getDepartmentID() const;
|
|
void setDepartmentID(const std::string& dept);
|
|
double getPrice() const;
|
|
void setPrice(double price);
|
|
};
|
|
|
|
#endif |