|
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.google.common.collect.Lists;
|
|
|
+import com.lantone.common.dto.GetOperationLogDTO;
|
|
|
import com.lantone.common.enums.IsDeleteEnum;
|
|
|
import com.lantone.common.util.BeanUtil;
|
|
|
import com.lantone.common.util.DateUtil;
|
|
@@ -13,25 +14,23 @@ import com.lantone.common.util.ListUtil;
|
|
|
import com.lantone.common.util.StringUtil;
|
|
|
import com.lantone.common.util.SysUserUtils;
|
|
|
import com.lantone.common.vo.BlockLossTypeGatherVO;
|
|
|
+import com.lantone.common.vo.DataCompareVO;
|
|
|
import com.lantone.common.vo.DataRepariVO;
|
|
|
import com.lantone.daqe.client.OperationLogService;
|
|
|
import com.lantone.daqe.dto.BlockLossTypeGatherDTO;
|
|
|
import com.lantone.daqe.dto.GetBlockLossPageDTO;
|
|
|
-import com.lantone.common.dto.GetOperationLogDTO;
|
|
|
import com.lantone.daqe.dto.HisMedicalRecordDTO;
|
|
|
import com.lantone.daqe.dto.UpBlockLossByIdVO;
|
|
|
import com.lantone.daqe.entity.BehospitalInfo;
|
|
|
import com.lantone.daqe.entity.BlocklossResult;
|
|
|
import com.lantone.daqe.entity.HomePage;
|
|
|
import com.lantone.daqe.entity.MedicalRecord;
|
|
|
-import com.lantone.daqe.entity.MedicalRecordContent;
|
|
|
import com.lantone.daqe.enums.DataSaveUrlEnum;
|
|
|
import com.lantone.daqe.enums.LossStatusEnum;
|
|
|
import com.lantone.daqe.enums.LossTypeEnum;
|
|
|
import com.lantone.daqe.enums.LossWayEnum;
|
|
|
import com.lantone.daqe.facade.base.BehospitalInfoFacade;
|
|
|
import com.lantone.daqe.facade.base.BlocklossResultFacade;
|
|
|
-import com.lantone.common.vo.DataCompareVO;
|
|
|
import com.lantone.daqe.facade.base.HomePageFacade;
|
|
|
import com.lantone.daqe.facade.base.MedicalRecordContentFacade;
|
|
|
import com.lantone.daqe.facade.base.MedicalRecordFacade;
|
|
@@ -121,11 +120,18 @@ public class BlockLossManagementFacade {
|
|
|
.eq(hospitalId != null, "hospital_id", hospitalId)
|
|
|
.eq("status", LossStatusEnum.IS_LOSS.getKey())
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey()));
|
|
|
- Map<String, List<BlocklossResult>> lossResultMap = null;
|
|
|
+// Map<String, List<BlocklossResult>> lossResultMap = null;
|
|
|
if (ListUtil.isNotEmpty(lossResults)) {
|
|
|
- lossResultMap = EntityUtil.makeEntityListMap(lossResults, "lossType");
|
|
|
+ Map<String, List<BlocklossResult>> lossResultMap = EntityUtil.makeEntityListMap(lossResults, "lossType");
|
|
|
//更新以缺失数据的状态
|
|
|
flag = upBlockLossStatus(lossResultMap, hospitalId, principleId);
|
|
|
+ //删除当前时间段的对比记录
|
|
|
+ flag = blocklossResultFacade.remove(new UpdateWrapper<BlocklossResult>()
|
|
|
+ .ge(dataCompareVO.getStartDate() != null && StringUtil.isBlank(dataCompareVO.getBehospitalCode()), "gmt_create", dataCompareVO.getStartDate())
|
|
|
+ .le(dataCompareVO.getEndDate() != null && StringUtil.isBlank(dataCompareVO.getBehospitalCode()), "gmt_create", dataCompareVO.getEndDate())
|
|
|
+ .eq(StringUtil.isNotBlank(dataCompareVO.getBehospitalCode()), "behospital_code", dataCompareVO.getBehospitalCode())
|
|
|
+ .eq(hospitalId != null, "hospital_id", hospitalId)
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey()));
|
|
|
}
|
|
|
|
|
|
//====2.某时间的数据对比
|
|
@@ -156,7 +162,7 @@ public class BlockLossManagementFacade {
|
|
|
homePageLogs = removeRepeat(getOperationLogs(dataCompareVO), "homePageId");
|
|
|
//文书数据
|
|
|
dataCompareVO.setOperationUrl(DataSaveUrlEnum.MEDICAL_RECORD.getKey());
|
|
|
- recLogs = removeRepeat(getOperationLogs(dataCompareVO), "recTitle");
|
|
|
+ recLogs = removeRepeat(getOperationLogs(dataCompareVO), "recId");
|
|
|
}
|
|
|
|
|
|
//获取库中数据
|
|
@@ -188,45 +194,6 @@ public class BlockLossManagementFacade {
|
|
|
.stream().map(MedicalRecord::getRecId).collect(Collectors.toList());
|
|
|
}
|
|
|
|
|
|
- //==已丢失 外部|内部 病历、文书、病案首页 id集合
|
|
|
- //外部
|
|
|
- List<String> outLossCodes = null;
|
|
|
- List<String> outLossHomepages = null;
|
|
|
- List<String> outLossRecs = null;
|
|
|
- //内部
|
|
|
- List<String> inLossCodes = null;
|
|
|
- List<String> inLossHomepages = null;
|
|
|
- List<String> inLossRecs = null;
|
|
|
- if (lossResultMap != null) {
|
|
|
- if (ListUtil.isNotEmpty(lossResultMap.get(LossTypeEnum.REC_LOSS.getKey()))) {
|
|
|
- Map<String, List<BlocklossResult>> lossWayRecMap = EntityUtil.makeEntityListMap(lossResultMap.get(LossTypeEnum.REC_LOSS.getKey()), "lossWay");
|
|
|
- if (ListUtil.isNotEmpty(lossWayRecMap.get(LossWayEnum.OUT_LOSS.getKey()))) {
|
|
|
- outLossRecs = lossWayRecMap.get(LossWayEnum.OUT_LOSS.getKey()).stream().map(BlocklossResult::getRecId).collect(Collectors.toList());
|
|
|
- }
|
|
|
- if (ListUtil.isNotEmpty(lossWayRecMap.get(LossWayEnum.IN_LOSS.getKey()))) {
|
|
|
- inLossRecs = lossWayRecMap.get(LossWayEnum.IN_LOSS.getKey()).stream().map(BlocklossResult::getRecId).collect(Collectors.toList());
|
|
|
- }
|
|
|
- }
|
|
|
- if (ListUtil.isNotEmpty(lossResultMap.get(LossTypeEnum.HOMEPAGE_LOSS.getKey()))) {
|
|
|
- Map<String, List<BlocklossResult>> lossWayHomePageMap = EntityUtil.makeEntityListMap(lossResultMap.get(LossTypeEnum.HOMEPAGE_LOSS.getKey()), "lossWay");
|
|
|
- if (ListUtil.isNotEmpty(lossWayHomePageMap.get(LossWayEnum.OUT_LOSS.getKey()))) {
|
|
|
- outLossHomepages = lossWayHomePageMap.get(LossWayEnum.OUT_LOSS.getKey()).stream().map(BlocklossResult::getRecId).collect(Collectors.toList());
|
|
|
- }
|
|
|
- if (ListUtil.isNotEmpty(lossWayHomePageMap.get(LossWayEnum.IN_LOSS.getKey()))) {
|
|
|
- inLossHomepages = lossWayHomePageMap.get(LossWayEnum.IN_LOSS.getKey()).stream().map(BlocklossResult::getRecId).collect(Collectors.toList());
|
|
|
- }
|
|
|
- }
|
|
|
- if (ListUtil.isNotEmpty(lossResultMap.get(LossTypeEnum.CODE_LOSS.getKey()))) {
|
|
|
- Map<String, List<BlocklossResult>> lossWayCodeMap = EntityUtil.makeEntityListMap(lossResultMap.get(LossTypeEnum.CODE_LOSS.getKey()), "lossWay");
|
|
|
- if (ListUtil.isNotEmpty(lossWayCodeMap.get(LossWayEnum.OUT_LOSS.getKey()))) {
|
|
|
- outLossCodes = lossWayCodeMap.get(LossWayEnum.OUT_LOSS.getKey()).stream().map(BlocklossResult::getBehospitalCode).collect(Collectors.toList());
|
|
|
- }
|
|
|
- if (ListUtil.isNotEmpty(lossWayCodeMap.get(LossWayEnum.IN_LOSS.getKey()))) {
|
|
|
- inLossCodes = lossWayCodeMap.get(LossWayEnum.IN_LOSS.getKey()).stream().map(BlocklossResult::getBehospitalCode).collect(Collectors.toList());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
//=====2.2数据对比
|
|
|
//his与log日志做对比
|
|
|
if (ListUtil.isNotEmpty(hisMedicalRecords)) {
|
|
@@ -249,11 +216,11 @@ public class BlockLossManagementFacade {
|
|
|
//外部丢失数据集合
|
|
|
List<BlocklossResult> outInserts = new ArrayList<>();
|
|
|
//文书数据对比
|
|
|
- compareHisWithLog(recs, recLogs, LossTypeEnum.REC_LOSS.getKey(), outInserts, outLossRecs, hisMedicalRecordMap, hospitalId, principleId);
|
|
|
+ compareHisWithLog(recs, recLogs, LossTypeEnum.REC_LOSS.getKey(), outInserts, hisMedicalRecordMap, hospitalId, principleId);
|
|
|
//病案首页数据对比
|
|
|
- compareHisWithLog(medicalRecords, homePageLogs, LossTypeEnum.HOMEPAGE_LOSS.getKey(), outInserts, outLossHomepages, hisMedicalRecordMap, hospitalId, principleId);
|
|
|
+ compareHisWithLog(medicalRecords, homePageLogs, LossTypeEnum.HOMEPAGE_LOSS.getKey(), outInserts, hisMedicalRecordMap, hospitalId, principleId);
|
|
|
//病历数据对比
|
|
|
- compareHisWithLog(medicalRecords, behospitalCodeLogs, LossTypeEnum.CODE_LOSS.getKey(), outInserts, outLossCodes, hisMedicalRecordMap, hospitalId, principleId);
|
|
|
+ compareHisWithLog(medicalRecords, behospitalCodeLogs, LossTypeEnum.CODE_LOSS.getKey(), outInserts, hisMedicalRecordMap, hospitalId, principleId);
|
|
|
|
|
|
flag = blocklossResultServiceImpl.saveBatch(outInserts);
|
|
|
}
|
|
@@ -262,13 +229,13 @@ public class BlockLossManagementFacade {
|
|
|
//内部丢失数据集合
|
|
|
List<BlocklossResult> inInserts = new ArrayList<>();
|
|
|
if (ListUtil.isNotEmpty(recLogs)) {
|
|
|
- compareLogWithLocal(recLogs, dataBaseRecIds, LossTypeEnum.REC_LOSS.getKey(), inInserts, inLossRecs, hisMedicalRecordMap, hospitalId, principleId);
|
|
|
+ compareLogWithLocal(recLogs, dataBaseRecIds, LossTypeEnum.REC_LOSS.getKey(), inInserts, hisMedicalRecordMap, hospitalId, principleId);
|
|
|
}
|
|
|
if (ListUtil.isNotEmpty(homePageLogs)) {
|
|
|
- compareLogWithLocal(homePageLogs, dataBaseHomePageIds, LossTypeEnum.HOMEPAGE_LOSS.getKey(), inInserts, inLossHomepages, hisMedicalRecordMap, hospitalId, principleId);
|
|
|
+ compareLogWithLocal(homePageLogs, dataBaseHomePageIds, LossTypeEnum.HOMEPAGE_LOSS.getKey(), inInserts, hisMedicalRecordMap, hospitalId, principleId);
|
|
|
}
|
|
|
if (ListUtil.isNotEmpty(behospitalCodeLogs)) {
|
|
|
- compareLogWithLocal(behospitalCodeLogs, dataBaseBehospitalCodes, LossTypeEnum.CODE_LOSS.getKey(), inInserts, inLossCodes, hisMedicalRecordMap, hospitalId, principleId);
|
|
|
+ compareLogWithLocal(behospitalCodeLogs, dataBaseBehospitalCodes, LossTypeEnum.CODE_LOSS.getKey(), inInserts, hisMedicalRecordMap, hospitalId, principleId);
|
|
|
}
|
|
|
if (ListUtil.isNotEmpty(inInserts)) {
|
|
|
flag = blocklossResultServiceImpl.saveBatch(inInserts);
|
|
@@ -299,14 +266,13 @@ public class BlockLossManagementFacade {
|
|
|
* @param dataBases 入库数据
|
|
|
* @param type 对比类型:0:文书丢失 1:病案首页丢失 2:患者信息丢失
|
|
|
* @param inInserts 内部丢失插入集合
|
|
|
- * @param havingLossIds 已经插入的id集合
|
|
|
* @param hisMedicalRecordMap his病历数据map(key-住院序号:value-人的his数据)
|
|
|
* @param hospitalId 医院id
|
|
|
* @param principleId 操作人id
|
|
|
* @Return void
|
|
|
*/
|
|
|
private void compareLogWithLocal(List<GetOperationLogDTO> logs, List<String> dataBases, String type,
|
|
|
- List<BlocklossResult> inInserts, List<String> havingLossIds,
|
|
|
+ List<BlocklossResult> inInserts,
|
|
|
Map<String, HisMedicalRecordDTO> hisMedicalRecordMap, Long hospitalId, Long principleId) {
|
|
|
switch (type) {
|
|
|
case "0":
|
|
@@ -314,52 +280,48 @@ public class BlockLossManagementFacade {
|
|
|
logs.stream().forEach(rec -> {
|
|
|
//存在记录但是没有入库
|
|
|
if (!dataBases.contains(rec.getRecId())) {
|
|
|
- if (havingLossIds == null || !havingLossIds.contains(rec.getRecId())) {
|
|
|
- BlocklossResult blocklossResult = new BlocklossResult();
|
|
|
- blocklossResult.setBehospitalCode(rec.getBehospitalCode());
|
|
|
- blocklossResult.setRecId(rec.getRecId());
|
|
|
- blocklossResult.setRecTitle(rec.getRecTitle());
|
|
|
- blocklossResult.setLossWay(LossWayEnum.IN_LOSS.getKey());
|
|
|
- blocklossResult.setLossType(LossTypeEnum.REC_LOSS.getKey());
|
|
|
- if (hisMedicalRecordMap.get(rec.getBehospitalCode()) != null) {
|
|
|
- blocklossResult.setBehospitalDate(hisMedicalRecordMap.get(rec.getBehospitalCode()).getBehospitalDate());
|
|
|
- }
|
|
|
- //拼装病历数据块丢失明细其他信息
|
|
|
- assembleOtherBlocklossResult(blocklossResult, hospitalId, principleId);
|
|
|
- inInserts.add(blocklossResult);
|
|
|
+ BlocklossResult blocklossResult = new BlocklossResult();
|
|
|
+ blocklossResult.setBehospitalCode(rec.getBehospitalCode());
|
|
|
+ blocklossResult.setRecId(rec.getRecId());
|
|
|
+ blocklossResult.setRecTitle(rec.getRecTitle());
|
|
|
+ blocklossResult.setLossWay(LossWayEnum.IN_LOSS.getKey());
|
|
|
+ blocklossResult.setLossType(LossTypeEnum.REC_LOSS.getKey());
|
|
|
+ if (hisMedicalRecordMap.get(rec.getBehospitalCode()) != null) {
|
|
|
+ blocklossResult.setBehospitalDate(hisMedicalRecordMap.get(rec.getBehospitalCode()).getBehospitalDate());
|
|
|
}
|
|
|
+ //拼装病历数据块丢失明细其他信息
|
|
|
+ assembleOtherBlocklossResult(blocklossResult, hospitalId, principleId);
|
|
|
+ inInserts.add(blocklossResult);
|
|
|
}
|
|
|
});
|
|
|
//判断只插入文书id的情况
|
|
|
//获取插入的文书
|
|
|
- if (ListUtil.isNotEmpty(dataBases)) {
|
|
|
- List<String> havingRecIds = medicalRecordContentFacade.list(new QueryWrapper<MedicalRecordContent>()
|
|
|
- .select("rec_id")
|
|
|
- .in("rec_id", dataBases)).stream().map(MedicalRecordContent::getRecId).collect(Collectors.toList());
|
|
|
- List<String> tempList = new ArrayList<>(dataBases);
|
|
|
- //移除查出来有内容的文书
|
|
|
- tempList.removeAll(havingRecIds);
|
|
|
- Map<String, GetOperationLogDTO> recMap = EntityUtil.makeEntityMap(logs, "recId");
|
|
|
- //有文书id无内容文书
|
|
|
- tempList.stream().forEach(recId -> {
|
|
|
- //没有被记录过
|
|
|
- if (havingLossIds == null || !havingLossIds.contains(recId)) {
|
|
|
- BlocklossResult blocklossResult = new BlocklossResult();
|
|
|
- blocklossResult.setBehospitalCode(recMap.get(recId).getBehospitalCode());
|
|
|
- blocklossResult.setRecId(recId);
|
|
|
- blocklossResult.setRecTitle(recMap.get(recId).getRecTitle());
|
|
|
- blocklossResult.setLossWay(LossWayEnum.IN_LOSS.getKey());
|
|
|
- blocklossResult.setLossType(LossTypeEnum.REC_LOSS.getKey());
|
|
|
- blocklossResult.setLossCause("文书id插入成功,文书内容没有插入");
|
|
|
- if (hisMedicalRecordMap.get(recMap.get(recId)) != null) {
|
|
|
- blocklossResult.setBehospitalDate(hisMedicalRecordMap.get(recMap.get(recId).getBehospitalCode()).getBehospitalDate());
|
|
|
- }
|
|
|
- //拼装病历数据块丢失明细其他信息
|
|
|
- assembleOtherBlocklossResult(blocklossResult, hospitalId, principleId);
|
|
|
- inInserts.add(blocklossResult);
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+// if (ListUtil.isNotEmpty(dataBases)) {
|
|
|
+// List<String> havingRecIds = medicalRecordContentFacade.list(new QueryWrapper<MedicalRecordContent>()
|
|
|
+// .select("rec_id")
|
|
|
+// .in("rec_id", dataBases)).stream().map(MedicalRecordContent::getRecId).collect(Collectors.toList());
|
|
|
+// List<String> tempList = new ArrayList<>(dataBases);
|
|
|
+// //移除查出来有内容的文书
|
|
|
+// tempList.removeAll(havingRecIds);
|
|
|
+// Map<String, GetOperationLogDTO> recMap = EntityUtil.makeEntityMap(logs, "recId");
|
|
|
+// //有文书id无内容文书
|
|
|
+// tempList.stream().forEach(recId -> {
|
|
|
+// //没有被记录过
|
|
|
+// BlocklossResult blocklossResult = new BlocklossResult();
|
|
|
+// blocklossResult.setBehospitalCode(recMap.get(recId).getBehospitalCode());
|
|
|
+// blocklossResult.setRecId(recId);
|
|
|
+// blocklossResult.setRecTitle(recMap.get(recId).getRecTitle());
|
|
|
+// blocklossResult.setLossWay(LossWayEnum.IN_LOSS.getKey());
|
|
|
+// blocklossResult.setLossType(LossTypeEnum.REC_LOSS.getKey());
|
|
|
+// blocklossResult.setLossCause("文书id插入成功,文书内容没有插入");
|
|
|
+// if (hisMedicalRecordMap.get(recMap.get(recId)) != null) {
|
|
|
+// blocklossResult.setBehospitalDate(hisMedicalRecordMap.get(recMap.get(recId).getBehospitalCode()).getBehospitalDate());
|
|
|
+// }
|
|
|
+// //拼装病历数据块丢失明细其他信息
|
|
|
+// assembleOtherBlocklossResult(blocklossResult, hospitalId, principleId);
|
|
|
+// inInserts.add(blocklossResult);
|
|
|
+// });
|
|
|
+// }
|
|
|
|
|
|
break;
|
|
|
case "1":
|
|
@@ -367,20 +329,18 @@ public class BlockLossManagementFacade {
|
|
|
logs.stream().forEach(homePages -> {
|
|
|
//存在记录但是没有入库
|
|
|
if (!dataBases.contains(homePages.getRecId())) {
|
|
|
- if (havingLossIds == null || !havingLossIds.contains(homePages.getHomePageId())) {
|
|
|
- BlocklossResult blocklossResult = new BlocklossResult();
|
|
|
- blocklossResult.setBehospitalCode(homePages.getBehospitalCode());
|
|
|
- blocklossResult.setRecId(homePages.getHomePageId());
|
|
|
- blocklossResult.setRecTitle("病案首页丢失");
|
|
|
- blocklossResult.setLossWay(LossWayEnum.IN_LOSS.getKey());
|
|
|
- blocklossResult.setLossType(LossTypeEnum.HOMEPAGE_LOSS.getKey());
|
|
|
- if (hisMedicalRecordMap.get(homePages.getBehospitalCode()) != null) {
|
|
|
- blocklossResult.setBehospitalDate(hisMedicalRecordMap.get(homePages.getBehospitalCode()).getBehospitalDate());
|
|
|
- }
|
|
|
- //拼装病历数据块丢失明细其他信息
|
|
|
- assembleOtherBlocklossResult(blocklossResult, hospitalId, principleId);
|
|
|
- inInserts.add(blocklossResult);
|
|
|
+ BlocklossResult blocklossResult = new BlocklossResult();
|
|
|
+ blocklossResult.setBehospitalCode(homePages.getBehospitalCode());
|
|
|
+ blocklossResult.setRecId(homePages.getHomePageId());
|
|
|
+ blocklossResult.setRecTitle("病案首页丢失");
|
|
|
+ blocklossResult.setLossWay(LossWayEnum.IN_LOSS.getKey());
|
|
|
+ blocklossResult.setLossType(LossTypeEnum.HOMEPAGE_LOSS.getKey());
|
|
|
+ if (hisMedicalRecordMap.get(homePages.getBehospitalCode()) != null) {
|
|
|
+ blocklossResult.setBehospitalDate(hisMedicalRecordMap.get(homePages.getBehospitalCode()).getBehospitalDate());
|
|
|
}
|
|
|
+ //拼装病历数据块丢失明细其他信息
|
|
|
+ assembleOtherBlocklossResult(blocklossResult, hospitalId, principleId);
|
|
|
+ inInserts.add(blocklossResult);
|
|
|
}
|
|
|
});
|
|
|
break;
|
|
@@ -389,18 +349,16 @@ public class BlockLossManagementFacade {
|
|
|
logs.stream().forEach(beHehospitalInfo -> {
|
|
|
//存在记录但是没有入库
|
|
|
if (!dataBases.contains(beHehospitalInfo.getBehospitalCode())) {
|
|
|
- if (havingLossIds == null || !havingLossIds.contains(beHehospitalInfo.getBehospitalCode())) {
|
|
|
- BlocklossResult blocklossResult = new BlocklossResult();
|
|
|
- blocklossResult.setBehospitalCode(beHehospitalInfo.getBehospitalCode());
|
|
|
- blocklossResult.setLossWay(LossWayEnum.IN_LOSS.getKey());
|
|
|
- blocklossResult.setLossType(LossTypeEnum.CODE_LOSS.getKey());
|
|
|
- if (hisMedicalRecordMap.get(beHehospitalInfo.getBehospitalCode()) != null) {
|
|
|
- blocklossResult.setBehospitalDate(hisMedicalRecordMap.get(beHehospitalInfo.getBehospitalCode()).getBehospitalDate());
|
|
|
- }
|
|
|
- //拼装病历数据块丢失明细其他信息
|
|
|
- assembleOtherBlocklossResult(blocklossResult, hospitalId, principleId);
|
|
|
- inInserts.add(blocklossResult);
|
|
|
+ BlocklossResult blocklossResult = new BlocklossResult();
|
|
|
+ blocklossResult.setBehospitalCode(beHehospitalInfo.getBehospitalCode());
|
|
|
+ blocklossResult.setLossWay(LossWayEnum.IN_LOSS.getKey());
|
|
|
+ blocklossResult.setLossType(LossTypeEnum.CODE_LOSS.getKey());
|
|
|
+ if (hisMedicalRecordMap.get(beHehospitalInfo.getBehospitalCode()) != null) {
|
|
|
+ blocklossResult.setBehospitalDate(hisMedicalRecordMap.get(beHehospitalInfo.getBehospitalCode()).getBehospitalDate());
|
|
|
}
|
|
|
+ //拼装病历数据块丢失明细其他信息
|
|
|
+ assembleOtherBlocklossResult(blocklossResult, hospitalId, principleId);
|
|
|
+ inInserts.add(blocklossResult);
|
|
|
}
|
|
|
});
|
|
|
break;
|
|
@@ -499,14 +457,13 @@ public class BlockLossManagementFacade {
|
|
|
* @param logs 日志数据
|
|
|
* @param type 对比类型:0:文书丢失 1:病案首页丢失 2:患者信息丢失
|
|
|
* @param outInserts 外部丢失插入集合
|
|
|
- * @param havingLossIds 已经插入的id集合
|
|
|
* @param hisMedicalRecordMap his病历数据map(key-住院序号:value-人的his数据)
|
|
|
* @param hospitalId 医院id
|
|
|
* @param principleId 操作人id
|
|
|
* @Return void
|
|
|
*/
|
|
|
private void compareHisWithLog(List<GetOperationLogDTO> medicalRecords, List<GetOperationLogDTO> logs,
|
|
|
- String type, List<BlocklossResult> outInserts, List<String> havingLossIds,
|
|
|
+ String type, List<BlocklossResult> outInserts,
|
|
|
Map<String, HisMedicalRecordDTO> hisMedicalRecordMap, Long hospitalId, Long principleId) {
|
|
|
//his数据为空直接返回
|
|
|
if (ListUtil.isEmpty(medicalRecords)) {
|
|
@@ -520,18 +477,16 @@ public class BlockLossManagementFacade {
|
|
|
if (StringUtil.isNotEmpty(medicalRecord.getRecId())) {
|
|
|
if (!recLogs.contains(medicalRecord.getRecId())) {
|
|
|
//该记录没有插入
|
|
|
- if (havingLossIds == null || ListUtil.isNotEmpty(havingLossIds) && !havingLossIds.contains(medicalRecord.getRecId())) {
|
|
|
- BlocklossResult blocklossResult = new BlocklossResult();
|
|
|
- blocklossResult.setBehospitalCode(medicalRecord.getBehospitalCode());
|
|
|
- blocklossResult.setRecId(medicalRecord.getRecId());
|
|
|
- blocklossResult.setRecTitle(medicalRecord.getRecTitle());
|
|
|
- blocklossResult.setLossWay(LossWayEnum.OUT_LOSS.getKey());
|
|
|
- blocklossResult.setLossType(LossTypeEnum.REC_LOSS.getKey());
|
|
|
- blocklossResult.setBehospitalDate(hisMedicalRecordMap.get(medicalRecord.getBehospitalCode()).getBehospitalDate());
|
|
|
- //拼装病历数据块丢失明细其他信息
|
|
|
- assembleOtherBlocklossResult(blocklossResult, hospitalId, principleId);
|
|
|
- outInserts.add(blocklossResult);
|
|
|
- }
|
|
|
+ BlocklossResult blocklossResult = new BlocklossResult();
|
|
|
+ blocklossResult.setBehospitalCode(medicalRecord.getBehospitalCode());
|
|
|
+ blocklossResult.setRecId(medicalRecord.getRecId());
|
|
|
+ blocklossResult.setRecTitle(medicalRecord.getRecTitle());
|
|
|
+ blocklossResult.setLossWay(LossWayEnum.OUT_LOSS.getKey());
|
|
|
+ blocklossResult.setLossType(LossTypeEnum.REC_LOSS.getKey());
|
|
|
+ blocklossResult.setBehospitalDate(hisMedicalRecordMap.get(medicalRecord.getBehospitalCode()).getBehospitalDate());
|
|
|
+ //拼装病历数据块丢失明细其他信息
|
|
|
+ assembleOtherBlocklossResult(blocklossResult, hospitalId, principleId);
|
|
|
+ outInserts.add(blocklossResult);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
@@ -541,18 +496,16 @@ public class BlockLossManagementFacade {
|
|
|
medicalRecords.stream().forEach(medicalRecord -> {
|
|
|
//病案首页不存在操作记录
|
|
|
if (StringUtil.isNotEmpty(medicalRecord.getHomePageId()) && !homepageLogs.contains(medicalRecord.getHomePageId())) {
|
|
|
- if (havingLossIds == null || ListUtil.isNotEmpty(havingLossIds) && !havingLossIds.contains(medicalRecord.getHomePageId())) {
|
|
|
- BlocklossResult blocklossResult = new BlocklossResult();
|
|
|
- blocklossResult.setBehospitalCode(medicalRecord.getBehospitalCode());
|
|
|
- blocklossResult.setRecId(medicalRecord.getHomePageId());
|
|
|
- blocklossResult.setRecTitle("病案首页丢失");
|
|
|
- blocklossResult.setLossWay(LossWayEnum.OUT_LOSS.getKey());
|
|
|
- blocklossResult.setLossType(LossTypeEnum.HOMEPAGE_LOSS.getKey());
|
|
|
- blocklossResult.setBehospitalDate(hisMedicalRecordMap.get(medicalRecord.getBehospitalCode()).getBehospitalDate());
|
|
|
- //拼装病历数据块丢失明细其他信息
|
|
|
- assembleOtherBlocklossResult(blocklossResult, hospitalId, principleId);
|
|
|
- outInserts.add(blocklossResult);
|
|
|
- }
|
|
|
+ BlocklossResult blocklossResult = new BlocklossResult();
|
|
|
+ blocklossResult.setBehospitalCode(medicalRecord.getBehospitalCode());
|
|
|
+ blocklossResult.setRecId(medicalRecord.getHomePageId());
|
|
|
+ blocklossResult.setRecTitle("病案首页丢失");
|
|
|
+ blocklossResult.setLossWay(LossWayEnum.OUT_LOSS.getKey());
|
|
|
+ blocklossResult.setLossType(LossTypeEnum.HOMEPAGE_LOSS.getKey());
|
|
|
+ blocklossResult.setBehospitalDate(hisMedicalRecordMap.get(medicalRecord.getBehospitalCode()).getBehospitalDate());
|
|
|
+ //拼装病历数据块丢失明细其他信息
|
|
|
+ assembleOtherBlocklossResult(blocklossResult, hospitalId, principleId);
|
|
|
+ outInserts.add(blocklossResult);
|
|
|
}
|
|
|
});
|
|
|
break;
|
|
@@ -561,16 +514,14 @@ public class BlockLossManagementFacade {
|
|
|
medicalRecords.stream().forEach(medicalRecord -> {
|
|
|
//病历数据不存在操作记录
|
|
|
if (!behospitalCodeLogs.contains(medicalRecord.getBehospitalCode())) {
|
|
|
- if (havingLossIds == null || ListUtil.isNotEmpty(havingLossIds) && !havingLossIds.contains(medicalRecord.getBehospitalCode())) {
|
|
|
- BlocklossResult blocklossResult = new BlocklossResult();
|
|
|
- blocklossResult.setBehospitalCode(medicalRecord.getBehospitalCode());
|
|
|
- blocklossResult.setLossWay(LossWayEnum.OUT_LOSS.getKey());
|
|
|
- blocklossResult.setLossType(LossTypeEnum.CODE_LOSS.getKey());
|
|
|
- blocklossResult.setBehospitalDate(hisMedicalRecordMap.get(medicalRecord.getBehospitalCode()).getBehospitalDate());
|
|
|
- //拼装病历数据块丢失明细其他信息
|
|
|
- assembleOtherBlocklossResult(blocklossResult, hospitalId, principleId);
|
|
|
- outInserts.add(blocklossResult);
|
|
|
- }
|
|
|
+ BlocklossResult blocklossResult = new BlocklossResult();
|
|
|
+ blocklossResult.setBehospitalCode(medicalRecord.getBehospitalCode());
|
|
|
+ blocklossResult.setLossWay(LossWayEnum.OUT_LOSS.getKey());
|
|
|
+ blocklossResult.setLossType(LossTypeEnum.CODE_LOSS.getKey());
|
|
|
+ blocklossResult.setBehospitalDate(hisMedicalRecordMap.get(medicalRecord.getBehospitalCode()).getBehospitalDate());
|
|
|
+ //拼装病历数据块丢失明细其他信息
|
|
|
+ assembleOtherBlocklossResult(blocklossResult, hospitalId, principleId);
|
|
|
+ outInserts.add(blocklossResult);
|
|
|
}
|
|
|
});
|
|
|
break;
|