|
@@ -440,71 +440,17 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
}
|
|
|
}
|
|
|
OutputInfo outputInfo = response.getData();
|
|
|
- //根据质控结果获取质控条目
|
|
|
- QcResultAlgQueryVO qcResultAlgQueryVO = new QcResultAlgQueryVO();
|
|
|
+ // 质控编码列表
|
|
|
List<String> codeList = new ArrayList<>();
|
|
|
// code和info的映射map
|
|
|
Map<String, String> codeToInfoMap = new LinkedHashMap<>();
|
|
|
- Map<String, Map<String, String>> codeMap = outputInfo.getResult();
|
|
|
- for (String key : codeMap.keySet()) {
|
|
|
- codeList.add(key);
|
|
|
- Map<String, String> mapInfo = codeMap.get(key);
|
|
|
- if (mapInfo != null && StringUtil.isNotBlank(mapInfo.get("info"))) {
|
|
|
- codeToInfoMap.put(key, mapInfo.get("info"));
|
|
|
- }
|
|
|
- }
|
|
|
- // 判断code是否为空
|
|
|
- List<QcResultAlgVO> qcResultAlgVOList = new ArrayList<>();
|
|
|
- if (ListUtil.isNotEmpty(codeList)) {
|
|
|
- qcResultAlgQueryVO.setCodeList(codeList);
|
|
|
- qcResultAlgQueryVO.setHospitalId(hospitalId);
|
|
|
- qcResultAlgVOList = qcCasesEntryFacade.getQcResultAlgVO(qcResultAlgQueryVO);
|
|
|
- }
|
|
|
+ // 对codeList 和 codeToInfoMap进行赋值
|
|
|
+ setCodeData(outputInfo, codeList, codeToInfoMap);
|
|
|
|
|
|
- // 对info赋值
|
|
|
- for (QcResultAlgVO bean : qcResultAlgVOList) {
|
|
|
- String info = codeToInfoMap.get(bean.getCode());
|
|
|
- if (StringUtil.isNotBlank(info)) {
|
|
|
- bean.setInfo(info);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 评分
|
|
|
- AlgorithmVO algorithmVO = new AlgorithmVO();
|
|
|
- algorithmVO.setType(0);
|
|
|
- algorithmVO.setQcResultAlgVOList(qcResultAlgVOList);
|
|
|
- algorithmVO.setHospitalId(hospitalId);
|
|
|
- algorithmVO.setBehospitalCode(analyzeVO.getBehospitalCode());
|
|
|
- AlgorithmDTO algorithmDTO = algorithmFacade.getAlgorithmRes(algorithmVO);
|
|
|
- //保存
|
|
|
- Map<String, Object> pageMap = outputInfo.getPageData();
|
|
|
- // 手动拼接数据【知情同意书】【谈话告知书】
|
|
|
- List<MedicalRecord> recordList = medicalRecordFacade.list(new QueryWrapper<MedicalRecord>()
|
|
|
- .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .eq("behospital_code", analyzeVO.getBehospitalCode())
|
|
|
- .eq("hospital_id", hospitalId)
|
|
|
- .in("mode_id", Arrays.asList(53, 54, 16))
|
|
|
- .orderByAsc("rec_date")
|
|
|
- );
|
|
|
- List<MedicalRecordDTO> medicalRecordDTOList = BeanUtil.listCopyTo(recordList, MedicalRecordDTO.class);
|
|
|
- Map<Long, List<MedicalRecordDTO>> recordMap = EntityUtil.makeEntityListMap(medicalRecordDTOList, "modeId");
|
|
|
- List<MedicalRecordDTO> recordDTOList = new ArrayList<>();
|
|
|
- if (recordMap.get(53L) != null) {
|
|
|
- recordDTOList.addAll(recordMap.get(53L)); // 知情同意书
|
|
|
- }
|
|
|
- if (recordMap.get(16L) != null) {
|
|
|
- recordDTOList.addAll(recordMap.get(16L)); // 手术知情同意书
|
|
|
- }
|
|
|
- // 知情同意书 = 【知情同意书】 + 【手术知情同意书】
|
|
|
- pageMap.put("知情同意书", recordDTOList);
|
|
|
- pageMap.put("谈话告知书", recordMap.get(54L));
|
|
|
-
|
|
|
- String pageData = JSON.toJSONString(pageMap);
|
|
|
- // 获取菜单信息
|
|
|
- List<QcModeDTO> qcModeDTOList = qcModeFacade.getMenu(pageMap);
|
|
|
- String menuData = JSON.toJSONString(qcModeDTOList);
|
|
|
-
|
|
|
- Date date = qcresultInfoFacade.saveQcResult(algorithmDTO, algorithmVO, analyzeVO, pageData, menuData, analyzeVO.getIsTask(), null);
|
|
|
+ // 计算分值并保存结果至数据库
|
|
|
+ Map<String, Object> resMap = calScoreAndSave(outputInfo, codeList, codeToInfoMap, analyzeVO);
|
|
|
+ AlgorithmDTO algorithmDTO = (AlgorithmDTO)resMap.get("algorithmDTO");
|
|
|
+ Date date = (Date)resMap.get("date");
|
|
|
|
|
|
// 返回提示信息
|
|
|
// List<MsgDTO> msgDTOList = getMsg(analyzeVO);
|
|
@@ -946,76 +892,17 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
}
|
|
|
}
|
|
|
OutputInfo outputInfo = response.getData();
|
|
|
+ // 质控编码列表
|
|
|
List<String> codeList = new ArrayList<>();
|
|
|
// code和info的映射map
|
|
|
Map<String, String> codeToInfoMap = new LinkedHashMap<>();
|
|
|
- Map<String, Map<String, String>> codeMap = outputInfo.getResult();
|
|
|
- for (String key : codeMap.keySet()) {
|
|
|
- codeList.add(key);
|
|
|
- Map<String, String> mapInfo = codeMap.get(key);
|
|
|
- if (mapInfo != null && StringUtil.isNotBlank(mapInfo.get("info"))) {
|
|
|
- codeToInfoMap.put(key, mapInfo.get("info"));
|
|
|
- }
|
|
|
- }
|
|
|
+ // 对codeList 和 codeToInfoMap进行赋值
|
|
|
+ setCodeData(outputInfo, codeList, codeToInfoMap);
|
|
|
|
|
|
- // 归档状态保存结果到数据库
|
|
|
+ // 如果是1,说明已是终末质控,不再保存质控结果数据;如果是0,则保存质控结果数据
|
|
|
if ("0".equals(analyzeRunVO.getIsPlacefile())) {
|
|
|
- List<QcResultAlgVO> qcResultAlgVOList = new ArrayList<>();
|
|
|
- if (ListUtil.isNotEmpty(codeList)) {
|
|
|
- // 根据质控结果获取质控条目
|
|
|
- QcResultAlgQueryVO qcResultAlgQueryVO = new QcResultAlgQueryVO();
|
|
|
- qcResultAlgQueryVO.setCodeList(codeList);
|
|
|
- qcResultAlgQueryVO.setHospitalId(hospitalId);
|
|
|
- qcResultAlgVOList = qcCasesEntryFacade.getQcResultAlgVO(qcResultAlgQueryVO);
|
|
|
- }
|
|
|
-
|
|
|
- // 对info赋值
|
|
|
- for (QcResultAlgVO bean : qcResultAlgVOList) {
|
|
|
- String info = codeToInfoMap.get(bean.getCode());
|
|
|
- if (StringUtil.isNotBlank(info)) {
|
|
|
- bean.setInfo(info);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 评分
|
|
|
- AlgorithmVO algorithmVO = new AlgorithmVO();
|
|
|
- algorithmVO.setType(0);
|
|
|
- algorithmVO.setQcResultAlgVOList(qcResultAlgVOList);
|
|
|
- algorithmVO.setHospitalId(hospitalId);
|
|
|
- algorithmVO.setBehospitalCode(analyzeVO.getBehospitalCode());
|
|
|
- algorithmVO.setQcResultAlgVOList(qcResultAlgVOList);
|
|
|
- AlgorithmDTO algorithmDTO = algorithmFacade.getAlgorithmRes(algorithmVO);
|
|
|
-
|
|
|
- //保存
|
|
|
- Map<String, Object> pageMap = outputInfo.getPageData();
|
|
|
- // 手动拼接数据【知情同意书】【谈话告知书】
|
|
|
- List<MedicalRecord> recordList = medicalRecordFacade.list(new QueryWrapper<MedicalRecord>()
|
|
|
- .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .eq("behospital_code", analyzeVO.getBehospitalCode())
|
|
|
- .eq("hospital_id", hospitalId)
|
|
|
- .in("mode_id", Arrays.asList(53, 54, 16))
|
|
|
- .orderByAsc("rec_date")
|
|
|
- );
|
|
|
- List<MedicalRecordDTO> medicalRecordDTOList = BeanUtil.listCopyTo(recordList, MedicalRecordDTO.class);
|
|
|
- Map<Long, List<MedicalRecordDTO>> recordMap = EntityUtil.makeEntityListMap(medicalRecordDTOList, "modeId");
|
|
|
- List<MedicalRecordDTO> recordDTOList = new ArrayList<>();
|
|
|
- if (recordMap.get(53L) != null) {
|
|
|
- recordDTOList.addAll(recordMap.get(53L)); // 知情同意书
|
|
|
- }
|
|
|
- if (recordMap.get(16L) != null) {
|
|
|
- recordDTOList.addAll(recordMap.get(16L)); // 手术知情同意书
|
|
|
- }
|
|
|
- // 知情同意书 = 【知情同意书】 + 【手术知情同意书】
|
|
|
- pageMap.put("知情同意书", recordDTOList);
|
|
|
- pageMap.put("谈话告知书", recordMap.get(54L));
|
|
|
-
|
|
|
- String pageData = JSON.toJSONString(pageMap);
|
|
|
- // 获取菜单信息
|
|
|
- List<QcModeDTO> qcModeDTOList = qcModeFacade.getMenu(pageMap);
|
|
|
- String menuData = JSON.toJSONString(qcModeDTOList);
|
|
|
-
|
|
|
- // 保存评分结果信息
|
|
|
- Date date = qcresultInfoFacade.saveQcResult(algorithmDTO, algorithmVO, analyzeVO, pageData, menuData, analyzeVO.getIsTask(), null);
|
|
|
+ // 计算分值并保存结果至数据库
|
|
|
+ Map<String, Object> resMap = calScoreAndSave(outputInfo, codeList, codeToInfoMap, analyzeVO);
|
|
|
}
|
|
|
|
|
|
// 返回缺陷提示信息
|
|
@@ -1176,4 +1063,100 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
response.setContentType("text/html;charset=UTF-8");
|
|
|
ExcelUtils.exportExcelUser(res, null, "sheet1", ExportExcelDTO.class, fileName, response);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设置共用code数据
|
|
|
+ *
|
|
|
+ * @param outputInfo 质控出参数据
|
|
|
+ * @param codeList 质控编码列表
|
|
|
+ * @param codeToInfoMap 质控编码对应的info信息
|
|
|
+ */
|
|
|
+ public void setCodeData(OutputInfo outputInfo, List<String> codeList, Map<String, String> codeToInfoMap) {
|
|
|
+ Map<String, Map<String, String>> codeMap = outputInfo.getResult();
|
|
|
+ for (String key : codeMap.keySet()) {
|
|
|
+ codeList.add(key);
|
|
|
+ Map<String, String> mapInfo = codeMap.get(key);
|
|
|
+ if (mapInfo != null && StringUtil.isNotBlank(mapInfo.get("info"))) {
|
|
|
+ codeToInfoMap.put(key, mapInfo.get("info"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 计算分值并保存结果至数据库
|
|
|
+ *
|
|
|
+ * @param outputInfo 质控出参数据
|
|
|
+ * @param codeList 质控编码列表
|
|
|
+ * @param codeToInfoMap 质控编码对应的info信息
|
|
|
+ * @param analyzeVO 入参
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Map<String, Object> calScoreAndSave(OutputInfo outputInfo, List<String> codeList,
|
|
|
+ Map<String, String> codeToInfoMap, AnalyzeVO analyzeVO) {
|
|
|
+ Long hospitalId = analyzeVO.getHospitalId();
|
|
|
+ List<QcResultAlgVO> qcResultAlgVOList = new ArrayList<>();
|
|
|
+ if (ListUtil.isNotEmpty(codeList)) {
|
|
|
+ // 根据质控结果获取质控条目
|
|
|
+ QcResultAlgQueryVO qcResultAlgQueryVO = new QcResultAlgQueryVO();
|
|
|
+ qcResultAlgQueryVO.setCodeList(codeList);
|
|
|
+ qcResultAlgQueryVO.setHospitalId(hospitalId);
|
|
|
+ qcResultAlgVOList = qcCasesEntryFacade.getQcResultAlgVO(qcResultAlgQueryVO);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 对info赋值
|
|
|
+ for (QcResultAlgVO bean : qcResultAlgVOList) {
|
|
|
+ String info = codeToInfoMap.get(bean.getCode());
|
|
|
+ if (StringUtil.isNotBlank(info)) {
|
|
|
+ bean.setInfo(info);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 评分
|
|
|
+ AlgorithmVO algorithmVO = new AlgorithmVO();
|
|
|
+ algorithmVO.setType(0);
|
|
|
+ algorithmVO.setQcResultAlgVOList(qcResultAlgVOList);
|
|
|
+ algorithmVO.setHospitalId(hospitalId);
|
|
|
+ algorithmVO.setBehospitalCode(analyzeVO.getBehospitalCode());
|
|
|
+ algorithmVO.setQcResultAlgVOList(qcResultAlgVOList);
|
|
|
+ AlgorithmDTO algorithmDTO = algorithmFacade.getAlgorithmRes(algorithmVO);
|
|
|
+
|
|
|
+ //保存
|
|
|
+ Map<String, Object> pageMap = outputInfo.getPageData();
|
|
|
+ // 手动拼接数据【知情同意书】【谈话告知书】
|
|
|
+ List<MedicalRecord> recordList = medicalRecordFacade.list(new QueryWrapper<MedicalRecord>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("behospital_code", analyzeVO.getBehospitalCode())
|
|
|
+ .eq("hospital_id", hospitalId)
|
|
|
+ .in("mode_id", Arrays.asList(53, 54, 16))
|
|
|
+ .orderByAsc("rec_date")
|
|
|
+ );
|
|
|
+ List<MedicalRecordDTO> medicalRecordDTOList = BeanUtil.listCopyTo(recordList, MedicalRecordDTO.class);
|
|
|
+ Map<Long, List<MedicalRecordDTO>> recordMap = EntityUtil.makeEntityListMap(medicalRecordDTOList, "modeId");
|
|
|
+ List<MedicalRecordDTO> recordDTOList = new ArrayList<>();
|
|
|
+ if (recordMap.get(53L) != null) {
|
|
|
+ recordDTOList.addAll(recordMap.get(53L)); // 知情同意书
|
|
|
+ }
|
|
|
+ if (recordMap.get(16L) != null) {
|
|
|
+ recordDTOList.addAll(recordMap.get(16L)); // 手术知情同意书
|
|
|
+ }
|
|
|
+ // 知情同意书 = 【知情同意书】 + 【手术知情同意书】
|
|
|
+ pageMap.put("知情同意书", recordDTOList);
|
|
|
+ pageMap.put("谈话告知书", recordMap.get(54L));
|
|
|
+
|
|
|
+ String pageData = JSON.toJSONString(pageMap);
|
|
|
+ // 获取菜单信息
|
|
|
+ List<QcModeDTO> qcModeDTOList = qcModeFacade.getMenu(pageMap);
|
|
|
+ String menuData = JSON.toJSONString(qcModeDTOList);
|
|
|
+
|
|
|
+ // 保存评分结果信息
|
|
|
+ Date date = qcresultInfoFacade.saveQcResult(algorithmDTO, algorithmVO, analyzeVO, pageData, menuData, analyzeVO.getIsTask(), null);
|
|
|
+
|
|
|
+ // 返回结果信息
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("algorithmDTO", algorithmDTO);
|
|
|
+ map.put("date", date);
|
|
|
+ return map;
|
|
|
+ }
|
|
|
}
|