Commit 10e8ce53be18dba63961e1998fc03c72f04d1fd8
1 parent
be1e9a085b
Exists in
master
and in
8 other branches
修改高危
Showing 1 changed file with 63 additions and 2 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
View file @
10e8ce5
| ... | ... | @@ -466,7 +466,6 @@ |
| 466 | 466 | patientQuery.setHospitalId(hid); |
| 467 | 467 | patientQuery.setrLevel("e637b361-99cf-41eb-84f2-f0dab596e928"); |
| 468 | 468 | |
| 469 | - | |
| 470 | 469 | List<Patients> patientses = patientsService.queryPatient(patientQuery); |
| 471 | 470 | int batchSize = 500; |
| 472 | 471 | int end = 0; |
| 473 | 472 | |
| ... | ... | @@ -495,9 +494,71 @@ |
| 495 | 494 | if (CollectionUtils.isNotEmpty(rFactors) && rFactors.contains("d42eec03-aa86-45b8-a4e0-78a0ff365fb6")) |
| 496 | 495 | { |
| 497 | 496 | rFactors.remove("d42eec03-aa86-45b8-a4e0-78a0ff365fb6"); |
| 498 | - String resultLevel = JsonUtil.array2JsonString(levels.remove("e637b361-99cf-41eb-84f2-f0dab596e928")); | |
| 497 | + levels.remove("e637b361-99cf-41eb-84f2-f0dab596e928"); | |
| 498 | + pat.setRiskFactorId(rFactors); | |
| 499 | + String resultLevel = JsonUtil.array2JsonString(levels); | |
| 499 | 500 | pat.setRiskLevelId(resultLevel); |
| 500 | 501 | patientsService.updatePatient(pat); |
| 502 | + | |
| 503 | + AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
| 504 | + antExChuQuery.setYn(YnEnums.YES.getId()); | |
| 505 | + antExChuQuery.setParentId(pat.getId()); | |
| 506 | + antExChuQuery.setHospitalId(pat.getHospitalId()); | |
| 507 | + List<AntExChuModel> antExChuModelList = antenatalExaminationService.queryAntExChu(antExChuQuery); | |
| 508 | + if (CollectionUtils.isNotEmpty(antExChuModelList)) | |
| 509 | + { | |
| 510 | + for(AntExChuModel cmodel : antExChuModelList) | |
| 511 | + { | |
| 512 | + String highriskStr = cmodel.getHighrisk(); | |
| 513 | + String otherRisk = cmodel.getOtherHighRisk(); | |
| 514 | + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(highriskStr)) | |
| 515 | + { | |
| 516 | + List<String> highrisks = JsonUtil.toList(highriskStr, String.class); | |
| 517 | + if (CollectionUtils.isNotEmpty(highrisks) && highrisks.contains("d42eec03-aa86-45b8-a4e0-78a0ff365fb6") && highrisks.size() > 1) | |
| 518 | + { | |
| 519 | + highrisks.remove("d42eec03-aa86-45b8-a4e0-78a0ff365fb6"); | |
| 520 | + cmodel.setHighrisk(JsonUtil.array2JsonString(highrisks)); | |
| 521 | + antenatalExaminationService.updateAntExChu(cmodel,cmodel.getId()); | |
| 522 | + } | |
| 523 | + else if (CollectionUtils.isNotEmpty(highrisks) && highrisks.contains("d42eec03-aa86-45b8-a4e0-78a0ff365fb6") && !"{}".equals(otherRisk)) | |
| 524 | + { | |
| 525 | + highrisks.remove("d42eec03-aa86-45b8-a4e0-78a0ff365fb6"); | |
| 526 | + cmodel.setHighrisk(JsonUtil.array2JsonString(highrisks)); | |
| 527 | + antenatalExaminationService.updateAntExChu(cmodel,cmodel.getId()); | |
| 528 | + } | |
| 529 | + } | |
| 530 | + } | |
| 531 | + | |
| 532 | + // 查询复诊 | |
| 533 | + AntExQuery antExQuery = new AntExQuery(); | |
| 534 | + antExQuery.setYn(YnEnums.YES.getId()); | |
| 535 | + antExQuery.setParentId(pat.getId()); | |
| 536 | + antExQuery.setHospitalId(pat.getHospitalId()); | |
| 537 | + List<AntenatalExaminationModel> antenatalExaminationModelList = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery()); | |
| 538 | + if (CollectionUtils.isNotEmpty(antenatalExaminationModelList)) { | |
| 539 | + for (AntenatalExaminationModel fmodel : antenatalExaminationModelList) { | |
| 540 | + String highriskStr = fmodel.getRiskFactor(); | |
| 541 | + String otherRisk = fmodel.getOtherRisk(); | |
| 542 | + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(highriskStr)) | |
| 543 | + { | |
| 544 | + List<String> highrisks = JsonUtil.toList(highriskStr, String.class); | |
| 545 | + if (CollectionUtils.isNotEmpty(highrisks) && highrisks.contains("d42eec03-aa86-45b8-a4e0-78a0ff365fb6") && highrisks.size() > 1) | |
| 546 | + { | |
| 547 | + highrisks.remove("d42eec03-aa86-45b8-a4e0-78a0ff365fb6"); | |
| 548 | + fmodel.setRiskFactor(JsonUtil.array2JsonString(highrisks)); | |
| 549 | + antenatalExaminationService.updateOneAnt(fmodel,fmodel.getId()); | |
| 550 | + } | |
| 551 | + else if (CollectionUtils.isNotEmpty(highrisks) && highrisks.contains("d42eec03-aa86-45b8-a4e0-78a0ff365fb6") && !"{}".equals(otherRisk)) | |
| 552 | + { | |
| 553 | + highrisks.remove("d42eec03-aa86-45b8-a4e0-78a0ff365fb6"); | |
| 554 | + fmodel.setRiskFactor(JsonUtil.array2JsonString(highrisks)); | |
| 555 | + antenatalExaminationService.updateOneAnt(fmodel, fmodel.getId()); | |
| 556 | + } | |
| 557 | + } | |
| 558 | + } | |
| 559 | + } | |
| 560 | + | |
| 561 | + } | |
| 501 | 562 | } |
| 502 | 563 | } |
| 503 | 564 |