67 lines
2.0 KiB
C++
67 lines
2.0 KiB
C++
#ifndef SETTLEMENT_H
|
||
#define SETTLEMENT_H
|
||
|
||
#include <string>
|
||
#include <vector>
|
||
#include <ctime>
|
||
|
||
class JsonValue;
|
||
|
||
// 结算单详情行项
|
||
struct SettlementItem {
|
||
std::string ItemName; // 项目名称(如"挂号费"、"检查费"等)
|
||
std::string ItemType; // 项目类型
|
||
std::string OperationID; // 关联的操作ID
|
||
double Quantity; // 数量
|
||
double UnitPrice; // 单价
|
||
double Amount; // 金额
|
||
std::string PaymentMethod; // 支付方式
|
||
|
||
SettlementItem();
|
||
SettlementItem(const std::string& name,
|
||
const std::string& type,
|
||
const std::string& opId,
|
||
double quantity,
|
||
double unitPrice,
|
||
const std::string& method = "");
|
||
|
||
JsonValue toJson() const;
|
||
static SettlementItem fromJson(const JsonValue& v);
|
||
};
|
||
|
||
// 结算单
|
||
class Settlement {
|
||
public:
|
||
std::string SettlementID; // 唯一主键
|
||
std::string PatientID; // 患者ID
|
||
std::string PatientName; // 患者姓名
|
||
std::string DischargeDate; // 出院日期
|
||
time_t SettlementTime; // 结算时间
|
||
std::vector<SettlementItem> Items; // 费用明细
|
||
double TotalAmount; // 医疗总费用
|
||
double InsurancePaid; // 医保支付
|
||
double PatientPaid; // 患者支付
|
||
std::string Status; // 结算状态("Pending", "Completed", "Settled")
|
||
std::string Notes; // 备注
|
||
|
||
Settlement();
|
||
Settlement(const std::string& settlementID,
|
||
const std::string& patientID,
|
||
const std::string& patientName);
|
||
|
||
// 添加费用项
|
||
void addItem(const SettlementItem& item, bool isInsuranceCovered = false);
|
||
|
||
// 计算总金额
|
||
void calculateTotals();
|
||
|
||
// JSON序列化
|
||
JsonValue toJson() const;
|
||
static Settlement fromJson(const JsonValue& v);
|
||
|
||
// 生成唯一ID
|
||
static std::string generateUniqueId();
|
||
};
|
||
|
||
#endif
|