Explorar o código

1.CRF 药品处理修改bug

huj %!s(int64=4) %!d(string=hai) anos
pai
achega
a3ba87dac0

+ 5 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR02985.java

@@ -143,7 +143,11 @@ public class THR02985 extends QCCatalogue {
         for (Map.Entry<Date, String> doctorAdviceDrug : doctorAdviceDrugMap.entrySet()) {
             Date doctorAdviceDate = doctorAdviceDrug.getKey();
             String drugs = doctorAdviceDrug.getValue();
-            drugs = removeBracket(drugs);
+            drugs = removeBracket(drugs).replaceAll("[^\u4e00-\u9fa5]", "");
+            String drugStandardWord = similarityUtil.getDrugStandardWord(drugs);
+            if (StringUtil.isNotBlank(drugStandardWord)) {
+                drugs = drugStandardWord;
+            }
             Set<String> splitDrugs = CatalogueUtil.getRegexWords(drugs, "[((\\[][^\\[\\]()()]+[\\]))]")
                     .stream().filter(x -> !x.equals("合资") && !x.equals("进口") && !x.equals("国产")).collect(Collectors.toSet());
             String missDrug = "";

+ 1 - 1
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/process/EntityProcess.java

@@ -252,7 +252,7 @@ public class EntityProcess {
      */
     protected <T> T findTAfter(Lemma detailLemma, T t, String entityType) throws Exception {
         for (Lemma lemma : detailLemma.getRelationLemmas()) {
-            if (lemma.getProperty().equals(entityType) && detailLemma.getFrom() < lemma.getFrom()) {
+            if (lemma.getProperty().equals(entityType) && Integer.parseInt(detailLemma.getPosition()) < Integer.parseInt(lemma.getPosition())) {
                 BeanUtils.copyProperty(t, "name", lemma.getText());
                 return t;
             }