Преглед на файлове

上级医师查房/日常病程录crf处理

chengyao преди 4 години
родител
ревизия
3e8911ad27

+ 0 - 1
structure-center/src/main/java/com/lantone/structure/ai/ThreeLevelWardAI.java

@@ -48,7 +48,6 @@ public class ThreeLevelWardAI extends ModelAI {
         List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
         //  "============恩泽医嘱crf单独处理================="
         if (ListUtil.isNotEmpty(threeLevelWardDocs) && StringUtil.isNotEmpty(threeLevelWardDocs.get(0).getText())) {
-            String text = threeLevelWardDocs.get(0).getText();
             Map<String, String> maps = threeLevelWardDocs.get(0).getStructureMap();
             if(StringUtil.isNotEmpty(maps.get("诊疗计划")) && StringUtil.isNotEmpty(maps.get("诊疗计划").trim())){
                 String plan = maps.get("诊疗计划");

+ 7 - 6
structure-center/src/main/java/com/lantone/structure/facade/tran/DailyCourseRecordTran.java

@@ -34,8 +34,6 @@ public class DailyCourseRecordTran extends TargetTran {
     public void dailyCourseContrast(List<DailyCourseRecordDoc> dailyCourseRecordDocs,Map<String, String> retMap) {
         String text = dailyCourseRecordDocs.get(0).getText();
         String file = text;
-        String[] split = file.split("\n");
-
         String str = extractDate(file);
             if(StringUtil.isNotEmpty(str)){
                 retMap.put("记录日期时间",str);
@@ -56,9 +54,13 @@ public class DailyCourseRecordTran extends TargetTran {
         if(StringUtil.isNotEmpty(signName) && StringUtil.isNotEmpty(signName.trim()) && signName.length()<15){
             retMap.put("医师签名",signName);
         }
-
-        if( split.length>1){
-            String ret = text.substring(text.lastIndexOf(split[1]) + split[1].length());
+        String ret = text;
+        if(StringUtil.isNotEmpty(str)){
+            String[] split = text.split(str);
+            ret = text.substring(text.lastIndexOf(split[1]));
+            String[] notes = ret.split("记录");
+            ret = ret.substring(ret.lastIndexOf(notes[1]));
+        }
             if(StringUtil.isNotEmpty(retMap.get("医师签名")) && ret.contains(retMap.get("医师签名"))){
                 ret = ret.substring(0, ret.lastIndexOf(retMap.get("医师签名")));
             }
@@ -72,7 +74,6 @@ public class DailyCourseRecordTran extends TargetTran {
             if(StringUtil.isNotEmpty(ret)){
                 retMap.put("住院病程",ret);
             }
-        }
     }
 
     public static void lastSovle(List<DailyCourseRecordDoc> dailyCourseRecordDocs , Map<String,String> rep) {

+ 12 - 18
structure-center/src/main/java/com/lantone/structure/facade/tran/ThreeLevelWardTran.java

@@ -2,6 +2,7 @@ package com.lantone.structure.facade.tran;
 
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
+import com.lantone.common.util.ListUtil;
 import com.lantone.common.util.StringUtil;
 import com.lantone.structure.facade.tran.util.CommonAnalysisUtil;
 import com.lantone.structure.model.doc.ThreeLevelWardDoc;
@@ -29,8 +30,6 @@ public class ThreeLevelWardTran extends TargetTran {
         Map<String, String> structureMap = cutWord(text);
         wardRecordContrast(inputInfo.getThreeLevelWardDocs(), structureMap);
         wardRecordDoc.setStructureMap(structureMap);
-        wardRecordDocList.add(wardRecordDoc);
-        inputInfo.setThreeLevelWardDocs(wardRecordDocList);
         aiProcess();
         lastSovle(inputInfo.getThreeLevelWardDocs(),structureMap);
         return structureMap;
@@ -43,15 +42,7 @@ public class ThreeLevelWardTran extends TargetTran {
                 text
         );
         CommonAnalysisUtil.cutByTitles(text, titles, 0, sourceMap);
-
-        if(sourceMap.containsKey("鉴别诊断") || sourceMap.containsKey("补充诊断")|| sourceMap.containsKey("注意事项")
-                || sourceMap.containsKey("Caprini评分为")   || sourceMap.containsKey("诊断考虑")){
-            sourceMap.remove("鉴别诊断");
-            sourceMap.remove("补充诊断");
-            sourceMap.remove("注意事项");
-            sourceMap.remove("Caprini评分为");
-            sourceMap.remove("诊断考虑");
-        }
+        sourceMap.entrySet().removeIf(entry -> entry.getKey().equals("鉴别诊断") || entry.getKey().equals("补充诊断") || entry.getKey().equals("注意事项") || entry.getKey().equals("Caprini评分为") || entry.getKey().equals("诊断考虑"));
         return sourceMap;
     }
 
@@ -70,17 +61,20 @@ public class ThreeLevelWardTran extends TargetTran {
             retMap.put("记录人签名",signName);
         }
 
-        String[] split = text.split("\n");
-        String logo = split[1];
-        fir = text.substring(text.indexOf(logo) + logo.length());
+        if(StringUtil.isNotEmpty(sumdDate)){
+            String[] split = text.split(sumdDate);
+            fir = text.substring(text.lastIndexOf(split[1]));
+            String[] notes = fir.split("查房记录");
+            fir = fir.substring(fir.lastIndexOf(notes[1]));
+        }
+
         if( StringUtil.isNotEmpty(signName.trim()) && signName.length()<15){
-             fir = text.substring(text.indexOf(logo) + logo.length(),text.lastIndexOf(signName));
+            fir = fir.substring(0,fir.lastIndexOf(signName));
             String flag  = "/";
             if(fir.endsWith("//")){
                 flag = "//";
             }
             fir = fir.substring(0,fir.lastIndexOf(flag));
-
         }
 
         if(StringUtil.isNotEmpty(fir)){
@@ -158,8 +152,8 @@ public class ThreeLevelWardTran extends TargetTran {
     }
 
     public static void lastSovle(List<ThreeLevelWardDoc> threeLevelWardDocs, Map<String,String> structureMap) {
-        if(!threeLevelWardDocs.isEmpty() && threeLevelWardDocs.get(0)!=null && threeLevelWardDocs.get(0)
-                .getThreeLevelWardLabel()!=null){
+        if(ListUtil.isNotEmpty(threeLevelWardDocs) && threeLevelWardDocs.get(0)!=null && threeLevelWardDocs.get(0)
+                .getThreeLevelWardLabel().size()>0 && threeLevelWardDocs.get(0).getThreeLevelWardLabel().get(0)!=null){
             ThreeLevelWardLabel threeLevelWardLabel = threeLevelWardDocs.get(0).getThreeLevelWardLabel().get(0);
             String doctorAdviceRecord = threeLevelWardLabel.getDoctorAdviceRecord();
             if(StringUtil.isNotEmpty(doctorAdviceRecord)){