|
@@ -10,6 +10,8 @@ import com.diagbot.dto.AnalyzeDTO;
|
|
|
import com.diagbot.dto.AnalyzeRunDTO;
|
|
|
import com.diagbot.dto.BehosDTO;
|
|
|
import com.diagbot.dto.BehospitalInfoDTO;
|
|
|
+import com.diagbot.dto.ExportExcelDTO;
|
|
|
+import com.diagbot.dto.MedicalRecordDTO;
|
|
|
import com.diagbot.dto.MsgApiDTO;
|
|
|
import com.diagbot.dto.MsgDTO;
|
|
|
import com.diagbot.dto.OutputInfo;
|
|
@@ -25,6 +27,7 @@ import com.diagbot.entity.DoctorAdvice;
|
|
|
import com.diagbot.entity.HomeDiagnoseInfo;
|
|
|
import com.diagbot.entity.HomeOperationInfo;
|
|
|
import com.diagbot.entity.HomePage;
|
|
|
+import com.diagbot.entity.MedicalRecord;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
|
import com.diagbot.exception.CommonException;
|
|
@@ -33,6 +36,7 @@ import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.DateUtil;
|
|
|
import com.diagbot.util.EncrypDES;
|
|
|
import com.diagbot.util.EntityUtil;
|
|
|
+import com.diagbot.util.ExcelUtils;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
import com.diagbot.util.MapUtil;
|
|
|
import com.diagbot.util.StringUtil;
|
|
@@ -43,6 +47,7 @@ import com.diagbot.vo.AnalyzeCodeVO;
|
|
|
import com.diagbot.vo.AnalyzeRunVO;
|
|
|
import com.diagbot.vo.AnalyzeVO;
|
|
|
import com.diagbot.vo.BehospitalPageVO;
|
|
|
+import com.diagbot.vo.ExportQcresultVO;
|
|
|
import com.diagbot.vo.GetDetailVO;
|
|
|
import com.diagbot.vo.MedrecVo;
|
|
|
import com.diagbot.vo.QcResultAlgQueryVO;
|
|
@@ -54,6 +59,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.Date;
|
|
@@ -106,6 +112,8 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
QcQuestionFacade qcQuestionFacade;
|
|
|
@Autowired
|
|
|
QcModelHospitalFacade qcModelHospitalFacade;
|
|
|
+ @Autowired
|
|
|
+ private FilterFacade filterFacade;
|
|
|
|
|
|
/**
|
|
|
* 分页
|
|
@@ -114,32 +122,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 +203,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, "该病历无关联的质控条目!");
|
|
|
}
|
|
|
|
|
@@ -269,6 +252,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
.eq("hospital_id", hospitalId)
|
|
|
.eq("home_page_id", homePage.getHomePageId())
|
|
|
+ .orderByAsc("diagnose_order_no")
|
|
|
);
|
|
|
|
|
|
// 获取首页手术信息
|
|
@@ -276,6 +260,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
.eq("hospital_id", hospitalId)
|
|
|
.eq("home_page_id", homePage.getHomePageId())
|
|
|
+ .orderByAsc("operation_order_no")
|
|
|
);
|
|
|
}
|
|
|
|
|
@@ -287,6 +272,22 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
queryVo.setInputCatalogueMap(getInputCatalogueMap(qcCasesEntryDTOList)); // 设置质控条目编码
|
|
|
List<MedrecVo> medrecVoList = new ArrayList<>(); // 设置内容
|
|
|
|
|
|
+
|
|
|
+ // 添加住院病历信息
|
|
|
+ List<BehospitalInfo> behospitalInfoList = this.list(new QueryWrapper<BehospitalInfo>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("hospital_id", hospitalId)
|
|
|
+ .eq("behospital_code", analyzeVO.getBehospitalCode())
|
|
|
+ );
|
|
|
+ if (ListUtil.isNotEmpty(behospitalInfoList)) {
|
|
|
+ MedrecVo medrecVo = new MedrecVo();
|
|
|
+ medrecVo.setTitle("住院病历信息");
|
|
|
+ Map<String, Object> content = new HashMap<>();
|
|
|
+ content.put("content", behospitalInfoList);
|
|
|
+ medrecVo.setContent(content);
|
|
|
+ medrecVoList.add(medrecVo);
|
|
|
+ }
|
|
|
+
|
|
|
addData("入院记录", recMap, medrecVoList);
|
|
|
addData("病危通知书", recMap, medrecVoList);
|
|
|
addData("阶段小结", recMap, medrecVoList);
|
|
@@ -346,7 +347,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 +380,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);
|
|
@@ -395,6 +396,19 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
AlgorithmDTO algorithmDTO = algorithmFacade.getAlgorithmRes(algorithmVO);
|
|
|
//保存
|
|
|
Map<String, Object> pageMap = outputInfo.getPageData();
|
|
|
+ // 手动拼接数据【知情同意书】【谈话告知书】
|
|
|
+ List<MedicalRecord> recordList = medicalRecordFacade.list(new QueryWrapper<MedicalRecord>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("behospital_code", analyzeVO.getBehospitalCode())
|
|
|
+ .eq("hospital_id", hospitalId)
|
|
|
+ .in("mode_id", Arrays.asList(53, 54))
|
|
|
+ .orderByAsc("rec_date")
|
|
|
+ );
|
|
|
+ List<MedicalRecordDTO> medicalRecordDTOList = BeanUtil.listCopyTo(recordList, MedicalRecordDTO.class);
|
|
|
+ Map<Long, List<MedicalRecordDTO>> recordMap = EntityUtil.makeEntityListMap(medicalRecordDTOList, "modeId");
|
|
|
+ pageMap.put("知情同意书", recordMap.get(53L));
|
|
|
+ pageMap.put("谈话告知书", recordMap.get(54L));
|
|
|
+
|
|
|
String pageData = JSON.toJSONString(pageMap);
|
|
|
// 获取菜单信息
|
|
|
List<QcModeDTO> qcModeDTOList = qcModeFacade.getMenu(pageMap);
|
|
@@ -403,8 +417,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();
|
|
@@ -433,7 +447,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.getXmlText()).collect(Collectors.toList()));
|
|
|
+ content.put("content", list);
|
|
|
medrecVo.setContent(content);
|
|
|
medrecVoList.add(medrecVo);
|
|
|
}
|
|
@@ -452,18 +466,18 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
MedrecVo medrecVo = new MedrecVo();
|
|
|
medrecVo.setTitle(key);
|
|
|
Map<String, Object> content = new HashMap<>();
|
|
|
- Map<String, List<String>> listMap = new HashMap<>();
|
|
|
+ Map<String, Object> listMap = new HashMap<>();
|
|
|
Boolean flag = false;
|
|
|
for (String k : keyList) {
|
|
|
if (ListUtil.isNotEmpty(recMap.get(k))) {
|
|
|
- listMap.put(k, recMap.get(k).stream().map(r -> r.getXmlText()).collect(Collectors.toList()));
|
|
|
+ listMap.put(k, recMap.get(k));
|
|
|
flag = true;
|
|
|
}
|
|
|
}
|
|
|
if (flag) {
|
|
|
// 会诊记录特殊处理,有会诊申请单,没有会诊结果单,复制一份到会诊结果单
|
|
|
- if ("会诊记录".equals(key) && ListUtil.isNotEmpty(listMap.get("会诊申请单"))
|
|
|
- && ListUtil.isEmpty(listMap.get("会诊结果单"))) {
|
|
|
+ if ("会诊记录".equals(key) && listMap.get("会诊申请单") != null
|
|
|
+ && listMap.get("会诊结果单") == null) {
|
|
|
listMap.put("会诊结果单", listMap.get("会诊申请单"));
|
|
|
}
|
|
|
content.put("content", listMap);
|
|
@@ -484,7 +498,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
MedrecVo medrecVo = new MedrecVo();
|
|
|
medrecVo.setTitle(key);
|
|
|
Map<String, Object> content = new HashMap<>();
|
|
|
- Map<String, List<String>> listMap = new HashMap<>();
|
|
|
+ Map<String, Object> listMap = new HashMap<>();
|
|
|
List<RecordContentDTO> recordContentDTOList = recMap.get(key);
|
|
|
if (ListUtil.isNotEmpty(recordContentDTOList)) {
|
|
|
Map<String, List<RecordContentDTO>> keyMap =
|
|
@@ -492,7 +506,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.getXmlText()).collect(Collectors.toList()));
|
|
|
+ listMap.put(k, keyMap.get(k));
|
|
|
}
|
|
|
}
|
|
|
content.put("content", listMap);
|
|
@@ -509,8 +523,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 +537,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 +570,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 +582,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
|
|
|
/**
|
|
|
* 拼接数据(病案首页),从数据字典获取信息转换
|
|
|
+ *
|
|
|
* @param key
|
|
|
* @param homePage
|
|
|
* @param medrecVoList
|
|
@@ -575,7 +590,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,8 +603,12 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
for (String objKey : objectMap.keySet()) {
|
|
|
if (map.containsKey(objKey)) {
|
|
|
if (firstPageDate.contains(objKey)) {
|
|
|
- Date date = (Date)objectMap.get(objKey);
|
|
|
- content.put(map.get(objKey), DateUtil.formatDateTime(date).replaceAll("null", ""));
|
|
|
+ Date date = (Date) objectMap.get(objKey);
|
|
|
+ if ("birthday".equals(objKey)) {
|
|
|
+ content.put(map.get(objKey), DateUtil.formatDate(date));
|
|
|
+ } else {
|
|
|
+ content.put(map.get(objKey), DateUtil.formatDateTime(date));
|
|
|
+ }
|
|
|
} else {
|
|
|
content.put(map.get(objKey), String.valueOf(objectMap.get(objKey)).replaceAll("null", ""));
|
|
|
}
|
|
@@ -655,44 +674,33 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * 执行未评分的病历
|
|
|
+ * 处理定时任务入参
|
|
|
+ *
|
|
|
+ * @param param
|
|
|
+ * @param taskVO
|
|
|
*/
|
|
|
- public void execute() {
|
|
|
- TaskVO taskVO = new TaskVO();
|
|
|
- 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);
|
|
|
+ public void dealTaskVO(String param, TaskVO taskVO) {
|
|
|
+ if (StringUtil.isNotBlank(param)) {
|
|
|
+ String[] hos = param.split(",");
|
|
|
+ List<Long> hosptialIdList = new ArrayList<>();
|
|
|
+ for (String id : hos) {
|
|
|
+ hosptialIdList.add(Long.parseLong(id));
|
|
|
+ }
|
|
|
+ taskVO.setHosptialIdList(hosptialIdList);
|
|
|
}
|
|
|
-
|
|
|
-// 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++);
|
|
|
-// }
|
|
|
-// }
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
- * 对出院日期之前3天的未评分的病历进行评分
|
|
|
+ * 评分
|
|
|
*/
|
|
|
- public void execute2() {
|
|
|
- TaskVO taskVO = new TaskVO();
|
|
|
- Date date = DateUtil.addDay(DateUtil.now(), -3);
|
|
|
- taskVO.setLeaveDate(date);
|
|
|
+ public void execute(TaskVO taskVO, String param) {
|
|
|
+ // 处理医院信息
|
|
|
+ dealTaskVO(param, taskVO);
|
|
|
+ // 处理时间过滤
|
|
|
+ if (taskVO.getType() != null && taskVO.getType() == 1) {
|
|
|
+ Date date = DateUtil.addDay(DateUtil.now(), -3);
|
|
|
+ taskVO.setLeaveDate(date);
|
|
|
+ }
|
|
|
List<BehospitalInfo> behospitalInfoList = getNoGrade(taskVO);
|
|
|
for (BehospitalInfo bean : behospitalInfoList) {
|
|
|
AnalyzeVO analyzeVO = new AnalyzeVO();
|
|
@@ -703,6 +711,21 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ // /**
|
|
|
+ // * 对出院日期之前3天的未评分的病历进行评分
|
|
|
+ // */
|
|
|
+ // public void execute2(TaskVO taskVO) {
|
|
|
+ // 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
|
|
|
*
|
|
@@ -751,7 +774,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 +792,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 +893,99 @@ 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()));
|
|
|
+ behospitalPageVO.setIsPlacefile("1");
|
|
|
+ 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));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public void exportExcelFac(HttpServletResponse response) {
|
|
|
+ List<ExportExcelDTO> res = this.exportExcel();
|
|
|
+ String fileName = "mrqc";
|
|
|
+ ExcelUtils.exportExcelUser(res, null, "病案质控", ExportExcelDTO.class, fileName + ".xls", response);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 质控结果导出
|
|
|
+ *
|
|
|
+ * @param response
|
|
|
+ * @param exportQcresultVO
|
|
|
+ */
|
|
|
+ public void exportQcresult(HttpServletResponse response, ExportQcresultVO exportQcresultVO) {
|
|
|
+ String hospitalId = SysUserUtils.getCurrentHospitalID();
|
|
|
+ exportQcresultVO.setHospitalId(hospitalId);
|
|
|
+ Date startDate = exportQcresultVO.getLeaveHosDateStart();
|
|
|
+ Date endDate = exportQcresultVO.getLeaveHosDateEnd();
|
|
|
+ //时间间隔7天
|
|
|
+ long interval = 7 * 24 * 60 * 60 * 1000;
|
|
|
+ if (endDate.getTime() < startDate.getTime()) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
|
+ }
|
|
|
+ if (endDate.getTime() - startDate.getTime() > interval) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于7天");
|
|
|
+ }
|
|
|
+
|
|
|
+ List<ExportExcelDTO> res = this.exportQcresult(exportQcresultVO);
|
|
|
+ response.setContentType("text/html;charset=UTF-8");
|
|
|
+ ExcelUtils.exportExcel(res, null, "导出sheet1", ExportExcelDTO.class, "测试user.xls", response);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 科室质控结果导出
|
|
|
+ *
|
|
|
+ * @param response
|
|
|
+ * @param exportQcresultVO
|
|
|
+ */
|
|
|
+ public void exportQcresultByDept(HttpServletResponse response, ExportQcresultVO exportQcresultVO) {
|
|
|
+ String hospitalId = SysUserUtils.getCurrentHospitalID();
|
|
|
+ String userId = SysUserUtils.getCurrentPrincipleID();
|
|
|
+ exportQcresultVO.setHospitalId(hospitalId);
|
|
|
+ exportQcresultVO.setUserId(Long.valueOf(userId));
|
|
|
+ Date startDate = exportQcresultVO.getLeaveHosDateStart();
|
|
|
+ Date endDate = exportQcresultVO.getLeaveHosDateEnd();
|
|
|
+ //时间间隔7天
|
|
|
+ long interval = 7 * 24 * 60 * 60 * 1000;
|
|
|
+ if (endDate.getTime() < startDate.getTime()) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
|
+ }
|
|
|
+ if (endDate.getTime() - startDate.getTime() > interval) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于7天");
|
|
|
+ }
|
|
|
+
|
|
|
+ List<ExportExcelDTO> res = this.exportQcresultByDept(exportQcresultVO);
|
|
|
+ response.setContentType("text/html;charset=UTF-8");
|
|
|
+ ExcelUtils.exportExcel(res, null, "导出sheet1", ExportExcelDTO.class, "测试user.xls", response);
|
|
|
+ }
|
|
|
}
|