|
@@ -14,6 +14,7 @@ import com.diagbot.enums.LexiconTypeEnum;
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
import com.diagbot.exception.CommonException;
|
|
import com.diagbot.exception.CommonException;
|
|
import com.diagbot.service.impl.ConceptServiceImpl;
|
|
import com.diagbot.service.impl.ConceptServiceImpl;
|
|
|
|
+import com.diagbot.util.ArrayUtil;
|
|
import com.diagbot.util.BeanUtil;
|
|
import com.diagbot.util.BeanUtil;
|
|
import com.diagbot.util.IntegerUtil;
|
|
import com.diagbot.util.IntegerUtil;
|
|
import com.diagbot.util.ListUtil;
|
|
import com.diagbot.util.ListUtil;
|
|
@@ -27,6 +28,7 @@ import com.diagbot.vo.ConceptUsualVO;
|
|
import com.diagbot.vo.ExistListByConceptIdsVO;
|
|
import com.diagbot.vo.ExistListByConceptIdsVO;
|
|
import com.diagbot.vo.GetStaticKnowledgeVO;
|
|
import com.diagbot.vo.GetStaticKnowledgeVO;
|
|
import com.diagbot.vo.RetrievalVO;
|
|
import com.diagbot.vo.RetrievalVO;
|
|
|
|
+import com.google.common.collect.Lists;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
@@ -115,16 +117,16 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "术语列表不能为空");
|
|
throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "术语列表不能为空");
|
|
}
|
|
}
|
|
|
|
|
|
- if (IntegerUtil.isNull(conceptFindVO.getAge())){
|
|
|
|
|
|
+ if (IntegerUtil.isNull(conceptFindVO.getAge())) {
|
|
throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "年龄不能为空");
|
|
throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "年龄不能为空");
|
|
}
|
|
}
|
|
|
|
|
|
- if (IntegerUtil.isNull(conceptFindVO.getSexType())){
|
|
|
|
|
|
+ if (IntegerUtil.isNull(conceptFindVO.getSexType())) {
|
|
throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "性别不能为空");
|
|
throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "性别不能为空");
|
|
}
|
|
}
|
|
|
|
|
|
//获取结构
|
|
//获取结构
|
|
- List<ConceptBaseDTO> concepts
|
|
|
|
|
|
+ List<ConceptBaseDTO> concepts
|
|
= this.getConceptConMap(conceptFindVO);
|
|
= this.getConceptConMap(conceptFindVO);
|
|
|
|
|
|
//出参封装
|
|
//出参封装
|
|
@@ -260,14 +262,14 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
* @param retrievalVO
|
|
* @param retrievalVO
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public List<ConceptRetrievalDTO> retrivelConceptInfo(RetrievalVO retrievalVO){
|
|
|
|
|
|
+ public List<ConceptRetrievalDTO> retrivelConceptInfo(RetrievalVO retrievalVO) {
|
|
Boolean bla = true;
|
|
Boolean bla = true;
|
|
- if (null != retrievalVO.getType()){
|
|
|
|
- if(retrievalVO.getType().intValue() == ConceptTypeEnum.Lis.getKey()){//如果是化验,添加化验子项类型
|
|
|
|
|
|
+ if (null != retrievalVO.getType()) {
|
|
|
|
+ if (retrievalVO.getType().intValue() == ConceptTypeEnum.Lis.getKey()) {//如果是化验,添加化验子项类型
|
|
retrievalVO.setDetilType(LexiconTypeEnum.LIS_DETAILS.getKey());
|
|
retrievalVO.setDetilType(LexiconTypeEnum.LIS_DETAILS.getKey());
|
|
bla = true;
|
|
bla = true;
|
|
- }else if(retrievalVO.getType().intValue() == ConceptTypeEnum.Past.getKey()
|
|
|
|
- || retrievalVO.getType().intValue() == ConceptTypeEnum.Other.getKey()){//如果是其他史设置其他史类型
|
|
|
|
|
|
+ } else if (retrievalVO.getType().intValue() == ConceptTypeEnum.Past.getKey()
|
|
|
|
+ || retrievalVO.getType().intValue() == ConceptTypeEnum.Other.getKey()) {//如果是其他史设置其他史类型
|
|
List<Integer> typeList = new ArrayList<>();
|
|
List<Integer> typeList = new ArrayList<>();
|
|
typeList.add(LexiconTypeEnum.HISTORY_OF_PAST_DISEASES.getKey());
|
|
typeList.add(LexiconTypeEnum.HISTORY_OF_PAST_DISEASES.getKey());
|
|
typeList.add(LexiconTypeEnum.HISTORY_OF_TRAUMA.getKey());
|
|
typeList.add(LexiconTypeEnum.HISTORY_OF_TRAUMA.getKey());
|
|
@@ -285,17 +287,23 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
retrievalVO.setOtherType(typeList);
|
|
retrievalVO.setOtherType(typeList);
|
|
bla = false;
|
|
bla = false;
|
|
}
|
|
}
|
|
- if(bla){
|
|
|
|
|
|
+ if (bla) {
|
|
retrievalVO.setType(ParamConvertUtil.conceptConvert2Lib(retrievalVO.getType()));
|
|
retrievalVO.setType(ParamConvertUtil.conceptConvert2Lib(retrievalVO.getType()));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- List<ConceptRetrievalDTO> conceptRetrievalDTOS = this.retrievalConcept(retrievalVO);
|
|
|
|
|
|
+ List<ConceptRetrievalDTO> conceptRetrievalDTOS = Lists.newArrayList();;
|
|
|
|
+ if (retrievalVO.getIsStatic().equals(1)) {
|
|
|
|
+ conceptRetrievalDTOS = this.staticKnowledge(retrievalVO);
|
|
|
|
+ } else {
|
|
|
|
+ conceptRetrievalDTOS = this.retrievalConcept(retrievalVO);
|
|
|
|
+ }
|
|
|
|
+
|
|
List<ConceptRetrievalDTO> res = new ArrayList<>();
|
|
List<ConceptRetrievalDTO> res = new ArrayList<>();
|
|
List<Long> selfList = new ArrayList<>(); // 本体
|
|
List<Long> selfList = new ArrayList<>(); // 本体
|
|
List<Long> subList = new ArrayList<>(); // 子项
|
|
List<Long> subList = new ArrayList<>(); // 子项
|
|
List<String> conceptNameList = new ArrayList<>();//名称结果集保证数据唯一
|
|
List<String> conceptNameList = new ArrayList<>();//名称结果集保证数据唯一
|
|
for (ConceptRetrievalDTO bean : conceptRetrievalDTOS) {
|
|
for (ConceptRetrievalDTO bean : conceptRetrievalDTOS) {
|
|
- if(StringUtil.isNotEmpty(bean.getParentName())) { // 重置showType
|
|
|
|
|
|
+ if (StringUtil.isNotEmpty(bean.getParentName())) { // 重置showType
|
|
bean.setShowType(2L);
|
|
bean.setShowType(2L);
|
|
}
|
|
}
|
|
if (bean.getShowType().intValue() == 1) { // 本体
|
|
if (bean.getShowType().intValue() == 1) { // 本体
|
|
@@ -306,17 +314,17 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
}
|
|
}
|
|
// 有本体,过滤同义词和子项;无本体,有子项,过滤同义词
|
|
// 有本体,过滤同义词和子项;无本体,有子项,过滤同义词
|
|
for (ConceptRetrievalDTO bean : conceptRetrievalDTOS) {
|
|
for (ConceptRetrievalDTO bean : conceptRetrievalDTOS) {
|
|
- if(bean.getShowType().intValue() == 1) {
|
|
|
|
|
|
+ if (bean.getShowType().intValue() == 1) {
|
|
res.add(bean);
|
|
res.add(bean);
|
|
} else if (bean.getShowType().intValue() == 2) {
|
|
} else if (bean.getShowType().intValue() == 2) {
|
|
- if(!selfList.contains(bean.getParentId()) && !conceptNameList.contains(bean.getParentName()) && retrievalVO.getIsSonShow().intValue() == 0) {
|
|
|
|
|
|
+ if (!selfList.contains(bean.getParentId()) && !conceptNameList.contains(bean.getParentName()) && retrievalVO.getIsSonShow().intValue() == 0) {
|
|
conceptNameList.add(bean.getParentName());
|
|
conceptNameList.add(bean.getParentName());
|
|
res.add(bean);
|
|
res.add(bean);
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
res.add(bean);
|
|
res.add(bean);
|
|
}
|
|
}
|
|
} else if (bean.getShowType().intValue() == 0) {
|
|
} else if (bean.getShowType().intValue() == 0) {
|
|
- if(!selfList.contains(bean.getSelfId()) && !subList.contains(bean.getSelfId()) && !conceptNameList.contains(bean.getSelfName())) {
|
|
|
|
|
|
+ if (!selfList.contains(bean.getSelfId()) && !subList.contains(bean.getSelfId()) && !conceptNameList.contains(bean.getSelfName())) {
|
|
conceptNameList.add(bean.getSelfName());
|
|
conceptNameList.add(bean.getSelfName());
|
|
res.add(bean);
|
|
res.add(bean);
|
|
}
|
|
}
|
|
@@ -324,7 +332,7 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
}
|
|
}
|
|
//把本体的sameName过滤掉
|
|
//把本体的sameName过滤掉
|
|
for (ConceptRetrievalDTO conceptRetrievalDTO : res) {
|
|
for (ConceptRetrievalDTO conceptRetrievalDTO : res) {
|
|
- if(conceptRetrievalDTO.getSameName() != null && conceptRetrievalDTO.getSameName().equals(conceptRetrievalDTO.getSelfName())){
|
|
|
|
|
|
+ if (conceptRetrievalDTO.getSameName() != null && conceptRetrievalDTO.getSameName().equals(conceptRetrievalDTO.getSelfName())) {
|
|
conceptRetrievalDTO.setSameName(null);
|
|
conceptRetrievalDTO.setSameName(null);
|
|
}
|
|
}
|
|
conceptRetrievalDTO.setType(ParamConvertUtil.libConvert2Concept(conceptRetrievalDTO.getLibTypeId().intValue()));
|
|
conceptRetrievalDTO.setType(ParamConvertUtil.libConvert2Concept(conceptRetrievalDTO.getLibTypeId().intValue()));
|
|
@@ -339,11 +347,11 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
* @param getStaticKnowledgeVO
|
|
* @param getStaticKnowledgeVO
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public List<RetrievalDTO> getStaticKnowledge(GetStaticKnowledgeVO getStaticKnowledgeVO){
|
|
|
|
|
|
+ public List<RetrievalDTO> getStaticKnowledge(GetStaticKnowledgeVO getStaticKnowledgeVO) {
|
|
List<RetrievalDTO> retrievalDTOS = new ArrayList<>();
|
|
List<RetrievalDTO> retrievalDTOS = new ArrayList<>();
|
|
RetrievalVO retrievalVO = new RetrievalVO();
|
|
RetrievalVO retrievalVO = new RetrievalVO();
|
|
RetrievalDTO retrievalDTO = new RetrievalDTO();
|
|
RetrievalDTO retrievalDTO = new RetrievalDTO();
|
|
- BeanUtil.copyProperties(getStaticKnowledgeVO,retrievalVO);
|
|
|
|
|
|
+ BeanUtil.copyProperties(getStaticKnowledgeVO, retrievalVO);
|
|
retrievalVO.setIsSonShow(1);
|
|
retrievalVO.setIsSonShow(1);
|
|
retrievalVO.setIsStatic(1);
|
|
retrievalVO.setIsStatic(1);
|
|
List<Integer> types = new ArrayList<>();
|
|
List<Integer> types = new ArrayList<>();
|
|
@@ -365,7 +373,7 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
retrievalDTO = new RetrievalDTO();
|
|
retrievalDTO = new RetrievalDTO();
|
|
retrievalDTO.setConceptId(conceptRetrievalDTO.getSelfId());
|
|
retrievalDTO.setConceptId(conceptRetrievalDTO.getSelfId());
|
|
retrievalDTO.setName(conceptRetrievalDTO.getSelfName());
|
|
retrievalDTO.setName(conceptRetrievalDTO.getSelfName());
|
|
- if(StringUtil.isEmpty(conceptRetrievalDTO.getParentName()) && conceptRetrievalDTO.getLibTypeId().intValue() == LexiconTypeEnum.LIS_PACKAGE.getKey()){
|
|
|
|
|
|
+ if (StringUtil.isEmpty(conceptRetrievalDTO.getParentName()) && conceptRetrievalDTO.getLibTypeId().intValue() == LexiconTypeEnum.LIS_PACKAGE.getKey()) {
|
|
retrievalDTO.setUniqueName(conceptRetrievalDTO.getSelfName());
|
|
retrievalDTO.setUniqueName(conceptRetrievalDTO.getSelfName());
|
|
uniqueNameList.add(conceptRetrievalDTO.getSelfName());
|
|
uniqueNameList.add(conceptRetrievalDTO.getSelfName());
|
|
}
|
|
}
|
|
@@ -373,10 +381,10 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
retrievalDTO.setConceptId(conceptRetrievalDTO.getParentId());
|
|
retrievalDTO.setConceptId(conceptRetrievalDTO.getParentId());
|
|
retrievalDTO.setName(conceptRetrievalDTO.getParentName());
|
|
retrievalDTO.setName(conceptRetrievalDTO.getParentName());
|
|
retrievalDTO.setRetrievalName(conceptRetrievalDTO.getSelfName());
|
|
retrievalDTO.setRetrievalName(conceptRetrievalDTO.getSelfName());
|
|
- if(StringUtil.isNotEmpty(conceptRetrievalDTO.getSelfName())){//如果selfName不为空是:大项(小项)组合
|
|
|
|
- retrievalDTO.setUniqueName(conceptRetrievalDTO.getParentName()+"--"+conceptRetrievalDTO.getSelfName());
|
|
|
|
- uniqueNameList.add(conceptRetrievalDTO.getParentName()+"--"+conceptRetrievalDTO.getSelfName());
|
|
|
|
- }else {//如果selfName为空是:子项推出大项
|
|
|
|
|
|
+ if (StringUtil.isNotEmpty(conceptRetrievalDTO.getSelfName())) {//如果selfName不为空是:大项(小项)组合
|
|
|
|
+ retrievalDTO.setUniqueName(conceptRetrievalDTO.getParentName() + "--" + conceptRetrievalDTO.getSelfName());
|
|
|
|
+ uniqueNameList.add(conceptRetrievalDTO.getParentName() + "--" + conceptRetrievalDTO.getSelfName());
|
|
|
|
+ } else {//如果selfName为空是:子项推出大项
|
|
retrievalDTO.setUniqueName(conceptRetrievalDTO.getParentName());
|
|
retrievalDTO.setUniqueName(conceptRetrievalDTO.getParentName());
|
|
uniqueNameList.add(conceptRetrievalDTO.getParentName());
|
|
uniqueNameList.add(conceptRetrievalDTO.getParentName());
|
|
}
|
|
}
|
|
@@ -393,11 +401,11 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
List<Concept> conceptDetilList = new ArrayList<>();//化验公表项
|
|
List<Concept> conceptDetilList = new ArrayList<>();//化验公表项
|
|
- if(ListUtil.isNotEmpty(uniqueNameList)){//如果有化验公表项,获取化验公表项id
|
|
|
|
|
|
+ if (ListUtil.isNotEmpty(uniqueNameList)) {//如果有化验公表项,获取化验公表项id
|
|
QueryWrapper<Concept> conceptQueryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<Concept> conceptQueryWrapper = new QueryWrapper<>();
|
|
- conceptQueryWrapper.eq("is_deleted",IsDeleteEnum.N.getKey())
|
|
|
|
- .eq("lib_type",LexiconTypeEnum.LIS_TABLES.getKey())
|
|
|
|
- .in("lib_name",uniqueNameList);
|
|
|
|
|
|
+ conceptQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("lib_type", LexiconTypeEnum.LIS_TABLES.getKey())
|
|
|
|
+ .in("lib_name", uniqueNameList);
|
|
conceptDetilList = this.list(conceptQueryWrapper);
|
|
conceptDetilList = this.list(conceptQueryWrapper);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -405,7 +413,7 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
List<Long> cenceptIdList = retrievalDTOS.stream().map(RetrievalDTO::getConceptId).collect(Collectors.toList());
|
|
List<Long> cenceptIdList = retrievalDTOS.stream().map(RetrievalDTO::getConceptId).collect(Collectors.toList());
|
|
for (RetrievalDTO retrievalDTO1 : retrievalDTOS) {
|
|
for (RetrievalDTO retrievalDTO1 : retrievalDTOS) {
|
|
for (Concept concept : conceptDetilList) {
|
|
for (Concept concept : conceptDetilList) {
|
|
- if(StringUtil.isNotEmpty(retrievalDTO1.getUniqueName()) && retrievalDTO1.getUniqueName().equals(concept.getLibName())){//添加公表项id
|
|
|
|
|
|
+ if (StringUtil.isNotEmpty(retrievalDTO1.getUniqueName()) && retrievalDTO1.getUniqueName().equals(concept.getLibName())) {//添加公表项id
|
|
retrievalDTO1.setUniqueId(concept.getId());
|
|
retrievalDTO1.setUniqueId(concept.getId());
|
|
cenceptIdList.add(concept.getId());
|
|
cenceptIdList.add(concept.getId());
|
|
}
|
|
}
|
|
@@ -414,21 +422,21 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
ExistListByConceptIdsVO existListByConceptIdsVO = new ExistListByConceptIdsVO();
|
|
ExistListByConceptIdsVO existListByConceptIdsVO = new ExistListByConceptIdsVO();
|
|
existListByConceptIdsVO.setConceptIds(cenceptIdList);
|
|
existListByConceptIdsVO.setConceptIds(cenceptIdList);
|
|
List<Long> existConceptIdList = conceptDetailFacade.existListByConceptIds(existListByConceptIdsVO);
|
|
List<Long> existConceptIdList = conceptDetailFacade.existListByConceptIds(existListByConceptIdsVO);
|
|
- if(ListUtil.isNotEmpty(existConceptIdList)){
|
|
|
|
|
|
+ if (ListUtil.isNotEmpty(existConceptIdList)) {
|
|
for (RetrievalDTO retrievalDTOInfo : retrievalDTOS) {
|
|
for (RetrievalDTO retrievalDTOInfo : retrievalDTOS) {
|
|
- if(StringUtil.isNotEmpty(retrievalDTOInfo.getUniqueName())){
|
|
|
|
|
|
+ if (StringUtil.isNotEmpty(retrievalDTOInfo.getUniqueName())) {
|
|
for (Long concept : existConceptIdList) {
|
|
for (Long concept : existConceptIdList) {
|
|
- if (null != retrievalDTOInfo.getUniqueId() && retrievalDTOInfo.getUniqueId().intValue() == concept.intValue()){//如果是化验时返回化验公表项
|
|
|
|
|
|
+ if (null != retrievalDTOInfo.getUniqueId() && retrievalDTOInfo.getUniqueId().intValue() == concept.intValue()) {//如果是化验时返回化验公表项
|
|
retrievalDTO = new RetrievalDTO();
|
|
retrievalDTO = new RetrievalDTO();
|
|
- BeanUtil.copyProperties(retrievalDTOInfo,retrievalDTO);
|
|
|
|
|
|
+ BeanUtil.copyProperties(retrievalDTOInfo, retrievalDTO);
|
|
staticRetrievalList.add(retrievalDTO);
|
|
staticRetrievalList.add(retrievalDTO);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
for (Long concept : existConceptIdList) {
|
|
for (Long concept : existConceptIdList) {
|
|
- if (retrievalDTOInfo.getConceptId().intValue() == concept.intValue()){
|
|
|
|
|
|
+ if (retrievalDTOInfo.getConceptId().intValue() == concept.intValue()) {
|
|
retrievalDTO = new RetrievalDTO();
|
|
retrievalDTO = new RetrievalDTO();
|
|
- BeanUtil.copyProperties(retrievalDTOInfo,retrievalDTO);
|
|
|
|
|
|
+ BeanUtil.copyProperties(retrievalDTOInfo, retrievalDTO);
|
|
staticRetrievalList.add(retrievalDTO);
|
|
staticRetrievalList.add(retrievalDTO);
|
|
}
|
|
}
|
|
}
|
|
}
|