|
@@ -26,6 +26,7 @@ import com.diagbot.exception.CommonErrorCode;
|
|
|
import com.diagbot.exception.CommonException;
|
|
|
import com.diagbot.repository.*;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
+import com.diagbot.util.NeoUtil;
|
|
|
import com.diagbot.util.RedisUtil;
|
|
|
import com.diagbot.util.StringUtil;
|
|
|
import com.diagbot.vo.BillNeoVO;
|
|
@@ -267,7 +268,7 @@ public class NeoFacade {
|
|
|
}
|
|
|
symptoms = Stream.of(symptom_chief,symptom_present).flatMap(Collection::stream).distinct().collect(Collectors.toList());
|
|
|
//症状推疾病
|
|
|
- List<String> allDis_bySymptom = getDisBySymptom(symptoms);
|
|
|
+ List<String> allDis_bySymptom = getDisBySymptom(symptoms,age,sex);
|
|
|
allDis.addAll(allDis_bySymptom);
|
|
|
//体征推出的疾病
|
|
|
//化验推出的疾病辅检
|
|
@@ -331,12 +332,12 @@ public class NeoFacade {
|
|
|
return neoPushDTOS;
|
|
|
}
|
|
|
|
|
|
- public List<String> getDisBySymptom(List<String> symptoms){
|
|
|
+ public List<String> getDisBySymptom(List<String> symptoms,Integer age,Integer sex){
|
|
|
List<String> symptomCache = getSymptomCache();
|
|
|
//取交集
|
|
|
symptoms.retainAll(symptomCache);
|
|
|
long start = System.currentTimeMillis();
|
|
|
- List<String> allDis_bySymptom = pushDis(symptomNameRepository, symptoms);
|
|
|
+ List<String> allDis_bySymptom = pushDis(symptomNameRepository, symptoms,age,sex);
|
|
|
long end = System.currentTimeMillis();
|
|
|
return allDis_bySymptom;
|
|
|
}
|
|
@@ -349,7 +350,7 @@ public class NeoFacade {
|
|
|
* @param symptoms
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<String> pushDis(SymptomNameRepository symptomNameRepository,List<String> symptoms){
|
|
|
+ public List<String> pushDis(SymptomNameRepository symptomNameRepository,List<String> symptoms,Integer age,Integer sex){
|
|
|
List<String> allDis = Lists.newArrayList();
|
|
|
|
|
|
/*if(ListUtil.isNotEmpty(symptoms)){
|
|
@@ -364,8 +365,12 @@ public class NeoFacade {
|
|
|
});
|
|
|
}*/
|
|
|
List<Symptom> byNameIn = symptomNameRepository.findByNameIn(symptoms);
|
|
|
- allDis = byNameIn.stream().filter(z -> z.getDisease() != null && z.getDisease().size() > 0)
|
|
|
- .map(z -> z.getDisease().stream().map(y -> y.getName()).collect(Collectors.toList())).flatMap(List::stream)
|
|
|
+ /*List<YiBaoDiseaseName> collect = byNameIn.stream()
|
|
|
+ .map(x -> x.getDisease().stream().filter(z -> NeoUtil.matchBasic(z,sex,age)).collect(Collectors.toList()))
|
|
|
+ .flatMap(List::stream).collect(Collectors.toList());*/
|
|
|
+
|
|
|
+ allDis = byNameIn.stream()
|
|
|
+ .map(z -> z.getDisease().stream().filter(o -> NeoUtil.matchBasic(o,sex,age)).map(y -> y.getName()).collect(Collectors.toList())).flatMap(List::stream)
|
|
|
.collect(Collectors.toList());
|
|
|
return allDis;
|
|
|
}
|