|
|
@ -40,6 +40,8 @@ public class MedicalRecManageServiceImpl implements MedicalRecManageService {
|
|
|
|
|
|
|
|
|
|
|
|
private final CommonDicService commonDicService;
|
|
|
|
private final CommonDicService commonDicService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final DiseaseQuestionService diseaseQuestionService;
|
|
|
|
|
|
|
|
|
|
|
|
public List<Disease> queryDiseaseListByKeyWord(String keyword) {
|
|
|
|
public List<Disease> queryDiseaseListByKeyWord(String keyword) {
|
|
|
|
// 注意,这里不支持查询复杂疾病,如果需要支持复杂疾病,这里需要单独进行改造
|
|
|
|
// 注意,这里不支持查询复杂疾病,如果需要支持复杂疾病,这里需要单独进行改造
|
|
|
|
return diseaseService.lambdaQuery().eq(Disease::getDiseaseType, 0).like(Disease::getDiseaseName, keyword).list();
|
|
|
|
return diseaseService.lambdaQuery().eq(Disease::getDiseaseType, 0).like(Disease::getDiseaseName, keyword).list();
|
|
|
@ -80,6 +82,40 @@ public class MedicalRecManageServiceImpl implements MedicalRecManageService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public List<MedicalRecQaVO> queryQuestionListByCreat(String diseaseId) {
|
|
|
|
|
|
|
|
// 去vp_disease_question获取
|
|
|
|
|
|
|
|
List<DiseaseQuestion> list = diseaseQuestionService.lambdaQuery().eq(DiseaseQuestion::getDiseaseId, diseaseId).list();
|
|
|
|
|
|
|
|
if (CollUtil.isEmpty(list)){
|
|
|
|
|
|
|
|
return new ArrayList<>();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// 获取问题
|
|
|
|
|
|
|
|
Set<String> libraryQuestionIdSet = list.stream().map(DiseaseQuestion::getQuestionId).collect(Collectors.toSet());
|
|
|
|
|
|
|
|
List<AskTemplateQuestionLibrary> askTemplateQuestionLibraryList = askTemplateQuestionLibraryService.listByIds(libraryQuestionIdSet);
|
|
|
|
|
|
|
|
Map<String, AskTemplateQuestionLibrary> askQuestionMap = askTemplateQuestionLibraryList.stream().collect(Collectors.toMap(AskTemplateQuestionLibrary::getId, Function.identity()));
|
|
|
|
|
|
|
|
// 获取字典
|
|
|
|
|
|
|
|
Set<Long> dictIdSet = askTemplateQuestionLibraryList.stream().map(AskTemplateQuestionLibrary::getDictId).collect(Collectors.toSet());
|
|
|
|
|
|
|
|
Map<Long, CommonDic> dictMap = commonDicService.listByIds(dictIdSet).stream().collect(Collectors.toMap(CommonDic::getId, Function.identity()));
|
|
|
|
|
|
|
|
List<MedicalRecQaVO> result = new ArrayList<>();
|
|
|
|
|
|
|
|
for (DiseaseQuestion diseaseQuestion : list) {
|
|
|
|
|
|
|
|
AskTemplateQuestionLibrary questionLibrary = askQuestionMap.get(diseaseQuestion.getQuestionId());
|
|
|
|
|
|
|
|
if (ObjectUtil.isNotEmpty(questionLibrary)) {
|
|
|
|
|
|
|
|
MedicalRecQaVO medicalRecQaVO = new MedicalRecQaVO();
|
|
|
|
|
|
|
|
medicalRecQaVO.setLibraryQuestionId(diseaseQuestion.getQuestionId());
|
|
|
|
|
|
|
|
// 问题
|
|
|
|
|
|
|
|
medicalRecQaVO.setQuestionList(questionLibrary.getQuestion());
|
|
|
|
|
|
|
|
// 类目
|
|
|
|
|
|
|
|
medicalRecQaVO.setDictId(questionLibrary.getDictId());
|
|
|
|
|
|
|
|
// 类目名称
|
|
|
|
|
|
|
|
medicalRecQaVO.setDictNamePath(dictMap.getOrDefault(questionLibrary.getDictId(), new CommonDic()).getNameZhPath());
|
|
|
|
|
|
|
|
// 默认回答
|
|
|
|
|
|
|
|
medicalRecQaVO.setDefaultAnswer(CollUtil.getFirst(questionLibrary.getDefaultAnswer()));
|
|
|
|
|
|
|
|
result.add(medicalRecQaVO);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void modifyMedicalRec(MedicalRecManageVO reqVO) {
|
|
|
|
public void modifyMedicalRec(MedicalRecManageVO reqVO) {
|
|
|
|
// 首先修改病人
|
|
|
|
// 首先修改病人
|
|
|
@ -168,7 +204,7 @@ public class MedicalRecManageServiceImpl implements MedicalRecManageService {
|
|
|
|
// 类目
|
|
|
|
// 类目
|
|
|
|
medicalRecQaVO.setDictId(questionLibrary.getDictId());
|
|
|
|
medicalRecQaVO.setDictId(questionLibrary.getDictId());
|
|
|
|
// 类目名称
|
|
|
|
// 类目名称
|
|
|
|
medicalRecQaVO.setDictName(dictMap.getOrDefault(questionLibrary.getDictId(), new CommonDic()).getNameZhPath());
|
|
|
|
medicalRecQaVO.setDictNamePath(dictMap.getOrDefault(questionLibrary.getDictId(), new CommonDic()).getNameZhPath());
|
|
|
|
// 默认回答
|
|
|
|
// 默认回答
|
|
|
|
medicalRecQaVO.setDefaultAnswer(CollUtil.getFirst(questionLibrary.getDefaultAnswer()));
|
|
|
|
medicalRecQaVO.setDefaultAnswer(CollUtil.getFirst(questionLibrary.getDefaultAnswer()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|