|
@@ -5,6 +5,8 @@ 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.LIS;
|
|
|
+import com.diagbot.entity.node.LISPack;
|
|
|
import com.diagbot.repository.DeptNode;
|
|
|
import com.diagbot.repository.DeptRepository;
|
|
|
import com.diagbot.repository.ICDDiseaseNode;
|
|
@@ -183,8 +185,83 @@ public class RetrievalFacade {
|
|
|
* @return
|
|
|
*/
|
|
|
public List<StaticKnowledgeIndexDTO> staticKnowledgeIndex(StaticKnowledgeIndexVO staticKnowledgeIndexVO) {
|
|
|
- List<StaticKnowledgeIndexDTO> staticKnowledgeIndexDTOList = Lists.newLinkedList();
|
|
|
+ List<StaticKnowledgeIndexDTO> retList = Lists.newLinkedList();
|
|
|
+ String inputStr = staticKnowledgeIndexVO.getInputStr();
|
|
|
+ List<Integer> types = staticKnowledgeIndexVO.getTypes();
|
|
|
+ //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);
|
|
|
+ } 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);
|
|
|
+ } else if (types.contains(3)) {
|
|
|
+ List<StaticKnowledgeIndexDTO> staticList = Lists.newLinkedList();
|
|
|
+ List<LIS> lislt = lisRepository.findByNameLike("*" + inputStr + "*");
|
|
|
+ //套餐显示在前
|
|
|
+ for (LIS lis : lislt) {
|
|
|
+ if (lis.getLisPacks().size() > 0) {
|
|
|
+ for (LISPack lisPack : lis.getLisPacks()) {
|
|
|
+ StaticKnowledgeIndexDTO staticDTO = new StaticKnowledgeIndexDTO();
|
|
|
+ staticDTO.setRetrievalName(lis.getName());
|
|
|
+ staticDTO.setName(lisPack.getName());
|
|
|
+ staticDTO.setType(3);
|
|
|
+ staticDTO.setTypeName("检验");
|
|
|
+ staticList.add(staticDTO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //明细显示在后
|
|
|
+ for (LIS lis : lislt) {
|
|
|
+ StaticKnowledgeIndexDTO staticDTO = new StaticKnowledgeIndexDTO();
|
|
|
+ staticDTO.setName(lis.getName());
|
|
|
+ staticDTO.setType(3);
|
|
|
+ staticDTO.setTypeName("检验");
|
|
|
+ staticList.add(staticDTO);
|
|
|
+ }
|
|
|
+ retList.addAll(staticList);
|
|
|
+ } 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);
|
|
|
+ } 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);
|
|
|
+ } else {
|
|
|
|
|
|
- return staticKnowledgeIndexDTOList;
|
|
|
+ }
|
|
|
+
|
|
|
+ return retList;
|
|
|
}
|
|
|
}
|