|
@@ -5,25 +5,31 @@ import com.diagbot.entity.node.Dept;
|
|
|
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.PacsSubName;
|
|
|
import com.diagbot.entity.node.YiBaoDiseaseName;
|
|
|
import com.diagbot.entity.node.YiBaoOperationName;
|
|
|
+import com.diagbot.entity.relationship.LisNameLisSet;
|
|
|
+import com.diagbot.entity.relationship.PacsNamePacsSubName;
|
|
|
import com.diagbot.repository.DeptRepository;
|
|
|
import com.diagbot.repository.LisNameRepository;
|
|
|
import com.diagbot.repository.LisSetRepository;
|
|
|
import com.diagbot.repository.MedicineRepository;
|
|
|
import com.diagbot.repository.PacsNameRepository;
|
|
|
+import com.diagbot.repository.PacsSubNameRepository;
|
|
|
import com.diagbot.repository.TransfusionRemindRepository;
|
|
|
import com.diagbot.repository.YiBaoDiseaseNameRepository;
|
|
|
import com.diagbot.repository.YiBaoOperationNameRepository;
|
|
|
+import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
import com.diagbot.vo.ConceptVO;
|
|
|
+import com.diagbot.vo.StaticKnowledgeNameVO;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
+import java.util.Set;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -45,6 +51,9 @@ public class ConceptFacade {
|
|
|
@Autowired
|
|
|
PacsNameRepository pacsNameRepository;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ PacsSubNameRepository pacsSubNameRepository;
|
|
|
+
|
|
|
@Autowired
|
|
|
MedicineRepository medicineRepository;
|
|
|
|
|
@@ -136,4 +145,68 @@ public class ConceptFacade {
|
|
|
}
|
|
|
return retList;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 取上级静态知识
|
|
|
+ *
|
|
|
+ * @param staticKnowledgeNameVO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public StaticKnowledgeNameVO getSuperName(StaticKnowledgeNameVO staticKnowledgeNameVO) {
|
|
|
+ //类型:1-诊断、2-药品、3-检验套餐、4-检验细项、5-检查、6-检查子项、7-手术和操作
|
|
|
+ StaticKnowledgeNameVO retName = new StaticKnowledgeNameVO();
|
|
|
+ BeanUtil.copyProperties(staticKnowledgeNameVO, retName);
|
|
|
+ switch (staticKnowledgeNameVO.getType()) {
|
|
|
+ case 4:
|
|
|
+ List<LisName> lisNameList = lisNameRepository.findByNameIs(staticKnowledgeNameVO.getName());
|
|
|
+ if (ListUtil.isNotEmpty(lisNameList)) {
|
|
|
+ LisName lisName = lisNameList.get(0);
|
|
|
+ Set<LisNameLisSet> lisNameLisSetSet = lisName.getLisNamelissets();
|
|
|
+ if (lisNameLisSetSet != null && lisNameLisSetSet.size() > 0) {
|
|
|
+ for (LisNameLisSet lisNameLisSet : lisNameLisSetSet) {
|
|
|
+ if (lisNameLisSet.getLisSet().getIs_kl().equals(1)) {
|
|
|
+ retName.setName(lisNameLisSet.getLisSet().getName());
|
|
|
+ retName.setType(3);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 6:
|
|
|
+ List<PacsSubName> pacsSubNameList = pacsSubNameRepository.findByNameIs(staticKnowledgeNameVO.getName());
|
|
|
+ if (ListUtil.isNotEmpty(pacsSubNameList)) {
|
|
|
+ PacsSubName pacsSubName = pacsSubNameList.get(0);
|
|
|
+ Set<PacsNamePacsSubName> pacsNamePacsSubNameSet = pacsSubName.getPacsNamePacsSubNames();
|
|
|
+ if (pacsNamePacsSubNameSet != null && pacsNamePacsSubNameSet.size() > 0) {
|
|
|
+ for (PacsNamePacsSubName pacsNamePacsSubName : pacsNamePacsSubNameSet) {
|
|
|
+ if (pacsNamePacsSubName.getPacsName().getIs_kl().equals(1)) {
|
|
|
+ retName.setName(pacsNamePacsSubName.getPacsName().getName());
|
|
|
+ retName.setType(5);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ return retName;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 取上级静态知识(批量)
|
|
|
+ *
|
|
|
+ * @param nameList
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<StaticKnowledgeNameVO> getSuperNameBatch(List<StaticKnowledgeNameVO> nameList) {
|
|
|
+ List<StaticKnowledgeNameVO> retList = Lists.newLinkedList();
|
|
|
+ if (ListUtil.isNotEmpty(nameList)) {
|
|
|
+ nameList.forEach(item -> {
|
|
|
+ retList.add(getSuperName(item));
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return retList;
|
|
|
+ }
|
|
|
}
|