|
@@ -5,6 +5,7 @@ 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.*;
|
|
|
+import com.diagbot.entity.KlConceptCommon;
|
|
|
import com.diagbot.entity.KlDiagHospital;
|
|
|
import com.diagbot.entity.KlDisease;
|
|
|
import com.diagbot.entity.KlDrug;
|
|
@@ -70,6 +71,9 @@ public class OtherTipProcess {
|
|
|
@Autowired
|
|
|
private KlDiseaseFacade klDiseaseFacade;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private KlConceptCommonFacade klConceptCommonFacade;
|
|
|
+
|
|
|
private static final List<String> professionalTitles = Arrays.asList("医师","主治医师","副主任医师","主任医师");
|
|
|
|
|
|
|
|
@@ -449,6 +453,55 @@ 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.searchCollectionConceptFacNew(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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
private static void specialDrugTip(Map<Integer, List<KlDrug>> drugGradeListMap, Map<Long, String> drugConceptIdNameMap, Map<String, String> drugNameMap, List<BillMsg> otherList) {
|
|
|
List<Long> specialConceptIds = drugGradeListMap.get(2).stream().map(KlDrug::getConceptId).collect(Collectors.toList());
|
|
|
List<String> specialUniqueNames = specialConceptIds.stream().map(drugConceptIdNameMap::get).collect(Collectors.toList());
|