|
@@ -1,5 +1,6 @@
|
|
package com.diagbot.facade;
|
|
package com.diagbot.facade;
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.diagbot.client.QcServiceClient;
|
|
import com.diagbot.client.QcServiceClient;
|
|
@@ -20,6 +21,7 @@ import com.diagbot.service.impl.BehospitalInfoServiceImpl;
|
|
import com.diagbot.util.BeanUtil;
|
|
import com.diagbot.util.BeanUtil;
|
|
import com.diagbot.util.EntityUtil;
|
|
import com.diagbot.util.EntityUtil;
|
|
import com.diagbot.util.ListUtil;
|
|
import com.diagbot.util.ListUtil;
|
|
|
|
+import com.diagbot.util.MapUtil;
|
|
import com.diagbot.util.SysUserUtils;
|
|
import com.diagbot.util.SysUserUtils;
|
|
import com.diagbot.vo.AlgorithmVO;
|
|
import com.diagbot.vo.AlgorithmVO;
|
|
import com.diagbot.vo.AnalyzeVO;
|
|
import com.diagbot.vo.AnalyzeVO;
|
|
@@ -68,6 +70,8 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
@Autowired
|
|
@Autowired
|
|
private AlgorithmFacade algorithmFacade;
|
|
private AlgorithmFacade algorithmFacade;
|
|
@Autowired
|
|
@Autowired
|
|
|
|
+ SysDictionaryFacade sysDictionaryFacade;
|
|
|
|
+ @Autowired
|
|
private QcresultInfoFacade qcresultInfoFacade;
|
|
private QcresultInfoFacade qcresultInfoFacade;
|
|
|
|
|
|
public IPage<BehospitalInfoDTO> pageFac(BehospitalPageVO behospitalPageVO) {
|
|
public IPage<BehospitalInfoDTO> pageFac(BehospitalPageVO behospitalPageVO) {
|
|
@@ -92,7 +96,8 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
// 获取质控条目
|
|
// 获取质控条目
|
|
List<QcCasesEntryDTO> qcCasesEntryDTOList = qcCasesEntryFacade.getQcCasesEntry(analyzeVO);
|
|
List<QcCasesEntryDTO> qcCasesEntryDTOList = qcCasesEntryFacade.getQcCasesEntry(analyzeVO);
|
|
|
|
|
|
- // TODO 获取病历所有数据
|
|
|
|
|
|
+ // 获取病历所有数据
|
|
|
|
+ Map<Long, Map<String, String>> dicMap = sysDictionaryFacade.getDictionaryWithKey(); // 获取字典信息
|
|
// 获取文书信息
|
|
// 获取文书信息
|
|
RecordContentVO recordContentVO = new RecordContentVO();
|
|
RecordContentVO recordContentVO = new RecordContentVO();
|
|
BeanUtil.copyProperties(analyzeVO, recordContentVO);
|
|
BeanUtil.copyProperties(analyzeVO, recordContentVO);
|
|
@@ -113,16 +118,18 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
.eq("behospital_code", analyzeVO.getBehospitalCode()), false
|
|
.eq("behospital_code", analyzeVO.getBehospitalCode()), false
|
|
);
|
|
);
|
|
|
|
|
|
|
|
+ List<HomeDiagnoseInfo> homePageList = new ArrayList<>();
|
|
|
|
+ List<HomeOperationInfo> homeOperationInfoList = new ArrayList<>();
|
|
if (homePage != null) {
|
|
if (homePage != null) {
|
|
// 获取首页出院诊断、病理诊断
|
|
// 获取首页出院诊断、病理诊断
|
|
- List<HomeDiagnoseInfo> homePageList = homeDiagnoseInfoFacade.list(new QueryWrapper<HomeDiagnoseInfo>()
|
|
|
|
|
|
+ homePageList = homeDiagnoseInfoFacade.list(new QueryWrapper<HomeDiagnoseInfo>()
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
.eq("hospital_id", hospitalId)
|
|
.eq("hospital_id", hospitalId)
|
|
.eq("home_page_id", homePage.getHomePageId())
|
|
.eq("home_page_id", homePage.getHomePageId())
|
|
);
|
|
);
|
|
|
|
|
|
// 获取首页手术信息
|
|
// 获取首页手术信息
|
|
- List<HomeOperationInfo> homeOperationInfoList = homeOperationInfoFacade.list(new QueryWrapper<HomeOperationInfo>()
|
|
|
|
|
|
+ homeOperationInfoList = homeOperationInfoFacade.list(new QueryWrapper<HomeOperationInfo>()
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
.eq("hospital_id", hospitalId)
|
|
.eq("hospital_id", hospitalId)
|
|
.eq("home_page_id", homePage.getHomePageId())
|
|
.eq("home_page_id", homePage.getHomePageId())
|
|
@@ -147,6 +154,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
addData("死亡病例讨论记录", recMap, medrecVoList);
|
|
addData("死亡病例讨论记录", recMap, medrecVoList);
|
|
addData("死亡记录", recMap, medrecVoList);
|
|
addData("死亡记录", recMap, medrecVoList);
|
|
addData("危急值记录", recMap, medrecVoList);
|
|
addData("危急值记录", recMap, medrecVoList);
|
|
|
|
+ addData("出院小结", recMap, medrecVoList);
|
|
|
|
|
|
// 会诊记录
|
|
// 会诊记录
|
|
addDataWithKey("会诊记录", recMap, medrecVoList,
|
|
addDataWithKey("会诊记录", recMap, medrecVoList,
|
|
@@ -157,11 +165,14 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
Arrays.asList("术后首次病程及谈话记录", "手术记录",
|
|
Arrays.asList("术后首次病程及谈话记录", "手术记录",
|
|
"术前讨论、术前小结", "手术知情同意书", "手术安全核查表"));
|
|
"术前讨论、术前小结", "手术知情同意书", "手术安全核查表"));
|
|
|
|
|
|
-
|
|
|
|
// 医嘱
|
|
// 医嘱
|
|
|
|
+ addDataWithKeyConvert("医嘱信息", doctorAdviceList, medrecVoList, dicMap.get(1));
|
|
|
|
|
|
|
|
+ // 病案首页
|
|
|
|
+ addDataWithFirstPage("病案首页", homePage, medrecVoList, dicMap,
|
|
|
|
+ homePageList, homeOperationInfoList);
|
|
|
|
|
|
- queryVo.setMedrec(medrecVoList); // 设置
|
|
|
|
|
|
+ queryVo.setMedrec(medrecVoList);
|
|
|
|
|
|
// 调用质控接口
|
|
// 调用质控接口
|
|
Response<OutputInfo> response = qcServiceClient.extract(queryVo);
|
|
Response<OutputInfo> response = qcServiceClient.extract(queryVo);
|
|
@@ -184,7 +195,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
algorithmVO.setQcResultAlgVOList(qcResultAlgVOList);
|
|
algorithmVO.setQcResultAlgVOList(qcResultAlgVOList);
|
|
AlgorithmDTO algorithmDTO = algorithmFacade.getAlgorithmRes(algorithmVO);
|
|
AlgorithmDTO algorithmDTO = algorithmFacade.getAlgorithmRes(algorithmVO);
|
|
//保存
|
|
//保存
|
|
- qcresultInfoFacade.saveQcResult(algorithmDTO, algorithmVO, analyzeVO);
|
|
|
|
|
|
+ qcresultInfoFacade.saveQcResult(algorithmDTO, algorithmVO, analyzeVO, outputInfo.getPageData().toString());
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -237,23 +248,114 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
- * 拼接医嘱数据
|
|
|
|
|
|
+ * 拼接数据(医嘱),从数据字典获取信息转换
|
|
*
|
|
*
|
|
* @param key
|
|
* @param key
|
|
- * @param doctorAdviceList
|
|
|
|
|
|
+ * @param list
|
|
* @param medrecVoList
|
|
* @param medrecVoList
|
|
|
|
+ * @param map
|
|
*/
|
|
*/
|
|
- public void addDataWithDocAdv(String key, List<DoctorAdvice> doctorAdviceList, List<MedrecVo> medrecVoList) {
|
|
|
|
- if (ListUtil.isNotEmpty(doctorAdviceList)) {
|
|
|
|
- MedrecVo medrecVo = new MedrecVo();
|
|
|
|
- medrecVo.setTitle(key);
|
|
|
|
- Map<String, Object> content = new HashMap<>();
|
|
|
|
- // TODO 医嘱信息
|
|
|
|
- // content.put("content", list.stream().map(r -> r.getContentText()).collect(Collectors.toList()));
|
|
|
|
- medrecVo.setContent(content);
|
|
|
|
- medrecVoList.add(medrecVo);
|
|
|
|
|
|
+ public void addDataWithKeyConvert(String key, List<DoctorAdvice> list,
|
|
|
|
+ List<MedrecVo> medrecVoList, Map<String, String> map) {
|
|
|
|
+ MedrecVo medrecVo = new MedrecVo();
|
|
|
|
+ medrecVo.setTitle(key);
|
|
|
|
+
|
|
|
|
+ Map<String, Object> content = new HashMap<>();
|
|
|
|
+ List<String> contents = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ for (DoctorAdvice doctorAdvice : list) {
|
|
|
|
+ try {
|
|
|
|
+ Map<String, String> res = new HashMap<>();
|
|
|
|
+ Map<String, Object> objectMap = MapUtil.objectToMap(doctorAdvice);
|
|
|
|
+ for (String objKey : objectMap.keySet()) {
|
|
|
|
+ if (map.get(objKey) != null) {
|
|
|
|
+ res.put(map.get(objKey), String.valueOf(objectMap.get(objKey)));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ String jsonStr = JSON.toJSONString(res);
|
|
|
|
+ contents.add(jsonStr);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ content.put("content", contents);
|
|
|
|
+ medrecVo.setContent(content);
|
|
|
|
+ medrecVoList.add(medrecVo);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 拼接数据(病案首页),从数据字典获取信息转换
|
|
|
|
+ * @param key
|
|
|
|
+ * @param homePage
|
|
|
|
+ * @param medrecVoList
|
|
|
|
+ * @param dicMap
|
|
|
|
+ * @param homeDiagnoseInfoList
|
|
|
|
+ * @param homeOperationInfoList
|
|
|
|
+ */
|
|
|
|
+ public void addDataWithFirstPage(String key, HomePage homePage, List<MedrecVo> medrecVoList, Map<Long, Map<String, String>> dicMap,
|
|
|
|
+ List<HomeDiagnoseInfo> homeDiagnoseInfoList, List<HomeOperationInfo> homeOperationInfoList) {
|
|
|
|
+ MedrecVo medrecVo = new MedrecVo();
|
|
|
|
+ medrecVo.setTitle(key);
|
|
|
|
+
|
|
|
|
+ Map<String, String> map = dicMap.get(2L); // 病案首页
|
|
|
|
+ Map<String, Object> content = new HashMap<>();
|
|
|
|
+ try {
|
|
|
|
+ Map<String, Object> objectMap = MapUtil.objectToMap(homePage);
|
|
|
|
+ for (String objKey : objectMap.keySet()) {
|
|
|
|
+ if (map.get(objKey) != null) {
|
|
|
|
+ content.put(map.get(objKey), String.valueOf(objectMap.get(objKey)));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 病案首页手术信息
|
|
|
|
+ if (ListUtil.isNotEmpty(homeOperationInfoList)) {
|
|
|
|
+ Map<String, String> dic3 = dicMap.get(3L); // 病案首页手术信息
|
|
|
|
+ List<Map> mapList = new ArrayList<>();
|
|
|
|
+ for (HomeOperationInfo homeOperationInfo : homeOperationInfoList) {
|
|
|
|
+ try {
|
|
|
|
+ Map<String, Object> objectMapOpe = MapUtil.objectToMap(homeOperationInfo);
|
|
|
|
+ for (String objKey : objectMapOpe.keySet()) {
|
|
|
|
+ if (dic3.get(objKey) != null) {
|
|
|
|
+ objectMapOpe.put(dic3.get(objKey) ,objectMapOpe.remove(objKey)); // 替换
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ mapList.add(objectMapOpe);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ content.put("手术信息", JSON.toJSONString(mapList));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 病案首页诊断信息
|
|
|
|
+ if (ListUtil.isNotEmpty(homeDiagnoseInfoList)) {
|
|
|
|
+ Map<String, String> dic4 = dicMap.get(4L); // 病案首页诊断信息
|
|
|
|
+ List<Map> mapList = new ArrayList<>();
|
|
|
|
+ for (HomeDiagnoseInfo homeDiagnoseInfo : homeDiagnoseInfoList) {
|
|
|
|
+ try {
|
|
|
|
+ Map<String, Object> objectMapDiag = MapUtil.objectToMap(homeDiagnoseInfo);
|
|
|
|
+ for (String objKey : objectMapDiag.keySet()) {
|
|
|
|
+ if (dic4.get(objKey) != null) {
|
|
|
|
+ objectMapDiag.put(dic4.get(objKey) ,objectMapDiag.remove(objKey)); // 替换
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ mapList.add(objectMapDiag);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ content.put("出院诊断", JSON.toJSONString(mapList));
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
+ medrecVo.setContent(content);
|
|
|
|
+ medrecVoList.add(medrecVo);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|