|
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.commons.collections4.ListUtils;
|
|
import org.apache.commons.collections4.ListUtils;
|
|
|
|
+import org.jetbrains.annotations.NotNull;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import thyyxxk.webserver.config.exception.BizException;
|
|
import thyyxxk.webserver.config.exception.BizException;
|
|
@@ -58,6 +59,8 @@ public class SetlListUpldService {
|
|
private static final int UPLOADED = 2;
|
|
private static final int UPLOADED = 2;
|
|
private static final int All = 4;
|
|
private static final int All = 4;
|
|
|
|
|
|
|
|
+ private static final String TOTAL_AMOUNT_CODE = "99";
|
|
|
|
+
|
|
private static final String RESULT_CODE = "infcode";
|
|
private static final String RESULT_CODE = "infcode";
|
|
private static final String ERROR_MESSAGE = "err_msg";
|
|
private static final String ERROR_MESSAGE = "err_msg";
|
|
private static final String OUTPUT = "output";
|
|
private static final String OUTPUT = "output";
|
|
@@ -81,6 +84,7 @@ public class SetlListUpldService {
|
|
this.caseFrontSheetService = caseFrontSheetService;
|
|
this.caseFrontSheetService = caseFrontSheetService;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 上传到医保的结算单上传
|
|
* 上传到医保的结算单上传
|
|
*
|
|
*
|
|
@@ -95,38 +99,32 @@ public class SetlListUpldService {
|
|
if (upldCollection.getCode() != 200) {
|
|
if (upldCollection.getCode() != 200) {
|
|
throw new BizException(ExceptionEnum.INTERNAL_SERVER_ERROR, upldCollection.getMessage());
|
|
throw new BizException(ExceptionEnum.INTERNAL_SERVER_ERROR, upldCollection.getMessage());
|
|
}
|
|
}
|
|
- if (patNo.startsWith("JT")) {
|
|
|
|
- throw new BizException(ExceptionEnum.INTERNAL_SERVER_ERROR, "单病种患者,无法上传数据。");
|
|
|
|
- }
|
|
|
|
- BigDecimal age = new BigDecimal(upldCollection.getData().getSetlinfo().getAge());
|
|
|
|
- // 年龄在大于 60 和 小于 16 之间联系人不能写 自己
|
|
|
|
- if (StringUtil.isBlank(upldCollection.getData().getSetlinfo().getConerName())) {
|
|
|
|
- throw new BizException(ExceptionEnum.INTERNAL_SERVER_ERROR, "患者联系人姓名不能为空。");
|
|
|
|
- }
|
|
|
|
- // 这个先占时放开
|
|
|
|
-// else if (BigUtils.bigDaYu(age, 60) || BigUtils.bigXiaoYu(age, 16)) {
|
|
|
|
-// if (upldCollection.getData().getSetlinfo().getPsnName().trim().equals(upldCollection.getData().getSetlinfo().getConerName().trim())) {
|
|
|
|
-// throw new BizException(ExceptionEnum.INTERNAL_SERVER_ERROR, "年龄在大于 60 和 小于 16 之间联系人不能写自己");
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
|
|
+ if (!patNo.startsWith("JT") && patNo.indexOf("-") == 0) {
|
|
|
|
+ if (StringUtil.isBlank(upldCollection.getData().getSetlinfo().getConerName())) {
|
|
|
|
+ throw new BizException(ExceptionEnum.INTERNAL_SERVER_ERROR, "患者联系人姓名不能为空。");
|
|
|
|
+ }
|
|
|
|
+// throw new BizException(ExceptionEnum.INTERNAL_SERVER_ERROR, "单病种患者,无法上传数据。");
|
|
|
|
+ }
|
|
if (StringUtil.notBlank(upldCollection.getData().getSetlinfo().getHiType()) && upldCollection.getData().getSetlinfo().getHiType().trim().equals("310")) {
|
|
if (StringUtil.notBlank(upldCollection.getData().getSetlinfo().getHiType()) && upldCollection.getData().getSetlinfo().getHiType().trim().equals("310")) {
|
|
if (StringUtil.isBlank(upldCollection.getData().getSetlinfo().getEmpAddr()) || StringUtil.isBlank(upldCollection.getData().getSetlinfo().getEmpName())) {
|
|
if (StringUtil.isBlank(upldCollection.getData().getSetlinfo().getEmpAddr()) || StringUtil.isBlank(upldCollection.getData().getSetlinfo().getEmpName())) {
|
|
throw new BizException(ExceptionEnum.INTERNAL_SERVER_ERROR, "结算清单中职工参保人的单位及地址不能为空。");
|
|
throw new BizException(ExceptionEnum.INTERNAL_SERVER_ERROR, "结算清单中职工参保人的单位及地址不能为空。");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- for (OprninfoUpld item : upldCollection.getData().getOprninfo()) {
|
|
|
|
- if (StringUtil.isBlank(item.getOperDrCode())) {
|
|
|
|
- throw new BizException(ExceptionEnum.INTERNAL_SERVER_ERROR, String.format("医生:【%s】,没有医保编码请去职工字典数据维护中添加", null == item.getOperDrName() ? "没有填写医生" : item.getOperDrName()));
|
|
|
|
- }
|
|
|
|
- if (StringUtil.notBlank(item.getAnstDrName()) && StringUtil.isBlank(item.getAnstDrCode())) {
|
|
|
|
- throw new BizException(ExceptionEnum.INTERNAL_SERVER_ERROR, String.format("医生:【%s】,没有医保编码请去职工字典数据维护中添加", null == item.getAnstDrName() ? "没有填写医生" : item.getAnstDrName()));
|
|
|
|
|
|
+ if (ListUtil.notBlank(upldCollection.getData().getOprninfo())) {
|
|
|
|
+ for (OprninfoUpld item : upldCollection.getData().getOprninfo()) {
|
|
|
|
+ if (StringUtil.isBlank(item.getOperDrCode())) {
|
|
|
|
+ throw new BizException(ExceptionEnum.INTERNAL_SERVER_ERROR, String.format("医生:【%s】,没有医保编码请去职工字典数据维护中添加", null == item.getOperDrName() ? "没有填写医生" : item.getOperDrName()));
|
|
|
|
+ }
|
|
|
|
+ if (StringUtil.notBlank(item.getAnstDrName()) && StringUtil.isBlank(item.getAnstDrCode())) {
|
|
|
|
+ throw new BizException(ExceptionEnum.INTERNAL_SERVER_ERROR, String.format("医生:【%s】,没有医保编码请去职工字典数据维护中添加", null == item.getAnstDrName() ? "没有填写医生" : item.getAnstDrName()));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
JSONObject input = new JSONObject();
|
|
JSONObject input = new JSONObject();
|
|
input.put("setlinfo", JSONObject.parseObject(JSONObject.toJSONStringWithDateFormat(upldCollection.getData().getSetlinfo(), "yyyy-MM-dd HH:mm:ss")));
|
|
input.put("setlinfo", JSONObject.parseObject(JSONObject.toJSONStringWithDateFormat(upldCollection.getData().getSetlinfo(), "yyyy-MM-dd HH:mm:ss")));
|
|
input.put("payinfo", JSONArray.parseArray(JSONArray.toJSONString(upldCollection.getData().getPayinfo())));
|
|
input.put("payinfo", JSONArray.parseArray(JSONArray.toJSONString(upldCollection.getData().getPayinfo())));
|
|
input.put("iteminfo", JSONArray.parseArray(JSONArray.toJSONString(upldCollection.getData().getIteminfo())));
|
|
input.put("iteminfo", JSONArray.parseArray(JSONArray.toJSONString(upldCollection.getData().getIteminfo())));
|
|
- input.put("opspdiseinfo", new JSONArray());
|
|
|
|
|
|
+ input.put("opspdiseinfo", JSONArray.parseArray(JSONArray.toJSONString(upldCollection.getData().getOpspdiseinfo())));
|
|
input.put("diseinfo", JSONArray.parseArray(JSONArray.toJSONString(upldCollection.getData().getDiseinfo())));
|
|
input.put("diseinfo", JSONArray.parseArray(JSONArray.toJSONString(upldCollection.getData().getDiseinfo())));
|
|
input.put("oprninfo", JSONArray.parseArray(JSONArray.toJSONString(upldCollection.getData().getOprninfo())));
|
|
input.put("oprninfo", JSONArray.parseArray(JSONArray.toJSONString(upldCollection.getData().getOprninfo())));
|
|
input.put("icuinfo", JSONArray.parseArray(JSONArray.toJSONString(upldCollection.getData().getIcuinfo())));
|
|
input.put("icuinfo", JSONArray.parseArray(JSONArray.toJSONString(upldCollection.getData().getIcuinfo())));
|
|
@@ -148,7 +146,6 @@ public class SetlListUpldService {
|
|
dao.fanHuiLiuShuiHao(result.getJSONObject(OUTPUT).getString("setl_list_id"), upldCollection.getData().getSetlinfo().getSetlId());
|
|
dao.fanHuiLiuShuiHao(result.getJSONObject(OUTPUT).getString("setl_list_id"), upldCollection.getData().getSetlinfo().getSetlId());
|
|
return ResultVoUtil.success(ExceptionEnum.SUCCESS, "上传成功");
|
|
return ResultVoUtil.success(ExceptionEnum.SUCCESS, "上传成功");
|
|
}
|
|
}
|
|
-// String errMsg = "测试";
|
|
|
|
String errMsg = result.getString("err_msg");
|
|
String errMsg = result.getString("err_msg");
|
|
if (errMsg.length() > 9999) {
|
|
if (errMsg.length() > 9999) {
|
|
errMsg = "字符超长自动截取" + errMsg.substring(0, 9999);
|
|
errMsg = "字符超长自动截取" + errMsg.substring(0, 9999);
|
|
@@ -175,13 +172,19 @@ public class SetlListUpldService {
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "该病案没有签收,请病案室签收后上传。");
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "该病案没有签收,请病案室签收后上传。");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
Integer flag = dao.setlModifyReqAuditFlag(patNo, times);
|
|
Integer flag = dao.setlModifyReqAuditFlag(patNo, times);
|
|
flag = flag == null ? 0 : flag;
|
|
flag = flag == null ? 0 : flag;
|
|
|
|
+ // 患者基本信息
|
|
SetlinfoUpld setlinfoUpld = dao.setlinfo1(patNo, times, ledgerSn);
|
|
SetlinfoUpld setlinfoUpld = dao.setlinfo1(patNo, times, ledgerSn);
|
|
|
|
+ EntityCopy.Copy(dao.setlinfo2(patNo, times), setlinfoUpld);
|
|
|
|
+ if (patNo.startsWith("JT")) {
|
|
|
|
+ EntityCopy.Copy(dao.singleDiseasePatientInformation(patNo, times), setlinfoUpld);
|
|
|
|
+ }
|
|
|
|
+
|
|
if (StringUtil.isBlank(setlinfoUpld.getSetlId())) {
|
|
if (StringUtil.isBlank(setlinfoUpld.getSetlId())) {
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "结算id为空");
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "结算id为空");
|
|
}
|
|
}
|
|
-// setlinfoUpld.setFixmedinsName(SiUtil.INSTITUTION_NAME);
|
|
|
|
// 特级护理
|
|
// 特级护理
|
|
setlinfoUpld.setSpgaNurscareDays(String.valueOf(dao.teJiHuLi(publicServer.getInpatientNo(patNo), times, ledgerSn, publicServer.getInfantFlag(patNo))));
|
|
setlinfoUpld.setSpgaNurscareDays(String.valueOf(dao.teJiHuLi(publicServer.getInpatientNo(patNo), times, ledgerSn, publicServer.getInfantFlag(patNo))));
|
|
// 一级护理
|
|
// 一级护理
|
|
@@ -190,16 +193,12 @@ public class SetlListUpldService {
|
|
setlinfoUpld.setScdNurscareDays(String.valueOf(dao.erJiHuLi(publicServer.getInpatientNo(patNo), times, ledgerSn, publicServer.getInfantFlag(patNo))));
|
|
setlinfoUpld.setScdNurscareDays(String.valueOf(dao.erJiHuLi(publicServer.getInpatientNo(patNo), times, ledgerSn, publicServer.getInfantFlag(patNo))));
|
|
// 三级护理
|
|
// 三级护理
|
|
setlinfoUpld.setLv3NurscareDays(String.valueOf(dao.sanJiHuLi(publicServer.getInpatientNo(patNo), times, ledgerSn, publicServer.getInfantFlag(patNo))));
|
|
setlinfoUpld.setLv3NurscareDays(String.valueOf(dao.sanJiHuLi(publicServer.getInpatientNo(patNo), times, ledgerSn, publicServer.getInfantFlag(patNo))));
|
|
-// setlinfoUpld.setFixmedinsCode(SiUtil.INSTITUTION_ID);
|
|
|
|
-
|
|
|
|
- // TokenUtil.getTokenUserId()
|
|
|
|
GetDropdownBox getDropdownBox = dao.userInfo(TokenUtil.getTokenUserId());
|
|
GetDropdownBox getDropdownBox = dao.userInfo(TokenUtil.getTokenUserId());
|
|
// 医疗机构填报人
|
|
// 医疗机构填报人
|
|
setlinfoUpld.setMedinsFillPsn(getDropdownBox.getName());
|
|
setlinfoUpld.setMedinsFillPsn(getDropdownBox.getName());
|
|
// 医疗机构填报部门
|
|
// 医疗机构填报部门
|
|
setlinfoUpld.setMedinsFillDept(getDropdownBox.getDeptName());
|
|
setlinfoUpld.setMedinsFillDept(getDropdownBox.getDeptName());
|
|
// 医保机构经办人
|
|
// 医保机构经办人
|
|
- EntityCopy.Copy(dao.setlinfo2(patNo, times), setlinfoUpld);
|
|
|
|
List<OprninfoUpld> oprninfoUpld = dao.oprninfoUplds(patNo, times, flag == 1 ? "batj_ba4_modify" : "batj_ba4");
|
|
List<OprninfoUpld> oprninfoUpld = dao.oprninfoUplds(patNo, times, flag == 1 ? "batj_ba4_modify" : "batj_ba4");
|
|
// 手术计数
|
|
// 手术计数
|
|
setlinfoUpld.setOprnOprtCodeCnt(String.valueOf(oprninfoUpld.size()));
|
|
setlinfoUpld.setOprnOprtCodeCnt(String.valueOf(oprninfoUpld.size()));
|
|
@@ -227,7 +226,6 @@ public class SetlListUpldService {
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, chrgitems.getMessage());
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, chrgitems.getMessage());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- setlinfoUpld.setSetlBegnDate(setlinfoUpld.getAdmTime());
|
|
|
|
// 票据代码
|
|
// 票据代码
|
|
setlinfoUpld.setBillNo(dao.billNo(patNo, times, ledgerSn));
|
|
setlinfoUpld.setBillNo(dao.billNo(patNo, times, ledgerSn));
|
|
setlinfoUpld.setBillCode("143001913350");
|
|
setlinfoUpld.setBillCode("143001913350");
|
|
@@ -248,10 +246,52 @@ public class SetlListUpldService {
|
|
String a = DecimalUtil.minus(item.getAmt(), item.getClaaSumfee());
|
|
String a = DecimalUtil.minus(item.getAmt(), item.getClaaSumfee());
|
|
a = DecimalUtil.minus(a, item.getClabAmt());
|
|
a = DecimalUtil.minus(a, item.getClabAmt());
|
|
a = DecimalUtil.minus(a, item.getFulamtOwnpayAmt());
|
|
a = DecimalUtil.minus(a, item.getFulamtOwnpayAmt());
|
|
- item.setOthAmt(a);
|
|
|
|
|
|
+ if (BigUtils.bigXiaoYu(new BigDecimal(a), 0)) {
|
|
|
|
+ item.setOthAmt("0.00");
|
|
|
|
+ } else {
|
|
|
|
+ item.setOthAmt(a);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 重症监护时间
|
|
// 重症监护时间
|
|
|
|
+ List<IcuinfoUpld> zhongZhenJianHu = getIcuinfoUplds(patNo, times);
|
|
|
|
+ List<PayinfoUpld> payinfo = dao.payinfoUpld(patNo, times, ledgerSn);
|
|
|
|
+ List<DiseinfoUpld> diseinfos = dao.diseinfo(patNo, times, flag == 1 ? "zy_dis_diag_yb_modify" : "zy_dis_diag_yb");
|
|
|
|
+ setlinfoUpld.setDiagCodeCnt(String.valueOf(diseinfos.size()));
|
|
|
|
+
|
|
|
|
+ for (int i = 0; i < diseinfos.size(); i++) {
|
|
|
|
+ diseinfos.get(i).setMaindiagFlag(i == 0 ? "1" : "0");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ UpldCollection upldCollection = new UpldCollection();
|
|
|
|
+ // 患者的基本信息
|
|
|
|
+ upldCollection.setSetlinfo(setlinfoUpld);
|
|
|
|
+ // 基金支付信息
|
|
|
|
+ upldCollection.setPayinfo(payinfo);
|
|
|
|
+ // 门特慢特病诊断信息 住院没有
|
|
|
|
+ upldCollection.setOpspdiseinfo(new ArrayList<>());
|
|
|
|
+ // 住院诊断信息
|
|
|
|
+ upldCollection.setDiseinfo(diseinfos);
|
|
|
|
+ // 收费项目信息
|
|
|
|
+ upldCollection.setIteminfo(amtAndOthAmt);
|
|
|
|
+ // 手术操作信息
|
|
|
|
+ upldCollection.setOprninfo(oprninfoUpld);
|
|
|
|
+ // 重症监护信息
|
|
|
|
+ upldCollection.setIcuinfo(zhongZhenJianHu);
|
|
|
|
+ // 输血信息
|
|
|
|
+ List<PatientBldInfo> patientBldInfos = dao.shuXueXinXi(patNo, times);
|
|
|
|
+ upldCollection.setBldinfo(new ArrayList<>());
|
|
|
|
+ patientBldInfos.forEach((item) -> {
|
|
|
|
+ Bldinfo bldinfo = new Bldinfo();
|
|
|
|
+ bldinfo.setBldCat(item.getBldCat()).setBldAmt(item.getBldAmt().toString()).setBldUnt(item.getBldUnit());
|
|
|
|
+ upldCollection.getBldinfo().add(bldinfo);
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ return ResultVoUtil.success(upldCollection);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @NotNull
|
|
|
|
+ private List<IcuinfoUpld> getIcuinfoUplds(String patNo, Integer times) {
|
|
List<IcuinfoUpld> zhongZhenJianHu = new ArrayList<>();
|
|
List<IcuinfoUpld> zhongZhenJianHu = new ArrayList<>();
|
|
List<Date> zhuanKeShiJian = dao.zhuanKeShiJian(patNo, times);
|
|
List<Date> zhuanKeShiJian = dao.zhuanKeShiJian(patNo, times);
|
|
if (ListUtil.notBlank(zhuanKeShiJian)) {
|
|
if (ListUtil.notBlank(zhuanKeShiJian)) {
|
|
@@ -285,45 +325,10 @@ public class SetlListUpldService {
|
|
zhongZhenJianHu.add(icuinfoUpld);
|
|
zhongZhenJianHu.add(icuinfoUpld);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- List<PayinfoUpld> payinfo = dao.payinfoUpld(patNo, times, ledgerSn);
|
|
|
|
- List<DiseinfoUpld> diseinfos = dao.diseinfo(patNo, times, flag == 1 ? "zy_dis_diag_yb_modify" : "zy_dis_diag_yb");
|
|
|
|
- setlinfoUpld.setDiagCodeCnt(String.valueOf(diseinfos.size()));
|
|
|
|
-
|
|
|
|
- for (int i = 0; i < diseinfos.size(); i++) {
|
|
|
|
- diseinfos.get(i).setMaindiagFlag(i == 0 ? "1" : "2");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- UpldCollection upldCollection = new UpldCollection();
|
|
|
|
- // 患者的基本信息
|
|
|
|
- upldCollection.setSetlinfo(setlinfoUpld);
|
|
|
|
- // 基金支付信息
|
|
|
|
-// if (ListUtil.notBlank(amtAndOthAmt)) {
|
|
|
|
-// amtAndOthAmt.sort(Comparator.comparing(IteminfoUpld::getMedChrgitm));
|
|
|
|
-// }
|
|
|
|
- // 基金支付信息
|
|
|
|
- upldCollection.setPayinfo(payinfo);
|
|
|
|
- // 门特慢特病诊断信息 目前还没有
|
|
|
|
- upldCollection.setOpspdiseinfo(new ArrayList<>());
|
|
|
|
- // 住院诊断信息
|
|
|
|
- upldCollection.setDiseinfo(diseinfos);
|
|
|
|
- // 收费项目信息
|
|
|
|
- upldCollection.setIteminfo(amtAndOthAmt);
|
|
|
|
- // 手术操作信息
|
|
|
|
- upldCollection.setOprninfo(oprninfoUpld);
|
|
|
|
- // 重症监护信息
|
|
|
|
- upldCollection.setIcuinfo(zhongZhenJianHu);
|
|
|
|
- // 输血信息
|
|
|
|
- List<PatientBldInfo> patientBldInfos = dao.shuXueXinXi(patNo, times);
|
|
|
|
- upldCollection.setBldinfo(new ArrayList<>());
|
|
|
|
- patientBldInfos.forEach((item) -> {
|
|
|
|
- Bldinfo bldinfo = new Bldinfo();
|
|
|
|
- bldinfo.setBldCat(item.getBldCat()).setBldAmt(item.getBldAmt().toString()).setBldUnt(item.getBldUnit());
|
|
|
|
- upldCollection.getBldinfo().add(bldinfo);
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- return ResultVoUtil.success(upldCollection);
|
|
|
|
|
|
+ return zhongZhenJianHu;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 这里是获取打印结算单的信息,需要重新分装一下
|
|
* 这里是获取打印结算单的信息,需要重新分装一下
|
|
*
|
|
*
|
|
@@ -343,33 +348,37 @@ public class SetlListUpldService {
|
|
}
|
|
}
|
|
// 重新封装信息
|
|
// 重新封装信息
|
|
UpldCollectionTemp temp = new UpldCollectionTemp();
|
|
UpldCollectionTemp temp = new UpldCollectionTemp();
|
|
|
|
+
|
|
// 患者基本信息
|
|
// 患者基本信息
|
|
temp.setSetlinfo(EntityCopy.Copy(uploadInfo.getData().getSetlinfo(), SetlinfoUpldTemp.class));
|
|
temp.setSetlinfo(EntityCopy.Copy(uploadInfo.getData().getSetlinfo(), SetlinfoUpldTemp.class));
|
|
|
|
+ temp.getSetlinfo().setSetlListId(dao.billingListSerialNumber(patNo, times, ledgerSn));
|
|
temp.setPayinfo(EntityCopy.CopyList(uploadInfo.getData().getPayinfo(), PayinfoUpldTemp.class));
|
|
temp.setPayinfo(EntityCopy.CopyList(uploadInfo.getData().getPayinfo(), PayinfoUpldTemp.class));
|
|
|
|
+ // 门诊慢特病
|
|
temp.setOpspdiseinfo(EntityCopy.CopyList(uploadInfo.getData().getOpspdiseinfo(), OpspdiseinfoUpldTemp.class));
|
|
temp.setOpspdiseinfo(EntityCopy.CopyList(uploadInfo.getData().getOpspdiseinfo(), OpspdiseinfoUpldTemp.class));
|
|
-
|
|
|
|
// 诊断 有申请且成功的 就用 新的诊断
|
|
// 诊断 有申请且成功的 就用 新的诊断
|
|
temp.setDiseinfo(EntityCopy.CopyList(dao.zhenDuanXinXi(patNo, times, flag == 1 ? "zy_dis_diag_yb_modify" : "zy_dis_diag_yb"), DiseinfoUpldTemp.class));
|
|
temp.setDiseinfo(EntityCopy.CopyList(dao.zhenDuanXinXi(patNo, times, flag == 1 ? "zy_dis_diag_yb_modify" : "zy_dis_diag_yb"), DiseinfoUpldTemp.class));
|
|
// 费用类型
|
|
// 费用类型
|
|
temp.setIteminfo(EntityCopy.CopyList(uploadInfo.getData().getIteminfo(), IteminfoUpldTemp.class));
|
|
temp.setIteminfo(EntityCopy.CopyList(uploadInfo.getData().getIteminfo(), IteminfoUpldTemp.class));
|
|
// 计算费用的总和
|
|
// 计算费用的总和
|
|
|
|
+ IteminfoUpldTemp heJi = new IteminfoUpldTemp();
|
|
if (ListUtil.notBlank(temp.getIteminfo())) {
|
|
if (ListUtil.notBlank(temp.getIteminfo())) {
|
|
temp.setIteminfo(setMedType(temp.getIteminfo()));
|
|
temp.setIteminfo(setMedType(temp.getIteminfo()));
|
|
- IteminfoUpldTemp heJi = new IteminfoUpldTemp();
|
|
|
|
- for (IteminfoUpldTemp item : temp.getIteminfo()) {
|
|
|
|
- heJi.setMedChrgitm("99");
|
|
|
|
|
|
+ if (ledgerSn > 0) {
|
|
|
|
+ for (IteminfoUpldTemp item : temp.getIteminfo()) {
|
|
|
|
+ heJi.setMedChrgitm(TOTAL_AMOUNT_CODE);
|
|
|
|
|
|
- heJi.setAmt(DecimalUtil.add(heJi.getAmt(), item.getAmt()));
|
|
|
|
|
|
+ heJi.setAmt(DecimalUtil.add(heJi.getAmt(), item.getAmt()));
|
|
|
|
|
|
- heJi.setClaaSumfee(DecimalUtil.add(heJi.getClaaSumfee(), item.getClaaSumfee()));
|
|
|
|
|
|
+ heJi.setClaaSumfee(DecimalUtil.add(heJi.getClaaSumfee(), item.getClaaSumfee()));
|
|
|
|
|
|
- heJi.setClabAmt(DecimalUtil.add(heJi.getClabAmt(), item.getClabAmt()));
|
|
|
|
|
|
+ heJi.setClabAmt(DecimalUtil.add(heJi.getClabAmt(), item.getClabAmt()));
|
|
|
|
|
|
- heJi.setFulamtOwnpayAmt(DecimalUtil.add(heJi.getFulamtOwnpayAmt(), item.getFulamtOwnpayAmt()));
|
|
|
|
|
|
+ heJi.setFulamtOwnpayAmt(DecimalUtil.add(heJi.getFulamtOwnpayAmt(), item.getFulamtOwnpayAmt()));
|
|
|
|
|
|
- heJi.setOthAmt(DecimalUtil.add(heJi.getOthAmt(), item.getOthAmt()));
|
|
|
|
|
|
+ heJi.setOthAmt(DecimalUtil.add(heJi.getOthAmt(), item.getOthAmt()));
|
|
|
|
+ }
|
|
|
|
+ temp.getIteminfo().add(heJi);
|
|
}
|
|
}
|
|
- temp.getIteminfo().add(heJi);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
// 手术 也是一样的
|
|
// 手术 也是一样的
|
|
@@ -397,6 +406,7 @@ public class SetlListUpldService {
|
|
temp.getSetlinfo().setRefldeptDeptName(dao.getYbDeptName(temp.getSetlinfo().getRefldeptDept()));
|
|
temp.getSetlinfo().setRefldeptDeptName(dao.getYbDeptName(temp.getSetlinfo().getRefldeptDept()));
|
|
// 出院科别
|
|
// 出院科别
|
|
temp.getSetlinfo().setDscgCatyName(dao.getYbDeptName(temp.getSetlinfo().getDscgCaty()));
|
|
temp.getSetlinfo().setDscgCatyName(dao.getYbDeptName(temp.getSetlinfo().getDscgCaty()));
|
|
|
|
+ log.info("数据:{}", JSON.toJSONString(temp));
|
|
return ResultVoUtil.success(temp);
|
|
return ResultVoUtil.success(temp);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -646,6 +656,7 @@ public class SetlListUpldService {
|
|
if (param.getHiPaymtd() != null && param.getHiPaymtd() != 0) {
|
|
if (param.getHiPaymtd() != null && param.getHiPaymtd() != 0) {
|
|
qw.eq("a.hi_paymtd", param.getHiPaymtd());
|
|
qw.eq("a.hi_paymtd", param.getHiPaymtd());
|
|
}
|
|
}
|
|
|
|
+ System.out.println(param.getHiPaymtd());
|
|
if (StringUtil.notBlank(param.getReferPhysician())) {
|
|
if (StringUtil.notBlank(param.getReferPhysician())) {
|
|
qw.eq("b.refer_physician", param.getReferPhysician());
|
|
qw.eq("b.refer_physician", param.getReferPhysician());
|
|
}
|
|
}
|
|
@@ -669,7 +680,7 @@ public class SetlListUpldService {
|
|
}
|
|
}
|
|
|
|
|
|
public List<IteminfoUpldTemp> setMedType(List<IteminfoUpldTemp> item) {
|
|
public List<IteminfoUpldTemp> setMedType(List<IteminfoUpldTemp> item) {
|
|
- Map<String, IteminfoUpldTemp> map = new HashMap<>();
|
|
|
|
|
|
+ Map<String, IteminfoUpldTemp> map = new HashMap<>(item.size());
|
|
for (IteminfoUpldTemp upldTemp : item) {
|
|
for (IteminfoUpldTemp upldTemp : item) {
|
|
String key = upldTemp.getMedChrgitm();
|
|
String key = upldTemp.getMedChrgitm();
|
|
if (map.containsKey(key)) {
|
|
if (map.containsKey(key)) {
|
|
@@ -695,6 +706,9 @@ public class SetlListUpldService {
|
|
newItem.add(it);
|
|
newItem.add(it);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if (map.containsKey(TOTAL_AMOUNT_CODE)) {
|
|
|
|
+ newItem.add(map.get(TOTAL_AMOUNT_CODE));
|
|
|
|
+ }
|
|
return newItem;
|
|
return newItem;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1007,24 +1021,71 @@ public class SetlListUpldService {
|
|
if (null == output || output.size() == 0) {
|
|
if (null == output || output.size() == 0) {
|
|
return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST, "没有查询到费用明细。");
|
|
return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST, "没有查询到费用明细。");
|
|
}
|
|
}
|
|
- List<MzChargitems> mzChargitems = new ArrayList<>();
|
|
|
|
|
|
+ Map<String, MzChargitems> detailsOfMedicalInsuranceExpenses = new HashMap<>();
|
|
|
|
+// 01 甲类 03 丙类 02 乙类
|
|
for (int i = 0; i < output.size(); i++) {
|
|
for (int i = 0; i < output.size(); i++) {
|
|
- mzChargitems.add(JSONObject.parseObject(output.getJSONObject(i).toJSONString(), MzChargitems.class));
|
|
|
|
|
|
+ MzChargitems mzChargitems1 = new MzChargitems();
|
|
|
|
+ DetailsOfMedicalInsuranceExpenses singleFee = EntityCopy.Copy(output.getJSONObject(i), DetailsOfMedicalInsuranceExpenses.class);
|
|
|
|
+ if (detailsOfMedicalInsuranceExpenses.containsKey(singleFee.getMed_chrgitm_type())) {
|
|
|
|
+ MzChargitems mzChargitems = detailsOfMedicalInsuranceExpenses.get(singleFee.getMed_chrgitm_type());
|
|
|
|
+ switch (singleFee.getChrgitm_lv()) {
|
|
|
|
+ case "01":
|
|
|
|
+ mzChargitems.setClaaSumfee(DecimalUtil.add(singleFee.getDet_item_fee_sumamt(), mzChargitems.getClaaSumfee()));
|
|
|
|
+ break;
|
|
|
|
+ case "02":
|
|
|
|
+ mzChargitems.setClabAmt(DecimalUtil.add(singleFee.getDet_item_fee_sumamt(), mzChargitems.getClabAmt()));
|
|
|
|
+ break;
|
|
|
|
+ case "03":
|
|
|
|
+ mzChargitems.setOthAmt(DecimalUtil.add(singleFee.getDet_item_fee_sumamt(), mzChargitems.getOthAmt()));
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ mzChargitems.setDetItemFeeSumamt(DecimalUtil.add(singleFee.getDet_item_fee_sumamt(), mzChargitems.getDetItemFeeSumamt()));
|
|
|
|
+ mzChargitems.setFulamtOwnpayAmt(DecimalUtil.add(singleFee.getFulamt_ownpay_amt(), mzChargitems.getFulamtOwnpayAmt()));
|
|
|
|
+ } else {
|
|
|
|
+ switch (singleFee.getChrgitm_lv()) {
|
|
|
|
+ case "01":
|
|
|
|
+ mzChargitems1.setClaaSumfee(singleFee.getDet_item_fee_sumamt());
|
|
|
|
+ break;
|
|
|
|
+ case "02":
|
|
|
|
+ mzChargitems1.setClabAmt(singleFee.getDet_item_fee_sumamt());
|
|
|
|
+ break;
|
|
|
|
+ case "03":
|
|
|
|
+ mzChargitems1.setOthAmt(singleFee.getDet_item_fee_sumamt());
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ mzChargitems1.setDetItemFeeSumamt(singleFee.getDet_item_fee_sumamt());
|
|
|
|
+ mzChargitems1.setMedChrgitmType(singleFee.getMed_chrgitm_type());
|
|
|
|
+ mzChargitems1.setFulamtOwnpayAmt(singleFee.getFulamt_ownpay_amt());
|
|
|
|
+ detailsOfMedicalInsuranceExpenses.put(singleFee.getMed_chrgitm_type(), mzChargitems1);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- return ResultVoUtil.success(mzChargitems);
|
|
|
|
|
|
+ return ResultVoUtil.success(new ArrayList<>(detailsOfMedicalInsuranceExpenses.values()));
|
|
}
|
|
}
|
|
return ResultVoUtil.fail(ExceptionEnum.INTERNAL_SERVER_ERROR, result.getString(ERROR_MESSAGE));
|
|
return ResultVoUtil.fail(ExceptionEnum.INTERNAL_SERVER_ERROR, result.getString(ERROR_MESSAGE));
|
|
}
|
|
}
|
|
|
|
|
|
public ResultVo<UpldCollection> outpatInformation(String patNo, Integer times, Integer ledgerSn) throws Exception {
|
|
public ResultVo<UpldCollection> outpatInformation(String patNo, Integer times, Integer ledgerSn) throws Exception {
|
|
UpldCollection upldCollection = new UpldCollection();
|
|
UpldCollection upldCollection = new UpldCollection();
|
|
- SetlinfoUpld mzPatient = dao.mzPatInfo(patNo);
|
|
|
|
-
|
|
|
|
|
|
+ SetlinfoUpld mzPatient = dao.mzPatInfo(patNo, times);
|
|
EntityCopy.Copy(dao.mzJieSuanXinXi(patNo, times), mzPatient);
|
|
EntityCopy.Copy(dao.mzJieSuanXinXi(patNo, times), mzPatient);
|
|
upldCollection.setSetlinfo(mzPatient);
|
|
upldCollection.setSetlinfo(mzPatient);
|
|
- upldCollection.getSetlinfo().setHiNo("43000020100030823694");
|
|
|
|
- upldCollection.getSetlinfo().setMedcasno(patNo + "_" + times);
|
|
|
|
|
|
+// upldCollection.getSetlinfo().setHiNo("43000020100030823694");
|
|
|
|
+ mzPatient.setMedcasno(patNo + "_" + times);
|
|
upldCollection.setOpspdiseinfo(dao.diagnosisOfMenterSDisease(patNo, times, ledgerSn));
|
|
upldCollection.setOpspdiseinfo(dao.diagnosisOfMenterSDisease(patNo, times, ledgerSn));
|
|
|
|
+ mzPatient.setHsorg("长沙市医疗保障事务中心");
|
|
|
|
+ mzPatient.setHsorgOpter("长沙市医疗保障事务中心");
|
|
|
|
+ GetDropdownBox getDropdownBox = dao.userInfo(TokenUtil.getTokenUserId());
|
|
|
|
+ // 医疗机构填报人
|
|
|
|
+ mzPatient.setMedinsFillPsn(getDropdownBox.getName());
|
|
|
|
+ // 医疗机构填报部门
|
|
|
|
+ mzPatient.setMedinsFillDept(getDropdownBox.getDeptName());
|
|
|
|
+ // 票据号码
|
|
|
|
+ mzPatient.setBillNo(dao.mzBillNo(patNo, times));
|
|
|
|
+ mzPatient.setBillCode("143001913350");
|
|
String setlId = upldCollection.getSetlinfo().getSetlId();
|
|
String setlId = upldCollection.getSetlinfo().getSetlId();
|
|
ResultVo<List<MzChargitems>> listResultVo = getmZChrgitems(patNo, setlId, mzPatient.getMdtrtId(), upldCollection.getSetlinfo().getInsuplc());
|
|
ResultVo<List<MzChargitems>> listResultVo = getmZChrgitems(patNo, setlId, mzPatient.getMdtrtId(), upldCollection.getSetlinfo().getInsuplc());
|
|
if (listResultVo.getCode() != 200) {
|
|
if (listResultVo.getCode() != 200) {
|
|
@@ -1034,6 +1095,24 @@ public class SetlListUpldService {
|
|
upldCollection.setIteminfo(EntityCopy.CopyList(listResultVo.getData(), IteminfoUpld.class));
|
|
upldCollection.setIteminfo(EntityCopy.CopyList(listResultVo.getData(), IteminfoUpld.class));
|
|
//基金支付类型
|
|
//基金支付类型
|
|
upldCollection.setPayinfo(dao.payinfoUpld(patNo, times, ledgerSn));
|
|
upldCollection.setPayinfo(dao.payinfoUpld(patNo, times, ledgerSn));
|
|
|
|
+ IteminfoUpld heJi = new IteminfoUpld();
|
|
|
|
+ if (ListUtil.notBlank(upldCollection.getIteminfo())) {
|
|
|
|
+ for (IteminfoUpld item : upldCollection.getIteminfo()) {
|
|
|
|
+ heJi.setMedChrgitm(TOTAL_AMOUNT_CODE);
|
|
|
|
+ heJi.setAmt(DecimalUtil.add(heJi.getAmt(), item.getAmt()));
|
|
|
|
+ heJi.setClaaSumfee(DecimalUtil.add(heJi.getClaaSumfee(), item.getClaaSumfee()));
|
|
|
|
+ heJi.setClabAmt(DecimalUtil.add(heJi.getClabAmt(), item.getClabAmt()));
|
|
|
|
+ heJi.setFulamtOwnpayAmt(DecimalUtil.add(heJi.getFulamtOwnpayAmt(), item.getFulamtOwnpayAmt()));
|
|
|
|
+ heJi.setOthAmt(DecimalUtil.add(heJi.getOthAmt(), item.getOthAmt()));
|
|
|
|
+ }
|
|
|
|
+ upldCollection.getIteminfo().add(heJi);
|
|
|
|
+ }
|
|
|
|
+ if (ListUtil.notBlank(upldCollection.getPayinfo())) {
|
|
|
|
+ for (PayinfoUpld item : upldCollection.getPayinfo()) {
|
|
|
|
+ upldCollection.getSetlinfo().setPsnSelfpay(DecimalUtil.minus(heJi.getAmt(), item.getFundPayamt()));
|
|
|
|
+ upldCollection.getSetlinfo().setPsnCashpay(upldCollection.getSetlinfo().getPsnSelfpay());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
return ResultVoUtil.success(upldCollection);
|
|
return ResultVoUtil.success(upldCollection);
|
|
}
|
|
}
|
|
|
|
|