|
@@ -222,52 +222,108 @@ public class RetrievalFacade {
|
|
|
List<StaticKnowledgeIndexDTO> retList = Lists.newLinkedList();
|
|
|
String inputStr = staticKnowledgeIndexVO.getInputStr();
|
|
|
List<Integer> types = staticKnowledgeIndexVO.getTypes();
|
|
|
+ List<YiBaoDiseaseName> icdDiseaseList = Lists.newLinkedList();
|
|
|
+ List<Medicine> medicineList = Lists.newLinkedList();
|
|
|
+ List<LisSet> lisSetList = Lists.newLinkedList();
|
|
|
+ List<LisName> lisList = Lists.newLinkedList();
|
|
|
+ List<BaseNodeInfo> pacsList = Lists.newLinkedList();
|
|
|
+ List<YiBaoOperationName> operationList = Lists.newLinkedList();
|
|
|
+
|
|
|
+ //检索类型(多选):0-全部、1-诊断、2-药品、3-检验、4-检查、5-手术和操作
|
|
|
+ int size = 100;
|
|
|
+ if (ListUtil.isEmpty(types)
|
|
|
+ || (ListUtil.isNotEmpty(types) && types.contains(0))) {
|
|
|
+ icdDiseaseList = icdDiseaseRepository.staticKnowledgeIndex(staticKnowledgeIndexVO.getHasInfo(), inputStr, inputStr, size);
|
|
|
+ size -= icdDiseaseList.size();
|
|
|
+ if (size > 0) {
|
|
|
+ medicineList = medicineRepository.staticKnowledgeIndex(staticKnowledgeIndexVO.getHasInfo(), inputStr, inputStr, size);
|
|
|
+ size -= medicineList.size();
|
|
|
+ }
|
|
|
+ if (size > 0) {
|
|
|
+ lisSetList = lisSetRepository.staticKnowledgeIndex(staticKnowledgeIndexVO.getHasInfo(), inputStr, inputStr, size);
|
|
|
+ size -= lisSetList.size();
|
|
|
+ }
|
|
|
+ if (size > 0) {
|
|
|
+ lisList = lisRepository.staticKnowledgeIndex(staticKnowledgeIndexVO.getHasInfo(), inputStr, inputStr, size);
|
|
|
+ size -= lisList.size();
|
|
|
+ }
|
|
|
+ if (size > 0) {
|
|
|
+ pacsList = pacsRepository.staticKnowledgeIndexIgnoreLabel(staticKnowledgeIndexVO.getHasInfo(), inputStr, inputStr, size);
|
|
|
+ size -= pacsList.size();
|
|
|
+ }
|
|
|
+ if (size > 0) {
|
|
|
+ operationList = operationRepository.staticKnowledgeIndex(staticKnowledgeIndexVO.getHasInfo(), inputStr, inputStr, size);
|
|
|
+ size -= operationList.size();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (types.contains(1)) {
|
|
|
+ icdDiseaseList = icdDiseaseRepository.staticKnowledgeIndex(staticKnowledgeIndexVO.getHasInfo(), inputStr, inputStr, size);
|
|
|
+ }
|
|
|
+ if (types.contains(2)) {
|
|
|
+ medicineList = medicineRepository.staticKnowledgeIndex(staticKnowledgeIndexVO.getHasInfo(), inputStr, inputStr, size);
|
|
|
+ }
|
|
|
+ if (types.contains(3)) {
|
|
|
+ lisSetList = lisSetRepository.staticKnowledgeIndex(staticKnowledgeIndexVO.getHasInfo(), inputStr, inputStr, size);
|
|
|
+ lisList = lisRepository.staticKnowledgeIndex(staticKnowledgeIndexVO.getHasInfo(), inputStr, inputStr, size);
|
|
|
+ }
|
|
|
+ if (types.contains(5)) {
|
|
|
+ pacsList = pacsRepository.staticKnowledgeIndexIgnoreLabel(staticKnowledgeIndexVO.getHasInfo(), inputStr, inputStr, size);
|
|
|
+ }
|
|
|
+ if (types.contains(6)) {
|
|
|
+ operationList = operationRepository.staticKnowledgeIndex(staticKnowledgeIndexVO.getHasInfo(), inputStr, inputStr, size);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
//TODO 诊断
|
|
|
- List<YiBaoDiseaseName> icdDiseaseList = icdDiseaseRepository.staticKnowledgeIndex(staticKnowledgeIndexVO.getHasInfo(), inputStr, inputStr, 100);
|
|
|
- List<StaticKnowledgeIndexDTO> disRetList = Lists.newLinkedList();
|
|
|
- for (YiBaoDiseaseName icdDisease : icdDiseaseList) {
|
|
|
- StaticKnowledgeIndexDTO staticDTO = new StaticKnowledgeIndexDTO();
|
|
|
- staticDTO.setName(icdDisease.getName());
|
|
|
- staticDTO.setType(StaticTypeEnum.DIS.getKey());
|
|
|
- staticDTO.setTypeName(StaticTypeEnum.DIS.getName());
|
|
|
- disRetList.add(staticDTO);
|
|
|
+ if (ListUtil.isNotEmpty(icdDiseaseList)) {
|
|
|
+ for (YiBaoDiseaseName icdDisease : icdDiseaseList) {
|
|
|
+ StaticKnowledgeIndexDTO staticDTO = new StaticKnowledgeIndexDTO();
|
|
|
+ staticDTO.setName(icdDisease.getName());
|
|
|
+ staticDTO.setType(StaticTypeEnum.DIS.getKey());
|
|
|
+ staticDTO.setTypeName(StaticTypeEnum.DIS.getName());
|
|
|
+ retList.add(staticDTO);
|
|
|
+ }
|
|
|
}
|
|
|
//TODO 药品
|
|
|
- List<Medicine> medicineList = medicineRepository.staticKnowledgeIndex(staticKnowledgeIndexVO.getHasInfo(), inputStr, inputStr, 100);
|
|
|
-
|
|
|
- List<StaticKnowledgeIndexDTO> drugRetList = Lists.newLinkedList();
|
|
|
- for (Medicine medicine : medicineList) {
|
|
|
- StaticKnowledgeIndexDTO staticDTO = new StaticKnowledgeIndexDTO();
|
|
|
- staticDTO.setName(medicine.getName());
|
|
|
- staticDTO.setType(StaticTypeEnum.DRUG.getKey());
|
|
|
- staticDTO.setTypeName(StaticTypeEnum.DRUG.getName());
|
|
|
- drugRetList.add(staticDTO);
|
|
|
+ if (ListUtil.isNotEmpty(medicineList)) {
|
|
|
+ for (Medicine medicine : medicineList) {
|
|
|
+ StaticKnowledgeIndexDTO staticDTO = new StaticKnowledgeIndexDTO();
|
|
|
+ staticDTO.setName(medicine.getName());
|
|
|
+ staticDTO.setType(StaticTypeEnum.DRUG.getKey());
|
|
|
+ staticDTO.setTypeName(StaticTypeEnum.DRUG.getName());
|
|
|
+ retList.add(staticDTO);
|
|
|
+ }
|
|
|
}
|
|
|
//TODO 检验套餐
|
|
|
- List<LisSet> lisSetList = lisSetRepository.staticKnowledgeIndex(staticKnowledgeIndexVO.getHasInfo(), inputStr, inputStr, 100);
|
|
|
-
|
|
|
List<StaticKnowledgeIndexDTO> lisSetRetList = Lists.newLinkedList();
|
|
|
- for (LisSet lisSet : lisSetList) {
|
|
|
- StaticKnowledgeIndexDTO staticDTO = new StaticKnowledgeIndexDTO();
|
|
|
- staticDTO.setName(lisSet.getName());
|
|
|
- staticDTO.setType(StaticTypeEnum.LISSET.getKey());
|
|
|
- staticDTO.setTypeName(StaticTypeEnum.LISSET.getName());
|
|
|
- lisSetRetList.add(staticDTO);
|
|
|
+ if (ListUtil.isNotEmpty(lisSetList)) {
|
|
|
+ for (LisSet lisSet : lisSetList) {
|
|
|
+ StaticKnowledgeIndexDTO staticDTO = new StaticKnowledgeIndexDTO();
|
|
|
+ staticDTO.setName(lisSet.getName());
|
|
|
+ staticDTO.setType(StaticTypeEnum.LISSET.getKey());
|
|
|
+ staticDTO.setTypeName(StaticTypeEnum.LISSET.getName());
|
|
|
+ lisSetRetList.add(staticDTO);
|
|
|
+ }
|
|
|
}
|
|
|
//TODO 检验明细关联出检验套餐
|
|
|
- List<LisName> lisList = lisRepository.staticKnowledgeIndex(staticKnowledgeIndexVO.getHasInfo(), inputStr, inputStr, 100);
|
|
|
-
|
|
|
List<StaticKnowledgeIndexDTO> lisSetRelatecLisRetList = Lists.newLinkedList();
|
|
|
- for (LisName lis : lisList) {
|
|
|
- if (lis.getLissets().size() > 0) {
|
|
|
- for (LisSet lisSet : lis.getLissets()) {
|
|
|
- StaticKnowledgeIndexDTO staticDTO = new StaticKnowledgeIndexDTO();
|
|
|
- staticDTO.setRetrievalName(lis.getName());
|
|
|
- staticDTO.setName(lisSet.getName());
|
|
|
- staticDTO.setType(StaticTypeEnum.LISSET.getKey());
|
|
|
- staticDTO.setTypeName(StaticTypeEnum.LISSET.getName());
|
|
|
- lisSetRelatecLisRetList.add(staticDTO);
|
|
|
+ //TODO 检验明细
|
|
|
+ if (ListUtil.isNotEmpty(lisList)) {
|
|
|
+ for (LisName lis : lisList) {
|
|
|
+ StaticKnowledgeIndexDTO staticDTO = new StaticKnowledgeIndexDTO();
|
|
|
+ staticDTO.setName(lis.getName());
|
|
|
+ staticDTO.setType(StaticTypeEnum.LIS.getKey());
|
|
|
+ staticDTO.setTypeName(StaticTypeEnum.LIS.getName());
|
|
|
+ retList.add(staticDTO);
|
|
|
+ if (lis.getLissets().size() > 0) {
|
|
|
+ for (LisSet lisSet : lis.getLissets()) {
|
|
|
+ StaticKnowledgeIndexDTO staticLisSetDTO = new StaticKnowledgeIndexDTO();
|
|
|
+ staticLisSetDTO.setRetrievalName(lis.getName());
|
|
|
+ staticLisSetDTO.setName(lisSet.getName());
|
|
|
+ staticLisSetDTO.setType(StaticTypeEnum.LISSET.getKey());
|
|
|
+ staticLisSetDTO.setTypeName(StaticTypeEnum.LISSET.getName());
|
|
|
+ lisSetRelatecLisRetList.add(staticLisSetDTO);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -283,82 +339,40 @@ public class RetrievalFacade {
|
|
|
lisSetRetList.add(entry.getValue().get(0));
|
|
|
}
|
|
|
}
|
|
|
- //TODO 检验明细
|
|
|
- //lisList = lisRepository.findByNameContainingOrPycodeContaining(inputStr, inputStr);
|
|
|
-
|
|
|
- List<StaticKnowledgeIndexDTO> lisRetList = Lists.newLinkedList();
|
|
|
- for (LisName lis : lisList) {
|
|
|
- StaticKnowledgeIndexDTO staticDTO = new StaticKnowledgeIndexDTO();
|
|
|
- staticDTO.setName(lis.getName());
|
|
|
- staticDTO.setType(StaticTypeEnum.LIS.getKey());
|
|
|
- staticDTO.setTypeName(StaticTypeEnum.LIS.getName());
|
|
|
- lisRetList.add(staticDTO);
|
|
|
+ //去重后加入检索结果集
|
|
|
+ if (ListUtil.isNotEmpty(lisSetRetList)) {
|
|
|
+ retList.addAll(lisSetRetList);
|
|
|
}
|
|
|
+
|
|
|
//TODO 检查
|
|
|
- //List<PacsName> pacsList = pacsRepository.staticKnowledgeIndex(staticKnowledgeIndexVO.getHasInfo(), inputStr, inputStr, 100);
|
|
|
- List<BaseNodeInfo> pacsList = pacsRepository.staticKnowledgeIndexIgnoreLabel(staticKnowledgeIndexVO.getHasInfo(), inputStr, inputStr, 100);
|
|
|
-
|
|
|
- List<StaticKnowledgeIndexDTO> pacsRetList = Lists.newLinkedList();
|
|
|
- for (BaseNodeInfo pacs : pacsList) {
|
|
|
- StaticKnowledgeIndexDTO staticDTO = new StaticKnowledgeIndexDTO();
|
|
|
- staticDTO.setName(pacs.getName());
|
|
|
- if (pacs.getLabels() != null && pacs.getLabels().size() > 0) {
|
|
|
- if (pacs.getLabels().contains(StaticTypeEnum.PACS.getName())) {
|
|
|
+ if (ListUtil.isNotEmpty(pacsList)) {
|
|
|
+ for (BaseNodeInfo pacs : pacsList) {
|
|
|
+ StaticKnowledgeIndexDTO staticDTO = new StaticKnowledgeIndexDTO();
|
|
|
+ staticDTO.setName(pacs.getName());
|
|
|
+ if (pacs.getLabels() != null && pacs.getLabels().size() > 0) {
|
|
|
+ if (pacs.getLabels().contains(StaticTypeEnum.PACS.getName())) {
|
|
|
+ staticDTO.setType(StaticTypeEnum.PACS.getKey());
|
|
|
+ staticDTO.setTypeName(StaticTypeEnum.PACS.getName());
|
|
|
+ } else if (pacs.getLabels().contains(StaticTypeEnum.PACSSUBNAME.getName())) {
|
|
|
+ staticDTO.setType(StaticTypeEnum.PACSSUBNAME.getKey());
|
|
|
+ staticDTO.setTypeName(StaticTypeEnum.PACSSUBNAME.getName());
|
|
|
+ }
|
|
|
+ } else {
|
|
|
staticDTO.setType(StaticTypeEnum.PACS.getKey());
|
|
|
staticDTO.setTypeName(StaticTypeEnum.PACS.getName());
|
|
|
- } else if (pacs.getLabels().contains(StaticTypeEnum.PACSSUBNAME.getName())) {
|
|
|
- staticDTO.setType(StaticTypeEnum.PACSSUBNAME.getKey());
|
|
|
- staticDTO.setTypeName(StaticTypeEnum.PACSSUBNAME.getName());
|
|
|
}
|
|
|
- } else {
|
|
|
- staticDTO.setType(StaticTypeEnum.PACS.getKey());
|
|
|
- staticDTO.setTypeName(StaticTypeEnum.PACS.getName());
|
|
|
+ retList.add(staticDTO);
|
|
|
}
|
|
|
- pacsRetList.add(staticDTO);
|
|
|
}
|
|
|
|
|
|
//TODO 手术和操作
|
|
|
- List<YiBaoOperationName> operationList = operationRepository.staticKnowledgeIndex(staticKnowledgeIndexVO.getHasInfo(), inputStr, inputStr, 100);
|
|
|
-
|
|
|
- List<StaticKnowledgeIndexDTO> operationRetList = Lists.newLinkedList();
|
|
|
-
|
|
|
- for (YiBaoOperationName operation : operationList) {
|
|
|
- StaticKnowledgeIndexDTO staticDTO = new StaticKnowledgeIndexDTO();
|
|
|
- staticDTO.setName(operation.getName());
|
|
|
- staticDTO.setType(StaticTypeEnum.OPT.getKey());
|
|
|
- staticDTO.setTypeName(StaticTypeEnum.OPT.getName());
|
|
|
- operationRetList.add(staticDTO);
|
|
|
- }
|
|
|
-
|
|
|
- //0-全部、1-诊断、2-药品、3-检验套餐、4-检验明细、5-检查、6-手术和操作
|
|
|
- if (ListUtil.isEmpty(types) || types.contains(0)) {
|
|
|
- retList.addAll(disRetList);
|
|
|
- retList.addAll(drugRetList);
|
|
|
- retList.addAll(lisSetRetList);
|
|
|
- //retList.addAll(lisSetRelatecLisRetList);
|
|
|
- retList.addAll(lisRetList);
|
|
|
- retList.addAll(pacsRetList);
|
|
|
- retList.addAll(operationRetList);
|
|
|
- } else {
|
|
|
- if (types.contains(1)) {
|
|
|
- retList.addAll(disRetList);
|
|
|
- }
|
|
|
- if (types.contains(2)) {
|
|
|
- retList.addAll(drugRetList);
|
|
|
- }
|
|
|
- if (types.contains(3)) {
|
|
|
- //套餐
|
|
|
- retList.addAll(lisSetRetList);
|
|
|
- //明细关联出的套餐
|
|
|
- //retList.addAll(lisSetRelatecLisRetList);
|
|
|
- //明细
|
|
|
- retList.addAll(lisRetList);
|
|
|
- }
|
|
|
- if (types.contains(5)) {
|
|
|
- retList.addAll(pacsRetList);
|
|
|
- }
|
|
|
- if (types.contains(6)) {
|
|
|
- retList.addAll(operationRetList);
|
|
|
+ if (ListUtil.isNotEmpty(operationList)) {
|
|
|
+ for (YiBaoOperationName operation : operationList) {
|
|
|
+ StaticKnowledgeIndexDTO staticDTO = new StaticKnowledgeIndexDTO();
|
|
|
+ staticDTO.setName(operation.getName());
|
|
|
+ staticDTO.setType(StaticTypeEnum.OPT.getKey());
|
|
|
+ staticDTO.setTypeName(StaticTypeEnum.OPT.getName());
|
|
|
+ retList.add(staticDTO);
|
|
|
}
|
|
|
}
|
|
|
if (ListUtil.isNotEmpty(retList) && retList.size() > 100) {
|