Commit 1d81366457e6b3ac15d13b1ca831e1ad549ff37e
1 parent
2bc6245150
Exists in
master
and in
6 other branches
根据疾病查询
Showing 1 changed file with 34 additions and 32 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
View file @
1d81366
| ... | ... | @@ -429,35 +429,6 @@ |
| 429 | 429 | } |
| 430 | 430 | patientsQuery.setHospitalList(hospitalList); |
| 431 | 431 | |
| 432 | - //根据疾病进行查询 | |
| 433 | - if (StringUtils.isNotEmpty(riskPatientsQueryRequest.getDiseaseType())) { | |
| 434 | - MongoCondition criteria = new MongoCondition("hospitalId", hospitalList, MongoOper.IN); | |
| 435 | - //乙肝查询 | |
| 436 | - if (StringUtils.contains(riskPatientsQueryRequest.getDiseaseType(), DiseaseTypeEnums.YIGAN.getId())) { | |
| 437 | - criteria = criteria.and("ygbmky", true, MongoOper.EXISTS).orCondition( | |
| 438 | - new MongoCondition[]{new MongoCondition("ygbmkt", true, MongoOper.EXISTS), | |
| 439 | - new MongoCondition("ygeky", true, MongoOper.EXISTS), | |
| 440 | - new MongoCondition("ygekt", true, MongoOper.EXISTS), | |
| 441 | - new MongoCondition("yghxkt", true, MongoOper.EXISTS) | |
| 442 | - }); | |
| 443 | - } | |
| 444 | - //丙肝查询 | |
| 445 | - if (StringUtils.contains(riskPatientsQueryRequest.getDiseaseType(), DiseaseTypeEnums.BINGGAN.getId())) { | |
| 446 | - criteria = criteria.and("bg", true, MongoOper.EXISTS); | |
| 447 | - } | |
| 448 | - //梅毒查询 | |
| 449 | - if (StringUtils.contains(riskPatientsQueryRequest.getDiseaseType(), DiseaseTypeEnums.MEIDU.getId())) { | |
| 450 | - criteria = criteria.andCondition(new MongoCondition("syjg", true, MongoOper.EXISTS) | |
| 451 | - .orCondition(new MongoCondition("hivkt", true, MongoOper.EXISTS))); | |
| 452 | - } | |
| 453 | - List<AntExChuModel> antExChuModels = antExService.queryAntExChu(criteria.toMongoQuery()); | |
| 454 | - List<String> pIds = new ArrayList<>(); | |
| 455 | - for (AntExChuModel antChu : antExChuModels) { | |
| 456 | - pIds.add(antChu.getPid()); | |
| 457 | - } | |
| 458 | - patientsQuery.setpIds(pIds); | |
| 459 | - } | |
| 460 | - | |
| 461 | 432 | fmHospitalList.addAll(hospitalList); |
| 462 | 433 | |
| 463 | 434 | if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(riskPatientsQueryRequest.getFprovinceId())) { |
| 464 | 435 | |
| 465 | 436 | |
| ... | ... | @@ -488,15 +459,46 @@ |
| 488 | 459 | patientsQuery.setFmHospitalList(fmHospitalList); |
| 489 | 460 | } |
| 490 | 461 | } |
| 491 | - | |
| 492 | - | |
| 493 | 462 | } else { |
| 494 | 463 | |
| 495 | 464 | patientsQuery.setFmHospital(riskPatientsQueryRequest.getFmHospital()); |
| 496 | - | |
| 497 | 465 | String hospital = autoMatchFacade.getHospitalId(userId); |
| 498 | 466 | if (null != hospital) { |
| 499 | 467 | patientsQuery.setHospitalId(hospital); |
| 468 | + } | |
| 469 | + | |
| 470 | + | |
| 471 | + //根据疾病进行查询 | |
| 472 | + if (StringUtils.isNotEmpty(riskPatientsQueryRequest.getDiseaseType())) { | |
| 473 | + MongoCondition criteria = new MongoCondition("hospitalId", hospital, MongoOper.IS); | |
| 474 | + | |
| 475 | + List<MongoCondition> mongoCondits = new ArrayList<>(); | |
| 476 | + //乙肝查询 | |
| 477 | + if (StringUtils.contains(riskPatientsQueryRequest.getDiseaseType(), DiseaseTypeEnums.YIGAN.getId())) { | |
| 478 | + mongoCondits.add(new MongoCondition("ygbmky", true, MongoOper.EXISTS)); | |
| 479 | + mongoCondits.add(new MongoCondition("ygbmkt", true, MongoOper.EXISTS)); | |
| 480 | + mongoCondits.add(new MongoCondition("ygeky", true, MongoOper.EXISTS)); | |
| 481 | + mongoCondits.add(new MongoCondition("ygekt", true, MongoOper.EXISTS)); | |
| 482 | + mongoCondits.add(new MongoCondition("yghxkt", true, MongoOper.EXISTS)); | |
| 483 | + } | |
| 484 | + //丙肝查询 | |
| 485 | + if (StringUtils.contains(riskPatientsQueryRequest.getDiseaseType(), DiseaseTypeEnums.BINGGAN.getId())) { | |
| 486 | + mongoCondits.add(new MongoCondition("bg", true, MongoOper.EXISTS)); | |
| 487 | + } | |
| 488 | + //梅毒查询 | |
| 489 | + if (StringUtils.contains(riskPatientsQueryRequest.getDiseaseType(), DiseaseTypeEnums.MEIDU.getId())) { | |
| 490 | + mongoCondits.add(new MongoCondition("syjg", true, MongoOper.EXISTS)); | |
| 491 | + mongoCondits.add(new MongoCondition("hivkt", true, MongoOper.EXISTS)); | |
| 492 | + } | |
| 493 | + | |
| 494 | + criteria = criteria.orCondition(mongoCondits.toArray(new MongoCondition[mongoCondits.size()])); | |
| 495 | + | |
| 496 | + List<AntExChuModel> antExChuModels = antExService.queryAntExChu(criteria.toMongoQuery()); | |
| 497 | + List<String> pIds = new ArrayList<>(); | |
| 498 | + for (AntExChuModel antChu : antExChuModels) { | |
| 499 | + pIds.add(antChu.getPid()); | |
| 500 | + } | |
| 501 | + patientsQuery.setpIds(pIds); | |
| 500 | 502 | } |
| 501 | 503 | /* boolean result = autoMatchFacade.checkBStatus(userId); |
| 502 | 504 | if(!result){ |