Browse Source

bug处理

chengyao 4 years ago
parent
commit
edb145f688

+ 10 - 22
structure-center/src/main/java/com/lantone/structure/facade/tran/BeHospitalizedTran.java

@@ -90,6 +90,13 @@ public class BeHospitalizedTran extends TargetTran {
     public void beHospitalContrast ( BeHospitalizedDoc beHospitalizedDoc,Map<String, String> retMap) {
         if(beHospitalizedDoc != null){
             String text = beHospitalizedDoc.getText();
+            String[] firSplit = text.split("\n");
+            if(firSplit.length>2){
+                String firStr = firSplit[0];
+                if(firStr.contains("24") || firStr.contains("二十四") && firStr.contains("入出院记录") ){
+                    retMap.remove("其他");
+                }
+            }
 
             //姓名
             if(StringUtil.isEmpty(retMap.get("姓    名")) || StringUtil.isEmpty(retMap.get("姓名"))){
@@ -133,31 +140,12 @@ public class BeHospitalizedTran extends TargetTran {
             //24小时出入院现病史
             if(StringUtil.isEmpty(retMap.get("现病史")) && StringUtil.isNotEmpty(retMap.get("入院情况"))) {
                 String value = retMap.get("入院情况");
-                String placeName = "";
-                Boolean flag = false;
                 if(value.contains("查体:")){
                     value = value.substring(0, value.lastIndexOf("查体:"));
-                    flag = true;
-                }
-                if(value.contains("收住我科")){
-                    placeName = "收住我科";
-                }
-                if(value.contains("门诊收住")){
-                    placeName = "门诊收住";
-                }
-                if( value.contains("收入院")){
-                    placeName = "收入院";
-                }
-                if( value.contains("收治入院")){
-                    placeName = "收治入院";
-                }
-                if(StringUtil.isEmpty(placeName) && flag){
-                    placeName = value;
                 }
-                String retStr = value.substring(0, value.lastIndexOf(placeName));
-                if(StringUtil.isNotEmpty(retStr)){
-                  retMap.put("现病史",retStr);
-                    retMap.put("症状描述",retStr);
+                if(StringUtil.isNotEmpty(value)){
+                  retMap.put("现病史",value);
+                    retMap.put("症状描述",value);
                 }
 
             }

+ 2 - 26
structure-center/src/main/java/com/lantone/structure/facade/tran/ConsultationTran.java

@@ -38,13 +38,12 @@ public class ConsultationTran extends TargetTran {
     }
 
     private List<String> stagesContrasts = Lists.newArrayList(
-            "姓名=患者姓名"
+            //"姓名=患者姓名"
     );
     private Map<String, String> cutWord(String text) {
         Map<String, String> sourceMap = Maps.newHashMap();
         List<String> titles = CommonAnalysisUtil.sortTitles(
-                Lists.newArrayList("简要病情","辅助检查","会诊理由及目的","鉴别诊断","诊疗计划"), text);
-
+                Lists.newArrayList("其病历简述如下","会诊理由","会诊目的","会诊理由及目的","日期","目前诊断考虑","会诊结论","会诊意见"), text);
         CommonAnalysisUtil.cutByTitles(text, titles, 0, sourceMap);
         return sourceMap;
     }
@@ -78,29 +77,6 @@ public class ConsultationTran extends TargetTran {
     }
 
 
-    /**
-     * 抽取文本中的最后时间
-     *
-     * @param top
-     * @return
-     */
-    public static String lastTime(String top) {
-        int length = top.trim().length();
-        String stringDate = top.trim().substring(length - 11, length);
-        Date date = null;
-        try {
-             date = DateUtils.parseDate(stringDate, StringUtil.dateFormats);
-        } catch (Exception e) {
-           log.error(e.getMessage(),e);
-        }
-        if(date!= null){
-            return stringDate;
-        }else{
-            return "";
-        }
-    }
-
-
     public void consultationContrast( List<ConsultationDoc> consultationDocs, Map<String, String> retMap) {
         if(consultationDocs != null) {
             String text = consultationDocs.get(0).getConsultationRecordDoc().getText();