|
@@ -23,6 +23,7 @@ import thyyxxk.webserver.entity.medicalinsurance.inpatient.BatjBa4;
|
|
|
import thyyxxk.webserver.entity.medicalinsurance.inpatient.YbZyDisDiag;
|
|
|
import thyyxxk.webserver.entity.medicalinsurance.inpatient.ZyDisDiagYb;
|
|
|
import thyyxxk.webserver.entity.medicalinsurance.inpatient.ZyInactpatient;
|
|
|
+import thyyxxk.webserver.entity.medicalinsurance.query.SiPatInfo;
|
|
|
import thyyxxk.webserver.entity.medicalinsurance.query.SiSetlFeeDetl;
|
|
|
import thyyxxk.webserver.entity.medicalinsurance.setllistupld.*;
|
|
|
import thyyxxk.webserver.entity.medicalinsurance.setllistupldTemp.*;
|
|
@@ -67,7 +68,15 @@ public class SetlListUpldService {
|
|
|
this.sendWxInfoService = sendWxInfoService;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 上传到医保的结算单上传
|
|
|
+ *
|
|
|
+ * @param patNo 住院号
|
|
|
+ * @param times 住院次数
|
|
|
+ * @param ledgerSn 账页号
|
|
|
+ * @return 返回体术
|
|
|
+ * @throws Exception 错误
|
|
|
+ */
|
|
|
public ResultVo<String> upldSetlList(String patNo, Integer times, Integer ledgerSn) throws Exception {
|
|
|
ResultVo<UpldCollection> upldCollection = getUploadInfo(patNo, times, ledgerSn);
|
|
|
if (upldCollection.getCode() != 200) {
|
|
@@ -99,17 +108,25 @@ public class SetlListUpldService {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, String.format("医保中心报错:【%s】 ", result.getString("err_msg")));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取上传到医保的信息
|
|
|
+ *
|
|
|
+ * @param patNo 住院号
|
|
|
+ * @param times 住院次数
|
|
|
+ * @param ledgerSn 账页号
|
|
|
+ * @return 返回上传的结算单信息
|
|
|
+ * @throws Exception 错误
|
|
|
+ */
|
|
|
public ResultVo<UpldCollection> getUploadInfo(String patNo, Integer times, Integer ledgerSn) throws Exception {
|
|
|
- log.info("住院号:{},次数:{},账页:{}", patNo, times, ledgerSn);
|
|
|
+ // 医保支付方式
|
|
|
+
|
|
|
+
|
|
|
Integer flag = dao.setlModifyReqAuditFlag(patNo, times);
|
|
|
flag = flag == null ? 0 : flag;
|
|
|
SetlinfoUpld setlinfoUpld = dao.setlinfo1(patNo, times, ledgerSn);
|
|
|
if (StringUtil.isBlank(setlinfoUpld.getSetlId())) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "结算id为空");
|
|
|
}
|
|
|
- if (!setlinfoUpld.getInsuplc().startsWith("4301") || setlinfoUpld.getInsuplc().equals("430182")) {
|
|
|
- return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "该患者参保地不属于长沙市,无法上传结算清单。");
|
|
|
- }
|
|
|
setlinfoUpld.setFixmedinsName(SiUtil.INSTITUTION_NAME);
|
|
|
// 特级护理
|
|
|
setlinfoUpld.setSpgaNurscareDays(String.valueOf(dao.teJiHuLi(publicServer.getInpatientNo(patNo), times, ledgerSn,
|
|
@@ -155,7 +172,7 @@ public class SetlListUpldService {
|
|
|
|
|
|
String setlId = setlinfoUpld.getSetlId();
|
|
|
List<IteminfoUpld> amtAndOthAmt = dao.amtAndOthAmt(setlId);
|
|
|
- if (null == amtAndOthAmt || amtAndOthAmt.isEmpty()) {
|
|
|
+ if (ListUtil.isBlank(amtAndOthAmt)) {
|
|
|
ResultVo<String> chrgitems = getChrgitems(patNo, setlId, setlinfoUpld.getMdtrtId(), setlinfoUpld.getInsuplc());
|
|
|
if (chrgitems.getCode() != 200) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, chrgitems.getMessage());
|
|
@@ -232,6 +249,8 @@ public class SetlListUpldService {
|
|
|
amtAndOthAmt.sort(Comparator.comparing(IteminfoUpld::getMedChrgitm));
|
|
|
}
|
|
|
|
|
|
+ setlinfoUpld.setHiPaymtd(YiBaoZhiFuFangShi(patNo, times, ledgerSn));
|
|
|
+
|
|
|
upldCollection.setPayinfo(payinfo);
|
|
|
// 门特慢特病诊断信息 目前还没有
|
|
|
upldCollection.setOpspdiseinfo(new ArrayList<>());
|
|
@@ -246,7 +265,52 @@ public class SetlListUpldService {
|
|
|
return ResultVoUtil.success(upldCollection);
|
|
|
}
|
|
|
|
|
|
+ public String YiBaoZhiFuFangShi(String patNo, Integer times, Integer ledgerSn) {
|
|
|
+ SiPatInfo patInfo = dao.huoQuZhiFuFangShi(patNo, times, ledgerSn);
|
|
|
+ String hiPaymtd = "3";
|
|
|
+ String insuplcAdmdvs = patInfo.getInsuplcAdmdvs();
|
|
|
+ String insutype = patInfo.getInsutype();
|
|
|
+ String medType = patInfo.getMedType();
|
|
|
+ // 参保地
|
|
|
+ List<String> chanBaoDi = new ArrayList<String>() {{
|
|
|
+ add("430121");
|
|
|
+ add("430181");
|
|
|
+ }};
|
|
|
+ // 医疗保障类型
|
|
|
+ List<String> mdcsType = new ArrayList<String>() {{
|
|
|
+ add("340");
|
|
|
+ add("350");
|
|
|
+ }};
|
|
|
+ // 险种类型
|
|
|
+ List<String> insutypeList = new ArrayList<String>() {{
|
|
|
+ add("340");
|
|
|
+ add("350");
|
|
|
+ }};
|
|
|
+ if (medType.equals("2101") || medType.equals("22")) {
|
|
|
+ if (!insuplcAdmdvs.startsWith("4301") || chanBaoDi.contains(insuplcAdmdvs) ||
|
|
|
+ mdcsType.contains(insuplcAdmdvs) || insutypeList.contains(insutype)) {
|
|
|
+ hiPaymtd = "1";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (medType.equals("2106") || medType.equals("2107") || medType.equals("52")) {
|
|
|
+ hiPaymtd = "7";
|
|
|
+ }
|
|
|
+ if (medType.equals("2102")) {
|
|
|
+ hiPaymtd = "2";
|
|
|
+ }
|
|
|
+ dao.genXingYiBaoZhiFuFangShi(patNo, times, ledgerSn, Integer.parseInt(hiPaymtd));
|
|
|
+ return hiPaymtd;
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ * 这里是获取打印结算单的信息,需要重新分装一下
|
|
|
+ *
|
|
|
+ * @param patNo 住院号
|
|
|
+ * @param times 住院次数
|
|
|
+ * @param ledgerSn 账页号
|
|
|
+ * @return 返回信息
|
|
|
+ * @throws Exception 克隆可能会报错
|
|
|
+ */
|
|
|
public ResultVo<UpldCollectionTemp> daYingShangChuanJieSuanDan(String patNo, Integer times, Integer ledgerSn) throws Exception {
|
|
|
log.info("住院号:{},住院次数:{},账页号:{}", patNo, times, ledgerSn);
|
|
|
Integer flag = dao.setlModifyReqAuditFlag(patNo, times);
|
|
@@ -395,11 +459,19 @@ public class SetlListUpldService {
|
|
|
log.info("发送信息通知:{}", message);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 进度条百分比
|
|
|
+ *
|
|
|
+ * @param index 当前下标
|
|
|
+ * @param size 总条数
|
|
|
+ * @return 返回
|
|
|
+ */
|
|
|
private int makePercentage(int index, int size) {
|
|
|
float per = (float) index / (float) size;
|
|
|
return (int) (per * 100);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
private ResultVo<String> getChrgitems(String patNo, String setlId, String mdtrtId, String admdvs) {
|
|
|
JSONObject input = exec.makeTradeHeaderWithInsureArea(SiFunction.QUERY_FEE_DETAILS, admdvs);
|
|
|
JSONObject data = new JSONObject();
|
|
@@ -633,9 +705,6 @@ public class SetlListUpldService {
|
|
|
if (StringUtil.isBlank(setlinfoUpld.getSetlId())) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "结算id为空");
|
|
|
}
|
|
|
- if (!setlinfoUpld.getInsuplc().startsWith("4301") || setlinfoUpld.getInsuplc().equals("430182")) {
|
|
|
- return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "该患者参保地不属于长沙市,无法上传结算清单。");
|
|
|
- }
|
|
|
ZyInactpatient zy = dao.huanZheXinXi(patNo, times);
|
|
|
List<Integer> code = publicServer.getRoleCode().getData();
|
|
|
if (!code.contains(1) && !code.contains(8)) {
|