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