Browse Source

输液贴排序

zengfanwei 4 days ago
parent
commit
13dc32daca

+ 1 - 1
src/main/java/thyyxxk/webserver/dao/his/inpatient/nursemodule/PrintInfusionCardDao.java

@@ -119,7 +119,7 @@ public interface PrintInfusionCardDao {
             "where b.ward_code=#{wardCode} ${alwaysFlag} " +
             "and b.occ_time>=#{startTime} and b.occ_time<=#{endTime} ${printComment} " +
             "and isnull(b.status_flag,'')!='d' and d.dept=#{wardCode} and d.ward=#{wardCode} " +
-            "and a.status_flag>'1' and a.supply_code=e.supply_code and e.print_name!='iv' and e.class='2' " +
+            "and a.status_flag>'1' and a.supply_code=e.supply_code and e.class='2' " +
             "and e.pring_flag='1' and isnull(a.parent_no,0)=0 and a.inpatient_no=d.inpatient_no " +
             "and a.admiss_times=d.admiss_times and a.frequ_code=c.code and a.act_order_no=b.act_order_no " +
             "and b.bed_no in (${bedNos})")

+ 1 - 0
src/main/java/thyyxxk/webserver/entity/inpatient/nursemodule/request/InfusionInsert.java

@@ -10,4 +10,5 @@ public class InfusionInsert {
     private String bedNos;
     private String startTime;
     private String endTime;
+    private String classCode;
 }

+ 1 - 0
src/main/java/thyyxxk/webserver/entity/orderZdMaintain/enums/SupplyClass.java

@@ -18,6 +18,7 @@ public enum SupplyClass {
     领药非临时(6, "领药(非临时)", "mz"),
     注射(7, "注射", "all"),
     药物治疗(8, "药物治疗", "all"),
+//    雾化(10, "雾化", "all"),
     其他(9, "其他", "all");
 
     private Integer code;

+ 26 - 0
src/main/java/thyyxxk/webserver/service/inpatient/nursemodule/PrintInfusionCardService.java

@@ -128,9 +128,35 @@ public class PrintInfusionCardService {
             info.setBottleCardDrugs(fetchDrugsForBottleCard(main, sideDrugs));
             response.add(info);
         }
+
+        // 按bed_no去掉最后一个字符后转为数字排序
+        response.sort((o1, o2) -> {
+            // 获取并处理bedNo(去掉最后一个字符)
+            String bedNo1 = getTrimmedBedNo(o1.getPatInfo());
+            String bedNo2 = getTrimmedBedNo(o2.getPatInfo());
+
+            // 转为数字比较
+            try {
+                Integer b1 = bedNo1.isEmpty() ? 0 : Integer.parseInt(bedNo1);
+                Integer b2 = bedNo2.isEmpty() ? 0 : Integer.parseInt(bedNo2);
+                return b1.compareTo(b2);
+            } catch (NumberFormatException e) {
+                // 非数字格式按处理后的字符串字典序排序
+                return bedNo1.compareTo(bedNo2);
+            }
+        });
         return ResultVoUtil.success(response);
     }
 
+    // 辅助方法:获取去掉最后一个字符的bedNo
+    private String getTrimmedBedNo(PatientBriefInfo patInfo) {
+        if (patInfo == null || patInfo.getBedNo() == null || patInfo.getBedNo().length() == 0) {
+            return "";
+        }
+        // 去掉最后一个字符(若长度为1则返回空字符串)
+        return patInfo.getBedNo().substring(0, patInfo.getBedNo().length() - 1);
+    }
+
     private List<YzActOccInfusionNew> fetchDrugsForBottleCard(YzActOccInfusionNew main, List<YzActOccInfusionNew> sideDrugs) {
         List<YzActOccInfusionNew> list = new ArrayList<>();
         list.add(main);