医保结算参数优化

This commit is contained in:
萧道子 2025-06-17 09:12:01 +08:00
parent 26e504232e
commit 789d0d17cb
1 changed files with 6 additions and 65 deletions

View File

@ -7,7 +7,6 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.dpkj.common.config.ChsConfig;
import com.dpkj.common.config.HisConfig;
import com.dpkj.common.utils.IDGenerator;
import com.dpkj.common.vo.ResultData;
import com.dpkj.modules.chs.service.IHispayService;
import com.dpkj.modules.chs.vo.OutpatientBeginModel;
@ -78,9 +77,9 @@ public class HispayServiceImpl implements IHispayService {
*/
private String processParameters(JSONObject params, String password) {
JSONObject req = new JSONObject() {{
put("timestamp", DateUtil.format(DateUtil.date(), "yyyyMMddHHmmss")); // 请求发送时间
put("requestid", IDGenerator.getSnowflakeIdToStr()); // 唯一请求id
put("operid", hisConfig.getOperationId()); // 调用者代码
put("timestamp", ""); // 请求发送时间 DateUtil.format(DateUtil.date(), "yyyyMMddHHmmss")
put("requestid", ""); // 唯一请求id IDGenerator.getSnowflakeIdToStr()
put("operid", ""); // 调用者代码 hisConfig.getOperationId()
put("password", password); // 密码
put("params", params);
}};
@ -187,64 +186,6 @@ public class HispayServiceImpl implements IHispayService {
}
// public JSONObject getPatientInfo_old(String type, String content) {
// Dispatch dispatch = instanceActive();
//
// /**
// * 1删除保存HIS读卡内容的文件 避免读取到错误信息
// */
// // 获取HIS-CHS医保库路径
// String chsPath = System.getProperty("java.library.path");
// String filePath = chsPath + "/" + chsConfig.getFileName();
// // 删除文件
// FileUtil.del(FileUtil.file(filePath));
//
// /**
// * 2组装参数
// */
// JSONObject val = new JSONObject()
// .fluentPut("cardtype", type) // 1.就诊卡2.医保卡5.门诊号6.患者姓名和电话号码8.电子健康码/9.医保电子凭证
// .fluentPut("cardno", "") // 患者就诊卡号
// .fluentPut("sfzh", "") // 身份证号
// .fluentPut("hzxm", "") // 患者姓名
// .fluentPut("phone", ""); // 患者电话号码
// String params = processParameters(val, content);
// log.info("[HispayServiceImpl][getPatientInfo][医保读卡] 接口入参:{}", params);
//
// /**
// * 3调用COM函数
// */
// Variant rest = new Variant();
// Variant call = Dispatch.call(dispatch, "fRun", "BMZXX010", params, rest);
// log.info("[HispayServiceImpl][getPatientInfo][医保读卡] call返回值{}", call);
//
// // 释放资源
// releaseActive();
//
// /**
// * 4处理读卡结果
// */
// // COM函数调用之后会生成新的文件 需要判断
// File file = FileUtil.file(filePath);
// if (!file.exists()) {
// throw new RuntimeException("读卡失败:数据未读取");
// }
//
// // 获取读卡结果
// FileReader fileReader = new FileReader(file, "GBK");
// String data = fileReader.readString();
//
// JSONObject result;
// try {
// result = JSONObject.parseObject(data);
// log.info("[HispayServiceImpl][getPatientInfo][医保读卡] 读卡值:{}", result);
// } catch (Exception e) {
// throw new RuntimeException("读卡失败:" + data);
// }
// return result;
// }
private ResultData outpatientBudget(OutpatientBeginModel data) {
// 加载资源
ActiveXComponent dispatch = instanceActive();
@ -253,7 +194,7 @@ public class HispayServiceImpl implements IHispayService {
JSONObject val = new JSONObject()
.fluentPut("patid", data.getPatientId()) // 病人ID
.fluentPut("cfxhhj", data.getPrescriptionNo()) // 划价单据格式:单据1,单据2,单据3
.fluentPut("czksfbz", "") // 是否扣院内账户0不使用院内账户1使用院内账户默认不使用院内账户
.fluentPut("czksfbz", "0") // 是否扣院内账户0不使用院内账户1使用院内账户默认不使用院内账户
.fluentPut("zfjsbz", "0") // 是否自费结算0根据医保代码缴费1自费结算默认自费结算
.fluentPut("ybrc", ""); // 医保入参xml节点
String params = processParameters(val, data.getPassword());
@ -304,11 +245,11 @@ public class HispayServiceImpl implements IHispayService {
String requestTime = DateUtil.now();
data.setPaytime(requestTime);
JSONObject val = ((JSONObject) JSON.toJSON(data))
.fluentPut("czksfbz", "") // 是否扣院内账户与预算保持一致
.fluentPut("czksfbz", "0") // 是否扣院内账户与预算保持一致
.fluentPut("zfjsbz", "0") // 是否自费结算与预算保持一致0根据病人医保代码结算1自费结算
.fluentPut("ybrc", "")
.fluentPut("ptlsh", "")
.fluentPut("jysm", "自助机结算");
.fluentPut("jysm", "");
String params = processParameters(val, null);
log.info("[HispayServiceImpl][chsCodeAsOutpatientFinal][门诊缴费-结算] 接口入参:{}", params);