Kaynağa Gözat

修改取手术的表,以及转科的 bug

xiaochan 3 yıl önce
ebeveyn
işleme
4a98510048

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

@@ -83,7 +83,7 @@ public interface UpIdCollectionDao {
             "       zzy_flag as days_rinp_flag_31,  " + // -- 出院31天内再住院计划标志
             "       rtrim(zzy_md) as days_rinp_pup_31,  " + // -- 出院31天内再住院目的
             "       chfpdr_name = (select rtrim(name) from a_employee_mi where code = isnull(zzys,b.consult_physician)),  " + // -- 主诊医师姓名
-            "       isnull(zzys,b.consult_physician) as chfpdr_code,  " + //-- 主诊医师代码
+            "       (select yb_code from a_employee_mi where code = isnull(zzys,b.consult_physician))  as chfpdr_code,  " + //-- 主诊医师代码
             "       b.admiss_date as adm_time,  " + //-- 入院时间
             "       adm_caty = (select rtrim(si_caty) from zd_unit_code where code = b.small_dept),  " + // -- 入院科别
             "       refldept_dept = (select rtrim(si_caty) from zd_unit_code where code = b.zk_ward),  " + //--转科科别
@@ -442,19 +442,20 @@ public interface UpIdCollectionDao {
             "<foreach collection='patNos' item='item' index='index' open='(' close=')' separator=','>" +
             "#{item}" +
             "</foreach>" +
-            "group by ward_code,inpatient_no,admiss_times " +
+            " order by times,charge_date" +
             "</script>")
     List<SiSetlinfoTemp> zhuanKeKeShi(@Param("patNos") Set<String> patNos);
 
 
-    @Select("select top 10 rtrim(code) code, rtrim(name) name from " +
+    @Select("select top 10 surgical_operation_code code,operation_operation_name name from " +
             "(SELECT ROW_NUMBER() OVER(ORDER BY code) AS Number,  * " +
-            "from zd_cm3 where (code like #{content} or name like #{content} or py_code like #{content})) a " +
+            "from t_si_dl_oprtn where (surgical_operation_code like #{content} or operation_operation_name like #{content} or py_code like #{content})) a " +
             "where Number > (${page}-1) * 10 ")
     List<GetDropdownBox> searchSurgeryByAlpha(@Param("content") String content, @Param("page") long page);
 
 
-    @Select("select count(1) from zd_cm3 where (code like #{content} or name like #{content} or py_code like #{content})")
+    @Select("select count(1) from t_si_dl_oprtn where (surgical_operation_code like #{content} or operation_operation_name" +
+            " like #{content} or py_code like #{content})")
     long searchSurgeryTotal(@Param("content") String content);
 
 
@@ -597,7 +598,9 @@ public interface UpIdCollectionDao {
     String getYbDeptName(String code);
 
 
-    @Select("select job_nurse as code,name = (select rtrim(name) from a_employee_mi where code = job_nurse ) from batj_ba2 where zyh = #{patNo} and zycs = #{times} ")
+    @Select("select (select yb_code from a_employee_mi where code = job_nurse) as code, " +
+            "name = (select rtrim(name) from a_employee_mi where code = job_nurse ) from batj_ba2 a,a_employee_mi b " +
+            "where job_nurse = b.code and  zyh = #{patNo} and zycs = #{times} ")
     GetDropdownBox zeRenHuShi(@Param("patNo") String patNo,
                               @Param("times") Integer times);
 }

+ 9 - 2
src/main/java/thyyxxk/webserver/service/medicalinsurance/SetlListUpldService.java

@@ -266,6 +266,7 @@ public class SetlListUpldService {
                 dao.zhenDuanXinXi(patNo, times, "zy_dis_diag_yb"), DiseinfoUpldTemp.class));
         // 费用类型
         temp.setIteminfo(EntityCopy.CopyList(uploadInfo.getData().getIteminfo(), IteminfoUpldTemp.class));
+        // 计算费用的总和
         if (ListUtil.notBlank(temp.getIteminfo())) {
             IteminfoUpldTemp heJi = new IteminfoUpldTemp();
             for (IteminfoUpldTemp item : temp.getIteminfo()) {
@@ -308,6 +309,7 @@ public class SetlListUpldService {
         temp.getSetlinfo().setRefldeptDeptName(dao.getYbDeptName(temp.getSetlinfo().getRefldeptDept()));
         // 出院科别
         temp.getSetlinfo().setDscgCatyName(dao.getYbDeptName(temp.getSetlinfo().getDscgCaty()));
+        // 责任护士
         GetDropdownBox zeRenHuShi = dao.zeRenHuShi(patNo, times);
         if (zeRenHuShi != null) {
             temp.getSetlinfo().setRespNurs(zeRenHuShi.getCode());
@@ -476,8 +478,13 @@ public class SetlListUpldService {
         Map<String, ZyDisDiagYb> zhuZhenDuanNew = dao.zhuZhenDuan(inpatientNos, "zy_dis_diag_yb_modify").stream().collect(
                 Collectors.toMap(item -> item.getInpatientNo() + item.getAdmissTimes(), a -> a, (k1, k2) -> k1)
         );
-
-        Map<String, List<SiSetlinfoTemp>> zhuanKeMap = dao.zhuanKeKeShi(inpatientNos).stream().collect(
+        // 坑爹的 group by 会自动排序 ,这样就会导致根据,科室的编码来排序,而不是根据我的,转科情况来排序
+        // 1、取出全部的数据
+        List<SiSetlinfoTemp> zhuanKeShi = dao.zhuanKeKeShi(inpatientNos);
+        // 2、重新 set 进去 这里要使用到 LinkedHashSet 因为这个是无序的,不然也会被盘排序
+        Set<SiSetlinfoTemp> keShiSet = new LinkedHashSet<>(zhuanKeShi);
+        // 3、 转map 然后 进行匹配
+        Map<String, List<SiSetlinfoTemp>> zhuanKeMap = keShiSet.stream().collect(
                 Collectors.groupingBy(item -> item.getPatNo() + item.getTimes())
         );
         for (SiSetlinfoTemp item : page.getRecords()) {