浏览代码

优化病案首页

lighter 3 年之前
父节点
当前提交
2816473bd2

+ 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>

+ 30 - 86
src/main/java/thyyxxk/webserver/dao/his/casefrontsheet/BasSelectOverviewDao.java

@@ -17,49 +17,21 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
             "bah=rtrim(a.inpatient_no), " +
             "times=rtrim(a.admiss_times), " +
             "name=rtrim(a.name), " +
-            "a.sex, " +
-            "deptName=(select rtrim(name) from zd_unit_code with(nolock) where code=a.dis_dept), " +
+            "a.sex,a.admiss_date, " +
+            "deptName=(select rtrim(name) from zd_unit_code with(nolock) where code=a.zk_ward), " +
             "doctorName=(select rtrim(name) from a_employee_mi with(nolock) where code=b.zyys), " +
             "b.late_flag, " +
             "lateCount=(select count(*) from batj_ba2 with(nolock) where late_flag=1 and zyys=b.zyys), " +
             "lateDays=datediff(day, a.dis_date, b.sign_date), " +
-            "disDate=convert(varchar(10), a.dis_date, 21) " +
-            "from zy_inactpatient a with(nolock), batj_ba2 b with(nolock), yz_inact_order c with(nolock) " +
-            "where " +
-            "a.inpatient_no=#{bah} and " +
-            "a.inpatient_no=b.zyh and " +
-            "a.admiss_times=b.zycs and " +
-            "a.inpatient_no=c.inpatient_no and " +
-            "a.admiss_times=c.admiss_times and " +
-            "c.start_time>=#{start} and " +
-            "c.start_time<=#{end} and " +
-            "c.order_code in ('06026','06053','06027', '05973') and " +
-            "isnull(a.file_status, 0)=#{fileStatus} " +
-            "union " +
-            "select " +
-            "signDate=(convert(varchar(10), b.sign_date, 21)), " +
-            "bedNo=rtrim(a.bed_no), " +
-            "bah=rtrim(a.inpatient_no), " +
-            "times=rtrim(a.admiss_times), " +
-            "name=rtrim(a.name), " +
-            "a.sex, " +
-            "deptName=(select rtrim(name) from zd_unit_code with(nolock) where code=a.dis_dept), " +
-            "doctorName=(select rtrim(name) from a_employee_mi with(nolock) where code=b.zyys), " +
-            "b.late_flag, " +
-            "lateCount=(select count(*) from batj_ba2 with(nolock) where late_flag=1 and zyys=b.zyys), " +
-            "lateDays=datediff(day, a.dis_date, b.sign_date), " +
-            "disDate=convert(varchar(10), c.start_time, 21) " +
-            "from zy_inactpatient a with(nolock), batj_ba2 b with(nolock), yz_act_order c with(nolock) " +
+            "a.dis_date " +
+            "from zy_inactpatient a with(nolock), batj_ba2 b with(nolock) " +
             "where " +
             "a.inpatient_no=#{bah} and " +
             "a.inpatient_no=b.zyh and " +
             "a.admiss_times=b.zycs and " +
-            "a.inpatient_no=c.inpatient_no and " +
-            "a.admiss_times=c.admiss_times and " +
-            "c.start_time>=#{start} and " +
-            "c.start_time<=#{end} and " +
-            "c.order_code in ('06026','06053','06027', '05973') and " +
-            "isnull(a.file_status, 0)=#{fileStatus} ")
+            "a.dis_date>=#{start} and " +
+            "a.dis_date<=#{end} and " +
+            "isnull(a.file_status, 0)=#{fileStatus} order by a.zk_ward,b.zyys")
     List<SheetOverview> selectPatientsForBasByBah(GetOutSheet param);
 
     @Select("select " +
@@ -68,49 +40,21 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
             "bah=rtrim(a.inpatient_no), " +
             "times=rtrim(a.admiss_times), " +
             "name=rtrim(a.name), " +
-            "a.sex, " +
-            "deptName=(select rtrim(name) from zd_unit_code with(nolock) where code=a.dis_dept), " +
+            "a.sex,a.admiss_date, " +
+            "deptName=(select rtrim(name) from zd_unit_code with(nolock) where code=a.zk_ward), " +
             "doctorName=(select rtrim(name) from a_employee_mi with(nolock) where code=b.zyys), " +
             "b.late_flag, " +
             "lateCount=(select count(*) from batj_ba2 with(nolock) where late_flag=1 and zyys=b.zyys), " +
             "lateDays=datediff(day, a.dis_date, b.sign_date), " +
-            "disDate=convert(varchar(10), a.dis_date, 21) " +
-            "from zy_inactpatient a with(nolock), batj_ba2 b with(nolock), yz_inact_order c with(nolock) " +
-            "where " +
-            "a.inpatient_no=#{bah} and " +
-            "a.inpatient_no=b.zyh and " +
-            "a.admiss_times=b.zycs and " +
-            "a.inpatient_no=c.inpatient_no and " +
-            "a.admiss_times=c.admiss_times and " +
-            "c.start_time>=#{start} and " +
-            "c.start_time<=#{end} and " +
-            "c.order_code in ('06026','06053','06027', '05973') and " +
-            "isnull(a.file_status, 0)>=1 " +
-            "union " +
-            "select " +
-            "signDate=(convert(varchar(10), b.sign_date, 21)), " +
-            "bedNo=rtrim(a.bed_no), " +
-            "bah=rtrim(a.inpatient_no), " +
-            "times=rtrim(a.admiss_times), " +
-            "name=rtrim(a.name), " +
-            "a.sex, " +
-            "deptName=(select rtrim(name) from zd_unit_code with(nolock) where code=a.dis_dept), " +
-            "doctorName=(select rtrim(name) from a_employee_mi with(nolock) where code=b.zyys), " +
-            "b.late_flag, " +
-            "lateCount=(select count(*) from batj_ba2 with(nolock) where late_flag=1 and zyys=b.zyys), " +
-            "lateDays=datediff(day, a.dis_date, b.sign_date), " +
-            "disDate=convert(varchar(10), c.start_time, 21) " +
-            "from zy_inactpatient a with(nolock), batj_ba2 b with(nolock), yz_act_order c with(nolock) " +
+            "a.dis_date " +
+            "from zy_inactpatient a with(nolock), batj_ba2 b with(nolock) " +
             "where " +
             "a.inpatient_no=#{bah} and " +
             "a.inpatient_no=b.zyh and " +
             "a.admiss_times=b.zycs and " +
-            "a.inpatient_no=c.inpatient_no and " +
-            "a.admiss_times=c.admiss_times and " +
-            "c.start_time>=#{start} and " +
-            "c.start_time<=#{end} and " +
-            "c.order_code in ('06026','06053','06027', '05973') and " +
-            "isnull(a.file_status, 0)>=1 ")
+            "a.dis_date>=#{start} and " +
+            "a.dis_date<=#{end} and " +
+            "isnull(a.file_status, 0)>=1 order by a.zk_ward,b.zyys")
     List<SheetOverview> selectPatientsForBasByBah2(GetOutSheet param);
 
     @Select("select " +
@@ -119,13 +63,13 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
             "bah=rtrim(a.inpatient_no), " +
             "times=rtrim(a.admiss_times), " +
             "name=rtrim(a.name), " +
-            "a.sex, " +
-            "deptName=(select rtrim(name) from zd_unit_code with(nolock) where code=a.dis_dept), " +
+            "a.sex,a.admiss_date, " +
+            "deptName=(select rtrim(name) from zd_unit_code with(nolock) where code=a.zk_ward), " +
             "doctorName=(select rtrim(name) from a_employee_mi with(nolock) where code=b.zyys), " +
             "b.late_flag, " +
             "lateCount=(select count(*) from batj_ba2 with(nolock) where late_flag=1 and zyys=b.zyys), " +
             "lateDays=datediff(day, a.dis_date, b.sign_date), " +
-            "disDate=convert(varchar(10), a.dis_date, 21) " +
+            "a.dis_date " +
             "from zy_inactpatient a with(nolock), batj_ba2 b with(nolock) " +
             "where " +
             "a.inpatient_no not like 'S%' and " +
@@ -136,7 +80,7 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
             "a.dis_date<=#{end} and " +
             "a.zk_ward = #{ward} and " +
             "isnull(a.file_status, 0)=#{fileStatus} and " +
-            "charindex('$',a.inpatient_no)=0 ")
+            "charindex('$',a.inpatient_no)=0 order by a.zk_ward,b.zyys")
     List<SheetOverview> selectPatientsForBasByWard(GetOutSheet param);
 
     @Select("select " +
@@ -145,13 +89,13 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
             "bah=rtrim(a.inpatient_no), " +
             "times=rtrim(a.admiss_times), " +
             "name=rtrim(a.name), " +
-            "a.sex, " +
-            "deptName=(select rtrim(name) from zd_unit_code with(nolock) where code=a.dis_dept), " +
+            "a.sex,a.admiss_date, " +
+            "deptName=(select rtrim(name) from zd_unit_code with(nolock) where code=a.zk_ward), " +
             "doctorName=(select rtrim(name) from a_employee_mi with(nolock) where code=b.zyys), " +
             "b.late_flag, " +
             "lateCount=(select count(*) from batj_ba2 with(nolock) where late_flag=1 and zyys=b.zyys), " +
             "lateDays=datediff(day, a.dis_date, b.sign_date), " +
-            "disDate=convert(varchar(10), a.dis_date, 21) " +
+            "a.dis_date " +
             "from zy_inactpatient a with(nolock), batj_ba2 b with(nolock) " +
             "where " +
             "a.inpatient_no not like 'S%' and " +
@@ -162,7 +106,7 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
             "a.dis_date<=#{end} and " +
             "a.zk_ward = #{ward} and " +
             "isnull(a.file_status, 0)>=1 and " +
-            "charindex('$',a.inpatient_no)=0 ")
+            "charindex('$',a.inpatient_no)=0 order by a.zk_ward,b.zyys")
     List<SheetOverview> selectPatientsForBasByWard2(GetOutSheet param);
 
     @Select("select " +
@@ -171,13 +115,13 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
             "bah=rtrim(a.inpatient_no), " +
             "times=rtrim(a.admiss_times), " +
             "name=rtrim(a.name), " +
-            "a.sex, " +
-            "deptName=(select rtrim(name) from zd_unit_code with(nolock) where code=a.dis_dept), " +
+            "a.sex,a.admiss_date, " +
+            "deptName=(select rtrim(name) from zd_unit_code with(nolock) where code=a.zk_ward), " +
             "doctorName=(select rtrim(name) from a_employee_mi with(nolock) where code=b.zyys), " +
             "b.late_flag, " +
             "lateCount=(select count(*) from batj_ba2 with(nolock) where late_flag=1 and zyys=b.zyys), " +
             "lateDays=datediff(day, a.dis_date, b.sign_date), " +
-            "disDate=convert(varchar(10), a.dis_date, 21) " +
+            "a.dis_date " +
             "from zy_inactpatient a with(nolock), batj_ba2 b with(nolock) " +
             "where " +
             "a.inpatient_no not like 'S%' and " +
@@ -187,7 +131,7 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
             "a.dis_date>=#{start} and " +
             "a.dis_date<=#{end} and " +
             "isnull(a.file_status, 0)=#{fileStatus} and " +
-            "charindex('$',a.inpatient_no)=0 ")
+            "charindex('$',a.inpatient_no)=0 order by a.zk_ward,b.zyys")
     List<SheetOverview> selectPatientsForBasByFileStatus(GetOutSheet param);
 
     @Select("select " +
@@ -196,13 +140,13 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
             "bah=rtrim(a.inpatient_no), " +
             "times=rtrim(a.admiss_times), " +
             "name=rtrim(a.name), " +
-            "a.sex, " +
-            "deptName=(select rtrim(name) from zd_unit_code with(nolock) where code=a.dis_dept), " +
+            "a.sex,a.admiss_date, " +
+            "deptName=(select rtrim(name) from zd_unit_code with(nolock) where code=a.zk_ward), " +
             "doctorName=(select rtrim(name) from a_employee_mi with(nolock) where code=b.zyys), " +
             "b.late_flag, " +
             "lateCount=(select count(*) from batj_ba2 with(nolock) where late_flag=1 and zyys=b.zyys), " +
             "lateDays=datediff(day, a.dis_date, b.sign_date), " +
-            "disDate=convert(varchar(10), a.dis_date, 21) " +
+            "a.dis_date " +
             "from zy_inactpatient a with(nolock), batj_ba2 b with(nolock) " +
             "where " +
             "a.inpatient_no not like 'S%' and " +
@@ -212,6 +156,6 @@ public interface BasSelectOverviewDao extends BaseMapper<CaseFrontsheetSurgery>
             "a.dis_date>=#{start} and " +
             "a.dis_date<=#{end} and " +
             "isnull(a.file_status, 0)>=1 and " +
-            "charindex('$',a.inpatient_no)=0 ")
+            "charindex('$',a.inpatient_no)=0 order by a.zk_ward,b.zyys")
     List<SheetOverview> selectPatientsForBasByFileStatus2(GetOutSheet param);
 }

+ 7 - 4
src/main/java/thyyxxk/webserver/dao/his/casefrontsheet/CaseFrontSheetDao.java

@@ -3,7 +3,6 @@ package thyyxxk.webserver.dao.his.casefrontsheet;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.*;
 import thyyxxk.webserver.entity.casefrontsheet.*;
-import thyyxxk.webserver.entity.dictionary.PureCodeName;
 
 import java.util.Date;
 import java.util.List;
@@ -736,9 +735,13 @@ public interface CaseFrontSheetDao extends BaseMapper<CaseFrontsheetMain> {
             "c.kzr,c.zzys,c.zyys,fdcrb=isnull(c.fdcrb,'')," +
             "deadOrder=(select count(1) from yz_inact_order t where t.inpatient_no=a.inpatient_no and " +
             "t.admiss_times=a.admiss_times and t.order_code='05973') " +
-            "from zy_inactpatient a, a_patient_mi b, batj_ba2 c " +
-            "where a.dis_date>=#{begntime} and a.dis_date<=#{endtime} and " +
-            "a.inpatient_no=b.inpatient_no and a.inpatient_no=c.zyh and a.admiss_times=c.zycs")
+            "from zy_inactpatient a, a_patient_mi b, batj_ba2 c where " +
+            "a.inpatient_no not like 'S%' and " +
+            "a.inpatient_no not like 'JT%' and " +
+            "charindex('$',a.inpatient_no)=0 and " +
+            "a.dis_date>=#{begntime} and a.dis_date<=#{endtime} and " +
+            "a.inpatient_no=b.inpatient_no and a.inpatient_no=c.zyh and a.admiss_times=c.zycs " +
+            "order by a.zk_ward")
     List<DismissCount> selectDismissDetailCount(@Param("begntime") String begntime,
                                                 @Param("endtime") String endtime);
 

+ 18 - 2
src/main/java/thyyxxk/webserver/entity/casefrontsheet/SheetOverview.java

@@ -2,6 +2,8 @@ package thyyxxk.webserver.entity.casefrontsheet;
 
 import lombok.Data;
 
+import java.util.Date;
+
 /**
  * @author dj
  */
@@ -12,10 +14,11 @@ public class SheetOverview {
     private Integer times;
     private String name;
     private Integer sex;
-    private String admissDate;
+    private String genderName;
+    private Date admissDate;
     private String deptName;
     private String doctorName;
-    private String disDate;
+    private Date disDate;
     private String signDate;
     private Integer lateCount;
     private Integer lateDays;
@@ -26,6 +29,19 @@ public class SheetOverview {
         return Math.max(lateDays - 8, 0);
     }
 
+    public String getGenderName() {
+        if (null == sex) {
+            return "未填写";
+        }
+        if (sex == 1) {
+            return "男";
+        }
+        if (sex == 2) {
+            return "女";
+        }
+        return "未知";
+    }
+
     public Integer getLateFlag() {
         return null == lateFlag ? 0 : lateFlag;
     }

+ 3 - 0
src/main/java/thyyxxk/webserver/service/casefrontsheet/CaseFrontSheetService.java

@@ -157,6 +157,9 @@ public class CaseFrontSheetService {
             } else {
                 list = basDao.selectPatientsForBasByBah2(param);
             }
+            if (list.isEmpty()) {
+                return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST, "没有此患者的结算信息,请联系病房核实。");
+            }
             if (param.getLateFlag() != 3) {
                 list.removeIf(item -> !item.getLateFlag().equals(param.getLateFlag()));
             }