|
@@ -2,10 +2,12 @@ package com.diagbot.facade;
|
|
|
|
|
|
import com.diagbot.dto.DictionaryInfoDTO;
|
|
import com.diagbot.dto.DictionaryInfoDTO;
|
|
import com.diagbot.entity.node.Indication;
|
|
import com.diagbot.entity.node.Indication;
|
|
|
|
+import com.diagbot.entity.node.IndicationConcept;
|
|
import com.diagbot.entity.node.IndicationCondition;
|
|
import com.diagbot.entity.node.IndicationCondition;
|
|
import com.diagbot.repository.IndicationRepository;
|
|
import com.diagbot.repository.IndicationRepository;
|
|
import com.diagbot.util.EntityUtil;
|
|
import com.diagbot.util.EntityUtil;
|
|
import com.diagbot.util.ListUtil;
|
|
import com.diagbot.util.ListUtil;
|
|
|
|
+import com.diagbot.vo.ConceptIndexVO;
|
|
import com.diagbot.vo.ConditionIndexVO;
|
|
import com.diagbot.vo.ConditionIndexVO;
|
|
import com.diagbot.vo.IndicationPageVO;
|
|
import com.diagbot.vo.IndicationPageVO;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
@@ -48,12 +50,12 @@ public class IndicationManFacade {
|
|
if (ListUtil.isNotEmpty(indicationPageVO.getTypes())) {
|
|
if (ListUtil.isNotEmpty(indicationPageVO.getTypes())) {
|
|
for (Integer type : indicationPageVO.getTypes()) {
|
|
for (Integer type : indicationPageVO.getTypes()) {
|
|
if (dicIndicationManTypeMap.containsKey(type.toString())
|
|
if (dicIndicationManTypeMap.containsKey(type.toString())
|
|
- && dicTypeConvertMap.containsKey(dicIndicationManTypeMap.containsKey(type.toString()))) {
|
|
|
|
|
|
+ && dicTypeConvertMap.containsKey(dicIndicationManTypeMap.get(type.toString()))) {
|
|
labels.add(dicTypeConvertMap.get(dicIndicationManTypeMap.get(type.toString())));
|
|
labels.add(dicTypeConvertMap.get(dicIndicationManTypeMap.get(type.toString())));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ indicationPageVO.setLabels(labels);
|
|
Pageable pageable = PageRequest.of(indicationPageVO.getNumber(), indicationPageVO.getSize());
|
|
Pageable pageable = PageRequest.of(indicationPageVO.getNumber(), indicationPageVO.getSize());
|
|
Page<Indication> page = indicationRepository.getPage(indicationPageVO.getLabels(),
|
|
Page<Indication> page = indicationRepository.getPage(indicationPageVO.getLabels(),
|
|
indicationPageVO.getConceptName(),
|
|
indicationPageVO.getConceptName(),
|
|
@@ -70,9 +72,6 @@ public class IndicationManFacade {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public List<IndicationCondition> conditionIndex(ConditionIndexVO conditionIndexVO) {
|
|
public List<IndicationCondition> conditionIndex(ConditionIndexVO conditionIndexVO) {
|
|
- //TODO 输血单独处理
|
|
|
|
-
|
|
|
|
-
|
|
|
|
List<DictionaryInfoDTO> dicTypeConvert = dictionaryFacade.getListByGroupType(8);
|
|
List<DictionaryInfoDTO> dicTypeConvert = dictionaryFacade.getListByGroupType(8);
|
|
List<DictionaryInfoDTO> dicIndicationManType = dictionaryFacade.getListByGroupType(11);
|
|
List<DictionaryInfoDTO> dicIndicationManType = dictionaryFacade.getListByGroupType(11);
|
|
Map<String, String> dicTypeConvertMap
|
|
Map<String, String> dicTypeConvertMap
|
|
@@ -80,7 +79,7 @@ public class IndicationManFacade {
|
|
Map<String, String> dicIndicationManTypeMap
|
|
Map<String, String> dicIndicationManTypeMap
|
|
= EntityUtil.makeMapWithKeyValue(dicIndicationManType, "val", "name");
|
|
= EntityUtil.makeMapWithKeyValue(dicIndicationManType, "val", "name");
|
|
if (dicIndicationManTypeMap.containsKey(conditionIndexVO.getType().toString())
|
|
if (dicIndicationManTypeMap.containsKey(conditionIndexVO.getType().toString())
|
|
- && dicTypeConvertMap.containsKey(dicIndicationManTypeMap.containsKey(conditionIndexVO.getType().toString()))) {
|
|
|
|
|
|
+ && dicTypeConvertMap.containsKey(dicIndicationManTypeMap.get(conditionIndexVO.getType().toString()))) {
|
|
conditionIndexVO.setConceptLabel(dicTypeConvertMap.get(dicIndicationManTypeMap.get(conditionIndexVO.getType().toString())));
|
|
conditionIndexVO.setConceptLabel(dicTypeConvertMap.get(dicIndicationManTypeMap.get(conditionIndexVO.getType().toString())));
|
|
}
|
|
}
|
|
List<String> relationTypes = indicationRepository.getRelationTypes(conditionIndexVO.getConceptLabel());
|
|
List<String> relationTypes = indicationRepository.getRelationTypes(conditionIndexVO.getConceptLabel());
|
|
@@ -88,9 +87,9 @@ public class IndicationManFacade {
|
|
//条件明细筛选范围
|
|
//条件明细筛选范围
|
|
if (ListUtil.isNotEmpty(relationTypes)) {
|
|
if (ListUtil.isNotEmpty(relationTypes)) {
|
|
for (String relationType : relationTypes) {
|
|
for (String relationType : relationTypes) {
|
|
- String[] splitArr = relationType.split("禁忌");
|
|
|
|
- if (splitArr != null && splitArr.length > 1) {
|
|
|
|
- conditionLabels.add(splitArr[splitArr.length - 1]);
|
|
|
|
|
|
+ int index = relationType.indexOf("禁忌");
|
|
|
|
+ if (index > 0) {
|
|
|
|
+ conditionLabels.add(relationType.substring(index + 2));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -109,4 +108,31 @@ public class IndicationManFacade {
|
|
|
|
|
|
return conditions;
|
|
return conditions;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 开单项检索
|
|
|
|
+ *
|
|
|
|
+ * @param conceptIndexVO
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public List<IndicationConcept> conceptIndex(ConceptIndexVO conceptIndexVO) {
|
|
|
|
+ List<String> conceptLabels = Lists.newArrayList();
|
|
|
|
+ List<DictionaryInfoDTO> dicTypeConvert = dictionaryFacade.getListByGroupType(8);
|
|
|
|
+ List<DictionaryInfoDTO> dicIndicationManType = dictionaryFacade.getListByGroupType(11);
|
|
|
|
+ Map<String, String> dicTypeConvertMap
|
|
|
|
+ = EntityUtil.makeMapWithKeyValue(dicTypeConvert, "name", "val");
|
|
|
|
+ Map<String, String> dicIndicationManTypeMap
|
|
|
|
+ = EntityUtil.makeMapWithKeyValue(dicIndicationManType, "val", "name");
|
|
|
|
+ if (dicIndicationManTypeMap.containsKey(conceptIndexVO.getType().toString())
|
|
|
|
+ && dicTypeConvertMap.containsKey(dicIndicationManTypeMap.get(conceptIndexVO.getType().toString()))) {
|
|
|
|
+ conceptIndexVO.setConceptLabel(dicTypeConvertMap.get(dicIndicationManTypeMap.get(conceptIndexVO.getType().toString())));
|
|
|
|
+ conceptLabels.add(conceptIndexVO.getConceptLabel());
|
|
|
|
+ }
|
|
|
|
+ List<IndicationConcept> concepts = indicationRepository.conceptIndex(conceptLabels,
|
|
|
|
+ conceptIndexVO.getConceptName(),
|
|
|
|
+ conceptIndexVO.getConceptName(),
|
|
|
|
+ 100);
|
|
|
|
+
|
|
|
|
+ return concepts;
|
|
|
|
+ }
|
|
}
|
|
}
|