瀏覽代碼

诊断依据导出更新

kongwz 4 年之前
父節點
當前提交
561bb6c454

+ 1 - 1
src/main/java/com/diagbot/enums/DiagnoseLexiconTypeEnum.java

@@ -33,7 +33,7 @@ public enum DiagnoseLexiconTypeEnum implements KeyedNamed {
     DiseaseHisTpye(6, "F:疾病"),//病史
     ZsxbszzTpyeCause(7, "G:主诉现病史正则"),//诱因
     ZsxbszzTpyeBc(8, "G:主诉现病史正则"),//病程
-    jwzzTpye(9, "H:既往史正则"),
+    jwzzTpye(9, "H:既往史正则"),//其他
     QuezhenTpye(91, "确诊"),
     NizhenTpye(92, "拟诊"),
     JtTpye(93, "警惕");

+ 18 - 8
src/main/java/com/diagbot/facade/KlDiagnoseDetailFacade.java

@@ -5,6 +5,7 @@ import com.diagbot.dto.ExportDescDTO;
 import com.diagbot.dto.ExportDiagnoseDTO;
 import com.diagbot.dto.ExportDiagnoseNameDTO;
 import com.diagbot.entity.KlDiagnoseDetail;
+import com.diagbot.enums.CommonEnum;
 import com.diagbot.enums.DiagnoseLexiconTypeEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.KlDiagnoseDetailServiceImpl;
@@ -124,7 +125,7 @@ public class KlDiagnoseDetailFacade extends KlDiagnoseDetailServiceImpl {
         List<Integer> types = Lists.newArrayList(91, 92, 93);
 
         Map<Integer, List<KlDiagnoseDetail>> typeDiagnoseDetails = EntityUtil.makeEntityListMap(datats, "type");
-        for (Map.Entry<Integer, List<String>> edd : exportDiagnoseDTOS.entrySet()) {
+        /*for (Map.Entry<Integer, List<String>> edd : exportDiagnoseDTOS.entrySet()) {
             Integer type = edd.getKey();
             List<KlDiagnoseDetail> klDiagnoseDetails = typeDiagnoseDetails.get(type);
             List<String> relations = edd.getValue();
@@ -142,7 +143,7 @@ public class KlDiagnoseDetailFacade extends KlDiagnoseDetailServiceImpl {
                 codes.add(maxCodeArray[0]+"."+max);
             }
 
-        }
+        }*/
         Map<String,List<String>> typeCodeMap = new HashMap<>();//A --> [1.0,1.1,1.2,1.3]
         Map<String,String> oldNewCodeMap = new HashMap<>();//1.0 -->A0
         for (Map.Entry<Integer, List<KlDiagnoseDetail>> tdd : typeDiagnoseDetails.entrySet()) {
@@ -152,6 +153,7 @@ public class KlDiagnoseDetailFacade extends KlDiagnoseDetailServiceImpl {
                 String code = kdl.getCode();
                 String formula = kdl.getFormula();
                 String typeName = DiagnoseLexiconTypeEnum.getName(type);//A:症状
+                String relation = kdl.getRelation();
 
                 ExportDiagnoseDTO exportDiagnoseDTO = new ExportDiagnoseDTO();
                 BeanUtil.copyProperties(kdl, exportDiagnoseDTO);
@@ -187,10 +189,14 @@ public class KlDiagnoseDetailFacade extends KlDiagnoseDetailServiceImpl {
                         exportDiagnoseDTO.setRule(kdl.getStandard());
                     }
                     if(code.startsWith("4.")){
-                        exportDiagnoseDTO.setRule(kdl.getRelation().replaceAll("\\、","|"));
+                        exportDiagnoseDTO.setRule(relation.replaceAll("\\、","|"));
                         exportDiagnoseDTO.setRelation(kdl.getStandard());
                     }
                     exportDiagnoseDTO.setEq(kdl.getMidResult());
+                    if(("G".equals(tType) || "H".equals(tType)) && StringUtil.isNotBlank(relation)){
+                        exportDiagnoseDTO.setRule(kdl.getStandard()+"|"+kdl.getRelation().replaceAll("\\、","|"));
+                        exportDiagnoseDTO.setRelation("");
+                    }
                 }else {
                     ReflectUtil.setProperty(exportDiagnoseDTO, "type", typeName);
                     for (Map.Entry<String,String> typeq:oldNewCodeMap.entrySet()){
@@ -239,10 +245,11 @@ public class KlDiagnoseDetailFacade extends KlDiagnoseDetailServiceImpl {
         List<String> regexData = getCodes(allFormula);
 
         //遍历病历
-        List<Integer> types = Stream.of(1, 2, 5, 6, 7, 8, 9).collect(Collectors.toList());
+        List<Integer> types = Stream.of(1, 2, 6).collect(Collectors.toList());//症状、体征、病史有关联词的把关联词添加到规则里
         Iterator<KlDiagnoseDetail> iterator = klDiagnoseDetails.iterator();
         while (iterator.hasNext()) {
             KlDiagnoseDetail next = iterator.next();
+            String standard = next.getStandard();
             String code = next.getCode();//1.0
             Integer type = next.getType();//1
             String relation = next.getRelation();
@@ -251,15 +258,18 @@ public class KlDiagnoseDetailFacade extends KlDiagnoseDetailServiceImpl {
             } else {
                 if (StringUtil.isNotBlank(relation) && types.contains(type)) {
                     List<String> relationNames = Lists.newArrayList(relation.split("\\、"));
-                    if (typeRelationNamesMap.containsKey(type)) {
+                    relationNames.add(0,standard);
+                    next.setStandard(String.join(CommonEnum.getName(1),relationNames));
+                    next.setRelation("");
+                    /*if (typeRelationNamesMap.containsKey(type)) {
                         List<String> contionNames = typeRelationNamesMap.get(type);
                         contionNames.addAll(relationNames);
                         typeRelationNamesMap.put(type, contionNames);
                     } else {
                         typeRelationNamesMap.put(type, relationNames);
-                    }
+                    }*/
                 }
-                if (StringUtil.isNotBlank(code)) {
+                /*if (StringUtil.isNotBlank(code)) {
                     if (typeCodeNewListMap.containsKey(type)) {
                         List<String> codes = typeCodeNewListMap.get(type);
                         codes.add(code);
@@ -269,7 +279,7 @@ public class KlDiagnoseDetailFacade extends KlDiagnoseDetailServiceImpl {
                         codes.add(code);
                         typeCodeNewListMap.put(type, codes);
                     }
-                }
+                }*/
             }
         }
         return typeRelationNamesMap;