|
@@ -1,6 +1,7 @@
|
|
|
package com.diagbot.facade;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.serializer.SerializerFeature;
|
|
|
import com.baomidou.mybatisplus.annotation.TableName;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
@@ -38,6 +39,7 @@ import com.diagbot.vo.RecordContentVO;
|
|
|
import com.diagbot.vo.TaskVO;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.google.common.collect.Maps;
|
|
|
+
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Component;
|
|
@@ -155,7 +157,6 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
MedWardRecordFacade medWardRecordFacade;
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 分页
|
|
|
*
|
|
@@ -285,7 +286,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
// 获取病历所有数据
|
|
|
Map<String, Map<String, String>> dicMap = sysDictionaryFacade.getDictionaryWithKey(); // 获取字典信息
|
|
|
// 获取文书信息
|
|
|
- /* RecordContentVO recordContentVO = new RecordContentVO();
|
|
|
+ /* RecordContentVO recordContentVO = new RecordContentVO();
|
|
|
BeanUtil.copyProperties(analyzeVO, recordContentVO);
|
|
|
List<RecordContentDTO> recordContentDTOList = medicalRecordFacade.getRecordContentFac(recordContentVO);
|
|
|
String recTitle = "";
|
|
@@ -303,8 +304,8 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- Map<String, List<RecordContentDTO>> recMap = EntityUtil.makeEntityListMap(recordContentDTOList, "standModelName");*/
|
|
|
-
|
|
|
+ Map<String, List<RecordContentDTO>> recMap = EntityUtil.makeEntityListMap(recordContentDTOList, "standModelName");
|
|
|
+*/
|
|
|
// -------------------------------------文书数据改造开始----------------------------------
|
|
|
// 获取会诊申请单
|
|
|
List<MedConsultationApply> medConsultationApplyList = medConsultationApplyFacade.list(new QueryWrapper<MedConsultationApply>()
|
|
@@ -594,141 +595,206 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
List<MedPacsResult> medPacsResultList = medPacsResultFacade.getMedPacsResultList(behospitalInfoList.get(0));
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 文书数据拼接
|
|
|
*/
|
|
|
//会诊申请单
|
|
|
- newAddData("会诊申请单",medConsultationApplyList,medrecVoList);
|
|
|
+ if (ListUtil.isNotEmpty(medConsultationApplyList)) {
|
|
|
+ newAddData("会诊申请单", medConsultationApplyList, medrecVoList, Arrays.asList("recordDate", "behospitalDate",
|
|
|
+ "applyDate", "consultationDate", "recDate", "auditDate", "gmtCreate", "gmtModified"));
|
|
|
+ }
|
|
|
|
|
|
//会诊结果单
|
|
|
- newAddData("会诊结果单",medConsultationResultList,medrecVoList);
|
|
|
+ if (ListUtil.isNotEmpty(medConsultationResultList)) {
|
|
|
+ newAddData("会诊结果单", medConsultationResultList, medrecVoList, Arrays.asList("recordDate", "behospitalDate",
|
|
|
+ "applyDate", "consultationArriveDate", "recDate", "auditDate", "gmtCreate", "gmtModified"));
|
|
|
+ }
|
|
|
|
|
|
//会诊单(申请和结果)
|
|
|
- newAddData("会诊单(申请和结果)",medConsultationNoteList,medrecVoList);
|
|
|
+ if (ListUtil.isNotEmpty(medConsultationNoteList)) {
|
|
|
+ newAddData("会诊单(申请和结果)", medConsultationNoteList, medrecVoList, Arrays.asList("recordDate", "behospitalDate",
|
|
|
+ "applyDate", "consultationDate", "recDate", "auditDate", "gmtCreate", "gmtModified"));
|
|
|
+ }
|
|
|
|
|
|
//入院记录
|
|
|
- newAddData("入院记录",medAdmissionNoteList,medrecVoList);
|
|
|
+ if (ListUtil.isNotEmpty(medAdmissionNoteList)) {
|
|
|
+ newAddData("入院记录", medAdmissionNoteList, medrecVoList, Arrays.asList("recordDate", "birthday", "behospitalDate",
|
|
|
+ "recDate", "auditDate", "gmtCreate", "gmtModified"));
|
|
|
+ }
|
|
|
|
|
|
//输血效果评价
|
|
|
- newAddData("输血效果评价",medBloodResultList,medrecVoList);
|
|
|
+ if (ListUtil.isNotEmpty(medBloodResultList)) {
|
|
|
+ newAddData("输血效果评价", medBloodResultList, medrecVoList, Arrays.asList("recordDate", "recDate", "auditDate",
|
|
|
+ "gmtCreate", "gmtModified"));
|
|
|
+ }
|
|
|
|
|
|
//输血记录
|
|
|
- newAddData("输血记录",medBloodTransfusionList,medrecVoList);
|
|
|
+ if (ListUtil.isNotEmpty(medBloodTransfusionList)) {
|
|
|
+ newAddData("输血记录", medBloodTransfusionList, medrecVoList, Arrays.asList("recordDate", "startTime",
|
|
|
+ "endTime", "recDate", "auditDate", "gmtCreate", "gmtModified"));
|
|
|
+ }
|
|
|
|
|
|
//危急值记录
|
|
|
- newAddData("危急值记录",medCrisisNoteList,medrecVoList);
|
|
|
+ if (ListUtil.isNotEmpty(medCrisisNoteList)) {
|
|
|
+ newAddData("危急值记录", medCrisisNoteList, medrecVoList, Arrays.asList("recordDate", "recieveDate",
|
|
|
+ "consultationDate", "recDate", "auditDate", "gmtCreate", "gmtModified"));
|
|
|
+ }
|
|
|
|
|
|
//死亡病例讨论记录
|
|
|
- newAddData("死亡病例讨论记录",medDeathDiscussionList,medrecVoList);
|
|
|
+ if (ListUtil.isNotEmpty(medDeathDiscussionList)) {
|
|
|
+ newAddData("死亡病例讨论记录", medDeathDiscussionList, medrecVoList, Arrays.asList("recordDate", "deathDate",
|
|
|
+ "discussDate", "recDate", "auditDate", "gmtCreate", "gmtModified"));
|
|
|
+ }
|
|
|
|
|
|
//死亡记录
|
|
|
- newAddData("死亡记录",medDeathNoteList,medrecVoList);
|
|
|
+ if (ListUtil.isNotEmpty(medDeathNoteList)) {
|
|
|
+ newAddData("死亡记录", medDeathNoteList, medrecVoList, Arrays.asList("recordDate", "behospitalDate",
|
|
|
+ "deathDate", "recDate", "auditDate", "gmtCreate", "gmtModified"));
|
|
|
+ }
|
|
|
|
|
|
//疑难病例讨论记录
|
|
|
- newAddData("疑难病例讨论记录",medDifficultCaseList,medrecVoList);
|
|
|
+ if (ListUtil.isNotEmpty(medDifficultCaseList)) {
|
|
|
+ newAddData("疑难病例讨论记录", medDifficultCaseList, medrecVoList, Arrays.asList("recordDate", "discussDate",
|
|
|
+ "recDate", "auditDate", "gmtCreate", "gmtModified"));
|
|
|
+ }
|
|
|
|
|
|
//首次病程录
|
|
|
- newAddData("首次病程录",medFirstRecordList,medrecVoList);
|
|
|
+ if (ListUtil.isNotEmpty(medFirstRecordList)) {
|
|
|
+ newAddData("首次病程录", medFirstRecordList, medrecVoList, Arrays.asList("recordDate", "behospitalDate",
|
|
|
+ "applyDate", "consultationDate", "recDate", "auditDate", "gmtCreate", "gmtModified"));
|
|
|
+ }
|
|
|
|
|
|
//病危通知单
|
|
|
- newAddData("病危通知单",medIllCriticallyList,medrecVoList);
|
|
|
+ if (ListUtil.isNotEmpty(medIllCriticallyList)) {
|
|
|
+ newAddData("病危通知单", medIllCriticallyList, medrecVoList, Arrays.asList("recordDate", "recDate",
|
|
|
+ "auditDate", "gmtCreate", "gmtModified"));
|
|
|
+ }
|
|
|
|
|
|
//病重通知单
|
|
|
- newAddData("病重通知单",medIllSeriouslList,medrecVoList);
|
|
|
+ if (ListUtil.isNotEmpty(medIllSeriouslList)) {
|
|
|
+ newAddData("病重通知单", medIllSeriouslList, medrecVoList, Arrays.asList("recordDate", "patientSignDate",
|
|
|
+ "doctorSignDate", "gmtCreate", "gmtModified"));
|
|
|
+ }
|
|
|
|
|
|
//出院小结
|
|
|
- newAddData("出院小结",medLeaveHospitalList,medrecVoList);
|
|
|
+ if (ListUtil.isNotEmpty(medLeaveHospitalList)) {
|
|
|
+ newAddData("出院小结", medLeaveHospitalList, medrecVoList, Arrays.asList("recordDate", "behospitalDate",
|
|
|
+ "leaveHospitalDate", "recDate", "auditDate", "gmtCreate", "gmtModified"));
|
|
|
+ }
|
|
|
|
|
|
//术后首程
|
|
|
- newAddData("术后首程",medOperativeFirstRecordList,medrecVoList);
|
|
|
+ if (ListUtil.isNotEmpty(medOperativeFirstRecordList)) {
|
|
|
+ newAddData("术后首程", medOperativeFirstRecordList, medrecVoList, Arrays.asList("recordDate", "operationDate",
|
|
|
+ "startTime", "endTime", "recDate", "auditDate", "gmtCreate", "gmtModified"));
|
|
|
+ }
|
|
|
|
|
|
//手术记录
|
|
|
- newAddData("手术记录",medOperativeNoteList,medrecVoList);
|
|
|
+ if (ListUtil.isNotEmpty(medOperativeNoteList)) {
|
|
|
+ newAddData("手术记录", medOperativeNoteList, medrecVoList, Arrays.asList("recordDate", "operationDate",
|
|
|
+ "startTime", "endTime", "recDate", "auditDate", "gmtCreate", "gmtModified"));
|
|
|
+ }
|
|
|
|
|
|
//阶段小结
|
|
|
- newAddData("阶段小结",medPeriodConclusionList,medrecVoList);
|
|
|
+ if (ListUtil.isNotEmpty(medPeriodConclusionList)) {
|
|
|
+ newAddData("阶段小结", medPeriodConclusionList, medrecVoList, Arrays.asList("recordaDte", "recDate",
|
|
|
+ "auditDate", "gmtCreate", "gmtModified"));
|
|
|
+ }
|
|
|
|
|
|
//术前讨论小结
|
|
|
- newAddData("术前讨论小结",medPreoperativeDiscussionList,medrecVoList);
|
|
|
+ if (ListUtil.isNotEmpty(medPreoperativeDiscussionList)) {
|
|
|
+ newAddData("术前讨论小结", medPreoperativeDiscussionList, medrecVoList, Arrays.asList("recordDate", "discussTime",
|
|
|
+ "recDate", "auditDate", "gmtCreate", "gmtModified"));
|
|
|
+ }
|
|
|
|
|
|
//抢救记录
|
|
|
- newAddData("抢救记录",medRescueNoteList,medrecVoList);
|
|
|
+ if (ListUtil.isNotEmpty(medRescueNoteList)) {
|
|
|
+ newAddData("抢救记录", medRescueNoteList, medrecVoList, Arrays.asList("recordDate", "startTime", "endTime",
|
|
|
+ "recDate", "auditDate", "gmtCreate", "gmtModified"));
|
|
|
+ }
|
|
|
|
|
|
//转入记录
|
|
|
- newAddData("转入记录",medTransferInNoteList,medrecVoList);
|
|
|
+ if (ListUtil.isNotEmpty(medTransferInNoteList)) {
|
|
|
+ newAddData("转入记录", medTransferInNoteList, medrecVoList, Arrays.asList("recordDate", "transferInDate",
|
|
|
+ "recDate", "auditDate", "gmtCreate", "gmtModified"));
|
|
|
+ }
|
|
|
|
|
|
//转出记录
|
|
|
- newAddData("转出记录",medTransferOutNoteList,medrecVoList);
|
|
|
+ if (ListUtil.isNotEmpty(medTransferOutNoteList)) {
|
|
|
+ newAddData("转出记录", medTransferOutNoteList, medrecVoList, Arrays.asList("recordDate", "transferInDate",
|
|
|
+ "recDate", "auditDate", "gmtCreate", "gmtModified"));
|
|
|
+ }
|
|
|
|
|
|
//查房记录
|
|
|
- newAddData("查房记录",medWardRecordList,medrecVoList);
|
|
|
+ if (ListUtil.isNotEmpty(medWardRecordList)) {
|
|
|
+ newAddData("查房记录", medWardRecordList, medrecVoList, Arrays.asList("recordDate", "recDate", "auditDate",
|
|
|
+ "gmtCreate", "gmtModified"));
|
|
|
+ }
|
|
|
|
|
|
|
|
|
// 会诊记录
|
|
|
-// addDataWithKey("会诊", recMap, medrecVoList,
|
|
|
-// Arrays.asList("会诊记录", "会诊结果单", "会诊申请单"));
|
|
|
+ /* addDataWithKey("会诊", recMap, medrecVoList,
|
|
|
+ Arrays.asList("会诊记录", "会诊结果单", "会诊申请单"));*/
|
|
|
|
|
|
// 手术
|
|
|
/**
|
|
|
* "手术知情同意书", "手术安全核查表" 谈话记录表现有表格没有
|
|
|
*/
|
|
|
-// addDataWithKey("手术", recMap, medrecVoList,
|
|
|
-// Arrays.asList("术后首次病程及谈话记录", "手术记录",
|
|
|
-// "术前讨论、术前小结", "手术知情同意书", "手术安全核查表"));
|
|
|
+/* addDataWithKey("手术", recMap, medrecVoList,
|
|
|
+ Arrays.asList("术后首次病程及谈话记录", "手术记录",
|
|
|
+ "术前讨论、术前小结", "手术知情同意书", "手术安全核查表"));*/
|
|
|
|
|
|
// 转科
|
|
|
|
|
|
-// addDataWithKey("转科", recMap, medrecVoList,
|
|
|
-// Arrays.asList("转入记录", "转出记录"));
|
|
|
+ /* addDataWithKey("转科", recMap, medrecVoList,
|
|
|
+ Arrays.asList("转入记录", "转出记录"));
|
|
|
|
|
|
- // 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);
|
|
|
+ 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);
|
|
|
/**
|
|
|
* 是首次病程录么?
|
|
|
*/
|
|
|
- // addData("日常病程录", recMap, medrecVoList);
|
|
|
+// addData("日常病程录", recMap, medrecVoList);
|
|
|
/**
|
|
|
* ?
|
|
|
*/
|
|
|
- // addDataWithInnerKey("知情同意书", recMap, medrecVoList);
|
|
|
+// addDataWithInnerKey("知情同意书", recMap, medrecVoList);
|
|
|
/**
|
|
|
* ?
|
|
|
*/
|
|
|
- // addDataWithInnerKey("谈话告知书", recMap, medrecVoList);
|
|
|
+// addDataWithInnerKey("谈话告知书", recMap, medrecVoList);
|
|
|
|
|
|
// 医嘱
|
|
|
if (ListUtil.isNotEmpty(doctorAdviceList)) {
|
|
@@ -940,18 +1006,38 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
* 1.5.0拼接数据
|
|
|
*
|
|
|
* @param key
|
|
|
- * @param objectData
|
|
|
+ * @param list
|
|
|
* @param medrecVoList
|
|
|
*/
|
|
|
- public void newAddData(String key, Object objectData, List<MedrecVo> medrecVoList) {
|
|
|
- if (ObjectUtils.isNotEmpty(objectData)) {
|
|
|
- MedrecVo medrecVo = new MedrecVo();
|
|
|
- medrecVo.setTitle(key);
|
|
|
- Map<String, Object> content = new HashMap<>();
|
|
|
- content.put("content", objectData);
|
|
|
- medrecVo.setContent(content);
|
|
|
- medrecVoList.add(medrecVo);
|
|
|
+ public <T> void newAddData(String key, List<T> list, List<MedrecVo> medrecVoList, List<String> dateList) {
|
|
|
+ MedrecVo medrecVo = new MedrecVo();
|
|
|
+ medrecVo.setTitle(key);
|
|
|
+ Map<String, Object> content = new HashMap<>();
|
|
|
+ //装入jason数据
|
|
|
+ List<String> contents = new ArrayList<>();
|
|
|
+ for (T bean : list) {
|
|
|
+ Map<String, Object> res = new HashMap<>();
|
|
|
+ try {
|
|
|
+ Map<String, Object> objectMap = MapUtil.objectToMap(bean);
|
|
|
+ for (String objKey : objectMap.keySet()) {
|
|
|
+ if (dateList.contains(objKey)) {
|
|
|
+ Date date = (Date) objectMap.get(objKey);
|
|
|
+ res.put(objKey, DateUtil.formatDateTime(date).replaceAll("null", ""));
|
|
|
+ } else {
|
|
|
+ res.put(objKey, (objectMap.get(objKey)));
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ String jsonStr = JSON.toJSONString(res, SerializerFeature.WRITE_MAP_NULL_FEATURES);
|
|
|
+ contents.add(jsonStr);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
}
|
|
|
+ content.put("content", contents);
|
|
|
+ medrecVo.setContent(content);
|
|
|
+ medrecVoList.add(medrecVo);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|