Browse Source

血糖优化

xiaochan 2 years ago
parent
commit
dde4689057

+ 15 - 19
src/main/java/thyyxxk/webserver/dao/his/examinations/BloodSugarQueryDao.java

@@ -11,8 +11,6 @@ import java.util.List;
 
 @Mapper
 public interface BloodSugarQueryDao {
-
-
     @Select("select bed_no, " +
             "       rtrim(a.name) name, " +
             "       birth_date, " +
@@ -29,34 +27,32 @@ public interface BloodSugarQueryDao {
                            @Param("patNo") String patNo,
                            @Param("times") Integer times);
 
-
-    @Select("select id,\n" +
-            "       inpatient_no,\n" +
-            "       admiss_times,\n" +
-            "       nurse_id,\n" +
+    @Select("select id, " +
+            "       inpatient_no, " +
+            "       admiss_times, " +
+            "       nurse_id, " +
             "       nurse_id_name = (select rtrim(name) from a_employee_mi where code = nurse_id)," +
-            "       test_time,\n" +
-            "       bed_no,\n" +
-            "       timecode_id,\n" +
-            "       timecode_name,\n" +
-            "       test_result = '(' +  test_result + ')',\n" +
-            "       result_unit\n" +
-            "from data_blood_glouse\n" +
+            "       test_time, " +
+            "       bed_no, " +
+            "       timecode_id, " +
+            "       timecode_name, " +
+            "       rtrim(test_result) test_result, " +
+            "       rtrim(result_unit) result_unit " +
+            "from data_blood_glouse " +
             "where inpatient_no = #{patNo}" +
             " and admiss_times = #{times}")
     List<BgNursingTestSync> getPatientLoodSugar(@Param("patNo") String patNo,
                                                 @Param("times") Integer times);
 
-
     @Select("select admiss_times " +
             "from zy_actpatient " +
             "where inpatient_no = #{patNo} ")
     Integer getPatientTimes(@Param("patNo") String patNo);
 
-    @Update("update bg_nursing_test_sync\n" +
-            "set nurse_id  = #{nurseId},\n" +
-            "    test_time = #{testTime},\n" +
-            "    test_result = #{testResult} \n" +
+    @Update("update bg_nursing_test_sync " +
+            "set nurse_id  = #{nurseId}, " +
+            "    test_time = #{testTime}, " +
+            "    test_result = #{testResult}  " +
             "where id = #{id}")
     void modifyPatientBloodGlucoseInfo(BgNursingTestSync param);
 

+ 1 - 1
src/main/java/thyyxxk/webserver/entity/examinations/BloodSugar/BgNursingTestSync.java

@@ -45,7 +45,7 @@ public class BgNursingTestSync implements Serializable {
         if (testTime == null) {
             return null;
         } else {
-            return DateUtil.formatDatetime(testTime, "HH:mm");
+            return "(" +  DateUtil.formatDatetime(testTime, "HH:mm") + ")".trim();
         }
     }
 

+ 8 - 2
src/main/java/thyyxxk/webserver/service/examinations/BloodSugarQueryServer.java

@@ -12,8 +12,10 @@ import thyyxxk.webserver.entity.inpatient.patient.Patient;
 import thyyxxk.webserver.utils.DateUtil;
 import thyyxxk.webserver.utils.ListUtil;
 import thyyxxk.webserver.utils.ResultVoUtil;
+import thyyxxk.webserver.utils.StringUtil;
 
 import java.util.*;
+import java.util.concurrent.atomic.AtomicInteger;
 import java.util.stream.Collectors;
 
 @Service
@@ -25,6 +27,7 @@ public class BloodSugarQueryServer {
     public BloodSugarQueryServer(BloodSugarQueryDao dao) {
         this.dao = dao;
     }
+
     private final static List<String> NAME_LIST = Arrays.asList("空腹", "早餐后", "中餐前", "中餐后", "晚餐前", "晚餐后", "零点", "三点");
 
 
@@ -49,13 +52,16 @@ public class BloodSugarQueryServer {
         if (ListUtil.isBlank(list)) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "没有查询到该患者的血糖信息。");
         }
-
+        AtomicInteger count = new AtomicInteger();
 
         Map<String, List<BgNursingTestSync>> map = list.stream().collect(
                 Collectors.groupingBy(item -> {
                     if (!NAME_LIST.contains(item.getTimecodeName())) {
                         item.setTimecodeName("随机血糖");
                     }
+                    if (!StringUtil.isChinese(item.getTestResult())) {
+                        count.incrementAndGet();
+                    }
                     return DateUtil.formatDatetime(item.getTestTime(), DateUtil.DATE);
                 })
         );
@@ -107,7 +113,7 @@ public class BloodSugarQueryServer {
             data.addAll(row);
         }
 
-        returnValue.put("size", list.size());
+        returnValue.put("size", count);
         returnValue.put("bloodSugarData", data);
 
         return ResultVoUtil.success(returnValue);

+ 0 - 1
src/main/java/thyyxxk/webserver/service/zhuyuanyisheng/emr/EmrControlRuleSeverV2.java

@@ -36,7 +36,6 @@ public class EmrControlRuleSeverV2 {
     private final EmrControlDaoV2 dao;
     private final EmrEditor editor;
     private static final ConcurrentHashMap<String, Session> SESSION_MAP = new ConcurrentHashMap<>();
-
     public EmrControlRuleSeverV2(EmrControlDaoV2 dao, EmrEditor editor) {
         this.dao = dao;
         this.editor = editor;

+ 17 - 2
src/main/java/thyyxxk/webserver/utils/StringUtil.java

@@ -93,8 +93,7 @@ public class StringUtil {
             return "%";
         }
         str = str.trim();
-        Matcher m = CHINESE_CHARACTERS.matcher(str);
-        if (m.find()) {
+        if (isChinese(str)) {
             return "%" + str + "%";
         }
 
@@ -105,6 +104,22 @@ public class StringUtil {
         return "%" + str.toUpperCase() + "%";
     }
 
+    /**
+     * 判断是否是中文
+     *
+     * @param str 字符串
+     * @return 提示
+     */
+    public static boolean isChinese(String str) {
+        if (isBlank(str)) {
+            return false;
+        }
+        str = str.trim();
+        Matcher m = CHINESE_CHARACTERS.matcher(str);
+
+        return m.find();
+    }
+
     public static String englishToCapital(String str) {
         if (isBlank(str)) {
             return "";