|
@@ -16,6 +16,7 @@ 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.HisDataService;
|
|
|
import com.lantone.daqe.client.OperationLogService;
|
|
|
import com.lantone.daqe.dto.BlockLossTypeGatherDTO;
|
|
|
import com.lantone.daqe.dto.GetBlockLossPageDTO;
|
|
@@ -69,6 +70,9 @@ public class BlockLossManagementFacade {
|
|
|
@Autowired
|
|
|
private OperationLogService operationLogService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private HisDataService hisDataService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private HisDataManagementFacade hisDataManagementFacade;
|
|
|
|
|
@@ -144,36 +148,36 @@ public class BlockLossManagementFacade {
|
|
|
Map<String, List<BlocklossResult>> auditedResultMap = EntityUtil.makeEntityListMap(auditedResults, "lossType");
|
|
|
if (ListUtil.isNotEmpty(auditedResultMap.get(LossTypeEnum.CODE_LOSS.getKey()))) {
|
|
|
List<BlocklossResult> auditedResultCodes = auditedResultMap.get(LossTypeEnum.CODE_LOSS.getKey());
|
|
|
- if(ListUtil.isNotEmpty(auditedResultCodes)){
|
|
|
- Map<String, List<BlocklossResult>> tempCodeMap = EntityUtil.makeEntityListMap(auditedResultCodes,"lossWay");
|
|
|
- if(ListUtil.isNotEmpty(tempCodeMap.get(LossWayEnum.IN_LOSS.getKey()))){
|
|
|
+ if (ListUtil.isNotEmpty(auditedResultCodes)) {
|
|
|
+ Map<String, List<BlocklossResult>> tempCodeMap = EntityUtil.makeEntityListMap(auditedResultCodes, "lossWay");
|
|
|
+ if (ListUtil.isNotEmpty(tempCodeMap.get(LossWayEnum.IN_LOSS.getKey()))) {
|
|
|
inAuditedResultCodes = tempCodeMap.get(LossWayEnum.IN_LOSS.getKey()).stream().map(BlocklossResult::getBehospitalCode).collect(Collectors.toList());
|
|
|
}
|
|
|
- if(ListUtil.isNotEmpty(tempCodeMap.get(LossWayEnum.OUT_LOSS.getKey()))){
|
|
|
+ if (ListUtil.isNotEmpty(tempCodeMap.get(LossWayEnum.OUT_LOSS.getKey()))) {
|
|
|
outAuditedResultCodes = tempCodeMap.get(LossWayEnum.OUT_LOSS.getKey()).stream().map(BlocklossResult::getBehospitalCode).collect(Collectors.toList());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
if (ListUtil.isNotEmpty(auditedResultMap.get(LossTypeEnum.HOMEPAGE_LOSS.getKey()))) {
|
|
|
List<BlocklossResult> auditedResultHomePages = auditedResultMap.get(LossTypeEnum.HOMEPAGE_LOSS.getKey());
|
|
|
- if(ListUtil.isNotEmpty(auditedResultHomePages)){
|
|
|
- Map<String, List<BlocklossResult>> tempHomePageMap = EntityUtil.makeEntityListMap(auditedResultHomePages,"lossWay");
|
|
|
- if(ListUtil.isNotEmpty(tempHomePageMap.get(LossWayEnum.IN_LOSS.getKey()))){
|
|
|
+ if (ListUtil.isNotEmpty(auditedResultHomePages)) {
|
|
|
+ Map<String, List<BlocklossResult>> tempHomePageMap = EntityUtil.makeEntityListMap(auditedResultHomePages, "lossWay");
|
|
|
+ if (ListUtil.isNotEmpty(tempHomePageMap.get(LossWayEnum.IN_LOSS.getKey()))) {
|
|
|
inAuditedResultHomePages = tempHomePageMap.get(LossWayEnum.IN_LOSS.getKey()).stream().map(BlocklossResult::getRecId).collect(Collectors.toList());
|
|
|
}
|
|
|
- if(ListUtil.isNotEmpty(tempHomePageMap.get(LossWayEnum.OUT_LOSS.getKey()))){
|
|
|
+ if (ListUtil.isNotEmpty(tempHomePageMap.get(LossWayEnum.OUT_LOSS.getKey()))) {
|
|
|
outAuditedResultHomePages = tempHomePageMap.get(LossWayEnum.OUT_LOSS.getKey()).stream().map(BlocklossResult::getRecId).collect(Collectors.toList());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
if (ListUtil.isNotEmpty(auditedResultMap.get(LossTypeEnum.REC_LOSS.getKey()))) {
|
|
|
List<BlocklossResult> auditedResultRecIds = auditedResultMap.get(LossTypeEnum.REC_LOSS.getKey());
|
|
|
- if(ListUtil.isNotEmpty(auditedResultRecIds)){
|
|
|
- Map<String, List<BlocklossResult>> tempRecMap = EntityUtil.makeEntityListMap(auditedResultRecIds,"lossWay");
|
|
|
- if(ListUtil.isNotEmpty(tempRecMap.get(LossWayEnum.IN_LOSS.getKey()))){
|
|
|
+ if (ListUtil.isNotEmpty(auditedResultRecIds)) {
|
|
|
+ Map<String, List<BlocklossResult>> tempRecMap = EntityUtil.makeEntityListMap(auditedResultRecIds, "lossWay");
|
|
|
+ if (ListUtil.isNotEmpty(tempRecMap.get(LossWayEnum.IN_LOSS.getKey()))) {
|
|
|
inAuditedResultRecIds = tempRecMap.get(LossWayEnum.IN_LOSS.getKey()).stream().map(BlocklossResult::getRecId).collect(Collectors.toList());
|
|
|
}
|
|
|
- if(ListUtil.isNotEmpty(tempRecMap.get(LossWayEnum.OUT_LOSS.getKey()))){
|
|
|
+ if (ListUtil.isNotEmpty(tempRecMap.get(LossWayEnum.OUT_LOSS.getKey()))) {
|
|
|
outAuditedResultRecIds = tempRecMap.get(LossWayEnum.OUT_LOSS.getKey()).stream().map(BlocklossResult::getRecId).collect(Collectors.toList());
|
|
|
}
|
|
|
}
|
|
@@ -199,12 +203,11 @@ public class BlockLossManagementFacade {
|
|
|
//文书数据
|
|
|
List<GetOperationLogDTO> recLogs = new ArrayList<>();
|
|
|
|
|
|
- List<String> logCodes = null;
|
|
|
//没有病历数据就不用去查病案首页和文书
|
|
|
if (ListUtil.isNotEmpty(behospitalCodeLogs)) {
|
|
|
//日志去重防止多次操作
|
|
|
behospitalCodeLogs = removeRepeat(behospitalCodeLogs, "behospitalCode");
|
|
|
- logCodes = behospitalCodeLogs.stream().map(GetOperationLogDTO::getBehospitalCode).collect(Collectors.toList());
|
|
|
+ List<String> logCodes = behospitalCodeLogs.stream().map(GetOperationLogDTO::getBehospitalCode).collect(Collectors.toList());
|
|
|
dataCompareVO.setBehospitalCodes(logCodes);
|
|
|
//病案首页数据
|
|
|
dataCompareVO.setOperationUrl(DataSaveUrlEnum.HOME_PAGE.getKey());
|
|
@@ -272,6 +275,7 @@ public class BlockLossManagementFacade {
|
|
|
compareHisWithLog(medicalRecords, behospitalCodeLogs, LossTypeEnum.CODE_LOSS.getKey(), outAuditedResultCodes, outInserts, hisMedicalRecordMap, hospitalId, principleId, dataUps);
|
|
|
|
|
|
flag = blocklossResultServiceImpl.saveBatch(outInserts);
|
|
|
+ System.out.println("...");
|
|
|
}
|
|
|
|
|
|
//日志与入库数据对比
|
|
@@ -290,16 +294,16 @@ public class BlockLossManagementFacade {
|
|
|
if (ListUtil.isNotEmpty(dataUps)) {
|
|
|
Long finalPrincipleId = principleId;
|
|
|
Long finalHospitalId = hospitalId;
|
|
|
- dataUps.stream().forEach(data->{
|
|
|
+ dataUps.stream().forEach(data -> {
|
|
|
blocklossResultFacade.update(new UpdateWrapper<BlocklossResult>()
|
|
|
.set("gmt_modified", DateUtil.now())
|
|
|
.set("modifier", finalPrincipleId != null ? finalPrincipleId + "" : "0")
|
|
|
- .eq(StringUtil.isNotBlank(data.getRecId()),"rec_id", data.getRecId())
|
|
|
+ .eq(StringUtil.isNotBlank(data.getRecId()), "rec_id", data.getRecId())
|
|
|
.notIn("is_audited", LossIsAuditedEnum.NOT_AUDITED.getKey())
|
|
|
- .eq("behospital_code",data.getBehospitalCode())
|
|
|
+ .eq("behospital_code", data.getBehospitalCode())
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .ge(dataCompareVO.getStartDate() != null , "behospital_date", dataCompareVO.getStartDate())
|
|
|
- .le(dataCompareVO.getEndDate() != null , "behospital_date", dataCompareVO.getEndDate())
|
|
|
+ .ge(dataCompareVO.getStartDate() != null, "behospital_date", dataCompareVO.getStartDate())
|
|
|
+ .le(dataCompareVO.getEndDate() != null, "behospital_date", dataCompareVO.getEndDate())
|
|
|
.eq(finalHospitalId != null, "hospital_id", finalHospitalId));
|
|
|
});
|
|
|
}
|
|
@@ -501,7 +505,7 @@ public class BlockLossManagementFacade {
|
|
|
.eq("hospital_id", hospitalId != null ? hospitalId : 0)
|
|
|
.in("rec_id", lossResultMap.get(lossType).stream().map(BlocklossResult::getRecId).collect(Collectors.toList()))
|
|
|
.in("behospital_code", lossResultMap.get(lossType).stream().map(BlocklossResult::getBehospitalCode).collect(Collectors.toList()))
|
|
|
- .notIn(ListUtil.isNotEmpty(lossCodes),"behospital_code",lossCodes)//如果说入院记录丢失了,文书的状态还是已丢失不会更新
|
|
|
+ .notIn(ListUtil.isNotEmpty(lossCodes), "behospital_code", lossCodes)//如果说入院记录丢失了,文书的状态还是已丢失不会更新
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey()))
|
|
|
.stream().map(MedicalRecord::getRecId).collect(Collectors.toList());
|
|
|
//更新状态-已恢复
|
|
@@ -524,7 +528,7 @@ public class BlockLossManagementFacade {
|
|
|
.eq("hospital_id", hospitalId != null ? hospitalId : 0)
|
|
|
.in("home_page_id", lossResultMap.get(lossType).stream().map(BlocklossResult::getRecId).collect(Collectors.toList()))
|
|
|
.in("behospital_code", lossResultMap.get(lossType).stream().map(BlocklossResult::getBehospitalCode).collect(Collectors.toList()))
|
|
|
- .notIn(ListUtil.isNotEmpty(lossCodes),"behospital_code",lossCodes)//如果说入院记录丢失了,病案首页的状态还是已丢失不会更新
|
|
|
+ .notIn(ListUtil.isNotEmpty(lossCodes), "behospital_code", lossCodes)//如果说入院记录丢失了,病案首页的状态还是已丢失不会更新
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey()))
|
|
|
.stream().map(HomePage::getHomePageId).collect(Collectors.toList());
|
|
|
//更新状态-已恢复
|
|
@@ -655,7 +659,7 @@ public class BlockLossManagementFacade {
|
|
|
medicalRecords.stream().forEach(medicalRecord -> {
|
|
|
//病历数据不存在操作记录
|
|
|
if (!behospitalCodeLogs.contains(medicalRecord.getBehospitalCode())) {
|
|
|
- if (auditedResultDatas == null || !auditedResultDatas.contains(medicalRecord.getRecId())) {
|
|
|
+ if (auditedResultDatas == null || !auditedResultDatas.contains(medicalRecord.getBehospitalCode())) {
|
|
|
BlocklossResult blocklossResult = new BlocklossResult();
|
|
|
blocklossResult.setBehospitalCode(medicalRecord.getBehospitalCode());
|
|
|
blocklossResult.setLossWay(LossWayEnum.OUT_LOSS.getKey());
|
|
@@ -715,6 +719,7 @@ public class BlockLossManagementFacade {
|
|
|
*/
|
|
|
private List<HisMedicalRecordDTO> getHisMedicalRecords(DataCompareVO dataCompareVO) {
|
|
|
//技术服务部接口 /balance/data/getDataCount
|
|
|
+// return hisDataService.getDataCount(dataCompareVO).getData();
|
|
|
//###模拟
|
|
|
return hisDataManagementFacade.getHisMedicalRecords(dataCompareVO);
|
|
|
}
|
|
@@ -730,40 +735,26 @@ public class BlockLossManagementFacade {
|
|
|
DataSaveUrlEnum.HOME_PAGE.getKey(),
|
|
|
DataSaveUrlEnum.MEDICAL_RECORD.getKey()));
|
|
|
|
|
|
- DataCompareVO dataCompareVO = new DataCompareVO();
|
|
|
- dataCompareVO.setStartDate(blockLossTypeGatherVO.getStartDate());
|
|
|
- dataCompareVO.setEndDate(blockLossTypeGatherVO.getEndDate());
|
|
|
- //获取his数据
|
|
|
- List<HisMedicalRecordDTO> hisMedicalRecords = getHisMedicalRecords(dataCompareVO);
|
|
|
|
|
|
BlockLossTypeGatherDTO blockLossTypeGatherDTO = new BlockLossTypeGatherDTO();
|
|
|
- //his数据量
|
|
|
- blockLossTypeGatherDTO.setHisNum(getHisMedicalRecordsCount(hisMedicalRecords));
|
|
|
+ //获取his数据
|
|
|
+ // DataCompareVO dataCompareVO = new DataCompareVO();
|
|
|
+ // dataCompareVO.setStartDate(blockLossTypeGatherVO.getStartDate());
|
|
|
+ // dataCompareVO.setEndDate(blockLossTypeGatherVO.getEndDate());
|
|
|
+ // List<HisMedicalRecordDTO> hisMedicalRecords = getHisMedicalRecords(dataCompareVO);
|
|
|
+ // blockLossTypeGatherDTO.setHisNum(getHisMedicalRecordsCount(hisMedicalRecords));
|
|
|
|
|
|
- //获取该时间段的日志数量
|
|
|
- //病历数据
|
|
|
- dataCompareVO.setOperationUrl(DataSaveUrlEnum.BEHOSPITAL_INFO.getKey());
|
|
|
- List<GetOperationLogDTO> behospitalCodeLogs = getOperationLogs(dataCompareVO);
|
|
|
- //病案首页数据
|
|
|
- List<GetOperationLogDTO> homePageLogs = new ArrayList<>();
|
|
|
- //文书数据
|
|
|
- List<GetOperationLogDTO> recLogs = new ArrayList<>();
|
|
|
|
|
|
- if (ListUtil.isNotEmpty(behospitalCodeLogs)) {
|
|
|
- List<String> logCodes = behospitalCodeLogs.stream().map(GetOperationLogDTO::getBehospitalCode).collect(Collectors.toList());
|
|
|
- dataCompareVO.setBehospitalCodes(logCodes);
|
|
|
- //病案首页数据
|
|
|
- dataCompareVO.setOperationUrl(DataSaveUrlEnum.HOME_PAGE.getKey());
|
|
|
- homePageLogs = getOperationLogs(dataCompareVO);
|
|
|
- //文书数据
|
|
|
- dataCompareVO.setOperationUrl(DataSaveUrlEnum.MEDICAL_RECORD.getKey());
|
|
|
- recLogs = getOperationLogs(dataCompareVO);
|
|
|
- Integer logNum = logCodes.size() + homePageLogs.size() + recLogs.size();
|
|
|
- blockLossTypeGatherDTO.setLogNum(logNum);
|
|
|
- }
|
|
|
+ //获取his数据
|
|
|
+ blockLossTypeGatherDTO.setHisNum(getHisDataCount(blockLossTypeGatherVO));
|
|
|
+
|
|
|
+ //获取该时间段的日志数量
|
|
|
+ Integer logNum = operationLogService.getOperationLogNum(blockLossTypeGatherVO).getData();
|
|
|
+ blockLossTypeGatherDTO.setLogNum(logNum);
|
|
|
|
|
|
//获取该时间段的实际数量
|
|
|
List<String> codes = behospitalInfoFacade.list(new QueryWrapper<BehospitalInfo>()
|
|
|
+ .select("behospital_code")
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
.eq("hospital_id", SysUserUtils.getCurrentHospitalId() != null ? SysUserUtils.getCurrentHospitalId() : 0)
|
|
|
.ge(blockLossTypeGatherVO.getStartDate() != null, "behospital_date", blockLossTypeGatherVO.getStartDate())
|
|
@@ -776,9 +767,11 @@ public class BlockLossManagementFacade {
|
|
|
if (ListUtil.isNotEmpty(codes)) {
|
|
|
homePageNum = homePageFacade.count(new QueryWrapper<HomePage>()
|
|
|
.eq("hospital_id", SysUserUtils.getCurrentHospitalId() != null ? SysUserUtils.getCurrentHospitalId() : 0)
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
.in("behospital_code", codes));
|
|
|
recNum = medicalRecordFacade.count(new QueryWrapper<MedicalRecord>()
|
|
|
.eq("hospital_id", SysUserUtils.getCurrentHospitalId() != null ? SysUserUtils.getCurrentHospitalId() : 0)
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
.in("behospital_code", codes));
|
|
|
}
|
|
|
|
|
@@ -787,11 +780,11 @@ public class BlockLossManagementFacade {
|
|
|
List<BlocklossResult> blocklossResults = blocklossResultFacade.list(new QueryWrapper<BlocklossResult>()
|
|
|
.eq("hospital_id", SysUserUtils.getCurrentHospitalId() != null ? SysUserUtils.getCurrentHospitalId() : 0)
|
|
|
.eq("status", LossStatusEnum.IS_LOSS.getKey())
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
.ge(blockLossTypeGatherVO.getStartDate() != null, "behospital_date", blockLossTypeGatherVO.getStartDate())
|
|
|
.le(blockLossTypeGatherVO.getEndDate() != null, "behospital_date", blockLossTypeGatherVO.getEndDate()));
|
|
|
Integer allLossNum = blocklossResults.size();
|
|
|
blockLossTypeGatherDTO.setAllLossNum(allLossNum);
|
|
|
- // blockLossTypeGatherDTO.setHisNum(codeNum + homePageNum + recNum + allLossNum);
|
|
|
|
|
|
Map<String, List<BlocklossResult>> lossWayMap = EntityUtil.makeEntityListMap(blocklossResults, "lossWay");
|
|
|
//外部丢失
|
|
@@ -837,6 +830,19 @@ public class BlockLossManagementFacade {
|
|
|
return blockLossTypeGatherDTO;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取his数据数量
|
|
|
+ *
|
|
|
+ * @param blockLossTypeGatherVO
|
|
|
+ * @Return java.lang.Integer
|
|
|
+ */
|
|
|
+ private Integer getHisDataCount(BlockLossTypeGatherVO blockLossTypeGatherVO) {
|
|
|
+ //获取his数量
|
|
|
+// return hisDataService.getCount(blockLossTypeGatherVO).getData();
|
|
|
+ //模拟his
|
|
|
+ return hisDataManagementFacade.gethisDataCount(blockLossTypeGatherVO);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获取这段时间内his的数据量
|
|
|
*
|