|
|
|
@ -58,8 +58,8 @@ public class DiagnoseHallServiceImpl implements DiagnoseHallService {
|
|
|
|
|
|
|
|
|
|
// 3.把疾病名填充到诊断列表中
|
|
|
|
|
List<String> medicalRecIds = records.stream().map(DiagnoseProcessResVo::getMedicalRecId).filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
|
|
Map<String, AskPatientAnswer> askPatientAnswerMap = queryAskPatientSilentVideoAnswer(medicalRecIds);
|
|
|
|
|
Map<String, AskPatientAnswer> dynamicAskPatientAnswerMap = queryAskPatientDynamicVideoAnswer(medicalRecIds);
|
|
|
|
|
Map<String, AskPatientAnswer> askPatientAnswerMap = queryAskPatientSystemVideoAnswer(medicalRecIds,"system_silent");
|
|
|
|
|
Map<String, AskPatientAnswer> dynamicAskPatientAnswerMap = queryAskPatientSystemVideoAnswer(medicalRecIds,"system_dynamic");
|
|
|
|
|
diagnoseProcessResVoPage.getRecords().forEach(vo->{
|
|
|
|
|
List<DiagnosisPrimaryVO> list = diagnosisPrimaryVOsMap.getOrDefault(vo.getProcessId(),new ArrayList<>());
|
|
|
|
|
vo.setPrimaryDiseaseNameList(list.stream().map(DiagnosisPrimaryVO::getPrimaryDiseaseName).distinct().collect(Collectors.toList()));
|
|
|
|
@ -80,57 +80,29 @@ public class DiagnoseHallServiceImpl implements DiagnoseHallService {
|
|
|
|
|
return medicalRecPageResVOIPage;
|
|
|
|
|
}
|
|
|
|
|
List<String> medicalRecIds = medicalRecPageResVOIPage.getRecords().stream().map(MedicalRecPageResVO::getMedicalId).collect(Collectors.toList());
|
|
|
|
|
Map<String, AskPatientAnswer> askPatientAnswerMap = queryAskPatientSilentVideoAnswer(medicalRecIds);
|
|
|
|
|
Map<String, AskPatientAnswer> askPatientAnswerMap = queryAskPatientSystemVideoAnswer(medicalRecIds,"system_silent");
|
|
|
|
|
medicalRecPageResVOIPage.getRecords().forEach(vo->{
|
|
|
|
|
vo.setPatientSilentVideo(askPatientAnswerMap.getOrDefault(vo.getMedicalId(),new AskPatientAnswer()).getAnswerResourceId());
|
|
|
|
|
});
|
|
|
|
|
return medicalRecPageResVOIPage;
|
|
|
|
|
}
|
|
|
|
|
private Map<String,AskPatientAnswer> queryAskPatientSystemVideoAnswer(List<String> medicalRecIds,String code){
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 疾病静默视频信息
|
|
|
|
|
* @param medicalRecIds
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
private Map<String,AskPatientAnswer> queryAskPatientSilentVideoAnswer(List<String> medicalRecIds){
|
|
|
|
|
|
|
|
|
|
if (CollUtil.isEmpty(medicalRecIds)){
|
|
|
|
|
return new HashMap<>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CommonDic one = commonDicService.lambdaQuery().eq(CommonDic::getGroupCode, "AQT").eq(CommonDic::getCode, "system_silent").one();
|
|
|
|
|
Assert.notNull(one,"字典项目未配置");
|
|
|
|
|
|
|
|
|
|
AskTemplateQuestionLibrary silentInfo = askTemplateQuestionLibraryService.lambdaQuery()
|
|
|
|
|
.eq(AskTemplateQuestionLibrary::getDictId, one.getId()).eq(AskTemplateQuestionLibrary::getDictId, one.getId()).one();
|
|
|
|
|
Assert.notNull(silentInfo,"静默视频未配置");
|
|
|
|
|
|
|
|
|
|
List<AskPatientAnswer> askPatientAnswerList = askPatientAnswerService.lambdaQuery()
|
|
|
|
|
.in(AskPatientAnswer::getMedicalId, medicalRecIds)
|
|
|
|
|
.eq(AskPatientAnswer::getLibraryQuestionId, silentInfo.getId()).list();
|
|
|
|
|
if (CollUtil.isEmpty(askPatientAnswerList)){
|
|
|
|
|
return new HashMap<>();
|
|
|
|
|
}
|
|
|
|
|
return askPatientAnswerList.stream().collect(Collectors.toMap(AskPatientAnswer::getMedicalId, o -> o));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Map<String,AskPatientAnswer> queryAskPatientDynamicVideoAnswer(List<String> medicalRecIds){
|
|
|
|
|
|
|
|
|
|
Assert.notEmpty(code,"code不允许为空");
|
|
|
|
|
if (CollUtil.isEmpty(medicalRecIds)){
|
|
|
|
|
return new HashMap<>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CommonDic one = commonDicService.lambdaQuery().eq(CommonDic::getGroupCode, "AQT").eq(CommonDic::getCode, "system_dynamic").one();
|
|
|
|
|
CommonDic one = commonDicService.lambdaQuery().eq(CommonDic::getGroupCode, "AQT").eq(CommonDic::getCode, code).one();
|
|
|
|
|
Assert.notNull(one,"字典项目未配置");
|
|
|
|
|
|
|
|
|
|
AskTemplateQuestionLibrary silentInfo = askTemplateQuestionLibraryService.lambdaQuery()
|
|
|
|
|
AskTemplateQuestionLibrary questionLibrary = askTemplateQuestionLibraryService.lambdaQuery()
|
|
|
|
|
.eq(AskTemplateQuestionLibrary::getDictId, one.getId()).eq(AskTemplateQuestionLibrary::getDictId, one.getId()).one();
|
|
|
|
|
Assert.notNull(silentInfo,"静默视频未配置");
|
|
|
|
|
Assert.notNull(questionLibrary,code+"对应的问题库未配置");
|
|
|
|
|
|
|
|
|
|
List<AskPatientAnswer> askPatientAnswerList = askPatientAnswerService.lambdaQuery()
|
|
|
|
|
.in(AskPatientAnswer::getMedicalId, medicalRecIds)
|
|
|
|
|
.eq(AskPatientAnswer::getLibraryQuestionId, silentInfo.getId()).list();
|
|
|
|
|
.eq(AskPatientAnswer::getLibraryQuestionId, questionLibrary.getId()).list();
|
|
|
|
|
if (CollUtil.isEmpty(askPatientAnswerList)){
|
|
|
|
|
return new HashMap<>();
|
|
|
|
|
}
|
|
|
|
|