Browse Source

解析问题调整

Gaozk 3 years ago
parent
commit
51f5836692

+ 3 - 3
kernel/src/main/resources/bootstrap.yml

@@ -1,5 +1,5 @@
 server:
-  port: 6010 # 端口号
+  port: 6012 # 端口号
   servlet:
     context-path: ${spring.application.name}  # 访问路径,如果不配置,访问IP:端口号,配置后访问IP:端口号/${context-path}
 
@@ -18,10 +18,10 @@ spring:
   resources:
     static-locations: classpath:/
   profiles:
-    active: test
+    active: debug
 
 qc:
-  hospital_id: 1,2,3,4,5,6,7,8,10,11,13,15,20,34,35,36,37
+  hospital_id: 1,2,3,4,5,6,7,8,10,11,13,15,20,21,22,23,24,34,35,36
 
 logging:          # 日志
   config: classpath:logback-spring.xml

+ 3 - 0
trans/src/main/java/com/lantone/qc/trans/xszyy/BeiLunFirstPageRecordDocTrans.java

@@ -8,6 +8,7 @@ import com.lantone.qc.pub.model.vo.MedrecVo;
 import com.lantone.qc.pub.util.FastJsonUtils;
 import com.lantone.qc.pub.util.ListUtil;
 import com.lantone.qc.trans.ModelDocTrans;
+import com.lantone.qc.trans.xszyy.util.comsis.XszyyCommonAnalysisUtil;
 
 import java.util.HashMap;
 import java.util.Iterator;
@@ -24,11 +25,13 @@ public class BeiLunFirstPageRecordDocTrans extends ModelDocTrans {
     @Override
     public FirstPageRecordDoc extract(MedrecVo medrecVo) {
         Map<String, String> content = (Map) medrecVo.getContent();
+        content.put("姓名", XszyyCommonAnalysisUtil.extracReplace(content.get("姓名")));
         FirstPageRecordDoc firstPageRecordDoc = new FirstPageRecordDoc();
         firstPageRecordDoc.setStructureMap(content);
 
         Map<String, Object> structureExtMap = Maps.newHashMap();
         structureExtMap.putAll(content);
+        structureExtMap.put("姓名", XszyyCommonAnalysisUtil.extracReplace(content.get("姓名")));
         structureExtMap.put(Content.diagnose_cts, FastJsonUtils.getJsonToBean(content.get(Content.diagnose_cts), Object.class));
         //        structureExtMap.put(Content.outpatientEmergencyDiag, FastJsonUtils.getJsonToBean(content.get(Content.outpatientEmergencyDiag), Object.class));
         structureExtMap.put(Content.operative_information, FastJsonUtils.getJsonToBean(content.get(Content.operative_information), Object.class));

+ 11 - 0
trans/src/main/java/com/lantone/qc/trans/xszyy/util/BeiLunBeHospitalizedHtmlAnalysis.java

@@ -60,11 +60,22 @@ public class BeiLunBeHospitalizedHtmlAnalysis implements BeiLunHtmlAnalysis {
             //有冒号版本
             XszyyCommonAnalysisUtil.html2StructureMap(titles,htmlContent,map);
         }
+        //拆分发病节气后面的病案号
+        if (map.containsKey("发病节气")){
+            map.put("病案号",map.get("发病节气").substring(map.get("发病节气").indexOf("病"),map.get("发病节气").indexOf(map.get("发病节气").charAt((map.get("发病节气").length()-1)))+1));
+            map.put("发病节气",map.get("发病节气").substring(0,map.get("发病节气").indexOf(map.get("病案号"))));
+            map.put("病案号",map.get("病案号").substring(map.get("发病节气").length(),map.get("病案号").length()));
+        }
         //书写医生中包含书写时间
         if(map.containsKey("书写医生")&&XszyyCommonAnalysisUtil.extractDate(map.get("书写医生"))!=null){
             map.put("书写时间",XszyyCommonAnalysisUtil.extractDate(map.get("书写医生")));
             map.put("书写医生",map.get("书写医生").substring(0,map.get("书写医生").indexOf(map.get("书写时间"))));
         }
+        //去掉所有空格
+        if(map.containsKey("姓名")&&map.get("姓名").length()>2){
+            map.put("姓名",XszyyCommonAnalysisUtil.extracReplace(map.get("姓名")));
+        }
+
         if(map.containsKey("医师签名")&&XszyyCommonAnalysisUtil.extractDate(map.get("医师签名"))!=null){
             map.put("书写时间",XszyyCommonAnalysisUtil.extractDate(map.get("医师签名")));
             map.put("书写医生",map.get("医师签名").substring(0,map.get("医师签名").indexOf(map.get("书写时间"))));

+ 9 - 0
trans/src/main/java/com/lantone/qc/trans/xszyy/util/comsis/XszyyCommonAnalysisUtil.java

@@ -302,6 +302,15 @@ public class XszyyCommonAnalysisUtil {
         return null;
     }
 
+    /**
+     * 去掉字符串中的空格
+     * @param top
+     * @return
+     */
+    public static String extracReplace(String top) {
+        String replaceAll = top.replaceAll(" +", "");
+        return replaceAll;
+    }
     /**
      * 宁波中医院抽取文本中的第一个时间
      *