Forráskód Böngészése

近期新增规则管理页面补充

zhaohan 7 hónapja
szülő
commit
d83e37cf61

+ 4 - 0
ruoyi-modules-api/ruoyi-knowledge-api/src/main/java/org/ruoyi/domain/ThinkTokenRole.java

@@ -102,6 +102,10 @@ public class ThinkTokenRole implements Serializable {
     @TableField("keywords")
     private String keywords;
 
+    /** 病人ID */
+    @TableField("pat_id")
+    private String patId;
+
     /** 时间字符串(前端显示用) */
     @TableField(exist = false)
     private String timeStr;

+ 4 - 1
ruoyi-modules-api/ruoyi-system-api/src/main/resources/mapper/ThinkTokenRoleMapper.xml

@@ -10,7 +10,7 @@
     <!-- 分页查询每个 out_num 最新一条 -->
     <select id="selectLatestByOutNumMap" resultType="java.util.HashMap">
         SELECT
-        id, pat_name, id_num, in_num, out_num, time, typename, content, dept_name
+        id, pat_name, pat_id, id_num, in_num, out_num, time, typename, content, dept_name
         FROM think_tokenrole
         WHERE id IN (
         SELECT MAX(id)
@@ -19,6 +19,9 @@
         )
         <if test="searchField != null and searchKeyword != null and searchKeyword != ''">
             <choose>
+                <when test="searchField == 'patId'">
+                    AND pat_id LIKE CONCAT('%', #{searchKeyword}, '%')
+                </when>
                 <when test="searchField == 'inNum'">
                     AND in_num LIKE CONCAT('%', #{searchKeyword}, '%')
                 </when>

+ 1 - 0
ruoyi-modules/ruoyi-chat/src/main/java/org/ruoyi/chat/controller/chat/ThinkTokenRoleController.java

@@ -33,6 +33,7 @@ public class ThinkTokenRoleController {
     @GetMapping("/searchFields")
     public R<List<SearchFieldDto>> getSearchFields() {
         List<SearchFieldDto> fields = Arrays.asList(
+                new SearchFieldDto("patId", "病人ID", "string", true),
                 new SearchFieldDto("inNum", "住院号", "string", true),
                 new SearchFieldDto("outNum", "门诊号", "string", true)
 

+ 2 - 3
ruoyi-modules/ruoyi-chat/src/main/java/org/ruoyi/chat/service/chat/impl/PatientRecordServiceImpl.java

@@ -490,11 +490,10 @@ public class PatientRecordServiceImpl implements PatientRecordService {
             lqw.like(PatientRecord::getAttendingDoctor, attendingDoctor);
         }
         if (admissionDate != null && !admissionDate.isEmpty()) {
-            // 将用户选择的日期转成开始和结束时间
+            // 将用户选择的日期转成开始和结束时间,根据质控结束时间进行搜索
             String startTime = admissionDate + " 00:00:00";
             String endTime = admissionDate + " 23:59:59";
-            lqw.ge(PatientRecord::getAdmissionDate, startTime)
-                    .le(PatientRecord::getAdmissionDate, endTime);
+            lqw.exists("SELECT 1 FROM medical_record_result mrr WHERE mrr.patient_record_id = patient_record.id AND mrr.qc_end_time >= '" + startTime + "' AND mrr.qc_end_time <= '" + endTime + "'");
         }
 
         Page<PatientRecord> resultPage = patientRecordMapper.selectPage(page, lqw);

+ 1 - 0
ruoyi-modules/ruoyi-chat/src/main/java/org/ruoyi/chat/service/chat/impl/ThinkTokenRoleServiceImpl.java

@@ -63,6 +63,7 @@ public class ThinkTokenRoleServiceImpl implements ThinkTokenRoleService {
             if (idObj instanceof Number) tokenRole.setId(((Number) idObj).intValue());
 
             tokenRole.setPatName(maskName((String) map.get("pat_name")));
+            tokenRole.setPatId((String) map.get("pat_id"));
             tokenRole.setIdNum((String) map.get("id_num"));
             tokenRole.setInNum((String) map.get("in_num"));
             tokenRole.setOutNum((String) map.get("out_num"));