|
@@ -0,0 +1,120 @@
|
|
|
+package com.diagbot.facade;
|
|
|
+
|
|
|
+import com.diagbot.entity.node.LisName;
|
|
|
+import com.diagbot.entity.node.LisSet;
|
|
|
+import com.diagbot.entity.node.Medicine;
|
|
|
+import com.diagbot.entity.node.PacsName;
|
|
|
+import com.diagbot.entity.node.YiBaoDiseaseName;
|
|
|
+import com.diagbot.entity.node.YiBaoOperationName;
|
|
|
+import com.diagbot.repository.LisNameRepository;
|
|
|
+import com.diagbot.repository.LisSetRepository;
|
|
|
+import com.diagbot.repository.MedicineRepository;
|
|
|
+import com.diagbot.repository.PacsNameRepository;
|
|
|
+import com.diagbot.repository.YiBaoDiseaseRepository;
|
|
|
+import com.diagbot.repository.YiBaoOperationNameRepository;
|
|
|
+import com.diagbot.util.ListUtil;
|
|
|
+import com.diagbot.vo.ConceptVO;
|
|
|
+import com.google.common.collect.Lists;
|
|
|
+import lombok.Getter;
|
|
|
+import lombok.Setter;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @Description:
|
|
|
+ * @Author:zhaops
|
|
|
+ * @time: 2020/9/10 14:51
|
|
|
+ */
|
|
|
+@Component
|
|
|
+public class ConceptFacade {
|
|
|
+ @Autowired
|
|
|
+ LisSetRepository lisSetRepository;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ LisNameRepository lisNameRepository;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ YiBaoDiseaseRepository yiBaoDiseaseRepository;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ PacsNameRepository pacsNameRepository;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ MedicineRepository medicineRepository;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ YiBaoOperationNameRepository yiBaoOperationNameRepository;
|
|
|
+
|
|
|
+ public List<String> getConceptNames(ConceptVO conceptVO) {
|
|
|
+ if (ListUtil.isEmpty(conceptVO.getNames())) {
|
|
|
+ return new ArrayList<>();
|
|
|
+ }
|
|
|
+ List<String> retList = Lists.newLinkedList();
|
|
|
+ //type: 类型:1-化验大项、2-化验小项、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血
|
|
|
+ switch (conceptVO.getType()) {
|
|
|
+ case 1:
|
|
|
+ List<LisSet> lisSetList = lisSetRepository.findByNameIn(conceptVO.getNames());
|
|
|
+ if (ListUtil.isNotEmpty(lisSetList)) {
|
|
|
+ retList = lisSetList.stream()
|
|
|
+ .map(i -> i.getName())
|
|
|
+ .distinct()
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ List<LisName> lisNameList = lisNameRepository.findByNameIn(conceptVO.getNames());
|
|
|
+ if (ListUtil.isNotEmpty(lisNameList)) {
|
|
|
+ retList = lisNameList.stream()
|
|
|
+ .map(i -> i.getName())
|
|
|
+ .distinct()
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ List<PacsName> pacsNameList = pacsNameRepository.findByNameIn(conceptVO.getNames());
|
|
|
+ if (ListUtil.isNotEmpty(pacsNameList)) {
|
|
|
+ retList = pacsNameList.stream()
|
|
|
+ .map(i -> i.getName())
|
|
|
+ .distinct()
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ List<YiBaoDiseaseName> yiBaoDiseaseNameList = yiBaoDiseaseRepository.findByNameIn(conceptVO.getNames());
|
|
|
+ if (ListUtil.isNotEmpty(yiBaoDiseaseNameList)) {
|
|
|
+ retList = yiBaoDiseaseNameList.stream()
|
|
|
+ .map(i -> i.getName())
|
|
|
+ .distinct()
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 5:
|
|
|
+ List<Medicine> medicineList = medicineRepository.findByNameIn(conceptVO.getNames());
|
|
|
+ if (ListUtil.isNotEmpty(medicineList)) {
|
|
|
+ retList = medicineList.stream()
|
|
|
+ .map(i -> i.getName())
|
|
|
+ .distinct()
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 6:
|
|
|
+ List<YiBaoOperationName> yiBaoOperationNameList = yiBaoOperationNameRepository.findByNameIn(conceptVO.getNames());
|
|
|
+ if (ListUtil.isNotEmpty(yiBaoOperationNameList)) {
|
|
|
+ retList = yiBaoOperationNameList.stream()
|
|
|
+ .map(i -> i.getName())
|
|
|
+ .distinct()
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 7:
|
|
|
+ break;
|
|
|
+ case 8:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ return retList;
|
|
|
+ }
|
|
|
+}
|