|
@@ -9,10 +9,12 @@ import com.diagbot.dto.AlgorithmDTO;
|
|
|
import com.diagbot.dto.AnalyzeDTO;
|
|
|
import com.diagbot.dto.BehosDTO;
|
|
|
import com.diagbot.dto.BehospitalInfoDTO;
|
|
|
+import com.diagbot.dto.MsgApiDTO;
|
|
|
import com.diagbot.dto.MsgDTO;
|
|
|
import com.diagbot.dto.OutputInfo;
|
|
|
import com.diagbot.dto.QcCasesEntryDTO;
|
|
|
import com.diagbot.dto.QcModeDTO;
|
|
|
+import com.diagbot.dto.QcResultApiDTO;
|
|
|
import com.diagbot.dto.QcResultDTO;
|
|
|
import com.diagbot.dto.RecordContentDTO;
|
|
|
import com.diagbot.dto.Response;
|
|
@@ -27,7 +29,6 @@ import com.diagbot.exception.CommonErrorCode;
|
|
|
import com.diagbot.exception.CommonException;
|
|
|
import com.diagbot.service.impl.BehospitalInfoServiceImpl;
|
|
|
import com.diagbot.util.BeanUtil;
|
|
|
-import com.diagbot.util.DBConn;
|
|
|
import com.diagbot.util.DateUtil;
|
|
|
import com.diagbot.util.EncrypDES;
|
|
|
import com.diagbot.util.EntityUtil;
|
|
@@ -35,6 +36,7 @@ import com.diagbot.util.ListUtil;
|
|
|
import com.diagbot.util.MapUtil;
|
|
|
import com.diagbot.util.SysUserUtils;
|
|
|
import com.diagbot.vo.AlgorithmVO;
|
|
|
+import com.diagbot.vo.AnalyzeApiVO;
|
|
|
import com.diagbot.vo.AnalyzeVO;
|
|
|
import com.diagbot.vo.BehospitalPageVO;
|
|
|
import com.diagbot.vo.GetDetailVO;
|
|
@@ -188,6 +190,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
public AnalyzeDTO analyze(AnalyzeVO analyzeVO) {
|
|
|
Long hospitalId = analyzeVO.getHospitalId();
|
|
|
if (!analyzeVO.getIsTask()) {
|
|
@@ -214,7 +217,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
EncrypDES encrypDES = new EncrypDES();
|
|
|
for (RecordContentDTO recordContentDTO : recordContentDTOList) {
|
|
|
recTitle = recordContentDTO.getRecTitle();
|
|
|
- recordContentDTO.setContentText(encrypDES.decryptor(recordContentDTO.getContentText()));
|
|
|
+ recordContentDTO.setXmlText(encrypDES.decryptor(recordContentDTO.getXmlText()));
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
@@ -366,7 +369,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
MedrecVo medrecVo = new MedrecVo();
|
|
|
medrecVo.setTitle(key);
|
|
|
Map<String, Object> content = new HashMap<>();
|
|
|
- content.put("content", list.stream().map(r -> r.getContentText()).collect(Collectors.toList()));
|
|
|
+ content.put("content", list.stream().map(r -> r.getXmlText()).collect(Collectors.toList()));
|
|
|
medrecVo.setContent(content);
|
|
|
medrecVoList.add(medrecVo);
|
|
|
}
|
|
@@ -389,7 +392,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
Boolean flag = false;
|
|
|
for (String k : keyList) {
|
|
|
if (ListUtil.isNotEmpty(recMap.get(k))) {
|
|
|
- listMap.put(k, recMap.get(k).stream().map(r -> r.getContentText()).collect(Collectors.toList()));
|
|
|
+ listMap.put(k, recMap.get(k).stream().map(r -> r.getXmlText()).collect(Collectors.toList()));
|
|
|
flag = true;
|
|
|
}
|
|
|
}
|
|
@@ -425,7 +428,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
Set<String> keyList = keyMap.keySet();
|
|
|
for (String k : keyList) {
|
|
|
if (ListUtil.isNotEmpty(keyMap.get(k))) {
|
|
|
- listMap.put(k, keyMap.get(k).stream().map(r -> r.getContentText()).collect(Collectors.toList()));
|
|
|
+ listMap.put(k, keyMap.get(k).stream().map(r -> r.getXmlText()).collect(Collectors.toList()));
|
|
|
}
|
|
|
}
|
|
|
content.put("content", listMap);
|
|
@@ -616,12 +619,66 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
// }
|
|
|
// }
|
|
|
}
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private BehospitalInfoServiceImpl behospitalInfoServiceImpl;
|
|
|
-
|
|
|
- public void executeTZ() {
|
|
|
- List<BehospitalInfo> behospitalInfoList=DBConn.getBehospitalInfo();
|
|
|
- behospitalInfoServiceImpl.saveBatch(behospitalInfoList);
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 评分api
|
|
|
+ *
|
|
|
+ * @param analyzeApiVO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Map<String, Object> analyzeApi(AnalyzeApiVO analyzeApiVO) {
|
|
|
+ AnalyzeVO analyzeVO = new AnalyzeVO();
|
|
|
+ BeanUtil.copyProperties(analyzeApiVO, analyzeVO);
|
|
|
+ // 评分
|
|
|
+ analyze(analyzeVO);
|
|
|
+ // 获取结果
|
|
|
+ GetDetailVO getDetailVO = new GetDetailVO();
|
|
|
+ getDetailVO.setHospitalId(analyzeApiVO.getHospitalId());
|
|
|
+ getDetailVO.setBehospitalCode(analyzeApiVO.getBehospitalCode());
|
|
|
+ return getByBehospitalCodeApi(getDetailVO);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取明细api
|
|
|
+ *
|
|
|
+ * @param getDetailVO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Map<String, Object> getByBehospitalCodeApi(GetDetailVO getDetailVO) {
|
|
|
+ Map<String, Object> res = new HashMap<>(); // 返回结果
|
|
|
+ Long hospitalId = getDetailVO.getHospitalId();
|
|
|
+ // 获取病历信息
|
|
|
+ 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);
|
|
|
+
|
|
|
+ // 获取结果主表信息
|
|
|
+ QcResultDTO qcResultDTO = qcresultInfoFacade.getByBehospitalCode(getDetailVO);
|
|
|
+ if (qcResultDTO == null) {
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该病历未评分!");
|
|
|
+ }
|
|
|
+ QcResultApiDTO qcResultApiDTO = new QcResultApiDTO();
|
|
|
+ BeanUtil.copyProperties(qcResultDTO, qcResultApiDTO);
|
|
|
+ res.put("result", qcResultApiDTO);
|
|
|
+
|
|
|
+ // 获取提示信息
|
|
|
+ AnalyzeVO analyzeVO = new AnalyzeVO();
|
|
|
+ BeanUtil.copyProperties(getDetailVO, analyzeVO);
|
|
|
+ List<MsgDTO> msgDTOList = getMsg(analyzeVO);
|
|
|
+ List<MsgApiDTO> msgApiDTOList = BeanUtil.listCopyTo(msgDTOList, MsgApiDTO.class);
|
|
|
+ Map<String, List<MsgApiDTO>> msgMap = EntityUtil.makeEntityListMap(msgApiDTOList, "modelName");
|
|
|
+
|
|
|
+ res.put("details", msgMap);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
}
|