|
@@ -43,6 +43,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.time.LocalDateTime;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.Date;
|
|
@@ -155,6 +156,8 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
StrTransferOutNoteFacade strTransferOutNoteFacade;
|
|
|
@Autowired
|
|
|
StrWardRecordFacade strWardRecordFacade;
|
|
|
+ @Autowired
|
|
|
+ MedTransferRecordFacade medTransferRecordFacade;
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -487,6 +490,25 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
.orderByAsc("rec_date")
|
|
|
);
|
|
|
|
|
|
+ List<LocalDateTime> transferOutDate = new ArrayList<>();
|
|
|
+ List<LocalDateTime> transferInDate = new ArrayList<>();
|
|
|
+ Map<String, List<LocalDateTime>> transferMap = new HashMap<>();
|
|
|
+
|
|
|
+ //转入转出时间表
|
|
|
+ List<MedTransferRecord> medTransferRecordList = medTransferRecordFacade.list(new QueryWrapper<MedTransferRecord>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("hospital_id", hospitalId)
|
|
|
+ .eq("behospital_code", analyzeVO.getBehospitalCode())
|
|
|
+ .orderByDesc("id"));
|
|
|
+ if(ListUtil.isNotEmpty(medTransferRecordList)){
|
|
|
+ medTransferRecordList.forEach(medTransferRecord -> {
|
|
|
+ transferOutDate.add(medTransferRecord.getTransferOutDate());
|
|
|
+ transferInDate.add(medTransferRecord.getTransferInDate());
|
|
|
+ });
|
|
|
+ }
|
|
|
+ transferMap.put("转出时间",transferOutDate);
|
|
|
+ transferMap.put("转入时间",transferInDate);
|
|
|
+
|
|
|
// 转入记录
|
|
|
List<StrTransferInNote> strTransferInNoteList = strTransferInNoteFacade.list(new QueryWrapper<StrTransferInNote>()
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
@@ -608,30 +630,30 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
|
|
|
// 会诊记录
|
|
|
if (ListUtil.isNotEmpty(strConsultationRecordList)) {
|
|
|
- specialData("会诊", strConsultationRecordList, recMap, medrecVoList, "会诊记录");
|
|
|
+ specialData("会诊", strConsultationRecordList, recMap, medrecVoList, "会诊记录",null);
|
|
|
} else {
|
|
|
specialDataWithKey("会诊", recMap, medrecVoList, "会诊记录",
|
|
|
- Arrays.asList("会诊记录"));
|
|
|
+ Arrays.asList("会诊记录"),null);
|
|
|
}
|
|
|
|
|
|
//会诊申请单
|
|
|
if (ListUtil.isNotEmpty(strConsultationApplyList)) {
|
|
|
- specialData("会诊", strConsultationApplyList, recMap, medrecVoList, "会诊申请单");
|
|
|
+ specialData("会诊", strConsultationApplyList, recMap, medrecVoList, "会诊申请单",null);
|
|
|
} else {
|
|
|
specialDataWithKey("会诊", recMap, medrecVoList, "会诊申请单",
|
|
|
- Arrays.asList("会诊申请单"));
|
|
|
+ Arrays.asList("会诊申请单"),null);
|
|
|
}
|
|
|
//会诊结果单
|
|
|
if (ListUtil.isNotEmpty(strConsultationResultList)) {
|
|
|
- specialData("会诊", strConsultationResultList, recMap, medrecVoList, "会诊结果单");
|
|
|
+ specialData("会诊", strConsultationResultList, recMap, medrecVoList, "会诊结果单",null);
|
|
|
} else {
|
|
|
specialDataWithKey("会诊", recMap, medrecVoList, "会诊结果单",
|
|
|
- Arrays.asList("会诊记录", "会诊结果单", "会诊申请单"));
|
|
|
+ Arrays.asList("会诊记录", "会诊结果单", "会诊申请单"),null);
|
|
|
}
|
|
|
|
|
|
//会诊单(申请和结果)
|
|
|
if (ListUtil.isNotEmpty(strConsultationNoteList)) {
|
|
|
- specialData("会诊", strConsultationNoteList, recMap, medrecVoList, "会诊单(申请和结果)");
|
|
|
+ specialData("会诊", strConsultationNoteList, recMap, medrecVoList, "会诊单(申请和结果)",null);
|
|
|
}
|
|
|
//入院记录
|
|
|
if (ListUtil.isNotEmpty(strAdmissionNoteList)) {
|
|
@@ -713,18 +735,18 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
|
|
|
//术后首程
|
|
|
if (ListUtil.isNotEmpty(strOperativeFirstRecordList)) {
|
|
|
- specialData("手术", strOperativeFirstRecordList, recMap, medrecVoList, "术后首次病程及谈话记录");
|
|
|
+ specialData("手术", strOperativeFirstRecordList, recMap, medrecVoList, "术后首次病程及谈话记录",null);
|
|
|
} else {
|
|
|
specialDataWithKey("手术", recMap, medrecVoList, "术后首次病程及谈话记录",
|
|
|
- null);
|
|
|
+ null,null);
|
|
|
}
|
|
|
|
|
|
//手术记录
|
|
|
if (ListUtil.isNotEmpty(strOperativeNoteList)) {
|
|
|
- specialData("手术", strOperativeNoteList, recMap, medrecVoList, "手术记录");
|
|
|
+ specialData("手术", strOperativeNoteList, recMap, medrecVoList, "手术记录",null);
|
|
|
} else {
|
|
|
specialDataWithKey("手术", recMap, medrecVoList, "手术记录",
|
|
|
- null);
|
|
|
+ null,null);
|
|
|
}
|
|
|
|
|
|
//阶段小结
|
|
@@ -736,10 +758,10 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
|
|
|
//术前讨论小结
|
|
|
if (ListUtil.isNotEmpty(strPreoperativeDiscussionList)) {
|
|
|
- specialData("手术", strPreoperativeDiscussionList, recMap, medrecVoList, "术前讨论、术前小结");
|
|
|
+ specialData("手术", strPreoperativeDiscussionList, recMap, medrecVoList, "术前讨论、术前小结",null);
|
|
|
} else {
|
|
|
specialDataWithKey("手术", recMap, medrecVoList, "术前讨论、术前小结",
|
|
|
- null);
|
|
|
+ null,null);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -752,18 +774,18 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
|
|
|
//转入记录
|
|
|
if (ListUtil.isNotEmpty(strTransferInNoteList)) {
|
|
|
- specialData("转科", strTransferInNoteList, recMap, medrecVoList, "转入记录");
|
|
|
+ specialData("转科", strTransferInNoteList, recMap, medrecVoList, "转入记录",transferMap);
|
|
|
} else {
|
|
|
specialDataWithKey("转科", recMap, medrecVoList, "转入记录",
|
|
|
- null);
|
|
|
+ null,transferMap);
|
|
|
}
|
|
|
|
|
|
//转出记录
|
|
|
if (ListUtil.isNotEmpty(strTransferOutNoteList)) {
|
|
|
- specialData("转科", strTransferOutNoteList, recMap, medrecVoList, "转出记录");
|
|
|
+ specialData("转科", strTransferOutNoteList, recMap, medrecVoList, "转出记录",transferMap);
|
|
|
} else {
|
|
|
specialDataWithKey("转科", recMap, medrecVoList, "转出记录",
|
|
|
- null);
|
|
|
+ null,transferMap);
|
|
|
}
|
|
|
|
|
|
//查房记录
|
|
@@ -775,10 +797,10 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
|
|
|
//==============非结构化表拥有,文书单独查出来====================
|
|
|
specialDataWithKey("手术", recMap, medrecVoList, "手术知情同意书",
|
|
|
- null);
|
|
|
+ null,null);
|
|
|
|
|
|
specialDataWithKey("手术", recMap, medrecVoList, "手术安全核查表",
|
|
|
- null);
|
|
|
+ null,null);
|
|
|
|
|
|
|
|
|
//=========================================
|
|
@@ -930,8 +952,8 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
* @param recMap
|
|
|
* @param medrecVoList
|
|
|
*/
|
|
|
- public void specialDataWithKey(String key, Map<String, List<RecordContentDTO>> recMap,
|
|
|
- List<MedrecVo> medrecVoList, String keyTagert, List<String> keyList) {
|
|
|
+ public void specialDataWithKey(String key, Map<String, List<RecordContentDTO>> recMap, List<MedrecVo> medrecVoList,
|
|
|
+ String keyTagert, List<String> keyList,Map<String, List<LocalDateTime>> transferMap) {
|
|
|
MedrecVo medrecVo = new MedrecVo();
|
|
|
Map<String, List<RecordContentDTO>> specialContent = new HashMap<String, List<RecordContentDTO>>();
|
|
|
Map<String, Object> content = new HashMap<>();
|
|
@@ -945,21 +967,32 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+ //设置特殊属性
|
|
|
List<RecordContentDTO> recordContentDTOS = recMap.get(keyTagert);
|
|
|
- List<RecordContentDTO> recordContentList = recMap.get("会诊申请单");
|
|
|
if(ListUtil.isNotEmpty(recordContentDTOS)){
|
|
|
for (RecordContentDTO recordContentDTO : recordContentDTOS) {
|
|
|
+ if(null != transferMap){
|
|
|
+ recordContentDTO.setTransferOutDate(transferMap.get("转出时间"));
|
|
|
+ recordContentDTO.setTransferInDate(transferMap.get("转入时间"));
|
|
|
+ }
|
|
|
recordContentDTO.setIsParsed(0);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //用来复制申请单
|
|
|
+ List<RecordContentDTO> recordContentList = recMap.get("会诊申请单");
|
|
|
if(ListUtil.isNotEmpty(recordContentList)){
|
|
|
for (RecordContentDTO recordContentDTO : recordContentList) {
|
|
|
+ if(null != transferMap){
|
|
|
+ recordContentDTO.setTransferOutDate(transferMap.get("转出时间"));
|
|
|
+ recordContentDTO.setTransferInDate(transferMap.get("转入时间"));
|
|
|
+ }
|
|
|
recordContentDTO.setIsParsed(0);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
for (MedrecVo medrec : medrecVoList) {
|
|
|
+// 存在标题
|
|
|
if (key.equals(medrec.getTitle())) {
|
|
|
Map<String, Object> keyContent = medrec.getContent();
|
|
|
specialContent = JSON.parseObject(JSON.toJSONString(keyContent.get("content")), new TypeReference<Map<String, List<RecordContentDTO>>>() {
|
|
@@ -984,6 +1017,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //没有第一标题
|
|
|
if (!flag) {
|
|
|
if (ListUtil.isNotEmpty(keyList) && keyList.size() == 3) {
|
|
|
if (Map.get("会诊申请单") != null && Map.get("会诊结果单") == null && ListUtil.isNotEmpty(recordContentDTOS)) {
|
|
@@ -1147,7 +1181,8 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
* @param list
|
|
|
* @param medrecVoList
|
|
|
*/
|
|
|
- public <T> void specialData(String key, List<T> list, Map<String, List<RecordContentDTO>> recMap, List<MedrecVo> medrecVoList, String keyTagert) {
|
|
|
+ public <T> void specialData(String key, List<T> list, Map<String, List<RecordContentDTO>> recMap, List<MedrecVo> medrecVoList, String keyTagert,
|
|
|
+ Map<String, List<LocalDateTime>> transferMap) {
|
|
|
MedrecVo medrecVo = new MedrecVo();
|
|
|
Map<String, Object> content = new HashMap<String, Object>();
|
|
|
Map<String, List<RecordContentDTO>> specialContent = new HashMap<>();
|
|
@@ -1175,6 +1210,10 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
Boolean flag = true;
|
|
|
List<RecordContentDTO> recordContentDTOS = recMap.get(keyTagert);
|
|
|
for (RecordContentDTO recordContentDTO : recordContentDTOS) {
|
|
|
+ if(null != transferMap){
|
|
|
+ recordContentDTO.setTransferOutDate(transferMap.get("转出时间"));
|
|
|
+ recordContentDTO.setTransferInDate(transferMap.get("转入时间"));
|
|
|
+ }
|
|
|
if (ListUtil.isNotEmpty(contents)) {
|
|
|
for (RePlaceData rePlaceData : contents) {
|
|
|
if (StringUtil.isNotEmpty(recordContentDTO.getRecId()) &&
|