|
@@ -106,6 +106,12 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
@Autowired
|
|
|
QcModelHospitalFacade qcModelHospitalFacade;
|
|
|
|
|
|
+ /**
|
|
|
+ * 分页
|
|
|
+ *
|
|
|
+ * @param behospitalPageVO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
public IPage<BehospitalInfoDTO> pageFac(BehospitalPageVO behospitalPageVO) {
|
|
|
//入参验证
|
|
|
//入院时间
|
|
@@ -137,6 +143,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());
|
|
@@ -198,18 +210,13 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 评分-终末质控
|
|
|
+ * 处理数据(公共方法)
|
|
|
*
|
|
|
+ * @param hospitalId
|
|
|
* @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);
|
|
|
+ public QueryVo dealCommonData(Long hospitalId, AnalyzeVO analyzeVO) {
|
|
|
// 获取质控条目
|
|
|
List<QcCasesEntryDTO> qcCasesEntryDTOList = qcCasesEntryFacade.getQcCasesEntry(analyzeVO);
|
|
|
if(ListUtil.isEmpty(qcCasesEntryDTOList)){
|
|
@@ -264,7 +271,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())
|
|
@@ -324,7 +331,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) {
|
|
@@ -802,121 +827,8 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
BeanUtil.copyProperties(analyzeRunVO, analyzeVO);
|
|
|
Long hospitalId = analyzeVO.getHospitalId();
|
|
|
|
|
|
- // 获取质控条目
|
|
|
- List<QcCasesEntryDTO> qcCasesEntryDTOList = qcCasesEntryFacade.getQcCasesEntry(analyzeVO);
|
|
|
- if(ListUtil.isEmpty(qcCasesEntryDTOList)){
|
|
|
- throw new CommonException(CommonErrorCode.NOT_EXISTS, "该病历无关联的质控条目!");
|
|
|
- }
|
|
|
-
|
|
|
- // 获取病历所有数据
|
|
|
- Map<String, Map<String, String>> dicMap = sysDictionaryFacade.getDictionaryWithKey(); // 获取字典信息
|
|
|
- // 获取文书信息
|
|
|
- RecordContentVO recordContentVO = new RecordContentVO();
|
|
|
- BeanUtil.copyProperties(analyzeVO, recordContentVO);
|
|
|
- List<RecordContentDTO> recordContentDTOList = medicalRecordFacade.getRecordContentFac(recordContentVO);
|
|
|
- String recTitle = "";
|
|
|
- // 解密数据
|
|
|
- if (encryptFlag) {
|
|
|
- try {
|
|
|
- EncrypDES encrypDES = new EncrypDES();
|
|
|
- for (RecordContentDTO recordContentDTO : recordContentDTOList) {
|
|
|
- recTitle = recordContentDTO.getRecTitle();
|
|
|
- recordContentDTO.setXmlText(encrypDES.decryptor(recordContentDTO.getXmlText()));
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
- "解密错误!病历号=【" + analyzeVO.getBehospitalCode() + "】,医院文书名称=【" + recTitle + "】");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- Map<String, List<RecordContentDTO>> recMap = EntityUtil.makeEntityListMap(recordContentDTOList, "standModelName");
|
|
|
-
|
|
|
- // 获取医嘱
|
|
|
- List<DoctorAdvice> doctorAdviceList = doctorAdviceFacade.list(new QueryWrapper<DoctorAdvice>()
|
|
|
- .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .eq("hospital_id", hospitalId)
|
|
|
- .eq("behospital_code", analyzeVO.getBehospitalCode())
|
|
|
- );
|
|
|
-
|
|
|
- // 获取病案首页
|
|
|
- HomePage homePage = homePageFacade.getOne(new QueryWrapper<HomePage>()
|
|
|
- .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .eq("hospital_id", hospitalId)
|
|
|
- .eq("behospital_code", analyzeVO.getBehospitalCode()), false
|
|
|
- );
|
|
|
-
|
|
|
- List<HomeDiagnoseInfo> homePageList = new ArrayList<>();
|
|
|
- List<HomeOperationInfo> homeOperationInfoList = new ArrayList<>();
|
|
|
- if (homePage != null) {
|
|
|
- // 获取首页出院诊断、病理诊断
|
|
|
- homePageList = homeDiagnoseInfoFacade.list(new QueryWrapper<HomeDiagnoseInfo>()
|
|
|
- .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .eq("hospital_id", hospitalId)
|
|
|
- .eq("home_page_id", homePage.getHomePageId())
|
|
|
- );
|
|
|
-
|
|
|
- // 获取首页手术信息
|
|
|
- homeOperationInfoList = homeOperationInfoFacade.list(new QueryWrapper<HomeOperationInfo>()
|
|
|
- .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .eq("hospital_id", hospitalId)
|
|
|
- .eq("home_page_id", homePage.getHomePageId())
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
- // 拼接数据
|
|
|
- String hosCode = basHospitalInfoFacade.getHosCode(hospitalId);
|
|
|
- QueryVo queryVo = new QueryVo();
|
|
|
- queryVo.setCid(hosCode); // 设置医院编码
|
|
|
- queryVo.setHospitalId(String.valueOf(hospitalId));
|
|
|
- queryVo.setInputCatalogueMap(getInputCatalogueMap(qcCasesEntryDTOList)); // 设置质控条目编码
|
|
|
- List<MedrecVo> medrecVoList = new ArrayList<>(); // 设置内容
|
|
|
-
|
|
|
- addData("入院记录", recMap, medrecVoList);
|
|
|
- addData("病危通知书", recMap, medrecVoList);
|
|
|
- addData("阶段小结", recMap, medrecVoList);
|
|
|
- addData("抢救记录", recMap, medrecVoList);
|
|
|
- addData("查房记录", recMap, medrecVoList);
|
|
|
- addData("首次病程录", recMap, medrecVoList);
|
|
|
- addData("输血/血制品病程记录", recMap, medrecVoList);
|
|
|
- addData("输血后效果评价", recMap, medrecVoList);
|
|
|
- addData("死亡病例讨论记录", recMap, medrecVoList);
|
|
|
- addData("死亡记录", recMap, medrecVoList);
|
|
|
- addData("危急值记录", recMap, medrecVoList);
|
|
|
- addData("出院小结", recMap, medrecVoList);
|
|
|
- addData("疑难病例讨论记录", recMap, medrecVoList);
|
|
|
- addData("输血后效果评价", recMap, medrecVoList);
|
|
|
- addData("病理检验送检单", recMap, medrecVoList);
|
|
|
-
|
|
|
- addDataWithInnerKey("知情同意书", recMap, medrecVoList);
|
|
|
- addDataWithInnerKey("谈话告知书", recMap, medrecVoList);
|
|
|
-
|
|
|
- // 会诊记录
|
|
|
- addDataWithKey("会诊", recMap, medrecVoList,
|
|
|
- Arrays.asList("会诊记录", "会诊结果单", "会诊申请单"));
|
|
|
-
|
|
|
- // 手术
|
|
|
- addDataWithKey("手术", recMap, medrecVoList,
|
|
|
- Arrays.asList("术后首次病程及谈话记录", "手术记录",
|
|
|
- "术前讨论、术前小结", "手术知情同意书", "手术安全核查表"));
|
|
|
-
|
|
|
- // 转科
|
|
|
- addDataWithKey("转科", recMap, medrecVoList,
|
|
|
- Arrays.asList("转入记录", "转出记录"));
|
|
|
-
|
|
|
- // 医嘱
|
|
|
- if (ListUtil.isNotEmpty(doctorAdviceList)) {
|
|
|
- addDataWithKeyConvert("医嘱信息", doctorAdviceList, medrecVoList,
|
|
|
- dicMap.get("1"), Arrays.asList("daStartDate", "daStopDate"));
|
|
|
- }
|
|
|
-
|
|
|
- // 病案首页
|
|
|
- if (homePage != null) {
|
|
|
- addDataWithFirstPage("病案首页", homePage, medrecVoList, dicMap,
|
|
|
- homePageList, homeOperationInfoList);
|
|
|
- }
|
|
|
-
|
|
|
- queryVo.setMedrec(medrecVoList);
|
|
|
-
|
|
|
+ // 处理公共数据
|
|
|
+ QueryVo queryVo = dealCommonData(hospitalId, analyzeVO);
|
|
|
// 调用质控接口
|
|
|
Response<OutputInfo> response = qcServiceClient.extract(queryVo);
|
|
|
if (response == null || response.getData() == null) {
|