|
|
@ -31,12 +31,6 @@ public class DiagnoseHallServiceImpl implements DiagnoseHallService {
|
|
|
|
|
|
|
|
|
|
|
|
private final DiagnosisPrimaryService diagnosisPrimaryService;
|
|
|
|
private final DiagnosisPrimaryService diagnosisPrimaryService;
|
|
|
|
|
|
|
|
|
|
|
|
private final AskPatientAnswerService askPatientAnswerService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final CommonDicService commonDicService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final AskTemplateQuestionLibraryService askTemplateQuestionLibraryService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public IPage<DiagnoseProcessResVo> queryDiagnoseProcessPageList(Integer pageNum, Integer pageSize,
|
|
|
|
public IPage<DiagnoseProcessResVo> queryDiagnoseProcessPageList(Integer pageNum, Integer pageSize,
|
|
|
@ -58,15 +52,9 @@ public class DiagnoseHallServiceImpl implements DiagnoseHallService {
|
|
|
|
Map<String, List<DiagnosisPrimaryVO>> diagnosisPrimaryVOsMap = diagnosisPrimaryVOS.stream().collect(Collectors.groupingBy(DiagnosisPrimary::getProcessId));
|
|
|
|
Map<String, List<DiagnosisPrimaryVO>> diagnosisPrimaryVOsMap = diagnosisPrimaryVOS.stream().collect(Collectors.groupingBy(DiagnosisPrimary::getProcessId));
|
|
|
|
|
|
|
|
|
|
|
|
// 3.把疾病名填充到诊断列表中
|
|
|
|
// 3.把疾病名填充到诊断列表中
|
|
|
|
List<String> medicalRecIds = records.stream().map(DiagnoseProcessResVo::getMedicalRecId).filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
|
|
|
|
|
Map<String, AskPatientAnswer> askPatientAnswerMap = queryAskPatientSystemVideoAnswer(medicalRecIds,"system_silent");
|
|
|
|
|
|
|
|
Map<String, AskPatientAnswer> dynamicAskPatientAnswerMap = queryAskPatientSystemVideoAnswer(medicalRecIds,"system_dynamic");
|
|
|
|
|
|
|
|
diagnoseProcessResVoPage.getRecords().forEach(vo->{
|
|
|
|
diagnoseProcessResVoPage.getRecords().forEach(vo->{
|
|
|
|
List<DiagnosisPrimaryVO> list = diagnosisPrimaryVOsMap.getOrDefault(vo.getProcessId(),new ArrayList<>());
|
|
|
|
List<DiagnosisPrimaryVO> list = diagnosisPrimaryVOsMap.getOrDefault(vo.getProcessId(),new ArrayList<>());
|
|
|
|
vo.setPrimaryDiseaseNameList(list.stream().map(DiagnosisPrimaryVO::getPrimaryDiseaseName).distinct().collect(Collectors.toList()));
|
|
|
|
vo.setPrimaryDiseaseNameList(list.stream().map(DiagnosisPrimaryVO::getPrimaryDiseaseName).distinct().collect(Collectors.toList()));
|
|
|
|
|
|
|
|
|
|
|
|
vo.setPatientSilentVideo(askPatientAnswerMap.getOrDefault(vo.getMedicalRecId(),new AskPatientAnswer()).getAnswerResourceId());
|
|
|
|
|
|
|
|
vo.setPatientDummyVideo(dynamicAskPatientAnswerMap.getOrDefault(vo.getMedicalRecId(),new AskPatientAnswer()).getAnswerResourceId());
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -77,40 +65,7 @@ public class DiagnoseHallServiceImpl implements DiagnoseHallService {
|
|
|
|
public IPage<MedicalRecPageResVO> queryMedicalRecPageList(Integer pageNum, Integer pageSize) {
|
|
|
|
public IPage<MedicalRecPageResVO> queryMedicalRecPageList(Integer pageNum, Integer pageSize) {
|
|
|
|
MedicalRecPageReqVO medicalRecPageReqVO = new MedicalRecPageReqVO();
|
|
|
|
MedicalRecPageReqVO medicalRecPageReqVO = new MedicalRecPageReqVO();
|
|
|
|
medicalRecPageReqVO.setStatus(1);// 设置为已发布的数据
|
|
|
|
medicalRecPageReqVO.setStatus(1);// 设置为已发布的数据
|
|
|
|
IPage<MedicalRecPageResVO> medicalRecPageResVOIPage = medicalRecService.queryMedicalRecManagePage(medicalRecPageReqVO, pageNum, pageSize);
|
|
|
|
return medicalRecService.queryMedicalRecManagePage(medicalRecPageReqVO, pageNum, pageSize);
|
|
|
|
if (CollUtil.isEmpty(medicalRecPageResVOIPage.getRecords())){
|
|
|
|
|
|
|
|
return medicalRecPageResVOIPage;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
List<String> medicalRecIds = medicalRecPageResVOIPage.getRecords().stream().map(MedicalRecPageResVO::getMedicalId).collect(Collectors.toList());
|
|
|
|
|
|
|
|
Map<String, AskPatientAnswer> askPatientAnswerMap = queryAskPatientSystemVideoAnswer(medicalRecIds,"system_silent");
|
|
|
|
|
|
|
|
Map<String, AskPatientAnswer> dynamicAskPatientAnswerMap = queryAskPatientSystemVideoAnswer(medicalRecIds,"system_dynamic");
|
|
|
|
|
|
|
|
medicalRecPageResVOIPage.getRecords().forEach(vo->{
|
|
|
|
|
|
|
|
vo.setPatientSilentVideo(askPatientAnswerMap.getOrDefault(vo.getMedicalId(),new AskPatientAnswer()).getAnswerResourceId());
|
|
|
|
|
|
|
|
vo.setPatientDummyVideo(dynamicAskPatientAnswerMap.getOrDefault(vo.getMedicalId(),new AskPatientAnswer()).getAnswerResourceId());
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
return medicalRecPageResVOIPage;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
private Map<String,AskPatientAnswer> queryAskPatientSystemVideoAnswer(List<String> medicalRecIds,String code){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert.notEmpty(code,"code不允许为空");
|
|
|
|
|
|
|
|
if (CollUtil.isEmpty(medicalRecIds)){
|
|
|
|
|
|
|
|
return new HashMap<>();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CommonDic one = commonDicService.lambdaQuery().eq(CommonDic::getGroupCode, "AQT").eq(CommonDic::getCode, code).one();
|
|
|
|
|
|
|
|
Assert.notNull(one,"字典项目未配置");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AskTemplateQuestionLibrary questionLibrary = askTemplateQuestionLibraryService.lambdaQuery()
|
|
|
|
|
|
|
|
.eq(AskTemplateQuestionLibrary::getDictId, one.getId()).eq(AskTemplateQuestionLibrary::getDictId, one.getId()).one();
|
|
|
|
|
|
|
|
Assert.notNull(questionLibrary,code+"对应的问题库未配置");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<AskPatientAnswer> askPatientAnswerList = askPatientAnswerService.lambdaQuery()
|
|
|
|
|
|
|
|
.in(AskPatientAnswer::getMedicalId, medicalRecIds)
|
|
|
|
|
|
|
|
.eq(AskPatientAnswer::getLibraryQuestionId, questionLibrary.getId()).list();
|
|
|
|
|
|
|
|
if (CollUtil.isEmpty(askPatientAnswerList)){
|
|
|
|
|
|
|
|
return new HashMap<>();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return askPatientAnswerList.stream().collect(Collectors.toMap(AskPatientAnswer::getMedicalId, o -> o));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|