Commit a9189470587bec9d12b971bfb7ea125a8769d841
1 parent
90ed7701d2
Exists in
master
and in
6 other branches
update code
Showing 2 changed files with 65 additions and 3 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntenatalExaminationController.java
View file @
a918947
| ... | ... | @@ -318,7 +318,21 @@ |
| 318 | 318 | @ResponseBody |
| 319 | 319 | public BaseResponse getLastCheck(HttpServletRequest request,@RequestParam("parentId")String pid){ |
| 320 | 320 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
| 321 | - return antenatalExaminationFacade.getLastCheck(loginState.getId(),pid); | |
| 321 | + return antenatalExaminationFacade.getLastCheck(loginState.getId(), pid); | |
| 322 | + } | |
| 323 | + | |
| 324 | + /** | |
| 325 | + * 最后高危因素 | |
| 326 | + * @param patientId | |
| 327 | + * @param request | |
| 328 | + * @return | |
| 329 | + */ | |
| 330 | + @RequestMapping(method = RequestMethod.GET, value = "/getLastRisk") | |
| 331 | + @ResponseBody | |
| 332 | + @TokenRequired | |
| 333 | + public BaseResponse getLastRisk(@RequestParam(required = true) String patientId,HttpServletRequest request) { | |
| 334 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 335 | + return antenatalExaminationFacade.getLastRisk(patientId, loginState.getId()); | |
| 322 | 336 | } |
| 323 | 337 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
a918947
| ... | ... | @@ -263,7 +263,7 @@ |
| 263 | 263 | patients.setLastCheckEmployeeId(antExAddRequest.getCheckDoctor()); |
| 264 | 264 | patientsService.updateNextCheckTime(antExAddRequest.getNextCheckTime(), patients.getId()); |
| 265 | 265 | patientsService.updatePatient(patients); |
| 266 | - patientsService.updatePatientOneCol(patients.getId(), com.lyms.platform.common.utils.StringUtils.isEmpty(antExAddRequest.getNextCheckTime())? null : DateUtil.parseYMD(antExAddRequest.getNextCheckTime())); | |
| 266 | + patientsService.updatePatientOneCol(patients.getId(), com.lyms.platform.common.utils.StringUtils.isEmpty(antExAddRequest.getNextCheckTime()) ? null : DateUtil.parseYMD(antExAddRequest.getNextCheckTime())); | |
| 267 | 267 | //修改孕妇高危等级 |
| 268 | 268 | updateLastRisk(antExAddRequest.getParentId()); |
| 269 | 269 | |
| ... | ... | @@ -274,7 +274,7 @@ |
| 274 | 274 | |
| 275 | 275 | |
| 276 | 276 | //修改数据 |
| 277 | - syncMaster(antExAddRequest.getParentId(),antExAddRequest.getNextCheckTime()); | |
| 277 | + syncMaster(antExAddRequest.getParentId(), antExAddRequest.getNextCheckTime()); | |
| 278 | 278 | |
| 279 | 279 | //复诊,修改产检管理 |
| 280 | 280 | antenatalExaminationService.updateAntExRecord(antExAddRequest.getId(), 2); |
| ... | ... | @@ -1445,6 +1445,54 @@ |
| 1445 | 1445 | Map<String, Object> map = new HashMap<>(); |
| 1446 | 1446 | map.put("getHighRisk", basicConfigFacade.getHighRiskAll()); |
| 1447 | 1447 | return new BaseObjectResponse().setData(map).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
| 1448 | + } | |
| 1449 | + | |
| 1450 | + public BaseResponse getLastRisk(String patientId, Integer id) { | |
| 1451 | + List highRisk = new ArrayList(); | |
| 1452 | + Patients patients = patientsService.findOnePatientById(patientId); | |
| 1453 | + if (patients != null) | |
| 1454 | + { | |
| 1455 | + HighScoreResult highScoreResult = findLastRisk(patients.getPid(), true); | |
| 1456 | + int score = 0; | |
| 1457 | + int index = -1; | |
| 1458 | + highRisk = highScoreResult.getHighRisk(); | |
| 1459 | + if (CollectionUtils.isNotEmpty(highRisk)) | |
| 1460 | + { | |
| 1461 | + for (int i = 0 ; i < highRisk.size() ; i++) | |
| 1462 | + { | |
| 1463 | + Map risk = (Map)highRisk.get(i); | |
| 1464 | + if (risk != null && risk.size() > 0) | |
| 1465 | + { | |
| 1466 | + Object codeObj = risk.get("code"); | |
| 1467 | + Object idObj = risk.get("id"); | |
| 1468 | + if (codeObj != null) | |
| 1469 | + { | |
| 1470 | + Integer code = Integer.valueOf(codeObj.toString()); | |
| 1471 | + score += code; | |
| 1472 | + } | |
| 1473 | + | |
| 1474 | + if (idObj == null || "".equals(idObj.toString())) | |
| 1475 | + { | |
| 1476 | + index = i; | |
| 1477 | + } | |
| 1478 | + } | |
| 1479 | + | |
| 1480 | + } | |
| 1481 | + } | |
| 1482 | + | |
| 1483 | + if (index > -1) | |
| 1484 | + { | |
| 1485 | + Integer otherScore = 0; | |
| 1486 | + if (highScoreResult.getScore() != null) | |
| 1487 | + { | |
| 1488 | + otherScore = highScoreResult.getScore() - score; | |
| 1489 | + } | |
| 1490 | + Map risk = (Map)highRisk.get(index); | |
| 1491 | + risk.put("code",otherScore); | |
| 1492 | + } | |
| 1493 | + } | |
| 1494 | + | |
| 1495 | + return new BaseObjectResponse().setData(highRisk).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); | |
| 1448 | 1496 | } |
| 1449 | 1497 | |
| 1450 | 1498 |