|
@@ -5,11 +5,16 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.diagbot.client.QcServiceClient;
|
|
|
import com.diagbot.dto.AlgorithmDTO;
|
|
|
+import com.diagbot.dto.BehosDTO;
|
|
|
+import com.diagbot.dto.AnalyzeDTO;
|
|
|
import com.diagbot.dto.BehospitalInfoDTO;
|
|
|
+import com.diagbot.dto.MsgDTO;
|
|
|
import com.diagbot.dto.OutputInfo;
|
|
|
import com.diagbot.dto.QcCasesEntryDTO;
|
|
|
+import com.diagbot.dto.QcResultDTO;
|
|
|
import com.diagbot.dto.RecordContentDTO;
|
|
|
import com.diagbot.dto.Response;
|
|
|
+import com.diagbot.entity.BehospitalInfo;
|
|
|
import com.diagbot.entity.DoctorAdvice;
|
|
|
import com.diagbot.entity.HomeDiagnoseInfo;
|
|
|
import com.diagbot.entity.HomeOperationInfo;
|
|
@@ -26,6 +31,7 @@ import com.diagbot.util.SysUserUtils;
|
|
|
import com.diagbot.vo.AlgorithmVO;
|
|
|
import com.diagbot.vo.AnalyzeVO;
|
|
|
import com.diagbot.vo.BehospitalPageVO;
|
|
|
+import com.diagbot.vo.GetDetailVO;
|
|
|
import com.diagbot.vo.MedrecVo;
|
|
|
import com.diagbot.vo.QcResultAlgQueryVO;
|
|
|
import com.diagbot.vo.QcResultAlgVO;
|
|
@@ -87,11 +93,43 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
+ public Map<String, Object> getByBehospitalCode(GetDetailVO getDetailVO) {
|
|
|
+ Map<String, Object> res = new HashMap<>(); // 返回结果
|
|
|
+ Long hospitalId = Long.parseLong(SysUserUtils.getCurrentHospitalID());
|
|
|
+ getDetailVO.setHospitalId(hospitalId);
|
|
|
+ // 获取病历信息
|
|
|
+ BehospitalInfo behospitalInfo = this.getOne(new QueryWrapper<BehospitalInfo>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("hospital_id", getDetailVO.getHospitalId())
|
|
|
+ .eq("behospital_code", getDetailVO.getBehospitalCode()), false
|
|
|
+ );
|
|
|
+ BehosDTO behosDTO = new BehosDTO();
|
|
|
+ if (behospitalInfo == null) {
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该病历已删除!");
|
|
|
+ }
|
|
|
+ BeanUtil.copyProperties(behospitalInfo, behosDTO);
|
|
|
+ res.put("beHospital", behosDTO);
|
|
|
|
|
|
- public Map<String, Object> analyze(AnalyzeVO analyzeVO) {
|
|
|
+ // 获取主表信息
|
|
|
+ QcResultDTO qcResultDTO = qcresultInfoFacade.getByBehospitalCode(getDetailVO);
|
|
|
+ if (qcResultDTO == null) {
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该病历未评分!");
|
|
|
+ }
|
|
|
+ res.put("result", qcResultDTO);
|
|
|
+
|
|
|
+ // 获取提示信息
|
|
|
+ AnalyzeVO analyzeVO = new AnalyzeVO();
|
|
|
+ BeanUtil.copyProperties(getDetailVO, analyzeVO);
|
|
|
+ List<MsgDTO> msgDTOList = getMsg(analyzeVO);
|
|
|
+ Map<String, List<MsgDTO>> msgMap = EntityUtil.makeEntityListMap(msgDTOList, "modelName");
|
|
|
+ res.put("msg", msgMap);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
|
|
|
- // Long hospitalId = Long.parseLong(SysUserUtils.getCurrentHospitalID());
|
|
|
- Long hospitalId = 1L; // 写死
|
|
|
+ public AnalyzeDTO analyze(AnalyzeVO analyzeVO) {
|
|
|
+ Map<String, Object> res = new HashMap<>(); // 返回结果
|
|
|
+ Long hospitalId = Long.parseLong(SysUserUtils.getCurrentHospitalID());
|
|
|
+// Long hospitalId = 1L; // 写死
|
|
|
analyzeVO.setHospitalId(hospitalId);
|
|
|
// 获取质控条目
|
|
|
List<QcCasesEntryDTO> qcCasesEntryDTOList = qcCasesEntryFacade.getQcCasesEntry(analyzeVO);
|
|
@@ -195,8 +233,24 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
algorithmVO.setQcResultAlgVOList(qcResultAlgVOList);
|
|
|
AlgorithmDTO algorithmDTO = algorithmFacade.getAlgorithmRes(algorithmVO);
|
|
|
//保存
|
|
|
- qcresultInfoFacade.saveQcResult(algorithmDTO, algorithmVO, analyzeVO, outputInfo.getPageData().toString());
|
|
|
- return null;
|
|
|
+ String pageData = JSON.toJSONString(outputInfo.getPageData());
|
|
|
+ Date date = qcresultInfoFacade.saveQcResult(algorithmDTO, algorithmVO, analyzeVO, pageData);
|
|
|
+ res.put("pageData", pageData);
|
|
|
+
|
|
|
+ // 返回提示信息
|
|
|
+ List<MsgDTO> msgDTOList = getMsg(analyzeVO);
|
|
|
+ Map<String, List<MsgDTO>> msgMap = EntityUtil.makeEntityListMap(msgDTOList, "modelName");
|
|
|
+ res.put("msg", msgMap);
|
|
|
+ //返回参数组装
|
|
|
+ AnalyzeDTO analyzeDTO = new AnalyzeDTO();
|
|
|
+ analyzeDTO.setBehospitalCode(analyzeVO.getBehospitalCode());
|
|
|
+ analyzeDTO.setIsSuccess(true);
|
|
|
+ analyzeDTO.setGradeType(1);
|
|
|
+ analyzeDTO.setGradeTypeName("机器");
|
|
|
+ analyzeDTO.setScoreRes(algorithmDTO.getScore());
|
|
|
+ analyzeDTO.setLevel(algorithmDTO.getLevel());
|
|
|
+ analyzeDTO.setGradeTime(date);
|
|
|
+ return analyzeDTO;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -302,19 +356,19 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
MedrecVo medrecVo = new MedrecVo();
|
|
|
medrecVo.setTitle(key);
|
|
|
|
|
|
- Map<String, String> map = dicMap.get(2L); // 病案首页
|
|
|
+ Map<String, String> map = dicMap.get("2"); // 病案首页
|
|
|
Map<String, Object> content = new HashMap<>();
|
|
|
try {
|
|
|
Map<String, Object> objectMap = MapUtil.objectToMap(homePage);
|
|
|
for (String objKey : objectMap.keySet()) {
|
|
|
- if (map.get(objKey) != null) {
|
|
|
+ if (map.containsKey(objKey)) {
|
|
|
content.put(map.get(objKey), String.valueOf(objectMap.get(objKey)));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 病案首页手术信息
|
|
|
if (ListUtil.isNotEmpty(homeOperationInfoList)) {
|
|
|
- Map<String, String> dic3 = dicMap.get(3L); // 病案首页手术信息
|
|
|
+ Map<String, String> dic3 = dicMap.get("3"); // 病案首页手术信息
|
|
|
List<Map> mapList = new ArrayList<>();
|
|
|
for (HomeOperationInfo homeOperationInfo : homeOperationInfoList) {
|
|
|
try {
|
|
@@ -334,7 +388,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
|
|
|
// 病案首页诊断信息
|
|
|
if (ListUtil.isNotEmpty(homeDiagnoseInfoList)) {
|
|
|
- Map<String, String> dic4 = dicMap.get(4L); // 病案首页诊断信息
|
|
|
+ Map<String, String> dic4 = dicMap.get("4"); // 病案首页诊断信息
|
|
|
List<Map> mapList = new ArrayList<>();
|
|
|
for (HomeDiagnoseInfo homeDiagnoseInfo : homeDiagnoseInfoList) {
|
|
|
try {
|