|
@@ -7,6 +7,7 @@ import com.diagbot.client.AuthServiceClient;
|
|
|
import com.diagbot.client.QcServiceClient;
|
|
|
import com.diagbot.dto.AlgorithmDTO;
|
|
|
import com.diagbot.dto.AnalyzeDTO;
|
|
|
+import com.diagbot.dto.AnalyzeRunDTO;
|
|
|
import com.diagbot.dto.BehosDTO;
|
|
|
import com.diagbot.dto.BehospitalInfoDTO;
|
|
|
import com.diagbot.dto.MsgApiDTO;
|
|
@@ -38,6 +39,8 @@ import com.diagbot.util.StringUtil;
|
|
|
import com.diagbot.util.SysUserUtils;
|
|
|
import com.diagbot.vo.AlgorithmVO;
|
|
|
import com.diagbot.vo.AnalyzeApiVO;
|
|
|
+import com.diagbot.vo.AnalyzeCodeVO;
|
|
|
+import com.diagbot.vo.AnalyzeRunVO;
|
|
|
import com.diagbot.vo.AnalyzeVO;
|
|
|
import com.diagbot.vo.BehospitalPageVO;
|
|
|
import com.diagbot.vo.GetDetailVO;
|
|
@@ -46,6 +49,7 @@ import com.diagbot.vo.QcResultAlgQueryVO;
|
|
|
import com.diagbot.vo.QcResultAlgVO;
|
|
|
import com.diagbot.vo.QueryVo;
|
|
|
import com.diagbot.vo.RecordContentVO;
|
|
|
+import com.diagbot.vo.TaskVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Component;
|
|
@@ -100,7 +104,15 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
Boolean encryptFlag;
|
|
|
@Autowired
|
|
|
QcQuestionFacade qcQuestionFacade;
|
|
|
+ @Autowired
|
|
|
+ QcModelHospitalFacade qcModelHospitalFacade;
|
|
|
|
|
|
+ /**
|
|
|
+ * 分页
|
|
|
+ *
|
|
|
+ * @param behospitalPageVO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
public IPage<BehospitalInfoDTO> pageFac(BehospitalPageVO behospitalPageVO) {
|
|
|
//入参验证
|
|
|
//入院时间
|
|
@@ -132,6 +144,12 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取明细
|
|
|
+ *
|
|
|
+ * @param getDetailVO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
public Map<String, Object> getByBehospitalCode(GetDetailVO getDetailVO) {
|
|
|
Map<String, Object> res = new HashMap<>(); // 返回结果
|
|
|
Long hospitalId = Long.parseLong(SysUserUtils.getCurrentHospitalID());
|
|
@@ -192,18 +210,18 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- public AnalyzeDTO analyze(AnalyzeVO analyzeVO) {
|
|
|
- Long hospitalId = analyzeVO.getHospitalId();
|
|
|
- if (!analyzeVO.getIsTask()) {
|
|
|
- hospitalId = Long.parseLong(SysUserUtils.getCurrentHospitalID());
|
|
|
- }
|
|
|
-// Long hospitalId = 1L; // 写死
|
|
|
- analyzeVO.setHospitalId(hospitalId);
|
|
|
+ /**
|
|
|
+ * 处理数据(公共方法)
|
|
|
+ *
|
|
|
+ * @param hospitalId
|
|
|
+ * @param analyzeVO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public QueryVo dealCommonData(Long hospitalId, AnalyzeVO analyzeVO) {
|
|
|
// 获取质控条目
|
|
|
List<QcCasesEntryDTO> qcCasesEntryDTOList = qcCasesEntryFacade.getQcCasesEntry(analyzeVO);
|
|
|
if(ListUtil.isEmpty(qcCasesEntryDTOList)){
|
|
|
- throw new CommonException(CommonErrorCode.NOT_EXISTS, "该病历找不到质控条目!");
|
|
|
+ throw new CommonException(CommonErrorCode.NOT_EXISTS, "该病历无关联的质控条目!");
|
|
|
}
|
|
|
|
|
|
// 获取病历所有数据
|
|
@@ -254,7 +272,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
);
|
|
|
|
|
|
// 获取首页手术信息
|
|
|
- homeOperationInfoList = homeOperationInfoFacade.list(new QueryWrapper<HomeOperationInfo>()
|
|
|
+ homeOperationInfoList = homeOperationInfoFacade.list(new QueryWrapper<HomeOperationInfo>()
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
.eq("hospital_id", hospitalId)
|
|
|
.eq("home_page_id", homePage.getHomePageId())
|
|
@@ -297,6 +315,10 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
Arrays.asList("术后首次病程及谈话记录", "手术记录",
|
|
|
"术前讨论、术前小结", "手术知情同意书", "手术安全核查表"));
|
|
|
|
|
|
+ // 转科
|
|
|
+ addDataWithKey("转科", recMap, medrecVoList,
|
|
|
+ Arrays.asList("转入记录", "转出记录"));
|
|
|
+
|
|
|
// 医嘱
|
|
|
if (ListUtil.isNotEmpty(doctorAdviceList)) {
|
|
|
addDataWithKeyConvert("医嘱信息", doctorAdviceList, medrecVoList,
|
|
@@ -310,7 +332,25 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
}
|
|
|
|
|
|
queryVo.setMedrec(medrecVoList);
|
|
|
+ return queryVo;
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ * 评分-终末质控
|
|
|
+ *
|
|
|
+ * @param analyzeVO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public AnalyzeDTO analyze(AnalyzeVO analyzeVO) {
|
|
|
+ Long hospitalId = analyzeVO.getHospitalId();
|
|
|
+ if (!analyzeVO.getIsTask()) {
|
|
|
+ hospitalId = Long.parseLong(SysUserUtils.getCurrentHospitalID());
|
|
|
+ }
|
|
|
+// Long hospitalId = 1L; // 写死
|
|
|
+ analyzeVO.setHospitalId(hospitalId);
|
|
|
+
|
|
|
+ // 处理公共数据
|
|
|
+ QueryVo queryVo = dealCommonData(hospitalId, analyzeVO);
|
|
|
// 调用质控接口
|
|
|
Response<OutputInfo> response = qcServiceClient.extract(queryVo);
|
|
|
if (response == null || response.getData() == null) {
|
|
@@ -330,9 +370,13 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
codeToInfoMap.put(key, mapInfo.get("info"));
|
|
|
}
|
|
|
}
|
|
|
- qcResultAlgQueryVO.setCodeList(codeList);
|
|
|
- qcResultAlgQueryVO.setHospitalId(hospitalId);
|
|
|
- List<QcResultAlgVO> qcResultAlgVOList = qcCasesEntryFacade.getQcResultAlgVO(qcResultAlgQueryVO);
|
|
|
+ // 判断code是否为空
|
|
|
+ List<QcResultAlgVO> qcResultAlgVOList = new ArrayList<>();
|
|
|
+ if (ListUtil.isNotEmpty(codeList)) {
|
|
|
+ qcResultAlgQueryVO.setCodeList(codeList);
|
|
|
+ qcResultAlgQueryVO.setHospitalId(hospitalId);
|
|
|
+ qcResultAlgVOList = qcCasesEntryFacade.getQcResultAlgVO(qcResultAlgQueryVO);
|
|
|
+ }
|
|
|
|
|
|
// 对info赋值
|
|
|
for(QcResultAlgVO bean : qcResultAlgVOList) {
|
|
@@ -614,7 +658,8 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
* 执行未评分的病历
|
|
|
*/
|
|
|
public void execute() {
|
|
|
- List<BehospitalInfo> behospitalInfoList = getNoGrade();
|
|
|
+ TaskVO taskVO = new TaskVO();
|
|
|
+ List<BehospitalInfo> behospitalInfoList = getNoGrade(taskVO);
|
|
|
for (BehospitalInfo bean : behospitalInfoList) {
|
|
|
AnalyzeVO analyzeVO = new AnalyzeVO();
|
|
|
analyzeVO.setIsTask(true);
|
|
@@ -641,6 +686,23 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 对出院日期之前3天的未评分的病历进行评分
|
|
|
+ */
|
|
|
+ public void execute2() {
|
|
|
+ TaskVO taskVO = new TaskVO();
|
|
|
+ Date date = DateUtil.addDay(DateUtil.now(), -3);
|
|
|
+ taskVO.setLeaveDate(date);
|
|
|
+ List<BehospitalInfo> behospitalInfoList = getNoGrade(taskVO);
|
|
|
+ for (BehospitalInfo bean : behospitalInfoList) {
|
|
|
+ AnalyzeVO analyzeVO = new AnalyzeVO();
|
|
|
+ analyzeVO.setIsTask(true);
|
|
|
+ analyzeVO.setHospitalId(bean.getHospitalId());
|
|
|
+ analyzeVO.setBehospitalCode(bean.getBehospitalCode());
|
|
|
+ authServiceClient.analyze_rpc(analyzeVO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 评分api
|
|
|
*
|
|
@@ -775,4 +837,88 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 评分-运行质控
|
|
|
+ *
|
|
|
+ * @param analyzeRunVO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public AnalyzeRunDTO analyzeRun(AnalyzeRunVO analyzeRunVO) {
|
|
|
+ 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) {
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR, "远程质控接口没有返回数据!");
|
|
|
+ }
|
|
|
+ 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"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // List<QcResultAlgVO> qcResultAlgVOList = new ArrayList<>();
|
|
|
+ // if (ListUtil.isNotEmpty(codeList)) {
|
|
|
+ // qcResultAlgQueryVO.setCodeList(codeList);
|
|
|
+ // qcResultAlgQueryVO.setHospitalId(hospitalId);
|
|
|
+ // qcResultAlgVOList = qcCasesEntryFacade.getQcResultAlgVO(qcResultAlgQueryVO);
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // // 评分
|
|
|
+ // AlgorithmVO algorithmVO = new AlgorithmVO();
|
|
|
+ // algorithmVO.setType(0);
|
|
|
+ // algorithmVO.setQcResultAlgVOList(qcResultAlgVOList);
|
|
|
+ // AlgorithmDTO algorithmDTO = algorithmFacade.getAlgorithmRes(algorithmVO);
|
|
|
+
|
|
|
+ //保存
|
|
|
+ // Map<String, Object> pageMap = outputInfo.getPageData();
|
|
|
+ // 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());
|
|
|
+
|
|
|
+ // 返回缺陷提示信息
|
|
|
+ List<MsgDTO> msgDTOList = new ArrayList<>();
|
|
|
+ if (ListUtil.isNotEmpty(codeList)) {
|
|
|
+ AnalyzeCodeVO analyzeCodeVO = new AnalyzeCodeVO();
|
|
|
+ analyzeCodeVO.setCodeList(codeList);
|
|
|
+ analyzeCodeVO.setHospitalId(hospitalId);
|
|
|
+ analyzeCodeVO.setModeId(analyzeRunVO.getModeId());
|
|
|
+
|
|
|
+ // 获取缺陷条目信息
|
|
|
+ msgDTOList = getMsgByEntryCode(analyzeCodeVO);
|
|
|
+ // 设置info信息
|
|
|
+ if (codeToInfoMap != null && !codeToInfoMap.isEmpty()) {
|
|
|
+ for (MsgDTO msgDTO : msgDTOList) {
|
|
|
+ String info = codeToInfoMap.get(msgDTO.getCode());
|
|
|
+ if (StringUtil.isNotBlank(info)) {
|
|
|
+ msgDTO.setInfo(info);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //返回参数组装
|
|
|
+ AnalyzeRunDTO analyzeRunDTO = new AnalyzeRunDTO();
|
|
|
+ // analyzeRunDTO.setScoreRes(algorithmDTO.getScore());
|
|
|
+ // analyzeRunDTO.setLevel(algorithmDTO.getLevel());
|
|
|
+ analyzeRunDTO.setMsgDTOList(msgDTOList);
|
|
|
+ return analyzeRunDTO;
|
|
|
+ }
|
|
|
+
|
|
|
}
|