Parcourir la source

按照医保科要求添加数据

xiaochan il y a 3 ans
Parent
commit
fdb952ef81

+ 1 - 1
pom.xml

@@ -10,7 +10,7 @@
     </parent>
     <groupId>thyyxxk</groupId>
     <artifactId>web-server</artifactId>
-    <version>2</version>
+    <version>1</version>
     <name>web-server</name>
     <description>server for yibao-web</description>
     <properties>

+ 121 - 26
src/main/java/thyyxxk/webserver/dao/his/medicalinsurance/SiQueryDao.java

@@ -295,26 +295,71 @@ public interface SiQueryDao {
                           @Param("mdtrtId") String mdtrtId,
                           @Param("insutype") String insutype);
 
-    @Select("select pat_no,times,ledger_sn,insuplc_admdvs,medfee_sumamt,insutype,hifmi_pay,hifp_pay,cvlserv_pay,setl_list_id,psn_name, " +
-            "psn_cash_pay,setl_time,med_type, " +
-            "fundPaySumamt=(select sum(b.fund_payamt) from t_si_setldetail b where b.pat_no=a.pat_no " +
-            "and b.times=a.times and b.ledger_sn=a.ledger_sn),a.insutype, " +
-            "hospPay=(select sum(b.fund_payamt) from t_si_setldetail b where b.pat_no=a.pat_no " +
-            "and b.times=a.times and b.ledger_sn=a.ledger_sn and (b.fund_pay_type='999996' or b.setl_proc_info='999996')) " +
-            "from t_si_setlinfo a where revoked=0 and setl_type=#{setlType} and insutype like #{insutype} and setl_time>=#{begntime} " +
-            "and setl_time<=#{endtime} and insuplc_admdvs='439900' ")
+    @Select("SELECT pat_no, " +
+            "   times, " +
+            "   ledger_sn, " +
+            "   insuplc_admdvs, " +
+            "   medfee_sumamt, " +
+            "   insutype, " +
+            "   hifmi_pay, " +
+            "   hifp_pay, " +
+            "   cvlserv_pay, " +
+            "   setl_list_id, " +
+            "   psn_name, " +
+            "   psn_cash_pay, " +
+            "   setl_time, " +
+            "   a.med_type, " +
+            "   fundPaySumamt= " +
+            "    (SELECT sum(b.fund_payamt) " +
+            "    FROM t_si_setldetail b " +
+            "    WHERE b.pat_no = a.pat_no " +
+            "      AND b.times = a.times " +
+            "      AND b.ledger_sn = a.ledger_sn), a.insutype, hospPay= " +
+            "    (SELECT sum(b.fund_payamt) " +
+            "    FROM t_si_setldetail b " +
+            "    WHERE b.pat_no = a.pat_no " +
+            "      AND b.times = a.times " +
+            "      AND b.ledger_sn = a.ledger_sn " +
+            "      AND (b.fund_pay_type = '999996' " +
+            "      OR b.setl_proc_info = '999996')), maf_pay/*医疗救助*/, admiss_date = zy.admiss_date, dis_date = zy.dis_date, idCard =  " +
+            "    (SELECT top 1 social_no " +
+            "    FROM a_patient_mi " +
+            "    WHERE pat_no = inpatient_no), dis_diag_comment = dis.dis_diag_comment, dis_diag = dis.dis_diag " +
+            "FROM t_si_setlinfo a " +
+            "LEFT JOIN zy_dis_diag_yb dis " +
+            " ON (a.pat_no = dis.inpatient_no " +
+            "  AND a.times = dis.admiss_times) " +
+            "LEFT JOIN zy_inactpatient zy " +
+            " ON (zy.inpatient_no = a.pat_no " +
+            "  AND zy.admiss_times = a.times) " +
+            "WHERE revoked = 0 " +
+            "  AND setl_type = #{setlType} " +
+            "  AND insutype LIKE #{insutype} " +
+            "  AND setl_time>=#{begntime} " +
+            "  AND setl_time<=#{endtime} " +
+            "  AND insuplc_admdvs='439900' ")
     List<BaseSetlStatistics> selectBaseSetlStatisticsInProvinceLevel(@Param("begntime") String begntime,
                                                                      @Param("endtime") String endtime,
                                                                      @Param("insutype") String insutype,
                                                                      @Param("setlType") String setlType);
 
     @Select("select pat_no,times,ledger_sn,insuplc_admdvs,medfee_sumamt,insutype,hifmi_pay,hifp_pay,cvlserv_pay,setl_list_id,psn_name, " +
-            "psn_cash_pay,setl_time,med_type, " +
+            "psn_cash_pay,setl_time,a.med_type, " +
             "fundPaySumamt=(select sum(b.fund_payamt) from t_si_setldetail b where b.pat_no=a.pat_no " +
             "and b.times=a.times and b.ledger_sn=a.ledger_sn),a.insutype, " +
             "hospPay=(select sum(b.fund_payamt) from t_si_setldetail b where b.pat_no=a.pat_no " +
-            "and b.times=a.times and b.ledger_sn=a.ledger_sn and (b.fund_pay_type='999996' or b.setl_proc_info='999996')) " +
-            "from t_si_setlinfo a where revoked=0 and setl_type=#{setlType} and insutype like #{insutype} and setl_time>=#{begntime} " +
+            "and b.times=a.times and b.ledger_sn=a.ledger_sn and (b.fund_pay_type='999996' or b.setl_proc_info='999996'))," +
+            "       maf_pay, " +
+            "       admiss_date = zy.admiss_date, " +
+            "       dis_date = zy.dis_date, " +
+            "       idCard = (select top 1 social_no from a_patient_mi where pat_no = inpatient_no), " +
+            "       dis_diag_comment = dis.dis_diag_comment, " +
+            "       dis_diag = dis.dis_diag " +
+            "from t_si_setlinfo a " +
+            "         left join zy_dis_diag_yb dis on (a.pat_no = dis.inpatient_no and a.times = dis.admiss_times) " +
+            "         left join zy_inactpatient zy on (zy.inpatient_no = a.pat_no " +
+            "    and zy.admiss_times = a.times) " +
+            "where revoked=0 and setl_type=#{setlType} and insutype like #{insutype} and setl_time>=#{begntime} " +
             "and setl_time<=#{endtime} and insuplc_admdvs not in ('439900','430121','430181') and insuplc_admdvs like '4301%' ")
     List<BaseSetlStatistics> selectBaseSetlStatisticsInChangshaCity(@Param("begntime") String begntime,
                                                                     @Param("endtime") String endtime,
@@ -322,12 +367,22 @@ public interface SiQueryDao {
                                                                     @Param("setlType") String setlType);
 
     @Select("select pat_no,times,ledger_sn,insuplc_admdvs,medfee_sumamt,insutype,hifmi_pay,hifp_pay,cvlserv_pay,setl_list_id,psn_name, " +
-            "psn_cash_pay,setl_time,med_type, " +
+            "psn_cash_pay,setl_time,a.med_type, " +
             "fundPaySumamt=(select sum(b.fund_payamt) from t_si_setldetail b where b.pat_no=a.pat_no " +
             "and b.times=a.times and b.ledger_sn=a.ledger_sn),a.insutype, " +
             "hospPay=(select sum(b.fund_payamt) from t_si_setldetail b where b.pat_no=a.pat_no " +
-            "and b.times=a.times and b.ledger_sn=a.ledger_sn and (b.fund_pay_type='999996' or b.setl_proc_info='999996')) " +
-            "from t_si_setlinfo a where revoked=0 and setl_type=#{setlType} and insutype like #{insutype} and setl_time>=#{begntime} " +
+            "and b.times=a.times and b.ledger_sn=a.ledger_sn and (b.fund_pay_type='999996' or b.setl_proc_info='999996')), " +
+            "       maf_pay, " +
+            "       admiss_date = zy.admiss_date, " +
+            "       dis_date = zy.dis_date, " +
+            "       idCard = (select top 1 social_no from a_patient_mi where pat_no = inpatient_no), " +
+            "       dis_diag_comment = dis.dis_diag_comment, " +
+            "       dis_diag = dis.dis_diag " +
+            "from t_si_setlinfo a " +
+            "         left join zy_dis_diag_yb dis on (a.pat_no = dis.inpatient_no and a.times = dis.admiss_times) " +
+            "         left join zy_inactpatient zy on (zy.inpatient_no = a.pat_no " +
+            "    and zy.admiss_times = a.times) " +
+            "where revoked=0 and setl_type=#{setlType} and insutype like #{insutype} and setl_time>=#{begntime} " +
             "and setl_time<=#{endtime} and insuplc_admdvs='430121' ")
     List<BaseSetlStatistics> selectBaseSetlStatisticsInChangshaCounty(@Param("begntime") String begntime,
                                                                       @Param("endtime") String endtime,
@@ -335,12 +390,22 @@ public interface SiQueryDao {
                                                                       @Param("setlType") String setlType);
 
     @Select("select pat_no,times,ledger_sn,insuplc_admdvs,medfee_sumamt,insutype,hifmi_pay,hifp_pay,cvlserv_pay,setl_list_id,psn_name, " +
-            "psn_cash_pay,setl_time,med_type, " +
+            "psn_cash_pay,setl_time,a.med_type, " +
             "fundPaySumamt=(select sum(b.fund_payamt) from t_si_setldetail b where b.pat_no=a.pat_no " +
             "and b.times=a.times and b.ledger_sn=a.ledger_sn),a.insutype, " +
             "hospPay=(select sum(b.fund_payamt) from t_si_setldetail b where b.pat_no=a.pat_no " +
-            "and b.times=a.times and b.ledger_sn=a.ledger_sn and (b.fund_pay_type='999996' or b.setl_proc_info='999996')) " +
-            "from t_si_setlinfo a where revoked=0 and setl_type=#{setlType} and insutype like #{insutype} and setl_time>=#{begntime} " +
+            "and b.times=a.times and b.ledger_sn=a.ledger_sn and (b.fund_pay_type='999996' or b.setl_proc_info='999996')), " +
+            "       maf_pay, " +
+            "       admiss_date = zy.admiss_date, " +
+            "       dis_date = zy.dis_date, " +
+            "       idCard = (select top 1 social_no from a_patient_mi where pat_no = inpatient_no), " +
+            "       dis_diag_comment = dis.dis_diag_comment, " +
+            "       dis_diag = dis.dis_diag " +
+            "from t_si_setlinfo a " +
+            "         left join zy_dis_diag_yb dis on (a.pat_no = dis.inpatient_no and a.times = dis.admiss_times) " +
+            "         left join zy_inactpatient zy on (zy.inpatient_no = a.pat_no " +
+            "    and zy.admiss_times = a.times) " +
+            "where revoked=0 and setl_type=#{setlType} and insutype like #{insutype} and setl_time>=#{begntime} " +
             "and setl_time<=#{endtime} and insuplc_admdvs='430181' ")
     List<BaseSetlStatistics> selectBaseSetlStatisticsInLiuYangCity(@Param("begntime") String begntime,
                                                                    @Param("endtime") String endtime,
@@ -348,12 +413,22 @@ public interface SiQueryDao {
                                                                    @Param("setlType") String setlType);
 
     @Select("select pat_no,times,ledger_sn,insuplc_admdvs,medfee_sumamt,insutype,hifmi_pay,hifp_pay,cvlserv_pay,setl_list_id,psn_name, " +
-            "psn_cash_pay,setl_time,med_type,med_type, " +
+            "psn_cash_pay,setl_time,a.med_type, " +
             "fundPaySumamt=(select sum(b.fund_payamt) from t_si_setldetail b where b.pat_no=a.pat_no " +
             "and b.times=a.times and b.ledger_sn=a.ledger_sn),a.insutype, " +
             "hospPay=(select sum(b.fund_payamt) from t_si_setldetail b where b.pat_no=a.pat_no " +
-            "and b.times=a.times and b.ledger_sn=a.ledger_sn and (b.fund_pay_type='999996' or b.setl_proc_info='999996')) " +
-            "from t_si_setlinfo a where revoked=0 and setl_type=#{setlType} and insutype like #{insutype} and setl_time>=#{begntime} " +
+            "and b.times=a.times and b.ledger_sn=a.ledger_sn and (b.fund_pay_type='999996' or b.setl_proc_info='999996')), " +
+            "       maf_pay, " +
+            "       admiss_date = zy.admiss_date, " +
+            "       dis_date = zy.dis_date, " +
+            "       idCard = (select top 1 social_no from a_patient_mi where pat_no = inpatient_no), " +
+            "       dis_diag_comment = dis.dis_diag_comment, " +
+            "       dis_diag = dis.dis_diag " +
+            "from t_si_setlinfo a " +
+            "         left join zy_dis_diag_yb dis on (a.pat_no = dis.inpatient_no and a.times = dis.admiss_times) " +
+            "         left join zy_inactpatient zy on (zy.inpatient_no = a.pat_no " +
+            "    and zy.admiss_times = a.times) " +
+            "where revoked=0 and setl_type=#{setlType} and insutype like #{insutype} and setl_time>=#{begntime} " +
             "and setl_time<=#{endtime} and insuplc_admdvs!='439900' and insuplc_admdvs like '43%' and insuplc_admdvs not like '4301%' ")
     List<BaseSetlStatistics> selectBaseSetlStatisticsInProvinceOtherCities(@Param("begntime") String begntime,
                                                                            @Param("endtime") String endtime,
@@ -361,12 +436,22 @@ public interface SiQueryDao {
                                                                            @Param("setlType") String setlType);
 
     @Select("select pat_no,times,ledger_sn,insuplc_admdvs,medfee_sumamt,insutype,hifmi_pay,hifp_pay,cvlserv_pay,setl_list_id,psn_name, " +
-            "psn_cash_pay,setl_time,med_type, " +
+            "psn_cash_pay,setl_time,a.med_type, " +
             "fundPaySumamt=(select sum(b.fund_payamt) from t_si_setldetail b where b.pat_no=a.pat_no " +
             "and b.times=a.times and b.ledger_sn=a.ledger_sn),a.insutype, " +
             "hospPay=(select sum(b.fund_payamt) from t_si_setldetail b where b.pat_no=a.pat_no " +
-            "and b.times=a.times and b.ledger_sn=a.ledger_sn and (b.fund_pay_type='999996' or b.setl_proc_info='999996')) " +
-            "from t_si_setlinfo a where revoked=0 and setl_type=#{setlType} and insutype like #{insutype} and setl_time>=#{begntime} " +
+            "and b.times=a.times and b.ledger_sn=a.ledger_sn and (b.fund_pay_type='999996' or b.setl_proc_info='999996')), " +
+            "       maf_pay, " +
+            "       admiss_date = zy.admiss_date, " +
+            "       dis_date = zy.dis_date, " +
+            "       idCard = (select top 1 social_no from a_patient_mi where pat_no = inpatient_no), " +
+            "       dis_diag_comment = dis.dis_diag_comment, " +
+            "       dis_diag = dis.dis_diag " +
+            "from t_si_setlinfo a " +
+            "         left join zy_dis_diag_yb dis on (a.pat_no = dis.inpatient_no and a.times = dis.admiss_times) " +
+            "         left join zy_inactpatient zy on (zy.inpatient_no = a.pat_no " +
+            "    and zy.admiss_times = a.times) " +
+            "where revoked=0 and setl_type=#{setlType} and insutype like #{insutype} and setl_time>=#{begntime} " +
             "and setl_time<=#{endtime} and insuplc_admdvs!='439900' and insuplc_admdvs not like '43%' ")
     List<BaseSetlStatistics> selectBaseSetlStatisticsOutProvince(@Param("begntime") String begntime,
                                                                  @Param("endtime") String endtime,
@@ -374,12 +459,22 @@ public interface SiQueryDao {
                                                                  @Param("setlType") String setlType);
 
     @Select("select pat_no,times,ledger_sn,insuplc_admdvs,medfee_sumamt,insutype,hifmi_pay,hifp_pay,cvlserv_pay,setl_list_id,psn_name, " +
-            "psn_cash_pay,setl_time,med_type, " +
+            "psn_cash_pay,setl_time,a.med_type, " +
             "fundPaySumamt=(select sum(b.fund_payamt) from t_si_setldetail b where b.pat_no=a.pat_no " +
             "and b.times=a.times and b.ledger_sn=a.ledger_sn),a.insutype, " +
             "hospPay=(select sum(b.fund_payamt) from t_si_setldetail b where b.pat_no=a.pat_no " +
-            "and b.times=a.times and b.ledger_sn=a.ledger_sn and (b.fund_pay_type='999996' or b.setl_proc_info='999996')) " +
-            "from t_si_setlinfo a where revoked=0 and setl_type=#{setlType} and insutype like #{insutype} and setl_time>=#{begntime} " +
+            "and b.times=a.times and b.ledger_sn=a.ledger_sn and (b.fund_pay_type='999996' or b.setl_proc_info='999996')), " +
+            "       maf_pay, " +
+            "       admiss_date = zy.admiss_date, " +
+            "       dis_date = zy.dis_date, " +
+            "       idCard = (select top 1 social_no from a_patient_mi where pat_no = inpatient_no), " +
+            "       dis_diag_comment = dis.dis_diag_comment, " +
+            "       dis_diag = dis.dis_diag " +
+            "from t_si_setlinfo a " +
+            "         left join zy_dis_diag_yb dis on (a.pat_no = dis.inpatient_no and a.times = dis.admiss_times) " +
+            "         left join zy_inactpatient zy on (zy.inpatient_no = a.pat_no " +
+            "    and zy.admiss_times = a.times) " +
+            "where revoked=0 and setl_type=#{setlType} and insutype like #{insutype} and setl_time>=#{begntime} " +
             "and setl_time<=#{endtime} ")
     List<BaseSetlStatistics> selectBaseSetlStatisticsInAllPlaces(@Param("begntime") String begntime,
                                                                  @Param("endtime") String endtime,

+ 31 - 0
src/main/java/thyyxxk/webserver/entity/medicalinsurance/query/BaseSetlStatistics.java

@@ -10,6 +10,11 @@ public class BaseSetlStatistics {
     private Integer times;
     private Integer ledgerSn;
     private String insuplcAdmdvs;
+
+    /**
+     * 参保地
+     */
+    private String insuplcAdmdvsName;
     private String medfeeSumamt;
     private String insutype;
     private String insutypeName;
@@ -54,4 +59,30 @@ public class BaseSetlStatistics {
      * 结算日期
      */
     private Date setlTime;
+
+    /**
+     * 医疗救助
+     */
+    private String mafPay;
+
+    /**
+     * 入院日期
+     */
+    private Date admissDate;
+
+    /**
+     * 出院日期
+     */
+    private Date disDate;
+
+    /**
+     * 身份证
+     */
+    private String idCard;
+
+    /**
+     * 出院诊断
+     */
+    private String disDiag;
+    private String disDiagComment;
 }

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

@@ -48,6 +48,7 @@ public class SiQueryService {
     private final SiSetlinfoDao setlinfoDao;
     private final RedisLikeService redis;
 
+
     @Autowired
     public SiQueryService(ExecService exec, SiQueryDao dao, SendWxInfoService wxsrvc, SiSetlinfoDao setlinfoDao, RedisLikeService redis) {
         this.exec = exec;
@@ -1485,6 +1486,7 @@ public class SiQueryService {
             if (null != itm.getHospPay()) {
                 itm.setFundPaySumamt(DecimalUtil.minus(itm.getFundPaySumamt(), itm.getHospPay()));
             }
+            itm.setInsuplcAdmdvsName(redis.getRegionName(itm.getInsuplcAdmdvs()));
             String key;
             if (condition.getAdmdvsType() == 5 || condition.getAdmdvsType() == 6) {
                 key = itm.getInsuplcAdmdvs();