浏览代码

在结算时计算参保信息。

lighter 3 年之前
父节点
当前提交
1385bb92f6

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

@@ -65,7 +65,7 @@ public interface SiSetlinfoDao extends BaseMapper<SiSetlinfo> {
                                   @Param("begntime") String begntime,
                                   @Param("endtime") String endtime);
 
-    @Select("select psn_no,setl_id,mdtrt_id,insuplc_admdvs,insutype,med_type,charges_analyzed from t_si_setlinfo with(nolock) " +
+    @Select("select psn_no,setl_id,mdtrt_id,insuplc_admdvs from t_si_setlinfo with(nolock) " +
             "where revoked=0 and setl_type=21 and charges_analyzed=0")
     List<SiSetlinfo> selectUnAnalyzedData();
 
@@ -76,6 +76,6 @@ public interface SiSetlinfoDao extends BaseMapper<SiSetlinfo> {
             "charge_sanitary_material=#{chargeSanitaryMaterial},charge_assay=#{chargeAssay}, " +
             "charge_general_diagnosis=#{chargeGeneralDiagnosis},charge_inspection=#{chargeInspection}, " +
             "charge_registration=#{chargeRegistration},charge_bed=#{chargeBed},charge_others=#{chargeOthers}, " +
-            "medins_type=#{medinsType},charges_analyzed=#{chargesAnalyzed} where setl_id=#{setlId}")
+            "charges_analyzed=#{chargesAnalyzed} where setl_id=#{setlId}")
     void fillAnalyzedData(SiSetlinfo setlinfo);
 }

+ 1 - 4
src/main/java/thyyxxk/webserver/scheduled/AnalyzeSiInpatientCharges.java

@@ -13,7 +13,6 @@ import thyyxxk.webserver.entity.ResultVo;
 import thyyxxk.webserver.entity.medicalinsurance.query.SiSetlFeeDetl;
 import thyyxxk.webserver.entity.medicalinsurance.setlinfo.SiSetlinfo;
 import thyyxxk.webserver.service.medicalinsurance.SiQueryService;
-import thyyxxk.webserver.utils.MedInsTypeUtil;
 
 import java.math.BigDecimal;
 import java.util.HashMap;
@@ -44,13 +43,11 @@ public class AnalyzeSiInpatientCharges {
     private void startAnalyze() {
         List<SiSetlinfo> unAnalyzedData = dao.selectUnAnalyzedData();
         for (SiSetlinfo setlinfo : unAnalyzedData) {
-            ResultVo<List<SiSetlFeeDetl>> chargeList = service.getChrgitems(setlinfo.getPsnNo(), setlinfo.getSetlId(),
-                    setlinfo.getMdtrtId(), setlinfo.getInsuplcAdmdvs());
+            ResultVo<List<SiSetlFeeDetl>> chargeList = service.getChrgitems(setlinfo);
             if (chargeList.getCode() == ExceptionEnum.SUCCESS.getCode()) {
                 analyzeChargeItems(setlinfo, chargeList.getData());
             }
             setlinfo.setChargesAnalyzed(YesOrNo.YES.getCode());
-            setlinfo.setMedinsType(MedInsTypeUtil.getMedInsDetail(setlinfo));
             dao.fillAnalyzedData(setlinfo);
         }
     }

+ 5 - 1
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiQueryService.java

@@ -1267,7 +1267,11 @@ public class SiQueryService {
         return cuminfo;
     }
 
-    public ResultVo<List<SiSetlFeeDetl>> getChrgitems(String psnNo, String setlId, String mdtrtId, String admdvs) {
+    public ResultVo<List<SiSetlFeeDetl>> getChrgitems(SiSetlinfo setlinfo) {
+        return getChrgitems(setlinfo.getPsnNo(), setlinfo.getSetlId(), setlinfo.getMdtrtId(), setlinfo.getInsuplcAdmdvs());
+    }
+
+    private ResultVo<List<SiSetlFeeDetl>> getChrgitems(String psnNo, String setlId, String mdtrtId, String admdvs) {
         List<SiSetlFeeDetl> list = dao.selectAllSetlFeeDtle(mdtrtId);
         if (list.size() > 0) {
             return ResultVoUtil.success(list);

+ 7 - 5
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiZyService.java

@@ -53,13 +53,12 @@ public class SiZyService {
     private final SiLogDao logDao;
     private final ExecService exec;
     private final DismissService dismissService;
-    private final SetlListUpldService setlListUpldService;
     private final SiZySrvc zySrvc;
 
     @Autowired
     public SiZyService(SiZyDao dao, SiQueryDao qrydao, SiSetlinfoDao setlinfoDao,
                        SiSetldetailDao setldetldao, SiChargeTempDao chrgtmpdao, SiLogDao logDao, ExecService exec,
-                       DismissService dismissService, SetlListUpldService setlListUpldService, SiZySrvc zySrvc) {
+                       DismissService dismissService, SiZySrvc zySrvc) {
         this.dao = dao;
         this.qrydao = qrydao;
         this.setlinfodao = setlinfoDao;
@@ -68,7 +67,6 @@ public class SiZyService {
         this.logDao = logDao;
         this.exec = exec;
         this.dismissService = dismissService;
-        this.setlListUpldService = setlListUpldService;
         this.zySrvc = zySrvc;
     }
 
@@ -451,7 +449,8 @@ public class SiZyService {
             setlEntity.setInsuplcAdmdvs(preSetlmt.getInsuplcAdmdvs());
             setlEntity.setBegntime(begntime);
             setlEntity.setEndtime(p.getDismissDate());
-            setlEntity.setHiPaymtd(calculateHiPaymtd(preSetlmt.getInsuplcAdmdvs(), setlEntity.getInsutype(), setlEntity.getMedType()));
+            setlEntity.setHiPaymtd(calculateHiPaymtd(setlEntity));
+            setlEntity.setMedinsType(MedInsTypeUtil.getMedInsType(setlEntity));
             setlinfodao.insert(setlEntity);
             setlinfodao.updateSiZyInfoSetlId(p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn(),
                     setlEntity.getSetlId(), setlEntity.getMedinsSetlId(), input.getString("msgid"));
@@ -488,7 +487,10 @@ public class SiZyService {
         return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
     }
 
-    private int calculateHiPaymtd(String insuplcAdmdvs, String insutype, String medType) {
+    private int calculateHiPaymtd(SiSetlinfo setlInfo) {
+        String medType = setlInfo.getMedType();
+        String insuplcAdmdvs = setlInfo.getInsuplcAdmdvs();
+        String insutype = setlInfo.getInsutype();
         if (medType.equals("2101") || medType.equals("22")) {
             List<String> insuplcAdmdvses = Arrays.asList("430121", "430181");
             List<String> insutypes = Arrays.asList("340", "350");

+ 1 - 1
src/main/java/thyyxxk/webserver/utils/MedInsTypeUtil.java

@@ -63,7 +63,7 @@ public class MedInsTypeUtil {
         map.put("长沙市单病种", new Judge(cssdbz, null, dbzMedtypes));
     }
 
-    public static String getMedInsDetail(SiSetlinfo setlinfo) {
+    public static String getMedInsType(SiSetlinfo setlinfo) {
         String admdvs = setlinfo.getInsuplcAdmdvs();
         Insutype insutype = Insutype.get(setlinfo.getInsutype());
         String medtype = setlinfo.getMedType();