|
@@ -1,4 +1,4 @@
|
|
|
-/*
|
|
|
+
|
|
|
package com.diagbot.facade;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
@@ -12,22 +12,21 @@ import com.diagbot.dto.RespDTO;
|
|
|
import com.diagbot.entity.ConceptInfo;
|
|
|
import com.diagbot.entity.DiseaseConfig;
|
|
|
import com.diagbot.entity.DrugConfig;
|
|
|
+import com.diagbot.entity.KlConcept;
|
|
|
+import com.diagbot.entity.KlConceptStatic;
|
|
|
+import com.diagbot.entity.KlRelation;
|
|
|
import com.diagbot.entity.LisConfig;
|
|
|
import com.diagbot.entity.OperationConfig;
|
|
|
import com.diagbot.entity.PacsConfig;
|
|
|
import com.diagbot.entity.ResultStaticInfo;
|
|
|
import com.diagbot.entity.ResultStaticKnowledge;
|
|
|
-import com.diagbot.entity.node.LisName;
|
|
|
-import com.diagbot.entity.node.PacsSubName;
|
|
|
-import com.diagbot.entity.relationship.LisNameLisSet;
|
|
|
-import com.diagbot.entity.relationship.PacsNamePacsSubName;
|
|
|
import com.diagbot.enums.ConceptTypeEnum;
|
|
|
import com.diagbot.enums.GraphLabelEnum;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
+import com.diagbot.enums.LexiconEnum;
|
|
|
+import com.diagbot.enums.StatusEnum;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
|
import com.diagbot.exception.CommonException;
|
|
|
-import com.diagbot.repository.LisNameRepository;
|
|
|
-import com.diagbot.repository.PacsSubNameRepository;
|
|
|
import com.diagbot.service.ResultStaticInfoService;
|
|
|
import com.diagbot.service.ResultStaticKnowledgeService;
|
|
|
import com.diagbot.service.impl.ResultStaticKnowledgeServiceImpl;
|
|
@@ -52,15 +51,14 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
-import java.util.Set;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
-*/
|
|
|
+
|
|
|
/**
|
|
|
* @Description:
|
|
|
* @Author:zhaops
|
|
|
* @time: 2021/1/21 15:20
|
|
|
- *//*
|
|
|
+ */
|
|
|
|
|
|
@Component
|
|
|
public class ResultStaticKnowledgeFacade extends ResultStaticKnowledgeServiceImpl {
|
|
@@ -69,6 +67,13 @@ public class ResultStaticKnowledgeFacade extends ResultStaticKnowledgeServiceImp
|
|
|
@Autowired
|
|
|
private ConceptInfoFacade conceptInfoFacade;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private KlConceptFacade klConceptFacade;
|
|
|
+ @Autowired
|
|
|
+ private KlRelationFacade klRelationFacade;
|
|
|
+ @Autowired
|
|
|
+ private KlConceptStaticFacade klConceptStaticFacade;
|
|
|
+
|
|
|
@Autowired
|
|
|
private LisConfigFacade lisConfigFacade;
|
|
|
@Autowired
|
|
@@ -80,17 +85,8 @@ public class ResultStaticKnowledgeFacade extends ResultStaticKnowledgeServiceImp
|
|
|
@Autowired
|
|
|
private OperationConfigFacade operationConfigFacade;
|
|
|
@Autowired
|
|
|
- private TransfusionConfigFacade transfusionConfigFacade;
|
|
|
- @Autowired
|
|
|
- private DictionaryFacade dictionaryFacade;
|
|
|
- @Autowired
|
|
|
private RunningInfoFacade runningInfoFacade;
|
|
|
|
|
|
- @Autowired
|
|
|
- private LisNameRepository lisNameRepository;
|
|
|
- @Autowired
|
|
|
- private PacsSubNameRepository pacsSubNameRepository;
|
|
|
-
|
|
|
@Autowired
|
|
|
@Qualifier("resultStaticKnowledgeServiceImpl")
|
|
|
private ResultStaticKnowledgeService resultStaticKnowledgeService;
|
|
@@ -99,14 +95,13 @@ public class ResultStaticKnowledgeFacade extends ResultStaticKnowledgeServiceImp
|
|
|
private ResultStaticInfoService resultStaticInfoService;
|
|
|
|
|
|
|
|
|
- */
|
|
|
-/**
|
|
|
+ /**
|
|
|
* 化验静态知识测试
|
|
|
*
|
|
|
* @param file
|
|
|
* @param testVO
|
|
|
* @return
|
|
|
- *//*
|
|
|
+ */
|
|
|
|
|
|
public Boolean lisTest(MultipartFile file, StaticKnowledgeTestVO testVO) {
|
|
|
RunningInfoVO runningInfoVO = new RunningInfoVO();
|
|
@@ -257,32 +252,35 @@ public class ResultStaticKnowledgeFacade extends ResultStaticKnowledgeServiceImp
|
|
|
result.setHasStaticKnowledge(1);
|
|
|
} else {
|
|
|
//查找上级静态知识是否存在
|
|
|
- List<LisName> lisNameList = lisNameRepository.findByNameIs(result.getName());
|
|
|
- if (ListUtil.isEmpty(lisNameList)) {
|
|
|
+ KlConcept lisSubName = klConceptFacade.getOne(new QueryWrapper<KlConcept>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("lib_name", result.getName())
|
|
|
+ .eq("lib_type", LexiconEnum.LisSubName.getKey()), false);
|
|
|
+ if (lisSubName == null) {
|
|
|
result.setHasStaticKnowledge(0);
|
|
|
result.setMessage(result.getMessage() + "缺少静态知识;");
|
|
|
} else {
|
|
|
- lisNameList.forEach(lisName -> {
|
|
|
- Boolean isExist = false;
|
|
|
- Set<LisNameLisSet> lisNameLisSetSet = lisName.getLisNamelissets();
|
|
|
- if (lisNameLisSetSet != null && lisNameLisSetSet.size() > 0) {
|
|
|
- List<String> lisPacks = lisNameLisSetSet.stream().map(i -> i.getLisSet()).collect(Collectors.toList())
|
|
|
- .stream().map(i -> i.getName()).sorted().collect(Collectors.toList());
|
|
|
- for (String lisPack : lisPacks) {
|
|
|
- if (lisPackStaticNames.contains(lisPack)) {
|
|
|
- isExist = true;
|
|
|
- result.setMessage(result.getMessage() + "取上级(" + lisPack + ")静态知识;");
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if (isExist) {
|
|
|
- result.setHasStaticKnowledge(1);
|
|
|
- } else {
|
|
|
+ List<KlRelation> relations = klRelationFacade.list(new QueryWrapper<KlRelation>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("end_id", lisSubName.getId())
|
|
|
+ .eq("relation_id", 600));
|
|
|
+ if (ListUtil.isNotEmpty(relations)) {
|
|
|
+ KlConceptStatic staticInfo = klConceptStaticFacade.getOne(new QueryWrapper<KlConceptStatic>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .in("concept_id", relations.stream().map(i -> i.getStartId()).collect(Collectors.toList()))
|
|
|
+ .eq("status", StatusEnum.Enable.getKey()), false);
|
|
|
+ if (staticInfo == null) {
|
|
|
result.setHasStaticKnowledge(0);
|
|
|
result.setMessage(result.getMessage() + "缺少静态知识;");
|
|
|
+ } else {
|
|
|
+ KlConcept lisName = klConceptFacade.getById(staticInfo.getConceptId());
|
|
|
+ result.setHasStaticKnowledge(1);
|
|
|
+ result.setMessage(result.getMessage() + "取上级(" + lisName.getLibName() + ")静态知识;");
|
|
|
}
|
|
|
- });
|
|
|
+ } else {
|
|
|
+ result.setHasStaticKnowledge(0);
|
|
|
+ result.setMessage(result.getMessage() + "缺少静态知识;");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -294,14 +292,14 @@ public class ResultStaticKnowledgeFacade extends ResultStaticKnowledgeServiceImp
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- */
|
|
|
-/**
|
|
|
+
|
|
|
+ /**
|
|
|
* 辅检静态知识测试
|
|
|
*
|
|
|
* @param file
|
|
|
* @param testVO
|
|
|
* @return
|
|
|
- *//*
|
|
|
+ */
|
|
|
|
|
|
public Boolean pacsTest(MultipartFile file, StaticKnowledgeTestVO testVO) {
|
|
|
RunningInfoVO runningInfoVO = new RunningInfoVO();
|
|
@@ -349,12 +347,11 @@ public class ResultStaticKnowledgeFacade extends ResultStaticKnowledgeServiceImp
|
|
|
}
|
|
|
|
|
|
//重复数据过滤
|
|
|
- */
|
|
|
-/*pacsConfigList = pacsConfigList
|
|
|
+ /*pacsConfigList = pacsConfigList
|
|
|
.stream()
|
|
|
.distinct()
|
|
|
- .collect(Collectors.toList());
|
|
|
-*//*
|
|
|
+ .collect(Collectors.toList());*/
|
|
|
+
|
|
|
|
|
|
// 已存在数据
|
|
|
Map<String, Map<String, List<Long>>> hisConfigMap = pacsConfigFacade.getConfigMap(Long.valueOf(hospitalId), null, null);
|
|
@@ -445,32 +442,35 @@ public class ResultStaticKnowledgeFacade extends ResultStaticKnowledgeServiceImp
|
|
|
result.setHasStaticKnowledge(1);
|
|
|
} else {
|
|
|
//查找上级静态知识是否存在
|
|
|
- List<PacsSubName> pacsSubNameList = pacsSubNameRepository.findByNameIs(result.getName());
|
|
|
- if (ListUtil.isEmpty(pacsSubNameList)) {
|
|
|
+ KlConcept pacsSubName = klConceptFacade.getOne(new QueryWrapper<KlConcept>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("lib_name", result.getName())
|
|
|
+ .eq("lib_type", LexiconEnum.PacsSubName.getKey()), false);
|
|
|
+ if (pacsSubName == null) {
|
|
|
result.setHasStaticKnowledge(0);
|
|
|
result.setMessage(result.getMessage() + "缺少静态知识;");
|
|
|
} else {
|
|
|
- pacsSubNameList.forEach(pacsSubName -> {
|
|
|
- Boolean isExist = false;
|
|
|
- Set<PacsNamePacsSubName> pacsNamePacsSubNameSet = pacsSubName.getPacsNamePacsSubNames();
|
|
|
- if (pacsNamePacsSubNameSet != null && pacsNamePacsSubNameSet.size() > 0) {
|
|
|
- List<String> pacsNames = pacsNamePacsSubNameSet.stream().map(i -> i.getPacsName()).collect(Collectors.toList())
|
|
|
- .stream().map(i -> i.getName()).sorted().collect(Collectors.toList());
|
|
|
- for (String pacsName : pacsNames) {
|
|
|
- if (pacsStaticNames.contains(pacsName)) {
|
|
|
- isExist = true;
|
|
|
- result.setMessage(result.getMessage() + "取上级(" + pacsName + ")静态知识;");
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if (isExist) {
|
|
|
- result.setHasStaticKnowledge(1);
|
|
|
- } else {
|
|
|
+ List<KlRelation> relations = klRelationFacade.list(new QueryWrapper<KlRelation>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("end_id", pacsSubName.getId())
|
|
|
+ .eq("relation_id", 600));
|
|
|
+ if (ListUtil.isNotEmpty(relations)) {
|
|
|
+ KlConceptStatic staticInfo = klConceptStaticFacade.getOne(new QueryWrapper<KlConceptStatic>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .in("concept_id", relations.stream().map(i -> i.getStartId()).collect(Collectors.toList()))
|
|
|
+ .eq("status", StatusEnum.Enable.getKey()), false);
|
|
|
+ if (staticInfo == null) {
|
|
|
result.setHasStaticKnowledge(0);
|
|
|
result.setMessage(result.getMessage() + "缺少静态知识;");
|
|
|
+ } else {
|
|
|
+ KlConcept pacsName = klConceptFacade.getById(staticInfo.getConceptId());
|
|
|
+ result.setHasStaticKnowledge(1);
|
|
|
+ result.setMessage(result.getMessage() + "取上级(" + pacsName.getLibName() + ")静态知识;");
|
|
|
}
|
|
|
- });
|
|
|
+ } else {
|
|
|
+ result.setHasStaticKnowledge(0);
|
|
|
+ result.setMessage(result.getMessage() + "缺少静态知识;");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -482,14 +482,14 @@ public class ResultStaticKnowledgeFacade extends ResultStaticKnowledgeServiceImp
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- */
|
|
|
-/**
|
|
|
+
|
|
|
+ /**
|
|
|
* 药品静态知识测试
|
|
|
*
|
|
|
* @param file
|
|
|
* @param testVO
|
|
|
* @return
|
|
|
- *//*
|
|
|
+ */
|
|
|
|
|
|
public Boolean drugTest(MultipartFile file, StaticKnowledgeTestVO testVO) {
|
|
|
RunningInfoVO runningInfoVO = new RunningInfoVO();
|
|
@@ -537,11 +537,10 @@ public class ResultStaticKnowledgeFacade extends ResultStaticKnowledgeServiceImp
|
|
|
}
|
|
|
|
|
|
//重复数据过滤
|
|
|
- */
|
|
|
-/*drugConfigList = drugConfigList
|
|
|
+ /*drugConfigList = drugConfigList
|
|
|
.stream()
|
|
|
.distinct()
|
|
|
- .collect(Collectors.toList());*//*
|
|
|
+ .collect(Collectors.toList());*/
|
|
|
|
|
|
|
|
|
// 已存在数据
|
|
@@ -639,14 +638,14 @@ public class ResultStaticKnowledgeFacade extends ResultStaticKnowledgeServiceImp
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- */
|
|
|
-/**
|
|
|
+
|
|
|
+ /**
|
|
|
* 诊断静态知识测试
|
|
|
*
|
|
|
* @param file
|
|
|
* @param testVO
|
|
|
* @return
|
|
|
- *//*
|
|
|
+ */
|
|
|
|
|
|
public Boolean diseaseTest(MultipartFile file, StaticKnowledgeTestVO testVO) {
|
|
|
RunningInfoVO runningInfoVO = new RunningInfoVO();
|
|
@@ -694,11 +693,10 @@ public class ResultStaticKnowledgeFacade extends ResultStaticKnowledgeServiceImp
|
|
|
}
|
|
|
|
|
|
//重复数据过滤
|
|
|
- */
|
|
|
-/*diseaseConfigList = diseaseConfigList
|
|
|
+ /*diseaseConfigList = diseaseConfigList
|
|
|
.stream()
|
|
|
.distinct()
|
|
|
- .collect(Collectors.toList());*//*
|
|
|
+ .collect(Collectors.toList());*/
|
|
|
|
|
|
|
|
|
// 已存在数据
|
|
@@ -796,14 +794,14 @@ public class ResultStaticKnowledgeFacade extends ResultStaticKnowledgeServiceImp
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- */
|
|
|
-/**
|
|
|
+
|
|
|
+ /**
|
|
|
* 手术/操作静态知识测试
|
|
|
*
|
|
|
* @param file
|
|
|
* @param testVO
|
|
|
* @return
|
|
|
- *//*
|
|
|
+ */
|
|
|
|
|
|
public Boolean operationTest(MultipartFile file, StaticKnowledgeTestVO testVO) {
|
|
|
RunningInfoVO runningInfoVO = new RunningInfoVO();
|
|
@@ -851,11 +849,10 @@ public class ResultStaticKnowledgeFacade extends ResultStaticKnowledgeServiceImp
|
|
|
}
|
|
|
|
|
|
//重复数据过滤
|
|
|
- */
|
|
|
-/*operationConfigList = operationConfigList
|
|
|
+ /* operationConfigList = operationConfigList
|
|
|
.stream()
|
|
|
.distinct()
|
|
|
- .collect(Collectors.toList());*//*
|
|
|
+ .collect(Collectors.toList());*/
|
|
|
|
|
|
|
|
|
// 已存在数据
|
|
@@ -953,14 +950,14 @@ public class ResultStaticKnowledgeFacade extends ResultStaticKnowledgeServiceImp
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- */
|
|
|
-/**
|
|
|
+
|
|
|
+ /**
|
|
|
* 保存静态知识测试结果
|
|
|
*
|
|
|
* @param list
|
|
|
* @param testVO
|
|
|
* @return
|
|
|
- *//*
|
|
|
+ */
|
|
|
|
|
|
@Transactional
|
|
|
public Boolean saveResult(List<ResultStaticKnowledge> list, StaticKnowledgeTestVO testVO, Integer totleNum) {
|
|
@@ -999,13 +996,13 @@ public class ResultStaticKnowledgeFacade extends ResultStaticKnowledgeServiceImp
|
|
|
|
|
|
//region --------------------------导出------------------------------
|
|
|
|
|
|
- */
|
|
|
-/**
|
|
|
+
|
|
|
+ /**
|
|
|
* 数据导出
|
|
|
*
|
|
|
* @param response
|
|
|
* @param resultStaticPageVO
|
|
|
- *//*
|
|
|
+ */
|
|
|
|
|
|
public void exportLisExcel(HttpServletResponse response, ResultStaticPageVO resultStaticPageVO) {
|
|
|
resultStaticPageVO.setSize(-1L);
|
|
@@ -1015,13 +1012,13 @@ public class ResultStaticKnowledgeFacade extends ResultStaticKnowledgeServiceImp
|
|
|
ExcelUtils.exportExcel(records, null, "sheet1", ExportLisTestDTO.class, fileName, response, 12.8f);
|
|
|
}
|
|
|
|
|
|
- */
|
|
|
-/**
|
|
|
+
|
|
|
+ /**
|
|
|
* 数据导出
|
|
|
*
|
|
|
* @param response
|
|
|
* @param resultStaticPageVO
|
|
|
- *//*
|
|
|
+ */
|
|
|
|
|
|
public void exportLisStaticExcel(HttpServletResponse response, ResultStaticPageVO resultStaticPageVO) {
|
|
|
resultStaticPageVO.setSize(-1L);
|
|
@@ -1031,13 +1028,13 @@ public class ResultStaticKnowledgeFacade extends ResultStaticKnowledgeServiceImp
|
|
|
ExcelUtils.exportExcel(records, null, "sheet1", ExportLisStaticTestDTO.class, fileName, response, 12.8f);
|
|
|
}
|
|
|
|
|
|
- */
|
|
|
-/**
|
|
|
+
|
|
|
+ /**
|
|
|
* 数据导出
|
|
|
*
|
|
|
* @param response
|
|
|
* @param resultStaticPageVO
|
|
|
- *//*
|
|
|
+ */
|
|
|
|
|
|
public void exportCommonExcel(HttpServletResponse response, ResultStaticPageVO resultStaticPageVO) {
|
|
|
resultStaticPageVO.setSize(-1L);
|
|
@@ -1047,13 +1044,13 @@ public class ResultStaticKnowledgeFacade extends ResultStaticKnowledgeServiceImp
|
|
|
ExcelUtils.exportExcel(records, null, "sheet1", ExportCommonTestDTO.class, fileName, response, 12.8f);
|
|
|
}
|
|
|
|
|
|
- */
|
|
|
-/**
|
|
|
+
|
|
|
+ /**
|
|
|
* 数据导出
|
|
|
*
|
|
|
* @param response
|
|
|
* @param resultStaticPageVO
|
|
|
- *//*
|
|
|
+ */
|
|
|
|
|
|
public void exportCommonStaticExcel(HttpServletResponse response, ResultStaticPageVO resultStaticPageVO) {
|
|
|
resultStaticPageVO.setSize(-1L);
|
|
@@ -1064,4 +1061,4 @@ public class ResultStaticKnowledgeFacade extends ResultStaticKnowledgeServiceImp
|
|
|
}
|
|
|
|
|
|
//endregion --------------------------导出------------------------------
|
|
|
-}*/
|
|
|
+}
|