|
@@ -106,6 +106,8 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
QcQuestionFacade qcQuestionFacade;
|
|
|
@Autowired
|
|
|
QcModelHospitalFacade qcModelHospitalFacade;
|
|
|
+ @Autowired
|
|
|
+ private FilterFacade filterFacade;
|
|
|
|
|
|
/**
|
|
|
* 分页
|
|
@@ -114,32 +116,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
* @return
|
|
|
*/
|
|
|
public IPage<BehospitalInfoDTO> pageFac(BehospitalPageVO behospitalPageVO) {
|
|
|
- //入参验证
|
|
|
- //入院时间
|
|
|
- if (null != behospitalPageVO && null != behospitalPageVO.getBehosDateStart()) {
|
|
|
- behospitalPageVO.setBehosDateStart(DateUtil.getFirstTimeOfDay(behospitalPageVO.getBehosDateStart()));
|
|
|
- }
|
|
|
- if (null != behospitalPageVO && null != behospitalPageVO.getBehosDateEnd()) {
|
|
|
- behospitalPageVO.setBehosDateEnd(DateUtil.getLastTimeOfDay(behospitalPageVO.getBehosDateEnd()));
|
|
|
- }
|
|
|
- if (null != behospitalPageVO && null != behospitalPageVO.getBehosDateStart() && null != behospitalPageVO.getBehosDateEnd()) {
|
|
|
- if (DateUtil.after(behospitalPageVO.getBehosDateStart(), behospitalPageVO.getBehosDateEnd())) {
|
|
|
- throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "入院时间的开始时间必须小于结束时间!");
|
|
|
- }
|
|
|
- }
|
|
|
- //出院时间
|
|
|
- if (null != behospitalPageVO && null != behospitalPageVO.getLeaveHosDateStart()) {
|
|
|
- behospitalPageVO.setLeaveHosDateStart(DateUtil.getFirstTimeOfDay(behospitalPageVO.getLeaveHosDateStart()));
|
|
|
- }
|
|
|
- if (null != behospitalPageVO && null != behospitalPageVO.getLeaveHosDateEnd()) {
|
|
|
- behospitalPageVO.setLeaveHosDateEnd(DateUtil.getLastTimeOfDay(behospitalPageVO.getLeaveHosDateEnd()));
|
|
|
- }
|
|
|
- if (null != behospitalPageVO && null != behospitalPageVO.getLeaveHosDateStart() && null != behospitalPageVO.getLeaveHosDateEnd()) {
|
|
|
- if (DateUtil.after(behospitalPageVO.getLeaveHosDateStart(), behospitalPageVO.getLeaveHosDateEnd())) {
|
|
|
- throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "出院时间的开始时间必须小于结束时间!");
|
|
|
- }
|
|
|
- }
|
|
|
- behospitalPageVO.setHospitalId(Long.parseLong(SysUserUtils.getCurrentHospitalID()));
|
|
|
+ behospitalPageSet(behospitalPageVO);
|
|
|
IPage<BehospitalInfoDTO> res = getPage(behospitalPageVO);
|
|
|
return res;
|
|
|
}
|
|
@@ -220,7 +197,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
public QueryVo dealCommonData(Long hospitalId, AnalyzeVO analyzeVO) {
|
|
|
// 获取质控条目
|
|
|
List<QcCasesEntryDTO> qcCasesEntryDTOList = qcCasesEntryFacade.getQcCasesEntry(analyzeVO);
|
|
|
- if(ListUtil.isEmpty(qcCasesEntryDTOList)){
|
|
|
+ if (ListUtil.isEmpty(qcCasesEntryDTOList)) {
|
|
|
throw new CommonException(CommonErrorCode.NOT_EXISTS, "该病历无关联的质控条目!");
|
|
|
}
|
|
|
|
|
@@ -346,7 +323,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
if (!analyzeVO.getIsTask()) {
|
|
|
hospitalId = Long.parseLong(SysUserUtils.getCurrentHospitalID());
|
|
|
}
|
|
|
-// Long hospitalId = 1L; // 写死
|
|
|
+ // Long hospitalId = 1L; // 写死
|
|
|
analyzeVO.setHospitalId(hospitalId);
|
|
|
|
|
|
// 处理公共数据
|
|
@@ -379,7 +356,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
}
|
|
|
|
|
|
// 对info赋值
|
|
|
- for(QcResultAlgVO bean : qcResultAlgVOList) {
|
|
|
+ for (QcResultAlgVO bean : qcResultAlgVOList) {
|
|
|
String info = codeToInfoMap.get(bean.getCode());
|
|
|
if (StringUtil.isNotBlank(info)) {
|
|
|
bean.setInfo(info);
|
|
@@ -403,8 +380,8 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
Date date = qcresultInfoFacade.saveQcResult(algorithmDTO, algorithmVO, analyzeVO, pageData, menuData, analyzeVO.getIsTask());
|
|
|
|
|
|
// 返回提示信息
|
|
|
-// List<MsgDTO> msgDTOList = getMsg(analyzeVO);
|
|
|
-// Map<String, List<MsgDTO>> msgMap = EntityUtil.makeEntityListMap(msgDTOList, "modelName");
|
|
|
+ // List<MsgDTO> msgDTOList = getMsg(analyzeVO);
|
|
|
+ // Map<String, List<MsgDTO>> msgMap = EntityUtil.makeEntityListMap(msgDTOList, "modelName");
|
|
|
|
|
|
//返回参数组装
|
|
|
AnalyzeDTO analyzeDTO = new AnalyzeDTO();
|
|
@@ -509,8 +486,8 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
* @param medrecVoList
|
|
|
* @param map
|
|
|
*/
|
|
|
- public void addDataWithKeyConvert(String key, List<DoctorAdvice> list,
|
|
|
- List<MedrecVo> medrecVoList, Map<String, String> map, List<String> dateList) {
|
|
|
+ public void addDataWithKeyConvert(String key, List<DoctorAdvice> list,
|
|
|
+ List<MedrecVo> medrecVoList, Map<String, String> map, List<String> dateList) {
|
|
|
MedrecVo medrecVo = new MedrecVo();
|
|
|
medrecVo.setTitle(key);
|
|
|
Map<String, Object> content = new HashMap<>();
|
|
@@ -523,7 +500,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
for (String objKey : objectMap.keySet()) {
|
|
|
if (map.get(objKey) != null) {
|
|
|
if (dateList.contains(objKey)) {
|
|
|
- Date date = (Date)objectMap.get(objKey);
|
|
|
+ Date date = (Date) objectMap.get(objKey);
|
|
|
res.put(map.get(objKey), DateUtil.formatDateTime(date).replaceAll("null", ""));
|
|
|
} else {
|
|
|
res.put(map.get(objKey), String.valueOf(objectMap.get(objKey)).replaceAll("null", ""));
|
|
@@ -556,7 +533,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
for (String objKey : objectMap.keySet()) {
|
|
|
if (dicMap.containsKey(objKey)) {
|
|
|
if (dateList.contains(objKey)) {
|
|
|
- Date date = (Date)objectMap.get(objKey);
|
|
|
+ Date date = (Date) objectMap.get(objKey);
|
|
|
res.put(dicMap.get(objKey), DateUtil.formatDateTime(date).replaceAll("null", ""));
|
|
|
} else {
|
|
|
res.put(dicMap.get(objKey), String.valueOf(objectMap.get(objKey)).replaceAll("null", ""));
|
|
@@ -568,6 +545,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
|
|
|
/**
|
|
|
* 拼接数据(病案首页),从数据字典获取信息转换
|
|
|
+ *
|
|
|
* @param key
|
|
|
* @param homePage
|
|
|
* @param medrecVoList
|
|
@@ -575,7 +553,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
* @param homeDiagnoseInfoList
|
|
|
* @param homeOperationInfoList
|
|
|
*/
|
|
|
- public void addDataWithFirstPage(String key, HomePage homePage, List<MedrecVo> medrecVoList, Map<String, Map<String, String>> dicMap,
|
|
|
+ public void addDataWithFirstPage(String key, HomePage homePage, List<MedrecVo> medrecVoList, Map<String, Map<String, String>> dicMap,
|
|
|
List<HomeDiagnoseInfo> homeDiagnoseInfoList, List<HomeOperationInfo> homeOperationInfoList) {
|
|
|
MedrecVo medrecVo = new MedrecVo();
|
|
|
medrecVo.setTitle(key);
|
|
@@ -588,7 +566,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
for (String objKey : objectMap.keySet()) {
|
|
|
if (map.containsKey(objKey)) {
|
|
|
if (firstPageDate.contains(objKey)) {
|
|
|
- Date date = (Date)objectMap.get(objKey);
|
|
|
+ Date date = (Date) objectMap.get(objKey);
|
|
|
content.put(map.get(objKey), DateUtil.formatDateTime(date).replaceAll("null", ""));
|
|
|
} else {
|
|
|
content.put(map.get(objKey), String.valueOf(objectMap.get(objKey)).replaceAll("null", ""));
|
|
@@ -668,21 +646,21 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
authServiceClient.analyze_rpc(analyzeVO);
|
|
|
}
|
|
|
|
|
|
-// List<BehospitalInfo> behospitalInfoList = this.list(new QueryWrapper<BehospitalInfo>()
|
|
|
-// .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
-// );
|
|
|
-//
|
|
|
-// int i = 1;
|
|
|
-// while(i < 100) {
|
|
|
-// for (BehospitalInfo bean : behospitalInfoList) {
|
|
|
-// AnalyzeVO analyzeVO = new AnalyzeVO();
|
|
|
-// analyzeVO.setIsTask(true);
|
|
|
-// analyzeVO.setHospitalId(bean.getHospitalId());
|
|
|
-// analyzeVO.setBehospitalCode(bean.getBehospitalCode());
|
|
|
-// authServiceClient.analyze_rpc(analyzeVO);
|
|
|
-// System.out.println(i++);
|
|
|
-// }
|
|
|
-// }
|
|
|
+ // List<BehospitalInfo> behospitalInfoList = this.list(new QueryWrapper<BehospitalInfo>()
|
|
|
+ // .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ // );
|
|
|
+ //
|
|
|
+ // int i = 1;
|
|
|
+ // while(i < 100) {
|
|
|
+ // for (BehospitalInfo bean : behospitalInfoList) {
|
|
|
+ // AnalyzeVO analyzeVO = new AnalyzeVO();
|
|
|
+ // analyzeVO.setIsTask(true);
|
|
|
+ // analyzeVO.setHospitalId(bean.getHospitalId());
|
|
|
+ // analyzeVO.setBehospitalCode(bean.getBehospitalCode());
|
|
|
+ // authServiceClient.analyze_rpc(analyzeVO);
|
|
|
+ // System.out.println(i++);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -751,7 +729,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
if (qcResultDTO == null) {
|
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
"该病历未评分!【hospitalId=" + hospitalId + "】【behospitalCode="
|
|
|
- + getDetailVO.getBehospitalCode() + "】");
|
|
|
+ + getDetailVO.getBehospitalCode() + "】");
|
|
|
}
|
|
|
QcResultApiDTO qcResultApiDTO = new QcResultApiDTO();
|
|
|
BeanUtil.copyProperties(qcResultDTO, qcResultApiDTO);
|
|
@@ -769,69 +747,18 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- *
|
|
|
* @param behospitalPageVO
|
|
|
* @return
|
|
|
*/
|
|
|
public IPage<BehospitalInfoDTO> pagePerson(BehospitalPageVO behospitalPageVO) {
|
|
|
- //入参验证
|
|
|
- //入院时间
|
|
|
- if (null != behospitalPageVO && null != behospitalPageVO.getBehosDateStart()) {
|
|
|
- behospitalPageVO.setBehosDateStart(DateUtil.getFirstTimeOfDay(behospitalPageVO.getBehosDateStart()));
|
|
|
- }
|
|
|
- if (null != behospitalPageVO && null != behospitalPageVO.getBehosDateEnd()) {
|
|
|
- behospitalPageVO.setBehosDateEnd(DateUtil.getLastTimeOfDay(behospitalPageVO.getBehosDateEnd()));
|
|
|
- }
|
|
|
- if (null != behospitalPageVO && null != behospitalPageVO.getBehosDateStart() && null != behospitalPageVO.getBehosDateEnd()) {
|
|
|
- if (DateUtil.after(behospitalPageVO.getBehosDateStart(), behospitalPageVO.getBehosDateEnd())) {
|
|
|
- throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "入院时间的开始时间必须小于结束时间!");
|
|
|
- }
|
|
|
- }
|
|
|
- //出院时间
|
|
|
- if (null != behospitalPageVO && null != behospitalPageVO.getLeaveHosDateStart()) {
|
|
|
- behospitalPageVO.setLeaveHosDateStart(DateUtil.getFirstTimeOfDay(behospitalPageVO.getLeaveHosDateStart()));
|
|
|
- }
|
|
|
- if (null != behospitalPageVO && null != behospitalPageVO.getLeaveHosDateEnd()) {
|
|
|
- behospitalPageVO.setLeaveHosDateEnd(DateUtil.getLastTimeOfDay(behospitalPageVO.getLeaveHosDateEnd()));
|
|
|
- }
|
|
|
- if (null != behospitalPageVO && null != behospitalPageVO.getLeaveHosDateStart() && null != behospitalPageVO.getLeaveHosDateEnd()) {
|
|
|
- if (DateUtil.after(behospitalPageVO.getLeaveHosDateStart(), behospitalPageVO.getLeaveHosDateEnd())) {
|
|
|
- throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "出院时间的开始时间必须小于结束时间!");
|
|
|
- }
|
|
|
- }
|
|
|
- behospitalPageVO.setHospitalId(Long.parseLong(SysUserUtils.getCurrentHospitalID()));
|
|
|
+ behospitalPageSet(behospitalPageVO);
|
|
|
behospitalPageVO.setUserId(Long.parseLong(SysUserUtils.getCurrentPrincipleID()));
|
|
|
IPage<BehospitalInfoDTO> res = getPageByPerson(behospitalPageVO);
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
public IPage<BehospitalInfoDTO> pageDept(BehospitalPageVO behospitalPageVO) {
|
|
|
- //入参验证
|
|
|
- //入院时间
|
|
|
- if (null != behospitalPageVO && null != behospitalPageVO.getBehosDateStart()) {
|
|
|
- behospitalPageVO.setBehosDateStart(DateUtil.getFirstTimeOfDay(behospitalPageVO.getBehosDateStart()));
|
|
|
- }
|
|
|
- if (null != behospitalPageVO && null != behospitalPageVO.getBehosDateEnd()) {
|
|
|
- behospitalPageVO.setBehosDateEnd(DateUtil.getLastTimeOfDay(behospitalPageVO.getBehosDateEnd()));
|
|
|
- }
|
|
|
- if (null != behospitalPageVO && null != behospitalPageVO.getBehosDateStart() && null != behospitalPageVO.getBehosDateEnd()) {
|
|
|
- if (DateUtil.after(behospitalPageVO.getBehosDateStart(), behospitalPageVO.getBehosDateEnd())) {
|
|
|
- throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "入院时间的开始时间必须小于结束时间!");
|
|
|
- }
|
|
|
- }
|
|
|
- //出院时间
|
|
|
- if (null != behospitalPageVO && null != behospitalPageVO.getLeaveHosDateStart()) {
|
|
|
- behospitalPageVO.setLeaveHosDateStart(DateUtil.getFirstTimeOfDay(behospitalPageVO.getLeaveHosDateStart()));
|
|
|
- }
|
|
|
- if (null != behospitalPageVO && null != behospitalPageVO.getLeaveHosDateEnd()) {
|
|
|
- behospitalPageVO.setLeaveHosDateEnd(DateUtil.getLastTimeOfDay(behospitalPageVO.getLeaveHosDateEnd()));
|
|
|
- }
|
|
|
- if (null != behospitalPageVO && null != behospitalPageVO.getLeaveHosDateStart() && null != behospitalPageVO.getLeaveHosDateEnd()) {
|
|
|
- if (DateUtil.after(behospitalPageVO.getLeaveHosDateStart(), behospitalPageVO.getLeaveHosDateEnd())) {
|
|
|
- throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "出院时间的开始时间必须小于结束时间!");
|
|
|
- }
|
|
|
- }
|
|
|
- behospitalPageVO.setHospitalId(Long.parseLong(SysUserUtils.getCurrentHospitalID()));
|
|
|
+ behospitalPageSet(behospitalPageVO);
|
|
|
behospitalPageVO.setUserId(Long.parseLong(SysUserUtils.getCurrentPrincipleID()));
|
|
|
IPage<BehospitalInfoDTO> res = getPageByDept(behospitalPageVO);
|
|
|
return res;
|
|
@@ -921,4 +848,40 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
return analyzeRunDTO;
|
|
|
}
|
|
|
|
|
|
+ private void behospitalPageSet(BehospitalPageVO behospitalPageVO) {
|
|
|
+ //入参验证
|
|
|
+ //入院时间
|
|
|
+ if (null != behospitalPageVO && null != behospitalPageVO.getBehosDateStart()) {
|
|
|
+ behospitalPageVO.setBehosDateStart(DateUtil.getFirstTimeOfDay(behospitalPageVO.getBehosDateStart()));
|
|
|
+ }
|
|
|
+ if (null != behospitalPageVO && null != behospitalPageVO.getBehosDateEnd()) {
|
|
|
+ behospitalPageVO.setBehosDateEnd(DateUtil.getFirstTimeOfDay(DateUtil.addDay(behospitalPageVO.getBehosDateEnd(), 1)));
|
|
|
+ }
|
|
|
+ if (null != behospitalPageVO && null != behospitalPageVO.getBehosDateStart() && null != behospitalPageVO.getBehosDateEnd()) {
|
|
|
+ if (DateUtil.after(behospitalPageVO.getBehosDateStart(), behospitalPageVO.getBehosDateEnd())) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "入院时间的开始时间必须小于结束时间!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //出院时间
|
|
|
+ if (null != behospitalPageVO && null != behospitalPageVO.getLeaveHosDateStart()) {
|
|
|
+ behospitalPageVO.setLeaveHosDateStart(DateUtil.getFirstTimeOfDay(behospitalPageVO.getLeaveHosDateStart()));
|
|
|
+ }
|
|
|
+ if (null != behospitalPageVO && null != behospitalPageVO.getLeaveHosDateEnd()) {
|
|
|
+ behospitalPageVO.setLeaveHosDateEnd(DateUtil.getFirstTimeOfDay(DateUtil.addDay(behospitalPageVO.getLeaveHosDateEnd(), 1)));
|
|
|
+ }
|
|
|
+ if (null != behospitalPageVO && null != behospitalPageVO.getLeaveHosDateStart() && null != behospitalPageVO.getLeaveHosDateEnd()) {
|
|
|
+ if (DateUtil.after(behospitalPageVO.getLeaveHosDateStart(), behospitalPageVO.getLeaveHosDateEnd())) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "出院时间的开始时间必须小于结束时间!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ behospitalPageVO.setHospitalId(Long.parseLong(SysUserUtils.getCurrentHospitalID()));
|
|
|
+ if (null != behospitalPageVO.getStatisticsType()
|
|
|
+ && null == behospitalPageVO.getLeaveHosDateStart()
|
|
|
+ && null == behospitalPageVO.getLeaveHosDateEnd()) {
|
|
|
+ String startDate = filterFacade.getStartDateStr(behospitalPageVO.getStatisticsType(), null);
|
|
|
+ String endDate = filterFacade.getEndDateStr(behospitalPageVO.getStatisticsType(), null);
|
|
|
+ behospitalPageVO.setLeaveHosDateStart(DateUtil.parseDate(startDate));
|
|
|
+ behospitalPageVO.setLeaveHosDateEnd(DateUtil.parseDate(endDate));
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|