|
@@ -5,8 +5,12 @@ import com.diagbot.dto.LisDetailDTO;
|
|
|
import com.diagbot.dto.OperationInfoDTO;
|
|
|
import com.diagbot.dto.RetrievalDTO;
|
|
|
import com.diagbot.dto.StaticKnowledgeIndexDTO;
|
|
|
+import com.diagbot.entity.node.ICDDisease;
|
|
|
import com.diagbot.entity.node.LIS;
|
|
|
import com.diagbot.entity.node.LISPack;
|
|
|
+import com.diagbot.entity.node.Medicine;
|
|
|
+import com.diagbot.entity.node.Operation;
|
|
|
+import com.diagbot.entity.node.PACS;
|
|
|
import com.diagbot.repository.DeptNode;
|
|
|
import com.diagbot.repository.DeptRepository;
|
|
|
import com.diagbot.repository.ICDDiseaseNode;
|
|
@@ -188,80 +192,91 @@ public class RetrievalFacade {
|
|
|
List<StaticKnowledgeIndexDTO> retList = Lists.newLinkedList();
|
|
|
String inputStr = staticKnowledgeIndexVO.getInputStr();
|
|
|
List<Integer> types = staticKnowledgeIndexVO.getTypes();
|
|
|
+ List<ICDDisease> icdDiseaseList = icdDiseaseRepository.findByNameLike("*" + inputStr + "*");
|
|
|
+ List<Medicine> medicineList = medicineRepository.findByNameLike("*" + inputStr + "*");
|
|
|
+ List<LIS> lisList = lisRepository.findByNameLike("*" + inputStr + "*");
|
|
|
+ List<PACS> pacsList = pacsRepository.findByNameLike("*" + inputStr + "*");
|
|
|
+ List<Operation> operationList = operationRepository.findByNameLike("*" + inputStr + "*");
|
|
|
+ //TODO 诊断
|
|
|
+ List<StaticKnowledgeIndexDTO> disRetList = Lists.newLinkedList();
|
|
|
+ for (ICDDisease icdDisease : icdDiseaseList) {
|
|
|
+ StaticKnowledgeIndexDTO staticDTO = new StaticKnowledgeIndexDTO();
|
|
|
+ staticDTO.setName(icdDisease.getName());
|
|
|
+ staticDTO.setType(1);
|
|
|
+ staticDTO.setTypeName("诊断");
|
|
|
+ disRetList.add(staticDTO);
|
|
|
+ }
|
|
|
+ //TODO 药品
|
|
|
+ List<StaticKnowledgeIndexDTO> drugRetList = Lists.newLinkedList();
|
|
|
+ for (Medicine medicine : medicineList) {
|
|
|
+ StaticKnowledgeIndexDTO staticDTO = new StaticKnowledgeIndexDTO();
|
|
|
+ staticDTO.setName(medicine.getName());
|
|
|
+ staticDTO.setType(2);
|
|
|
+ staticDTO.setTypeName("药品");
|
|
|
+ drugRetList.add(staticDTO);
|
|
|
+ }
|
|
|
+ //TODO 检验
|
|
|
+ List<StaticKnowledgeIndexDTO> lisPackRetList = Lists.newLinkedList();
|
|
|
+ for (LIS lis : lisList) {
|
|
|
+ if (lis.getLisPacks_related_lis().size() > 0) {
|
|
|
+ for (LISPack lisPack : lis.getLisPacks_related_lis()) {
|
|
|
+ StaticKnowledgeIndexDTO staticDTO = new StaticKnowledgeIndexDTO();
|
|
|
+ staticDTO.setRetrievalName(lis.getName());
|
|
|
+ staticDTO.setName(lisPack.getName());
|
|
|
+ staticDTO.setType(3);
|
|
|
+ staticDTO.setTypeName("检验");
|
|
|
+ lisPackRetList.add(staticDTO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<StaticKnowledgeIndexDTO> lisRetList = Lists.newLinkedList();
|
|
|
+ for (LIS lis : lisList) {
|
|
|
+ StaticKnowledgeIndexDTO staticDTO = new StaticKnowledgeIndexDTO();
|
|
|
+ staticDTO.setName(lis.getName());
|
|
|
+ staticDTO.setType(3);
|
|
|
+ staticDTO.setTypeName("检验");
|
|
|
+ lisRetList.add(staticDTO);
|
|
|
+ }
|
|
|
+ //TODO 检查
|
|
|
+ List<StaticKnowledgeIndexDTO> pacsRetList = Lists.newLinkedList();
|
|
|
+ for (PACS pacs : pacsList) {
|
|
|
+ StaticKnowledgeIndexDTO staticDTO = new StaticKnowledgeIndexDTO();
|
|
|
+ staticDTO.setName(pacs.getName());
|
|
|
+ staticDTO.setType(4);
|
|
|
+ staticDTO.setTypeName("检查");
|
|
|
+ pacsRetList.add(staticDTO);
|
|
|
+ }
|
|
|
+ //TODO 手术和操作
|
|
|
+ List<StaticKnowledgeIndexDTO> operationRetList = Lists.newLinkedList();
|
|
|
+ for (Operation item : operationList) {
|
|
|
+ StaticKnowledgeIndexDTO staticDTO = new StaticKnowledgeIndexDTO();
|
|
|
+ staticDTO.setName(item.getName());
|
|
|
+ staticDTO.setType(5);
|
|
|
+ staticDTO.setTypeName("手术和操作");
|
|
|
+ operationRetList.add(staticDTO);
|
|
|
+ }
|
|
|
//0-全部、1-诊断、2-药品、3-检验、4-检查、5-手术和操作
|
|
|
if (types.contains(1)) {
|
|
|
- List<String> diseases = getDiseases(inputStr);
|
|
|
- List<StaticKnowledgeIndexDTO> staticList = Lists.newLinkedList();
|
|
|
- for (String str : diseases) {
|
|
|
- StaticKnowledgeIndexDTO staticDTO = new StaticKnowledgeIndexDTO();
|
|
|
- staticDTO.setName(str);
|
|
|
- staticDTO.setType(1);
|
|
|
- staticDTO.setTypeName("诊断");
|
|
|
- staticList.add(staticDTO);
|
|
|
- }
|
|
|
- retList.addAll(staticList);
|
|
|
+ retList.addAll(disRetList);
|
|
|
} else if (types.contains(2)) {
|
|
|
- List<DrugInfoDTO> items = getMedicines(inputStr);
|
|
|
- List<StaticKnowledgeIndexDTO> staticList = Lists.newLinkedList();
|
|
|
- for (DrugInfoDTO item : items) {
|
|
|
- StaticKnowledgeIndexDTO staticDTO = new StaticKnowledgeIndexDTO();
|
|
|
- staticDTO.setName(item.getName());
|
|
|
- staticDTO.setType(2);
|
|
|
- staticDTO.setTypeName("药品");
|
|
|
- staticList.add(staticDTO);
|
|
|
- }
|
|
|
- retList.addAll(staticList);
|
|
|
+ retList.addAll(drugRetList);
|
|
|
} else if (types.contains(3)) {
|
|
|
- List<StaticKnowledgeIndexDTO> staticList = Lists.newLinkedList();
|
|
|
- List<LIS> lislt = lisRepository.findByNameLike("*" + inputStr + "*");
|
|
|
//套餐显示在前
|
|
|
- for (LIS lis : lislt) {
|
|
|
- if (lis.getLisPacks_related_lis().size() > 0) {
|
|
|
- for (LISPack lisPack : lis.getLisPacks_related_lis()) {
|
|
|
- StaticKnowledgeIndexDTO staticDTO = new StaticKnowledgeIndexDTO();
|
|
|
- staticDTO.setRetrievalName(lis.getName());
|
|
|
- staticDTO.setName(lisPack.getName());
|
|
|
- staticDTO.setType(3);
|
|
|
- staticDTO.setTypeName("检验");
|
|
|
- staticList.add(staticDTO);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ retList.addAll(lisPackRetList);
|
|
|
//明细显示在后
|
|
|
- for (LIS lis : lislt) {
|
|
|
- StaticKnowledgeIndexDTO staticDTO = new StaticKnowledgeIndexDTO();
|
|
|
- staticDTO.setName(lis.getName());
|
|
|
- staticDTO.setType(3);
|
|
|
- staticDTO.setTypeName("检验");
|
|
|
- staticList.add(staticDTO);
|
|
|
- }
|
|
|
- retList.addAll(staticList);
|
|
|
+ retList.addAll(lisRetList);
|
|
|
} else if (types.contains(4)) {
|
|
|
- List<String> pacSs = getPACSs(inputStr);
|
|
|
- List<StaticKnowledgeIndexDTO> staticList = Lists.newLinkedList();
|
|
|
- for (String str : pacSs) {
|
|
|
- StaticKnowledgeIndexDTO staticDTO = new StaticKnowledgeIndexDTO();
|
|
|
- staticDTO.setName(str);
|
|
|
- staticDTO.setType(4);
|
|
|
- staticDTO.setTypeName("检查");
|
|
|
- staticList.add(staticDTO);
|
|
|
- }
|
|
|
- retList.addAll(staticList);
|
|
|
+ retList.addAll(pacsRetList);
|
|
|
} else if (types.contains(5)) {
|
|
|
- List<OperationInfoDTO> items = getOperations(inputStr);
|
|
|
- List<StaticKnowledgeIndexDTO> staticList = Lists.newLinkedList();
|
|
|
- for (OperationInfoDTO item : items) {
|
|
|
- StaticKnowledgeIndexDTO staticDTO = new StaticKnowledgeIndexDTO();
|
|
|
- staticDTO.setName(item.getName());
|
|
|
- staticDTO.setType(5);
|
|
|
- staticDTO.setTypeName("手术和操作");
|
|
|
- staticList.add(staticDTO);
|
|
|
- }
|
|
|
- retList.addAll(staticList);
|
|
|
+ retList.addAll(operationRetList);
|
|
|
} else {
|
|
|
-
|
|
|
+ retList.addAll(disRetList);
|
|
|
+ retList.addAll(drugRetList);
|
|
|
+ retList.addAll(lisPackRetList);
|
|
|
+ retList.addAll(lisRetList);
|
|
|
+ retList.addAll(pacsRetList);
|
|
|
+ retList.addAll(operationRetList);
|
|
|
}
|
|
|
-
|
|
|
return retList;
|
|
|
}
|
|
|
}
|