فهرست منبع

Merge remote-tracking branch 'origin/dev/KLBstand' into dev/KLBstand

wangyu 6 سال پیش
والد
کامیت
506e4edf76

+ 16 - 4
aipt-service/src/main/java/com/diagbot/facade/ClinicalFacade.java

@@ -53,6 +53,9 @@ public class ClinicalFacade {
     @Autowired
     private NLPServiceClient nlpServiceClient;
 
+    @Autowired
+    private ConceptFacade conceptFacade;
+
     private static String up = "增高";
     private static String down = "降低";
     private static String normal = "正常";
@@ -60,6 +63,8 @@ public class ClinicalFacade {
     private static String pos = "阳性";
     private static String neg = "阴性";
 
+    //    private static Map<String, List<Map<String, String>>> standWordObj = null;
+
     /**
      * 处理临床数据
      *
@@ -69,6 +74,7 @@ public class ClinicalFacade {
     public ResponseData processClinicalData(@RequestBody SearchVo searchVo) {
         SearchVo sData = searchVo;
         Map<String, List<Map<String, String>>> standWord = getStandWord();
+        //        standWordObj = getStandWord();
         Response<List<Lexeme>> resp = nlpServiceClient.split(sData.getSymptom());
         if (null != resp && null != resp.getData()) {
             addStandWord(resp.getData(), standWord, sData);
@@ -327,7 +333,7 @@ public class ClinicalFacade {
         Map<String, List<Map<String, String>>> standWordObj = new HashMap<>();
         List<List<Lexeme>> splitStandWords = new ArrayList<>();
         List<Lexeme> data = null;
-        BufferedReader reader = null;
+        /*BufferedReader reader = null;
         InputStream inputStream = null;
         String line = "";
         try {
@@ -353,7 +359,13 @@ public class ClinicalFacade {
             } catch (IOException e) {
                 e.printStackTrace();
             }
+        }*/
+        List<String> standWords = conceptFacade.getStandWord();
+        for (String standWord : standWords) {
+            data = nlpServiceClient.split(standWord).getData();
+            splitStandWords.add(data);
         }
+
         List<Map<String, String>> standWordObjValList = null;
         Map<String, String> standWordObjVal = null;
         for (List<Lexeme> splitStandWord : splitStandWords) {
@@ -363,9 +375,9 @@ public class ClinicalFacade {
             String standWordObjKey = "";
             for (Lexeme lexeme : splitStandWord) {
                 i++;
-                if ("\uFEFF".equals(lexeme.getText()) || lexeme.getText().length() <= 0) {
-                    continue;
-                }
+                //                if ("\uFEFF".equals(lexeme.getText()) || lexeme.getText().length() <= 0) {
+                //                    continue;
+                //                }
                 if (lexeme.getProperty().contains("1") || lexeme.getProperty().contains("5")
                         || lexeme.getProperty().contains("33")) {
                     if (!standWordObj.containsKey(lexeme.getText())) {

+ 6 - 0
aipt-service/src/main/java/com/diagbot/mapper/ConceptMapper.java

@@ -43,4 +43,10 @@ public interface ConceptMapper extends BaseMapper<Concept> {
      * @return
      */
     List<ConceptRetrievalDTO> retrievalConcept(RetrievalVO retrievalVO);
+
+    /**
+     * 获得诊断依据问题词的标准词
+     * @return
+     */
+    List<String> getStandWord();
 }

+ 7 - 0
aipt-service/src/main/java/com/diagbot/service/ConceptService.java

@@ -43,4 +43,11 @@ public interface ConceptService extends IService<Concept> {
      * @return
      */
     List<ConceptRetrievalDTO> retrievalConcept(RetrievalVO retrievalVO);
+
+    /**
+     * 获得诊断依据问题词的标准词
+     *
+     * @return
+     */
+    List<String> getStandWord();
 }

+ 11 - 1
aipt-service/src/main/java/com/diagbot/service/impl/ConceptServiceImpl.java

@@ -2,8 +2,8 @@ package com.diagbot.service.impl;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.diagbot.dto.ConceptRes;
-import com.diagbot.dto.ConceptWithOrderRes;
 import com.diagbot.dto.ConceptRetrievalDTO;
+import com.diagbot.dto.ConceptWithOrderRes;
 import com.diagbot.entity.Concept;
 import com.diagbot.entity.wrapper.ConceptWrapper;
 import com.diagbot.mapper.ConceptMapper;
@@ -56,4 +56,14 @@ public class ConceptServiceImpl extends ServiceImpl<ConceptMapper, Concept> impl
     public List<ConceptWithOrderRes> getConceptWithOrder(ConceptWrapper conceptWrapper) {
         return baseMapper.getConceptWithOrder(conceptWrapper);
     }
+
+    /**
+     * 获得诊断依据问题词的标准词
+     *
+     * @return
+     */
+    @Override
+    public List<String> getStandWord() {
+        return baseMapper.getStandWord();
+    }
 }

+ 4 - 0
aipt-service/src/main/resources/mapper/ConceptMapper.xml

@@ -479,4 +479,8 @@
             LIMIT 100
         </if>
     </select>
+
+    <select id="getStandWord" resultType="java.lang.String">
+        SELECT lib_name FROM kl_concept WHERE is_deleted = 'N' AND lib_type = 33
+    </select>
 </mapper>