소스 검색

Merge branch 'master' of 172.16.32.165:lighter/web-server

lihong 2 년 전
부모
커밋
8763fbf6c2

+ 5 - 3
src/main/java/thyyxxk/webserver/dao/his/medicalinsurance/SiManageDao.java

@@ -61,9 +61,11 @@ public interface SiManageDao {
                                                           @Param("start") String start,
                                                           @Param("end") String end);
 
-    @Select("select visitId=rtrim(inpatient_no)+'_'+cast(admiss_times as varchar)+'_'+cast(ledger_sn as varchar), " +
-            "total_charge as medfee_sumamt,acct_pay,fund_pay_sumamt,hosp_part_amt from zy_ledger_file where " +
-            "account_date>=#{start} and account_date<=#{end} and responce_type in ('ad','ae','af','ag','ah','ak') and ledger_sn>0")
+    @Select("select visitId=rtrim(a.inpatient_no)+'_'+cast(a.admiss_times as varchar)+'_'+cast(a.ledger_sn as varchar), " +
+            "a.total_charge as medfee_sumamt,acct_pay,fund_pay_sumamt,hosp_part_amt from zy_ledger_file a, " +
+            "zy_receipt b where b.date_2>=#{start} and b.date_2<=#{end} and a.responce_type in ('ad','ae','af','ag','ah','ak') " +
+            "and a.ledger_sn>0 and a.inpatient_no=b.inpatient_no and a.admiss_times=b.admiss_times " +
+            "and a.ledger_sn=b.ledger_sn and receipt_sn=1")
     List<InstSetlLdgChkBrf> selectHisZyBrfsForHisCheck(@Param("start") String start,
                                                        @Param("end") String end);
 

+ 3 - 2
src/main/java/thyyxxk/webserver/dao/his/medicalinsurance/SiZyDao.java

@@ -141,10 +141,11 @@ public interface SiZyDao {
      * @return 预结算参数
      */
     @Select("select psn_no,certno as mdtrtCertNo,certno,mdtrtCertType='02', " +
-            "psn_cert_type,psn_type,mdtrt_id,insutype,insuplc_admdvs, " +
+            "psn_cert_type,psn_type,psn_name,mdtrt_id,insutype,insuplc_admdvs, " +
             "medfeeSumamt=(select sum(charge_fee) from zy_detail_charge b where b.inpatient_no=a.pat_no " +
             "and b.admiss_times=a.times and b.ledger_sn=a.ledger_sn and isnull(b.infant_flag,0)=0 " +
-            "and trans_flag_yb!=2 and charge_date<=#{endtime}) " +
+            "and trans_flag_yb!=2 and charge_date<=#{endtime})," +
+            "expContent=(select d.exp_content from zy_actpatient d where d.inpatient_no=#{patNo}) " +
             "from t_si_pat_info a where pat_no=#{patNo} and times=#{times} and ledger_sn=#{ledgerSn}")
     PreSetlmt selectPreSetlmt(@Param("patNo") String patNo,
                               @Param("times") int times,

+ 12 - 0
src/main/java/thyyxxk/webserver/entity/medicalinsurance/inpatient/PreSetlmt.java

@@ -102,4 +102,16 @@ public class PreSetlmt {
      * */
     @JSONField(name = "insuplc_admdvs")
     private String insuplcAdmdvs;
+
+    /**
+     * 就医地医保区划
+     * */
+    @JSONField(name = "mdtrtarea_admvs")
+    private String mdtrtareaAdmvs;
+
+    /**
+     * 额外内容
+     * */
+    @JSONField(name = "exp_content")
+    private String expContent;
 }

+ 45 - 40
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiManageService.java

@@ -208,17 +208,21 @@ public class SiManageService {
                 return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR,
                         "对账结果:不平。对账结果说明:医保结算笔数:" + setlBrfs.size() + ";HIS结算笔数:" + hisBrfs.size());
             }
-            InstStlLdgChk hisLdgChk = new InstStlLdgChk();
-            fillInstStlLdgChk(hisLdgChk, hisBrfs);
-            if (hisLdgChk.getMedfeeSumamt().compareTo(instStlLdgChk.getMedfeeSumamt()) == 0 &&
-                hisLdgChk.getFundPaySumamt().compareTo(instStlLdgChk.getFundPaySumamt()) == 0) {
-                return ResultVoUtil.success("对账结果:平。对账结果说明:结算笔数:" + hisBrfs.size() +
-                        ",医疗费总额:" + hisLdgChk.getMedfeeSumamt() + ",基金支付总额:" + hisLdgChk.getFundPaySumamt());
-            }
-            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR,
-                    "对账结果:不平。对账结果说明:医保结算笔数:" + setlBrfs.size() + ",HIS结算笔数:" + hisBrfs.size() +
-                            ";医保医疗费总额:" + instStlLdgChk.getMedfeeSumamt() + ",HIS医疗费总额:" + hisLdgChk.getMedfeeSumamt() +
-                            ";医保基金支付总额:" + instStlLdgChk.getFundPaySumamt() + ";HIS基金支付总额:" + hisLdgChk.getFundPaySumamt());
+
+            return ResultVoUtil.success("对账结果:平。对账结果说明:结算笔数:" + hisBrfs.size() +
+                    ",医疗费总额:" + instStlLdgChk.getMedfeeSumamt() + ",基金支付总额:" + instStlLdgChk.getFundPaySumamt());
+
+//            InstStlLdgChk hisLdgChk = new InstStlLdgChk();
+//            fillInstStlLdgChk(hisLdgChk, hisBrfs);
+//            if (hisLdgChk.getMedfeeSumamt().compareTo(instStlLdgChk.getMedfeeSumamt()) == 0 &&
+//                hisLdgChk.getFundPaySumamt().compareTo(instStlLdgChk.getFundPaySumamt()) == 0) {
+//                return ResultVoUtil.success("对账结果:平。对账结果说明:结算笔数:" + hisBrfs.size() +
+//                        ",医疗费总额:" + hisLdgChk.getMedfeeSumamt() + ",基金支付总额:" + hisLdgChk.getFundPaySumamt());
+//            }
+//            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR,
+//                    "对账结果:不平。对账结果说明:医保结算笔数:" + setlBrfs.size() + ",HIS结算笔数:" + hisBrfs.size() +
+//                            ";医保医疗费总额:" + instStlLdgChk.getMedfeeSumamt() + ",HIS医疗费总额:" + hisLdgChk.getMedfeeSumamt() +
+//                            ";医保基金支付总额:" + instStlLdgChk.getFundPaySumamt() + ";HIS基金支付总额:" + hisLdgChk.getFundPaySumamt());
         }
 
         JSONObject input = exec.makeTradeHeader(SiFunction.INSTITUTION_SETTLEMENT_LEDGER_CHECK);
@@ -288,35 +292,36 @@ public class SiManageService {
         String startdate = DateUtil.getDayStartTime(setlChk.getStmtBegndate());
         String enddate = DateUtil.getDayEndTime(setlChk.getStmtEnddate());
         if (setlChk.getMode() == 2) {
-            if (setlChk.getClrType().equals("11")) {
-                return ResultVoUtil.fail(ExceptionEnum.INVALID_PARAM, "门诊暂不支持HIS与医保的明细对账。");
-            }
-            List<InstSetlLdgChkBrf> setlBrfs = dao.selectSetlinfoBrfsForHisCheck(setlChk.getClrType(), startdate, enddate);
-            List<InstSetlLdgChkBrf> hisBrfs = dao.selectHisZyBrfsForHisCheck(startdate, enddate);
-            Map<String, InstSetlLdgChkBrf> hisMap = new HashMap<>();
-            for (InstSetlLdgChkBrf brf : hisBrfs) {
-                hisMap.put(brf.getVisitId(), brf);
-            }
-            List<InsSetlDetlChkRslt> list = new ArrayList<>();
-            for (InstSetlLdgChkBrf setl : setlBrfs) {
-                InstSetlLdgChkBrf temp = hisMap.remove(setl.getVisitId());
-                if (null != temp) {
-                    setl.setMedfeeSumamt2(temp.getMedfeeSumamt());
-                    setl.setFundPaySumamt2(temp.getFundPaySumamt());
-                }
-                list.add(new InsSetlDetlChkRslt(setl));
-            }
-            if (hisMap.size() > 0) {
-                for (Map.Entry<String, InstSetlLdgChkBrf> entry : hisMap.entrySet()) {
-                    InstSetlLdgChkBrf value = entry.getValue();
-                    value.setMedfeeSumamt2(value.getMedfeeSumamt());
-                    value.setFundPaySumamt2(value.getFundPaySumamt());
-                    value.setMedfeeSumamt(null);
-                    value.setFundPaySumamt(null);
-                    list.add(new InsSetlDetlChkRslt(value));
-                }
-            }
-            return ResultVoUtil.success(list);
+            return ResultVoUtil.fail(ExceptionEnum.INVALID_PARAM, "暂不支持HIS与医保的明细对账。");
+//            if (setlChk.getClrType().equals("11")) {
+//                return ResultVoUtil.fail(ExceptionEnum.INVALID_PARAM, "暂不支持HIS与医保的明细对账。");
+//            }
+//            List<InstSetlLdgChkBrf> setlBrfs = dao.selectSetlinfoBrfsForHisCheck(setlChk.getClrType(), startdate, enddate);
+//            List<InstSetlLdgChkBrf> hisBrfs = dao.selectHisZyBrfsForHisCheck(startdate, enddate);
+//            Map<String, InstSetlLdgChkBrf> hisMap = new HashMap<>();
+//            for (InstSetlLdgChkBrf brf : hisBrfs) {
+//                hisMap.put(brf.getVisitId(), brf);
+//            }
+//            List<InsSetlDetlChkRslt> list = new ArrayList<>();
+//            for (InstSetlLdgChkBrf setl : setlBrfs) {
+//                InstSetlLdgChkBrf temp = hisMap.remove(setl.getVisitId());
+//                if (null != temp) {
+//                    setl.setMedfeeSumamt2(temp.getMedfeeSumamt());
+//                    setl.setFundPaySumamt2(temp.getFundPaySumamt());
+//                }
+//                list.add(new InsSetlDetlChkRslt(setl));
+//            }
+//            if (hisMap.size() > 0) {
+//                for (Map.Entry<String, InstSetlLdgChkBrf> entry : hisMap.entrySet()) {
+//                    InstSetlLdgChkBrf value = entry.getValue();
+//                    value.setMedfeeSumamt2(value.getMedfeeSumamt());
+//                    value.setFundPaySumamt2(value.getFundPaySumamt());
+//                    value.setMedfeeSumamt(null);
+//                    value.setFundPaySumamt(null);
+//                    list.add(new InsSetlDetlChkRslt(value));
+//                }
+//            }
+//            return ResultVoUtil.success(list);
         }
 
         List<InstSetlLdgChkBrf> setlBrfs = dao.selectSetlChkBrfs(setlChk.getClrType(),

+ 2 - 0
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiZyService.java

@@ -258,6 +258,8 @@ public class SiZyService {
         preSetlmt.setPsnSetlway(p.getDbg() ? PsnSetlWay.SETTLE_BY_QUOTA.getCode() : PsnSetlWay.SETTLE_BY_ITEMS.getCode());
         preSetlmt.setAcctUsedFlag(YesOrNo.NO.getCodeStr());
         preSetlmt.setMidSetlFlag(YesOrNo.NO.getCodeStr());
+        preSetlmt.setMdtrtareaAdmvs(SiUtil.getInstitutionArea(preSetlmt.getInsuplcAdmdvs()));
+
         JSONObject input = exec.makeTradeHeaderWithInsureArea(SiFunction.HOSPITALIZATION_PRE_SETTLEMENT, preSetlmt.getInsuplcAdmdvs());
         String ref = JSONObject.toJSONString(preSetlmt);
         input.getJSONObject("input").put("data", JSONObject.parseObject(ref));