Browse Source

护理看板

xiaochan 1 year ago
parent
commit
822b93065d

+ 56 - 0
src/main/java/thyyxxk/webserver/dao/his/dashboard/DashboardDao.java

@@ -37,4 +37,60 @@ public interface DashboardDao {
             "from zy_bed_mi\n" +
             "where ward_code = '${dept}'")
     Integer bedCount(@Param("dept") String dept);
+
+
+    @Select("select count(*) from zy_actpatient " +
+            "where CONVERT(varchar(100), admiss_times, 23) = CONVERT(varchar(100), GETDATE(), 23)  and admiss_dept='${dept}'")
+    Integer admissCount(@Param("dept") String dept);
+
+    @Select("select (select count(*)\n" +
+            "        from zy_actpatient\n" +
+            "        where CONVERT(varchar(100), dis_date, 23) = CONVERT(varchar(100), GETDATE(), 23)  and admiss_dept = '${dept}')\n" +
+            "           +\n" +
+            "       (select count(*)\n" +
+            "        from zy_inactpatient\n" +
+            "        where CONVERT(varchar(100), dis_date, 23) = CONVERT(varchar(100), GETDATE(), 23) and admiss_dept = '${dept}')")
+    Integer dischargeCount(String dept);
+
+    @Select("select count(*)\n" +
+            "from yz_act_order a,zy_order_zk b\n" +
+            "where  CONVERT(varchar(100), a.start_time, 23) = CONVERT(varchar(100), GETDATE(), 23) \n" +
+            "and a.act_order_no=b.act_order_no\n" +
+            "and old_ward='${dept}'")
+    Integer outCount(String dept);
+
+    @Select("select count(*)\n" +
+            "from yz_act_order a,zy_order_zk b\n" +
+            "where CONVERT(varchar(100), a.start_time, 23) = CONVERT(varchar(100), GETDATE(), 23)\n" +
+            "and a.act_order_no=b.act_order_no\n" +
+            "and new_ward='${dept}'")
+    Integer inCount(String dept);
+
+    @Select("select count(*)\n" +
+            "from yz_act_order \n" +
+            "where ward_code='${dept}'\n" +
+            "and end_time is null and group_no ='00'  \n" +
+            "and order_name like '%病危%'")
+    Integer criticallyIllCount(String dept);
+
+    @Select("select count(*)\n" +
+            "from yz_act_order \n" +
+            "where ward_code='${dept}'\n" +
+            "and end_time is null and group_no ='00' \n" +
+            "and order_name like '%病重%'\n ")
+    Integer seriouslyIllCount(String dept);
+
+    @Select("select count(*)\n" +
+            "from yz_act_order \n" +
+            "where ward_code='${dept}'\n" +
+            "and end_time is null  \n" +
+            "and order_code in ('01296') and group_no ='00'")
+    Integer primaryCare(String dept);
+
+    @Select("select count(*)\n" +
+            "from yz_act_order \n" +
+            "where ward_code='${dept}'\n" +
+            "and end_time is null  \n" +
+            "and order_code in ('05300','01297') and group_no ='00'")
+    Integer secondaryCare(String dept);
 }

+ 18 - 0
src/main/java/thyyxxk/webserver/service/dashboard/DashboardService.java

@@ -1,6 +1,7 @@
 package thyyxxk.webserver.service.dashboard;
 
 import com.alibaba.fastjson.JSONObject;
+import lombok.Data;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import thyyxxk.webserver.constants.sidicts.MedType;
@@ -18,6 +19,11 @@ import java.util.List;
 public class DashboardService {
     private final DashboardDao dao;
 
+    @Data
+    public static class careKanban {
+
+    }
+
     @Autowired
     public DashboardService(DashboardDao dao) {
         this.dao = dao;
@@ -45,6 +51,18 @@ public class DashboardService {
         JSONObject jsonObject = new JSONObject();
         jsonObject.put("data", selectInpatientBriefs(deptCode).getData());
         jsonObject.put("bedCount", dao.bedCount(deptCode));
+
+        jsonObject.put("huli", new JSONObject() {{
+            put("病危", dao.criticallyIllCount(deptCode));
+            put("病重", dao.seriouslyIllCount(deptCode));
+            put("一级护理", dao.primaryCare(deptCode));
+            put("二级护理", dao.secondaryCare(deptCode));
+            put("入院人数", dao.admissCount(deptCode));
+            put("出院人数", dao.dischargeCount(deptCode));
+            put("转出人数", dao.outCount(deptCode));
+            put("转入人数", dao.inCount(deptCode));
+        }});
+
         return ResultVoUtil.success(jsonObject);
     }