|
@@ -1571,63 +1571,39 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
*/
|
|
*/
|
|
public AnalyzeRunDTO analyzeApi(AnalyzeRunVO analyzeRunVO) {
|
|
public AnalyzeRunDTO analyzeApi(AnalyzeRunVO analyzeRunVO) {
|
|
List<MsgDTO> msgDTOList = this.getMsgByBehospitalCode(analyzeRunVO);
|
|
List<MsgDTO> msgDTOList = this.getMsgByBehospitalCode(analyzeRunVO);
|
|
- analyzeRunVO.setModeId(null);
|
|
|
|
- AnalyzeVO analyzeVO = new AnalyzeVO();
|
|
|
|
- BeanUtil.copyProperties(analyzeRunVO, analyzeVO);
|
|
|
|
- Long hospitalId = analyzeVO.getHospitalId();
|
|
|
|
- // 处理公共数据
|
|
|
|
- QueryVo queryVo = dealCommonData(hospitalId, analyzeVO);
|
|
|
|
- // 调用质控接口
|
|
|
|
- Response<OutputInfo> response = qcServiceClient.extract(queryVo);
|
|
|
|
- if (response == null || response.getData() == null) {
|
|
|
|
- return null;
|
|
|
|
- }
|
|
|
|
- OutputInfo outputInfo = response.getData();
|
|
|
|
- // 质控编码列表
|
|
|
|
- List<String> codeList = new ArrayList<>();
|
|
|
|
- // code和info的映射map
|
|
|
|
- Map<String, String> codeToInfoMap = new LinkedHashMap<>();
|
|
|
|
- // 对codeList 和 codeToInfoMap进行赋值
|
|
|
|
- setCodeData(outputInfo, codeList, codeToInfoMap);
|
|
|
|
- List<QcResultAlgVO> qcResultAlgVOList = new ArrayList<>();
|
|
|
|
- if (ListUtil.isNotEmpty(codeList)) {
|
|
|
|
- // 根据质控结果获取质控条目
|
|
|
|
- QcResultAlgQueryVO qcResultAlgQueryVO = new QcResultAlgQueryVO();
|
|
|
|
- qcResultAlgQueryVO.setCodeList(codeList);
|
|
|
|
- qcResultAlgQueryVO.setHospitalId(hospitalId);
|
|
|
|
- qcResultAlgQueryVO.setIsPlacefile(analyzeRunVO.getIsPlacefile());
|
|
|
|
- qcResultAlgVOList = qcCasesEntryFacade.getQcResultAlgVO(qcResultAlgQueryVO);
|
|
|
|
- }
|
|
|
|
|
|
+ //返回参数组装
|
|
|
|
+ AnalyzeRunDTO analyzeRunDTO = new AnalyzeRunDTO();
|
|
|
|
|
|
- // 对info赋值
|
|
|
|
- for (QcResultAlgVO bean : qcResultAlgVOList) {
|
|
|
|
- String info = codeToInfoMap.get(bean.getCode());
|
|
|
|
- if (StringUtil.isNotBlank(info)) {
|
|
|
|
- bean.setInfo(info);
|
|
|
|
|
|
+ QcresultInfo qcresultInfo = qcresultInfoFacade.getOne(new QueryWrapper<QcresultInfo>()
|
|
|
|
+ .eq("behospital_code", analyzeRunVO.getBehospitalCode())
|
|
|
|
+ .eq("hospital_id", analyzeRunVO.getHospitalId())
|
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .select("behospital_code", "level", "score_res"));
|
|
|
|
+ BigDecimal bigDecimal = new BigDecimal(0);
|
|
|
|
+ BigDecimal res = new BigDecimal(120);
|
|
|
|
+ if(null != qcresultInfo){
|
|
|
|
+ analyzeRunDTO.setLevel(qcresultInfo.getLevel()==null?"":qcresultInfo.getLevel());
|
|
|
|
+ analyzeRunDTO.setScoreRes(qcresultInfo.getScoreRes() ==null ? bigDecimal : qcresultInfo.getScoreRes());
|
|
|
|
+ if(analyzeRunVO.getHospitalId()==1) {
|
|
|
|
+ bigDecimal = res.subtract(analyzeRunDTO.getScoreRes());
|
|
|
|
+ }else{
|
|
|
|
+ bigDecimal = res.subtract(analyzeRunDTO.getScoreRes().multiply(new BigDecimal(1.2)));
|
|
}
|
|
}
|
|
- }
|
|
|
|
-
|
|
|
|
- // 评分
|
|
|
|
- AlgorithmVO algorithmVO = new AlgorithmVO();
|
|
|
|
- algorithmVO.setType(0);
|
|
|
|
- algorithmVO.setQcResultAlgVOList(qcResultAlgVOList);
|
|
|
|
- algorithmVO.setHospitalId(hospitalId);
|
|
|
|
- algorithmVO.setBehospitalCode(analyzeVO.getBehospitalCode());
|
|
|
|
- algorithmVO.setQcResultAlgVOList(qcResultAlgVOList);
|
|
|
|
- algorithmVO.setIsPlacefile(analyzeRunVO.getIsPlacefile());
|
|
|
|
- AlgorithmDTO algorithmDTO = algorithmFacade.getAlgorithmRes(algorithmVO);
|
|
|
|
- AnalyzeRunDTO analyzeRunDTO = new AnalyzeRunDTO();
|
|
|
|
- if(null != algorithmDTO){
|
|
|
|
- analyzeRunDTO.setLevel(algorithmDTO.getLevel());
|
|
|
|
- analyzeRunDTO.setScoreRes(algorithmDTO.getScore());
|
|
|
|
- }
|
|
|
|
- if(null != algorithmDTO){
|
|
|
|
|
|
+ //缺陷总数
|
|
|
|
+ Long num = msgDTOList
|
|
|
|
+ .stream()
|
|
|
|
+ .filter(Objects::nonNull)
|
|
|
|
+ .count();
|
|
|
|
+ analyzeRunDTO.setNum(num);
|
|
|
|
+ analyzeRunDTO.setNumScore(bigDecimal);
|
|
analyzeRunDTO.setMsgDTOList(msgDTOList);
|
|
analyzeRunDTO.setMsgDTOList(msgDTOList);
|
|
}
|
|
}
|
|
return analyzeRunDTO;
|
|
return analyzeRunDTO;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 获取明细api
|
|
* 获取明细api
|
|
*
|
|
*
|