|
@@ -3,17 +3,15 @@ package com.diagbot.process;
|
|
|
import com.diagbot.biz.push.entity.Item;
|
|
|
import com.diagbot.biz.push.entity.Lis;
|
|
|
import com.diagbot.biz.push.entity.Scale;
|
|
|
-import com.diagbot.dto.BillMsg;
|
|
|
-import com.diagbot.dto.IndicationDTO;
|
|
|
-import com.diagbot.dto.RuleBaseDTO;
|
|
|
-import com.diagbot.dto.RuleConditionDTO;
|
|
|
-import com.diagbot.dto.RuleExtDTO;
|
|
|
-import com.diagbot.dto.WordCrfDTO;
|
|
|
+import com.diagbot.dto.*;
|
|
|
+import com.diagbot.entity.KlConceptCommon;
|
|
|
import com.diagbot.enums.LexiconEnum;
|
|
|
import com.diagbot.enums.RedisEnum;
|
|
|
import com.diagbot.enums.RuleTypeEnum;
|
|
|
import com.diagbot.enums.TypeEnum;
|
|
|
import com.diagbot.facade.CommonFacade;
|
|
|
+import com.diagbot.facade.KlConceptCommonFacade;
|
|
|
+import com.diagbot.facade.KlConceptFacade;
|
|
|
import com.diagbot.model.entity.PacsNum;
|
|
|
import com.diagbot.model.label.PacsLabel;
|
|
|
import com.diagbot.rule.AgeRule;
|
|
@@ -30,12 +28,16 @@ import com.diagbot.util.ReflectUtil;
|
|
|
import com.diagbot.util.StringUtil;
|
|
|
import com.diagbot.vo.ItemExt;
|
|
|
import com.diagbot.vo.RuleVO;
|
|
|
+import com.diagbot.vo.SearchCollectionConceptVO;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.Objects;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @Description: 其他提示总入口
|
|
@@ -60,6 +62,11 @@ public class OtherTipProcess {
|
|
|
@Autowired
|
|
|
AgeRule ageRule;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ KlConceptFacade klConceptFacade;
|
|
|
+ @Autowired
|
|
|
+ KlConceptCommonFacade klConceptCommonFacade;
|
|
|
+
|
|
|
/**
|
|
|
* 处理业务——化验
|
|
|
*
|
|
@@ -87,6 +94,62 @@ public class OtherTipProcess {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 处理业务——诊断性别和年龄合理性校验
|
|
|
+ *
|
|
|
+ * @param wordCrfDTO
|
|
|
+ * @param res
|
|
|
+ */
|
|
|
+ public void processDiagnosticCheckGender(WordCrfDTO wordCrfDTO, IndicationDTO res) {
|
|
|
+ List<BillMsg> otherList = res.getOtherList();
|
|
|
+ // 诊断
|
|
|
+ List<Item> diagItems = wordCrfDTO.getDiag();
|
|
|
+ if (ListUtil.isEmpty(diagItems)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, String> diagNameMap = diagItems.stream().collect(Collectors.toMap(Item::getUniqueName, Item::getName));
|
|
|
+
|
|
|
+ List<String> uniqueNames = diagItems.stream().map(Item::getUniqueName).collect(Collectors.toList());
|
|
|
+
|
|
|
+ SearchCollectionConceptVO searchCollectionConceptVO = new SearchCollectionConceptVO();
|
|
|
+ searchCollectionConceptVO.setNames(uniqueNames);
|
|
|
+ List<GetAllForRelationDTO> getAllForRelationDTOS = klConceptFacade.searchCollectionConceptNew(searchCollectionConceptVO);
|
|
|
+
|
|
|
+ if (ListUtil.isEmpty(getAllForRelationDTOS)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<Long,String> diagConceptIdNameMap = getAllForRelationDTOS.stream()
|
|
|
+ .collect(Collectors.toMap(GetAllForRelationDTO::getConceptId ,GetAllForRelationDTO::getConceptName));
|
|
|
+
|
|
|
+ List<Long> conceptIds = getAllForRelationDTOS.stream().map(GetAllForRelationDTO::getConceptId).collect(Collectors.toList());
|
|
|
+
|
|
|
+
|
|
|
+ List<KlConceptCommon> conceptCommons = klConceptCommonFacade.getKlConceptCommonByConceptIdsNew(conceptIds);
|
|
|
+
|
|
|
+ if (ListUtil.isEmpty(conceptCommons)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (KlConceptCommon klConceptCommon : conceptCommons) {
|
|
|
+ if (klConceptCommon.getSexType() != 3 && !Objects.equals(klConceptCommon.getSexType(), wordCrfDTO.getSex())) {
|
|
|
+ String diagName = diagNameMap.get(diagConceptIdNameMap.get(klConceptCommon.getConceptId()));
|
|
|
+ String msg = diagName + "是" + (klConceptCommon.getSexType() == 1 ? "男" : "女") + "性诊断,与当前性别不符";
|
|
|
+ BillMsg billMsg = MsgUtil.getCommonOtherMsg(TypeEnum.other.getName(), msg, null, null, null);
|
|
|
+ CoreUtil.addBeanToList(otherList, billMsg);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (wordCrfDTO.getAgeNum() < klConceptCommon.getMinAge() || wordCrfDTO.getAgeNum() > klConceptCommon.getMaxAge()) {
|
|
|
+ String diagName = diagNameMap.get(diagConceptIdNameMap.get(klConceptCommon.getConceptId()));
|
|
|
+ String msg = "患者年龄是" + wordCrfDTO.getAge() + "," + diagName + "与年龄不符";
|
|
|
+ BillMsg billMsg = MsgUtil.getCommonOtherMsg(TypeEnum.other.getName(), msg, null, null, null);
|
|
|
+ CoreUtil.addBeanToList(otherList, billMsg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 处理业务——辅检
|
|
|
*
|