Browse Source

患者呼吸机使用时长 和 自费

xiaochan 3 years ago
parent
commit
7ec8d295e3

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

@@ -301,8 +301,15 @@ public interface UpIdCollectionDao {
             "  and chrgitm_lv = #{chrgitmLv} " +
             "group by med_chrgitm_type")
     List<IteminfoUpld> aAndBAndCFees(@Param("setlId") String setlId,
-                                 @Param("chrgitmLv") String chrgitmLv,
-                                 @Param("feeName") String feeName);
+                                     @Param("chrgitmLv") String chrgitmLv,
+                                     @Param("feeName") String feeName);
+
+    @Select("SELECT sum(DATEDIFF(second, start_time, end_time))\n" +
+            "from yz_inact_order\n" +
+            "where order_code in ('05181', '06563')\n" +
+            "  and inpatient_no = #{patNo}\n" +
+            "  and admiss_times = #{times}")
+    Integer ventilatorUseTime(@Param("patNo") String patNo, @Param("times") Integer times);
 
     /**
      * 重症监护信息

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

@@ -300,6 +300,12 @@ public class SetlListUpldService {
             }
         }
 
+        // 呼吸机使用时长
+        Integer ventUsedDura = dao.ventilatorUseTime(patNo, times);
+        if (ventUsedDura != null) {
+            setlinfoUpld.setVentUsedDura(secondsToTime(ventUsedDura));
+        }
+
         UpldCollection upldCollection = new UpldCollection();
         // 患者的基本信息
         upldCollection.setSetlinfo(setlinfoUpld);
@@ -708,6 +714,18 @@ public class SetlListUpldService {
         return qw;
     }
 
+    public String secondsToTime(int seconds) {
+        int day;
+        int hour;
+        int minute;
+        day = seconds / (24 * 60 * 60);
+        seconds -= day * 24 * 60 * 60;
+        hour = seconds / (60 * 60);
+        seconds -= hour * 60 * 60;
+        minute = seconds / 60;
+        return day + "/" + hour + "/" + minute;
+    }
+
     /**
      * 获取 医疗类别
      *

+ 17 - 0
src/main/java/thyyxxk/webserver/utils/DateUtil.java

@@ -351,5 +351,22 @@ public class DateUtil {
         }
         return "";
     }
+
+
+    public static String secondsToTime(int seconds) {
+        //小时
+        int h = seconds / 3600;
+        //分钟
+        int m = (seconds % 3600) / 60;
+        //秒
+        int s = (seconds % 3600) % 60;
+        if (h > 0) {
+            return h + "小时" + m + "分钟" + s + "秒";
+        }
+        if (m > 0) {
+            return m + "分钟" + s + "秒";
+        }
+        return s + "秒";
+    }
 }