|
@ -1,6 +1,7 @@
|
|
package com.yihu.wlyy.service.service.prescription;
|
|
package com.yihu.wlyy.service.service.prescription;
|
|
|
|
|
|
import com.yihu.wlyy.service.common.model.Result;
|
|
import com.yihu.wlyy.service.common.model.Result;
|
|
|
|
import com.yihu.wlyy.service.common.util.StringUtil;
|
|
import com.yihu.wlyy.service.dao.DoctorMappingDao;
|
|
import com.yihu.wlyy.service.dao.DoctorMappingDao;
|
|
import com.yihu.wlyy.service.dao.HospitalDao;
|
|
import com.yihu.wlyy.service.dao.HospitalDao;
|
|
import com.yihu.wlyy.service.dao.PatientDao;
|
|
import com.yihu.wlyy.service.dao.PatientDao;
|
|
@ -59,6 +60,8 @@ public class PrescriptionService extends ZysoftBaseService{
|
|
private PrescriptionExpressageDao prescriptionExpressageDao;
|
|
private PrescriptionExpressageDao prescriptionExpressageDao;
|
|
@Autowired
|
|
@Autowired
|
|
private HospitalDao hospitalDao;
|
|
private HospitalDao hospitalDao;
|
|
|
|
@Autowired
|
|
|
|
private PrescriptionPayDao prescriptionPayDao;
|
|
|
|
|
|
@Value("${redisChannel.prescription}")
|
|
@Value("${redisChannel.prescription}")
|
|
private String channelTopic;
|
|
private String channelTopic;
|
|
@ -68,7 +71,7 @@ public class PrescriptionService extends ZysoftBaseService{
|
|
* 新增续方日志
|
|
* 新增续方日志
|
|
* @param prescription
|
|
* @param prescription
|
|
*/
|
|
*/
|
|
public void addPrescriptionLog(Prescription prescription,String remark){
|
|
|
|
|
|
public void addPrescriptionLog(Prescription prescription, String remark){
|
|
PrescriptionLog log = new PrescriptionLog();
|
|
PrescriptionLog log = new PrescriptionLog();
|
|
log.setStatus(prescription.getStatus());
|
|
log.setStatus(prescription.getStatus());
|
|
log.setPrescriptionCode(prescription.getCode());
|
|
log.setPrescriptionCode(prescription.getCode());
|
|
@ -488,7 +491,7 @@ public class PrescriptionService extends ZysoftBaseService{
|
|
* @return
|
|
* @return
|
|
* @throws Exception
|
|
* @throws Exception
|
|
*/
|
|
*/
|
|
public String executeSickSettle(JSONObject json, String hospital, String licence) throws Exception
|
|
|
|
|
|
public String executeSickSettle(String prescriptionCode, String hospital, String licence) throws Exception
|
|
{
|
|
{
|
|
if(hospital==null){
|
|
if(hospital==null){
|
|
String[] hospitalMapping = getHospitalMapping(null); //获取机构映射
|
|
String[] hospitalMapping = getHospitalMapping(null); //获取机构映射
|
|
@ -500,6 +503,58 @@ public class PrescriptionService extends ZysoftBaseService{
|
|
header.put("ORGCODE",hospital);
|
|
header.put("ORGCODE",hospital);
|
|
header.put("LICENCE",licence);
|
|
header.put("LICENCE",licence);
|
|
|
|
|
|
|
|
Prescription prescription = prescriptionDao.findByCode(prescriptionCode);
|
|
|
|
if(prescription == null){
|
|
|
|
throw new Exception("未找到该处方!");
|
|
|
|
}
|
|
|
|
if(StringUtils.isBlank(prescription.getVisitNo())){
|
|
|
|
throw new Exception("处方为挂号成功");
|
|
|
|
}
|
|
|
|
PrescriptionPay prescriptionPay = prescriptionPayDao.findByPrescriptionPay(prescriptionCode);
|
|
|
|
if(prescriptionPay == null){
|
|
|
|
throw new Exception("支付失败,无法结算,请重新支付!");
|
|
|
|
}
|
|
|
|
|
|
|
|
//拼接结算参数
|
|
|
|
JSONObject json = new JSONObject();
|
|
|
|
json.put("cardNo",prescription.getSsc());// "cardNo": "病人卡号",
|
|
|
|
// "saveDept": "开单科室编码",
|
|
|
|
// "REGISTER_TYPE": "挂号类型编码",
|
|
|
|
// "RATE_TYPE": "费别类型编码",
|
|
|
|
json.put("settleDept","结算科室编码");//结算科室编码--------待处理
|
|
|
|
String jwdoctor = doctorMappingDao.findByDocotrCodeAndJwDoctorHospital(prescription.getDoctor(),hospital);
|
|
|
|
json.put("saveOperator",jwdoctor);// "saveOperator": "开单人员编码",
|
|
|
|
json.put("visitNo",prescription.getVisitNo());// "院内挂号号,取费用列表中最小的院内挂号号
|
|
|
|
|
|
|
|
//医保支付需要组装以下参数
|
|
|
|
if (1 == prescriptionPay.getType()){
|
|
|
|
JSONObject insurResult = new JSONObject();
|
|
|
|
insurResult.put("zhzfe0",prescriptionPay.getAccountPay());//个人账户支付(医保个人账户支付)
|
|
|
|
insurResult.put("jjzfe0",prescriptionPay.getFundPay());//基金支付(医保统筹基金支付)
|
|
|
|
insurResult.put("sybxzf",prescriptionPay.getCommercePay());//商业保险支付
|
|
|
|
insurResult.put("bjjjzf",prescriptionPay.getHealthCarePay());//保健基金支付(保健支付)
|
|
|
|
insurResult.put("mzbzje",prescriptionPay.getCivilPay());//民政补助金额(民政医疗救助金额)
|
|
|
|
insurResult.put("ylzfe0",prescriptionPay.getBdrugPay());//医保乙类支付
|
|
|
|
insurResult.put("Cfdxje",prescriptionPay.getExceedAmount());//超封顶线金额
|
|
|
|
insurResult.put("gwybz0",prescriptionPay.getCadresPay());//超公务员补助支付
|
|
|
|
insurResult.put("grzhye",prescriptionPay.getAccountBalance());//个人账户余额
|
|
|
|
insurResult.put("mzlsh0",prescriptionPay.getMiRegisterNo());//医保挂号号(门诊流水号)
|
|
|
|
insurResult.put("djlsh0",prescriptionPay.getMiSettleNo());//医保收费单据号(单据流水号)
|
|
|
|
insurResult.put("jkzhzf",prescriptionPay.getHeathPay());//健康账户支付
|
|
|
|
insurResult.put("Jkzhye",prescriptionPay.getHealthBalance());//健康账户余额
|
|
|
|
insurResult.put("gjzhzf",prescriptionPay.getFamilyPay());//共济账户支付
|
|
|
|
insurResult.put("bckbcs","");//医保挂号接口返回结果中的本次看病次数
|
|
|
|
insurResult.put("gzztmc","");//医保挂号接口返回结果中的工作状态名称
|
|
|
|
insurResult.put("grsfen","");//医保挂号接口返回结果中的个人身份名称
|
|
|
|
insurResult.put("bjjbie","");//医保挂号接口返回结果中的保健级别
|
|
|
|
insurResult.put("dispOverLimit",0);//门诊超限制标志,1是,0否
|
|
|
|
insurResult.put("bcbxf0",prescriptionPay.getMiTotalFee());//本次报销总额
|
|
|
|
insurResult.put("grzfe0",prescriptionPay.getSelfPay());//个人自付额
|
|
|
|
insurResult.put("fybfy0",prescriptionPay.getUnlessAmount());//非医保费用
|
|
|
|
|
|
|
|
json.put("insurResult",insurResult);
|
|
|
|
}
|
|
|
|
|
|
String response = postSecond("executeSickSettle","院内结算确认接口",null,json,header,false,2);
|
|
String response = postSecond("executeSickSettle","院内结算确认接口",null,json,header,false,2);
|
|
|
|
|
|
return response;
|
|
return response;
|