|
@@ -11,7 +11,9 @@ import com.lantone.common.util.EntityUtil;
|
|
|
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.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;
|
|
@@ -20,6 +22,7 @@ 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.LossStatusEnum;
|
|
|
import com.lantone.daqe.enums.LossTypeEnum;
|
|
|
import com.lantone.daqe.enums.LossWayEnum;
|
|
@@ -27,6 +30,7 @@ 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;
|
|
|
import com.lantone.daqe.service.impl.BlocklossResultServiceImpl;
|
|
|
import com.lantone.daqe.vo.GetBlockLossPageVO;
|
|
@@ -58,6 +62,8 @@ public class BlockLossManagementFacade {
|
|
|
@Autowired
|
|
|
private MedicalRecordFacade medicalRecordFacade;
|
|
|
@Autowired
|
|
|
+ private MedicalRecordContentFacade medicalRecordContentFacade;
|
|
|
+ @Autowired
|
|
|
private OperationLogService operationLogService;
|
|
|
|
|
|
|
|
@@ -97,8 +103,9 @@ public class BlockLossManagementFacade {
|
|
|
.le(dataCompareVO.getStartDate() != null, "gmt_create", dataCompareVO.getStartDate())
|
|
|
.eq("status", LossStatusEnum.IS_LOSS.getKey())
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey()));
|
|
|
+ Map<String, List<BlocklossResult>> lossResultMap = null;
|
|
|
if (ListUtil.isNotEmpty(lossResults)) {
|
|
|
- Map<String, List<BlocklossResult>> lossResultMap = EntityUtil.makeEntityListMap(lossResults, "lossType");
|
|
|
+ lossResultMap = EntityUtil.makeEntityListMap(lossResults, "lossType");
|
|
|
//更新以缺失数据的状态
|
|
|
flag = upBlockLossStatus(lossResultMap);
|
|
|
}
|
|
@@ -112,13 +119,13 @@ public class BlockLossManagementFacade {
|
|
|
//获取操作记录数据
|
|
|
//病历数据
|
|
|
dataCompareVO.setOperationUrl("save/saveBehospitalCode");
|
|
|
- List<GetOperationLogDTO> behospitalCodeLogs = getOperationLog(dataCompareVO);
|
|
|
+ List<GetOperationLogDTO> behospitalCodeLogs = getOperationLogs(dataCompareVO);
|
|
|
//病案首页数据
|
|
|
dataCompareVO.setOperationUrl("save/saveHomePages");
|
|
|
- List<GetOperationLogDTO> homePageLogs = getOperationLog(dataCompareVO);
|
|
|
+ List<GetOperationLogDTO> homePageLogs = getOperationLogs(dataCompareVO);
|
|
|
//文书数据
|
|
|
dataCompareVO.setOperationUrl("save/saveRecs");
|
|
|
- List<GetOperationLogDTO> recLogs = getOperationLog(dataCompareVO);
|
|
|
+ List<GetOperationLogDTO> recLogs = getOperationLogs(dataCompareVO);
|
|
|
|
|
|
//获取库中数据
|
|
|
//病历数据
|
|
@@ -147,6 +154,43 @@ public class BlockLossManagementFacade {
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey()))
|
|
|
.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 (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))) {
|
|
|
+ outLossRecs = lossWayRecMap.get(LossWayEnum.OUT_LOSS).stream().map(BlocklossResult::getRecId).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ if (ListUtil.isNotEmpty(lossWayRecMap.get(LossWayEnum.IN_LOSS))) {
|
|
|
+ inLossRecs = lossWayRecMap.get(LossWayEnum.IN_LOSS).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))) {
|
|
|
+ outLossHomepages = lossWayHomePageMap.get(LossWayEnum.OUT_LOSS).stream().map(BlocklossResult::getRecId).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ if (ListUtil.isNotEmpty(lossWayHomePageMap.get(LossWayEnum.IN_LOSS))) {
|
|
|
+ inLossHomepages = lossWayHomePageMap.get(LossWayEnum.IN_LOSS).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))) {
|
|
|
+ outLossCodes = lossWayCodeMap.get(LossWayEnum.OUT_LOSS).stream().map(BlocklossResult::getRecId).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ if (ListUtil.isNotEmpty(lossWayCodeMap.get(LossWayEnum.IN_LOSS))) {
|
|
|
+ inLossCodes = lossWayCodeMap.get(LossWayEnum.IN_LOSS).stream().map(BlocklossResult::getRecId).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
//=====2.2数据对比
|
|
|
//his与log日志做对比
|
|
@@ -170,25 +214,26 @@ public class BlockLossManagementFacade {
|
|
|
//外部丢失数据集合
|
|
|
List<BlocklossResult> outInserts = new ArrayList<>();
|
|
|
//文书数据对比
|
|
|
- compareHisWithLog(recs, recLogs, "0", outInserts);
|
|
|
+ compareHisWithLog(recs, recLogs, "0", outInserts, outLossRecs);
|
|
|
//病案首页数据对比
|
|
|
- compareHisWithLog(medicalRecords, homePageLogs, "1", outInserts);
|
|
|
+ compareHisWithLog(medicalRecords, homePageLogs, "1", outInserts, outLossHomepages);
|
|
|
//病历数据对比
|
|
|
- compareHisWithLog(medicalRecords, behospitalCodeLogs, "2", outInserts);
|
|
|
+ compareHisWithLog(medicalRecords, behospitalCodeLogs, "2", outInserts, outLossCodes);
|
|
|
+
|
|
|
flag = blocklossResultServiceImpl.saveBatch(outInserts);
|
|
|
}
|
|
|
|
|
|
//日志与入库数据对比
|
|
|
//内部丢失数据集合
|
|
|
List<BlocklossResult> inInserts = new ArrayList<>();
|
|
|
- if (ListUtil.isNotEmpty(dataBaseRecIds)) {
|
|
|
- compareLogWithLocal(recLogs, dataBaseRecIds, "0", inInserts);
|
|
|
+ if (ListUtil.isNotEmpty(recLogs)) {
|
|
|
+ compareLogWithLocal(recLogs, dataBaseRecIds, "0", inInserts, inLossRecs);
|
|
|
}
|
|
|
- if (ListUtil.isNotEmpty(dataBaseHomePageIds)) {
|
|
|
- compareLogWithLocal(homePageLogs, dataBaseHomePageIds, "1", inInserts);
|
|
|
+ if (ListUtil.isNotEmpty(homePageLogs)) {
|
|
|
+ compareLogWithLocal(homePageLogs, dataBaseHomePageIds, "1", inInserts, inLossHomepages);
|
|
|
}
|
|
|
- if (ListUtil.isNotEmpty(dataBaseBehospitalCodes)) {
|
|
|
- compareLogWithLocal(behospitalCodeLogs, dataBaseBehospitalCodes, "2", inInserts);
|
|
|
+ if (ListUtil.isNotEmpty(behospitalCodeLogs)) {
|
|
|
+ compareLogWithLocal(behospitalCodeLogs, dataBaseBehospitalCodes, "2", inInserts, inLossCodes);
|
|
|
}
|
|
|
if (ListUtil.isNotEmpty(inInserts)) {
|
|
|
flag = blocklossResultServiceImpl.saveBatch(inInserts);
|
|
@@ -199,45 +244,70 @@ public class BlockLossManagementFacade {
|
|
|
/**
|
|
|
* 日志与入库数据对比
|
|
|
*
|
|
|
- * @param logs 日志记录
|
|
|
- * @param dataBases 入库数据
|
|
|
- * @param type 对比类型:0:文书丢失 1:病案首页丢失 2:患者信息丢失
|
|
|
- * @param inInserts 内部丢失插入集合
|
|
|
+ * @param logs 日志记录
|
|
|
+ * @param dataBases 入库数据
|
|
|
+ * @param type 对比类型:0:文书丢失 1:病案首页丢失 2:患者信息丢失
|
|
|
+ * @param inInserts 内部丢失插入集合
|
|
|
+ * @param havingLossIds 已经插入的id集合
|
|
|
* @Return void
|
|
|
*/
|
|
|
- private void compareLogWithLocal(List<GetOperationLogDTO> logs, List<String> dataBases, String type, List<BlocklossResult> inInserts) {
|
|
|
+ private void compareLogWithLocal(List<GetOperationLogDTO> logs, List<String> dataBases, String type,
|
|
|
+ List<BlocklossResult> inInserts, List<String> havingLossIds) {
|
|
|
switch (type) {
|
|
|
case "0":
|
|
|
//文书丢失
|
|
|
logs.stream().forEach(rec -> {
|
|
|
//存在记录但是没有入库
|
|
|
if (!dataBases.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());
|
|
|
- //拼装病历数据块丢失明细其他信息
|
|
|
- assembleOtherBlocklossResult(blocklossResult);
|
|
|
- inInserts.add(blocklossResult);
|
|
|
+ if (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());
|
|
|
+ //拼装病历数据块丢失明细其他信息
|
|
|
+ assembleOtherBlocklossResult(blocklossResult);
|
|
|
+ inInserts.add(blocklossResult);
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
+ //判断只插入文书id的情况
|
|
|
+ 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");
|
|
|
+ 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插入成功,文书内容没有插入");
|
|
|
+ //拼装病历数据块丢失明细其他信息
|
|
|
+ assembleOtherBlocklossResult(blocklossResult);
|
|
|
+ inInserts.add(blocklossResult);
|
|
|
+ });
|
|
|
break;
|
|
|
case "1":
|
|
|
//病案首页丢失
|
|
|
logs.stream().forEach(homePages -> {
|
|
|
//存在记录但是没有入库
|
|
|
if (!dataBases.contains(homePages.getRecId())) {
|
|
|
- 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());
|
|
|
- //拼装病历数据块丢失明细其他信息
|
|
|
- assembleOtherBlocklossResult(blocklossResult);
|
|
|
- inInserts.add(blocklossResult);
|
|
|
+ if (havingLossIds.contains(homePages.getRecId())) {
|
|
|
+ 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());
|
|
|
+ //拼装病历数据块丢失明细其他信息
|
|
|
+ assembleOtherBlocklossResult(blocklossResult);
|
|
|
+ inInserts.add(blocklossResult);
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
break;
|
|
@@ -246,19 +316,22 @@ public class BlockLossManagementFacade {
|
|
|
logs.stream().forEach(beHehospitalInfo -> {
|
|
|
//存在记录但是没有入库
|
|
|
if (!dataBases.contains(beHehospitalInfo.getBehospitalCode())) {
|
|
|
- BlocklossResult blocklossResult = new BlocklossResult();
|
|
|
- blocklossResult.setBehospitalCode(beHehospitalInfo.getBehospitalCode());
|
|
|
- blocklossResult.setLossWay(LossWayEnum.IN_LOSS.getKey());
|
|
|
- blocklossResult.setLossType(LossTypeEnum.CODE_LOSS.getKey());
|
|
|
- //拼装病历数据块丢失明细其他信息
|
|
|
- assembleOtherBlocklossResult(blocklossResult);
|
|
|
- inInserts.add(blocklossResult);
|
|
|
+ if (havingLossIds.contains(beHehospitalInfo.getBehospitalCode())) {
|
|
|
+ BlocklossResult blocklossResult = new BlocklossResult();
|
|
|
+ blocklossResult.setBehospitalCode(beHehospitalInfo.getBehospitalCode());
|
|
|
+ blocklossResult.setLossWay(LossWayEnum.IN_LOSS.getKey());
|
|
|
+ blocklossResult.setLossType(LossTypeEnum.CODE_LOSS.getKey());
|
|
|
+ //拼装病历数据块丢失明细其他信息
|
|
|
+ assembleOtherBlocklossResult(blocklossResult);
|
|
|
+ inInserts.add(blocklossResult);
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -347,24 +420,31 @@ public class BlockLossManagementFacade {
|
|
|
* @param logs 日志数据
|
|
|
* @param type 对比类型:0:文书丢失 1:病案首页丢失 2:患者信息丢失
|
|
|
* @param outInserts 外部丢失插入集合
|
|
|
+ * @param havingLossIds 已经插入的id集合
|
|
|
* @Return void
|
|
|
*/
|
|
|
- private void compareHisWithLog(List<GetOperationLogDTO> medicalRecords, List<GetOperationLogDTO> logs, String type, List<BlocklossResult> outInserts) {
|
|
|
+ private void compareHisWithLog(List<GetOperationLogDTO> medicalRecords, List<GetOperationLogDTO> logs,
|
|
|
+ String type, List<BlocklossResult> outInserts, List<String> havingLossIds) {
|
|
|
switch (type) {
|
|
|
case "0":
|
|
|
List<String> recLogs = logs.stream().map(GetOperationLogDTO::getRecId).collect(Collectors.toList());
|
|
|
medicalRecords.stream().forEach(medicalRecord -> {
|
|
|
//文书不存在操作记录
|
|
|
- if (StringUtil.isNotEmpty(medicalRecord.getRecId()) && !recLogs.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());
|
|
|
- //拼装病历数据块丢失明细其他信息
|
|
|
- assembleOtherBlocklossResult(blocklossResult);
|
|
|
- outInserts.add(blocklossResult);
|
|
|
+ if (StringUtil.isNotEmpty(medicalRecord.getRecId())) {
|
|
|
+ if (!recLogs.contains(medicalRecord.getRecId())) {
|
|
|
+ //该记录没有插入
|
|
|
+ if (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());
|
|
|
+ //拼装病历数据块丢失明细其他信息
|
|
|
+ assembleOtherBlocklossResult(blocklossResult);
|
|
|
+ outInserts.add(blocklossResult);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
break;
|
|
@@ -373,15 +453,17 @@ public class BlockLossManagementFacade {
|
|
|
medicalRecords.stream().forEach(medicalRecord -> {
|
|
|
//病案首页不存在操作记录
|
|
|
if (StringUtil.isNotEmpty(medicalRecord.getHomePageId()) && !homepageLogs.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());
|
|
|
- //拼装病历数据块丢失明细其他信息
|
|
|
- assembleOtherBlocklossResult(blocklossResult);
|
|
|
- outInserts.add(blocklossResult);
|
|
|
+ if (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());
|
|
|
+ //拼装病历数据块丢失明细其他信息
|
|
|
+ assembleOtherBlocklossResult(blocklossResult);
|
|
|
+ outInserts.add(blocklossResult);
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
break;
|
|
@@ -390,13 +472,15 @@ public class BlockLossManagementFacade {
|
|
|
medicalRecords.stream().forEach(medicalRecord -> {
|
|
|
//病历数据不存在操作记录
|
|
|
if (!behospitalCodeLogs.contains(medicalRecord.getBehospitalCode())) {
|
|
|
- BlocklossResult blocklossResult = new BlocklossResult();
|
|
|
- blocklossResult.setBehospitalCode(medicalRecord.getBehospitalCode());
|
|
|
- blocklossResult.setLossWay(LossWayEnum.OUT_LOSS.getKey());
|
|
|
- blocklossResult.setLossType(LossTypeEnum.CODE_LOSS.getKey());
|
|
|
- //拼装病历数据块丢失明细其他信息
|
|
|
- assembleOtherBlocklossResult(blocklossResult);
|
|
|
- outInserts.add(blocklossResult);
|
|
|
+ if (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());
|
|
|
+ //拼装病历数据块丢失明细其他信息
|
|
|
+ assembleOtherBlocklossResult(blocklossResult);
|
|
|
+ outInserts.add(blocklossResult);
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
break;
|
|
@@ -426,8 +510,8 @@ public class BlockLossManagementFacade {
|
|
|
* @param dataCompareVO
|
|
|
* @Return java.util.List<com.lantone.common.dto.GetOperationLogDTO>
|
|
|
*/
|
|
|
- private List<GetOperationLogDTO> getOperationLog(DataCompareVO dataCompareVO) {
|
|
|
- return operationLogService.getOperationLog(dataCompareVO).getData();
|
|
|
+ private List<GetOperationLogDTO> getOperationLogs(DataCompareVO dataCompareVO) {
|
|
|
+ return operationLogService.getOperationLogs(dataCompareVO).getData();
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -441,4 +525,83 @@ public class BlockLossManagementFacade {
|
|
|
|
|
|
return new ArrayList<>();
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 丢失量分类汇总
|
|
|
+ *
|
|
|
+ * @param blockLossTypeGatherVO
|
|
|
+ * @Return com.lantone.daqe.dto.BlockLossTypeGatherDTO
|
|
|
+ */
|
|
|
+ public BlockLossTypeGatherDTO blockLossTypeGather(BlockLossTypeGatherVO blockLossTypeGatherVO) {
|
|
|
+ BlockLossTypeGatherDTO blockLossTypeGatherDTO = new BlockLossTypeGatherDTO();
|
|
|
+ //获取该时间段的日志数量
|
|
|
+ Integer logNum = operationLogService.getOperationLogNum(blockLossTypeGatherVO).getData();
|
|
|
+ blockLossTypeGatherDTO.setLogNum(logNum);
|
|
|
+ //获取该时间段的实际数量
|
|
|
+ Integer codeNum = behospitalInfoFacade.count(new QueryWrapper<BehospitalInfo>()
|
|
|
+ .eq("hospital_id", SysUserUtils.getCurrentHospitalId())
|
|
|
+ .ge(blockLossTypeGatherVO.getStartDate() != null, "gmt_create", blockLossTypeGatherVO.getStartDate())
|
|
|
+ .le(blockLossTypeGatherVO.getStartDate() != null, "gmt_create", blockLossTypeGatherVO.getStartDate()));
|
|
|
+ Integer homePageNum = homePageFacade.count(new QueryWrapper<HomePage>()
|
|
|
+ .eq("hospital_id", SysUserUtils.getCurrentHospitalId())
|
|
|
+ .ge(blockLossTypeGatherVO.getStartDate() != null, "gmt_create", blockLossTypeGatherVO.getStartDate())
|
|
|
+ .le(blockLossTypeGatherVO.getStartDate() != null, "gmt_create", blockLossTypeGatherVO.getStartDate()));
|
|
|
+ Integer recNum = medicalRecordFacade.count(new QueryWrapper<MedicalRecord>()
|
|
|
+ .eq("hospital_id", SysUserUtils.getCurrentHospitalId())
|
|
|
+ .ge(blockLossTypeGatherVO.getStartDate() != null, "gmt_create", blockLossTypeGatherVO.getStartDate())
|
|
|
+ .le(blockLossTypeGatherVO.getStartDate() != null, "gmt_create", blockLossTypeGatherVO.getStartDate()));
|
|
|
+ blockLossTypeGatherDTO.setRealNum(codeNum + homePageNum + recNum);
|
|
|
+ //获取该时间段的丢失数量
|
|
|
+ List<BlocklossResult> blocklossResults = blocklossResultFacade.list(new QueryWrapper<BlocklossResult>()
|
|
|
+ .eq("hospital_id", SysUserUtils.getCurrentHospitalId())
|
|
|
+ .eq("status", LossStatusEnum.IS_LOSS.getKey())
|
|
|
+ .ge(blockLossTypeGatherVO.getStartDate() != null, "gmt_create", blockLossTypeGatherVO.getStartDate())
|
|
|
+ .le(blockLossTypeGatherVO.getStartDate() != null, "gmt_create", blockLossTypeGatherVO.getStartDate()));
|
|
|
+ Integer allLossNum = blocklossResults.size();
|
|
|
+ blockLossTypeGatherDTO.setAllLossNum(allLossNum);
|
|
|
+ blockLossTypeGatherDTO.setHisNum(logNum + allLossNum);
|
|
|
+
|
|
|
+ Map<String, List<BlocklossResult>> lossWayMap = EntityUtil.makeEntityListMap(blocklossResults, "lossWay");
|
|
|
+ //外部丢失
|
|
|
+ if (lossWayMap.get(LossWayEnum.OUT_LOSS.getKey()) != null) {
|
|
|
+ Integer outLossNum = lossWayMap.get(LossWayEnum.OUT_LOSS.getKey()).size();
|
|
|
+ blockLossTypeGatherDTO.setOutLossNum(outLossNum);
|
|
|
+ if (lossWayMap.get(LossWayEnum.OUT_LOSS.getKey()) != null) {
|
|
|
+ Map<String, List<BlocklossResult>> outLossTypeMap = EntityUtil.makeEntityListMap(lossWayMap.get(LossWayEnum.OUT_LOSS.getKey()), "lossType");
|
|
|
+ if (outLossTypeMap.get(LossTypeEnum.REC_LOSS.getKey()) != null) {
|
|
|
+ Integer outRecNum = outLossTypeMap.get(LossTypeEnum.REC_LOSS.getKey()).size();
|
|
|
+ blockLossTypeGatherDTO.setOutRecNum(outRecNum);
|
|
|
+ }
|
|
|
+ if (outLossTypeMap.get(LossTypeEnum.CODE_LOSS.getKey()) != null) {
|
|
|
+ Integer outCodeNum = outLossTypeMap.get(LossTypeEnum.CODE_LOSS.getKey()).size();
|
|
|
+ blockLossTypeGatherDTO.setOutCodeNum(outCodeNum);
|
|
|
+ }
|
|
|
+ if (outLossTypeMap.get(LossTypeEnum.HOMEPAGE_LOSS.getKey()) != null) {
|
|
|
+ Integer outHomePageNum = outLossTypeMap.get(LossTypeEnum.HOMEPAGE_LOSS.getKey()).size();
|
|
|
+ blockLossTypeGatherDTO.setOutHomePageNum(outHomePageNum);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //内部丢失
|
|
|
+ if (lossWayMap.get(LossWayEnum.IN_LOSS.getKey()) != null) {
|
|
|
+ Integer inLossNum = lossWayMap.get(LossWayEnum.IN_LOSS.getKey()).size();
|
|
|
+ blockLossTypeGatherDTO.setInLossNum(inLossNum);
|
|
|
+ if (lossWayMap.get(LossWayEnum.IN_LOSS.getKey()) != null) {
|
|
|
+ Map<String, List<BlocklossResult>> inLossTypeMap = EntityUtil.makeEntityListMap(lossWayMap.get(LossWayEnum.IN_LOSS.getKey()), "lossType");
|
|
|
+ if (inLossTypeMap.get(LossTypeEnum.REC_LOSS.getKey()) != null) {
|
|
|
+ Integer inRecNum = inLossTypeMap.get(LossTypeEnum.REC_LOSS.getKey()).size();
|
|
|
+ blockLossTypeGatherDTO.setInRecNum(inRecNum);
|
|
|
+ }
|
|
|
+ if (inLossTypeMap.get(LossTypeEnum.CODE_LOSS.getKey()) != null) {
|
|
|
+ Integer inCodeNum = inLossTypeMap.get(LossTypeEnum.CODE_LOSS.getKey()).size();
|
|
|
+ blockLossTypeGatherDTO.setInCodeNum(inCodeNum);
|
|
|
+ }
|
|
|
+ if (inLossTypeMap.get(LossTypeEnum.HOMEPAGE_LOSS.getKey()) != null) {
|
|
|
+ Integer inHomePageNum = inLossTypeMap.get(LossTypeEnum.HOMEPAGE_LOSS.getKey()).size();
|
|
|
+ blockLossTypeGatherDTO.setInHomePageNum(inHomePageNum);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return blockLossTypeGatherDTO;
|
|
|
+ }
|
|
|
}
|