|
@@ -494,13 +494,21 @@ public class BlockLossManagementFacade {
|
|
|
* @Return void
|
|
|
*/
|
|
|
private Boolean upBlockLossStatus(Map<String, List<BlocklossResult>> lossResultMap, Long hospitalId, Long principleId) {
|
|
|
- //====获取已丢失病历记录
|
|
|
+ //====获取所有丢失记录code,在入院记录表没有入院登记则不更新它文书和病案首页状态为已恢复
|
|
|
List<String> lossCodes = blocklossResultFacade.list(new QueryWrapper<BlocklossResult>()
|
|
|
- .select("id,behospital_code")
|
|
|
+ .select("DISTINCT behospital_code")
|
|
|
.eq(hospitalId != null, "hospital_id", hospitalId)
|
|
|
.eq("status", LossStatusEnum.IS_LOSS.getKey())
|
|
|
- .eq("loss_type", LossTypeEnum.CODE_LOSS.getKey())
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())).stream().map(BlocklossResult::getBehospitalCode).collect(Collectors.toList());
|
|
|
+ //查询已恢复的
|
|
|
+ List<String> medCode = behospitalInfoFacade.list(new QueryWrapper<BehospitalInfo>()
|
|
|
+ .select("DISTINCT behospital_code")
|
|
|
+ .in("behospital_code",lossCodes)
|
|
|
+ .eq(hospitalId != null, "hospital_id", hospitalId)
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())).stream().map(BehospitalInfo::getBehospitalCode).collect(Collectors.toList());
|
|
|
+ //去除已恢复得到已丢失的
|
|
|
+ lossCodes.removeAll(medCode);
|
|
|
+
|
|
|
AtomicReference<Boolean> flag = new AtomicReference<>(false);
|
|
|
lossResultMap.keySet().stream().forEach(lossType -> {
|
|
|
//0:文书丢失 1:病案首页丢失 2:患者信息丢失
|