Commit 57d367e18ccae6ad34dc819658ecea9902794bf8
1 parent
883ea70415
Exists in
master
and in
6 other branches
update
Showing 1 changed file with 19 additions and 15 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java
View file @
57d367e
... | ... | @@ -4415,36 +4415,40 @@ |
4415 | 4415 | //建档且初诊(限本院) |
4416 | 4416 | List<Object> filingPids = new ArrayList<>(); |
4417 | 4417 | for (Patients patients : patientsList) { |
4418 | - filingPids.add(patients.getPid()); | |
4418 | + filingPids.add(patients.getId()); | |
4419 | 4419 | } |
4420 | - Criteria criteria3 = Criteria.where("pid").in(filingPids) | |
4420 | + Criteria criteria3 = Criteria.where("parentId").in(filingPids) | |
4421 | 4421 | .and("hospitalId").is(hospitalId) |
4422 | 4422 | .and("yn").is(YnEnums.YES.getId()) |
4423 | 4423 | .and("checkTime").gte(startDate).lte(endDate); |
4424 | 4424 | long filingRoAntExChu = mongoTemplate.count(Query.query(criteria3), AntExChuModel.class); |
4425 | 4425 | //建档未初诊(包含外院初诊) |
4426 | - criteria.and("firstCheckTime").exists(false); | |
4427 | - List<Patients> antExChuNotList = mongoTemplate.find(Query.query(criteria), Patients.class); | |
4428 | - //建档未初诊-下月初诊 | |
4429 | - List<Object> antExChuNotPids = new ArrayList<>(); | |
4430 | - for (Patients patients : antExChuNotList) { | |
4431 | - antExChuNotPids.add(patients.getPid()); | |
4426 | + List<Object> antExChuNotList = new ArrayList<>();//档案pid | |
4427 | + for (Object obj : filingPids) { | |
4428 | + Criteria criteria0 = Criteria.where("parentId").is(obj) | |
4429 | + .and("yn").is(YnEnums.YES.getId()) | |
4430 | + .and("checkTime").gte(startDate).lte(endDate); | |
4431 | + long count = mongoTemplate.count(Query.query(criteria0), AntExChuModel.class); | |
4432 | + if(count==0){ | |
4433 | + antExChuNotList.add(obj); | |
4434 | + } | |
4432 | 4435 | } |
4433 | - Criteria criteria4 = Criteria.where("pid").in(antExChuNotPids) | |
4436 | + //建档未初诊-下月初诊 | |
4437 | + Criteria criteria4 = Criteria.where("parentId").in(antExChuNotList) | |
4434 | 4438 | .and("hospitalId").is(hospitalId) |
4435 | 4439 | .and("yn").is(YnEnums.YES.getId()) |
4436 | 4440 | .and("checkTime").gte(DateUtil.getMonthDay(startDate,1,1)).lte(DateUtil.getMonthDay(startDate,1,0)); |
4437 | 4441 | long antExChuNext = mongoTemplate.count(Query.query(criteria4), AntExChuModel.class); |
4438 | 4442 | //建档未初诊-外院初诊 |
4439 | - Criteria criteria5= Criteria.where("pid").in(antExChuNotPids) | |
4443 | + Criteria criteria5= Criteria.where("parentId").in(antExChuNotList) | |
4440 | 4444 | .and("hospitalId").ne(hospitalId) |
4441 | 4445 | .and("yn").is(YnEnums.YES.getId()) |
4442 | 4446 | .and("checkTime").gte(startDate); |
4443 | 4447 | long antExChuWai = mongoTemplate.count(Query.query(criteria5), AntExChuModel.class); |
4444 | 4448 | //一直未初诊 |
4445 | 4449 | int filingNotAntExChu= 0; |
4446 | - for (Patients patients : antExChuNotList) { | |
4447 | - Criteria criteria6= Criteria.where("pid").is(patients.getPid()) | |
4450 | + for (Object obj : antExChuNotList) { | |
4451 | + Criteria criteria6= Criteria.where("parentId").is(obj) | |
4448 | 4452 | .and("hospitalId").is(hospitalId) |
4449 | 4453 | .and("yn").is(YnEnums.YES.getId()) |
4450 | 4454 | .and("checkTime").gte(startDate); |
... | ... | @@ -4461,7 +4465,7 @@ |
4461 | 4465 | int filingBefore=0; |
4462 | 4466 | for (AntExChuModel antExChuModel : antExChuBeforeFiling) { |
4463 | 4467 | Criteria criteria8 = Criteria.where("bookbuildingDate").gte(antExChuModel.getLastMenses()).lt(startDate) |
4464 | - .and("pid").is(antExChuModel.getPid()) | |
4468 | + .and("parentId").is(antExChuModel.getParentId()) | |
4465 | 4469 | .and("hospitalId").is(hospitalId) |
4466 | 4470 | .and("yn").is(YnEnums.YES.getId()); |
4467 | 4471 | Patients patient = mongoTemplate.findOne(Query.query(criteria8), Patients.class); |
... | ... | @@ -4474,7 +4478,7 @@ |
4474 | 4478 | for (AntExChuModel antExChuModel : antExChuBeforeFiling) { |
4475 | 4479 | Criteria criteria9 = Criteria.where("bookbuildingDate") |
4476 | 4480 | .gte(DateUtil.getMonthDay(startDate,-1,1)).lte(DateUtil.getMonthDay(startDate,-1,0)) |
4477 | - .and("pid").is(antExChuModel.getPid()) | |
4481 | + .and("parentId").is(antExChuModel.getParentId()) | |
4478 | 4482 | .and("hospitalId").is(hospitalId) |
4479 | 4483 | .and("yn").is(YnEnums.YES.getId()); |
4480 | 4484 | Patients patient = mongoTemplate.findOne(Query.query(criteria9), Patients.class); |
... | ... | @@ -4487,7 +4491,7 @@ |
4487 | 4491 | for (AntExChuModel antExChuModel : antExChuBeforeFiling) { |
4488 | 4492 | Criteria criteria10 = Criteria.where("bookbuildingDate") |
4489 | 4493 | .gte(antExChuModel.getLastMenses()).lt(DateUtil.getMonthDay(startDate,-1,1)) |
4490 | - .and("pid").is(antExChuModel.getPid()) | |
4494 | + .and("parentId").is(antExChuModel.getParentId()) | |
4491 | 4495 | .and("hospitalId").is(hospitalId) |
4492 | 4496 | .and("yn").is(YnEnums.YES.getId()); |
4493 | 4497 | Patients patient = mongoTemplate.findOne(Query.query(criteria10), Patients.class); |