浏览代码

优化结算单上传数据

xiaochan 2 年之前
父节点
当前提交
4aa6e67121

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

@@ -56,7 +56,7 @@ public interface UpIdCollectionDao {
             "       (select rytj from batj_ba1 where zyh = #{patNo} and zycs = #{times})  as admWay,  " +  // 入院途径
             "       a.setl_time as  setl_end_date, " +  //结算时间
             "       a.ipt_med_type, a.hi_paymtd, " +
-            "       cast(fund_pay_sumamt as decimal(16,2)) as  fund_pay_sumamt," + //
+            "       cast(fund_pay_sumamt as decimal(16,2) ) as  fund_pay_sumamt," + //
             "       cast(maf_pay as decimal(16,2)) as maf_pay," +
             "       psn_idet_type as  sp_psn_type " +
             "from t_si_setlinfo a," +
@@ -177,6 +177,13 @@ public interface UpIdCollectionDao {
             "  and admiss_times = #{times}")
     SetlinfoUpld setlinfo4(@Param("patNo") String patNo, @Param("times") Integer times);
 
+    @Select("select fund_payamt\n" +
+            "from t_si_setldetail\n" +
+            "where fund_pay_type = '999996'\n" +
+            "and pat_no = #{patNo}\n" +
+            "and times = #{times}\n" +
+            "and ledger_sn = #{ledgerSn}")
+    String advancePaidByTheHospital(@Param("patNo") String patNo, @Param("times") Integer times, @Param("ledgerSn") Integer ledgerSn);
 
     @Select("select (select si_code from zd_country_code where code = country)                    as ntly, " +
             "       dis_date                               as setl_end_date, " +
@@ -278,7 +285,8 @@ public interface UpIdCollectionDao {
 
     // 基金支付信息
     @Select("select fund_pay_type,fund_payamt=cast(sum(fund_payamt) as decimal(16,2)) from t_si_setldetail " +
-            "where pat_no = #{patNo} and times = #{times} and ledger_sn = #{ledgerSn} " + "group by fund_pay_type ")
+            "where pat_no = #{patNo} and times = #{times} and ledger_sn = #{ledgerSn} " +
+            "group by fund_pay_type ")
     List<PayinfoUpld> payinfoUpld(@Param("patNo") String patNo, @Param("times") Integer times, @Param("ledgerSn") Integer ledgerSn);
 
     /*                                              收费项目信息                                              */

+ 46 - 0
src/main/java/thyyxxk/webserver/entity/medicalinsurance/inpatient/BatjBa4.java

@@ -1,6 +1,7 @@
 package thyyxxk.webserver.entity.medicalinsurance.inpatient;
 
 import com.alibaba.fastjson.annotation.JSONField;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import org.springframework.format.annotation.DateTimeFormat;
 
@@ -112,15 +113,60 @@ public class BatjBa4 implements Serializable {
     private String sszsName1;
     private String sszsName2;
     private String mzysName;
+    /**
+     * 手术操作类别
+     */
+    @JSONField(name = "oprn_oprt_type")
+    private String oprnOprtType;
+
+    /**
+     * 手术操作名称
+     */
+    @JSONField(name = "oprn_oprt_name")
+    private String oprnOprtName;
+
+    /**
+     * 手术操作代码
+     */
+    @JSONField(name = "oprn_oprt_code")
+    private String oprnOprtCode;
+
+    /**
+     * 手术操作日期
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @JSONField(name = "oprn_oprt_date")
+    private Date oprnOprtDate;
+
+    /**
+     * 麻醉方式
+     */
+    @JSONField(name = "anst_way")
+    private String anstWay;
+
+    /**
+     * 术者医师姓名
+     */
+    @JSONField(name = "oper_dr_name")
+    private String operDrName;
+
     /**
      * 术者医师代码
      */
     @JSONField(name = "oper_dr_code")
     private String operDrCode;
+
     /**
      * 麻醉医师姓名
      */
     @JSONField(name = "anst_dr_name")
+    private String anstDrName;
+
+    /**
+     * 麻醉医师代码
+     */
+    @JSONField(name = "anst_dr_code")
     private String anstDrCode;
 
     //////////////// 以下是 4101A 新增数据 ///////////////////////////

+ 22 - 0
src/main/java/thyyxxk/webserver/service/medicalinsurance/SetlListUpldService.java

@@ -279,6 +279,14 @@ public class SetlListUpldService {
         List<IcuinfoUpld> zhongZhenJianHu = getIcuinfoUplds(patNo, times);
         List<PayinfoUpld> payinfo = dao.payinfoUpld(patNo, times, ledgerSn);
 
+        for (PayinfoUpld item : payinfo) {
+
+            if ("999996".equals(item.getFundPayType())) {
+
+            }
+
+        }
+
         List<DiseinfoUpld> diseinfos = dao.diseinfo(patNo, times, flag == 1 ? "zy_dis_diag_yb_modify" : "zy_dis_diag_yb");
         setlinfoUpld.setDiagCodeCnt(String.valueOf(diseinfos.size()));
 
@@ -333,6 +341,20 @@ public class SetlListUpldService {
             upldCollection.getBldinfo().add(bldinfo);
         });
 
+        // 医保统筹基金支付	要减去 本院垫付
+        String advancePaidByTheHospital = dao.advancePaidByTheHospital(patNo, times, ledgerSn);
+        if (advancePaidByTheHospital != null) {
+            upldCollection.getSetlinfo().setFundPaySumamt(DecimalUtil.minus(upldCollection.getSetlinfo().getFundPaySumamt(), advancePaidByTheHospital));
+        }
+        // 医疗类别为 生育
+        List<String> birth = Arrays.asList("51", "52", "2106", "2107");
+
+        if (birth.contains(medType)) {
+            // 生育类别不需要下面的这些
+            upldCollection.getSetlinfo().setNwbAge(null);
+            upldCollection.getSetlinfo().setNwbAdmType(null);
+        }
+
         return ResultVoUtil.success(upldCollection);
     }