Ver código fonte

三级查房AI处理修改bug

hujing 5 anos atrás
pai
commit
d6815b408e

+ 7 - 2
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/ThreeLevelWardAI.java

@@ -54,8 +54,10 @@ public class ThreeLevelWardAI extends ModelAI {
             putContent(crfContent, medicalTextType.get(0), firstWardRecord.get(Content.director).get("病情记录"), Content.director);
         }
         Map<String, String> lastCourseRecord = getLastCourseRecord(threeLevelWardDocs);
-        //主任医师最后一次查房记录
-        putContent(crfContent, medicalTextType.get(1), lastCourseRecord.get("病情记录"), "最后一次" + Content.director);
+        if (lastCourseRecord != null && lastCourseRecord.containsKey("病情记录")) {
+            //主任医师最后一次查房记录
+            putContent(crfContent, medicalTextType.get(1), lastCourseRecord.get("病情记录"), "最后一次" + Content.director);
+        }
 
         List<Map<String, String>> directorDifficultRecord = new ArrayList<>();
         //疑难患者副高及以上查房记录
@@ -301,6 +303,9 @@ public class ThreeLevelWardAI extends ModelAI {
             dateRecord.put(recordDate, rescueStructureMap);
         }
         List<Map<String, String>> dateRecordList = new ArrayList<>(dateRecord.values());
+        if (ListUtil.isEmpty(dateRecordList)){
+            return null;
+        }
         return dateRecordList.get(0);
     }
 }

+ 7 - 3
kernel/src/main/java/com/lantone/qc/kernel/util/ModelDataUtil.java

@@ -50,13 +50,17 @@ public class ModelDataUtil {
     public void insertDB(String caseNumber, Map<String, Map<String, String>> changxDocs) {
         PropertiesUtil propertiesUtil = new PropertiesUtil("kernel.properties");
         MysqlJdbc mysqlJdbc = new MysqlJdbc(propertiesUtil.getProperty("mysql.test.user"),
-                propertiesUtil.getProperty("mysql.local.password"),
-                propertiesUtil.getProperty("mysql.local.url"));
+                propertiesUtil.getProperty("mysql.test.password"),
+                propertiesUtil.getProperty("mysql.test.url"));
         Connection connect = null;
         PreparedStatement pst = null;
-        String sql = "INSERT INTO qc_model_input_info(case_number,title,sub_title,text) VALUES(?,?,?,?)";
+        String sql = "TRUNCATE qc_model_input_info";
         try {
             connect = mysqlJdbc.connect();
+            pst = connect.prepareStatement(sql);
+            pst.execute();
+
+            sql = "INSERT INTO qc_model_input_info(case_number,title,sub_title,text) VALUES(?,?,?,?)";
             connect.setAutoCommit(false);
             pst = connect.prepareStatement(sql);
             for (Map.Entry<String, Map<String, String>> changxDoc : changxDocs.entrySet()) {