Files
HIS-GUI/include/core/settlement_service.h
2026-04-06 16:23:17 +08:00

73 lines
2.1 KiB
C++

#ifndef SETTLEMENT_SERVICE_H
#define SETTLEMENT_SERVICE_H
#include <functional>
#include <string>
#include "core/his_context.h"
#include "models/settlement.h"
namespace core {
/**
* 结算服务
* 负责生成和管理结算单,与支付系统集成,在患者出院时自动生成结算单
*/
class SettlementService {
public:
explicit SettlementService(HisContext& ctx);
// 为患者生成结算单
bool generateSettlement(const std::string& patientID,
const std::string& patientName,
const std::string& dischargeDate,
std::string& outSettlementID);
// 查询结算单
size_t settlementCount() const;
const Settlement* findSettlement(const std::string& settlementId) const;
Settlement* findSettlement(const std::string& settlementId);
// 按患者ID查询结算单
void findByPatientId(
const std::string& patientId,
const std::function<void(const std::string&, const Settlement&)>& visitor) const;
// 遍历所有结算单
void for_eachSettlement(
const std::function<void(const std::string&, const Settlement&)>& visitor) const;
// 添加费用项到结算单
bool addItemToSettlement(const std::string& settlementId,
const SettlementItem& item,
bool isInsuranceCovered = false);
// 计算结算单总额
bool calculateSettlement(const std::string& settlementId);
// 完成结算
bool completeSettlement(const std::string& settlementId);
// 获取患者的结算总额
double getPatientTotalAmount(const std::string& patientId) const;
// 获取患者的医保支付总额
double getPatientInsurancePaid(const std::string& patientId) const;
// 获取患者的自付总额
double getPatientPatientPaid(const std::string& patientId) const;
// 删除结算单
bool removeSettlement(const std::string& settlementId);
// 生成结算单详情报告(用于打印)
std::string generateSettlementReport(const std::string& settlementId);
private:
HisContext& ctx_;
};
} // namespace core
#endif