Commit 5cacd6f0c8ba735fbe60cafb41150fb5e0964abd
1 parent
19b302f863
Exists in
master
and in
1 other branch
其他高危
Showing 1 changed file with 44 additions and 95 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.java
View file @
5cacd6f
... | ... | @@ -380,16 +380,6 @@ |
380 | 380 | Patients patients = patientsService.findOnePatientById(record.getParentId()); |
381 | 381 | String dueWeek = ""; |
382 | 382 | if (null != patients) { |
383 | -// if (patients.getDueStatus() != null && patients.getDueStatus() == 1 && patients.getType() == 3) { | |
384 | -// dueWeek = "终止妊娠"; | |
385 | -// } else if (patients.getType() == 3) { | |
386 | -// dueWeek = "已分娩"; | |
387 | -// } else { | |
388 | -// int days = DateUtil.daysBetween(patients.getLastMenses(), new Date()); | |
389 | -// String week = (days / 7) + ""; | |
390 | -// int day = (days % 7); | |
391 | -// dueWeek = "孕" + week + "周" + (day > 0 ? "+" + day + "天" : ""); | |
392 | -// } | |
393 | 383 | //2017-03-15 高帆说的改成这样 |
394 | 384 | if (patients.getLastMenses() != null && record.getCheckTime() != null) { |
395 | 385 | int days = DateUtil.daysBetween(patients.getLastMenses(), record.getCheckTime()); |
396 | 386 | |
397 | 387 | |
... | ... | @@ -405,93 +395,10 @@ |
405 | 395 | if (null != users) { |
406 | 396 | cjStatisticsListResult.setCheckDoctor(users.getName()); |
407 | 397 | } |
408 | - List<String> factor = record.gethRisk(); | |
409 | 398 | |
410 | - if (CollectionUtils.isNotEmpty(factor)) { | |
411 | - StringBuilder sb = new StringBuilder(56); | |
412 | - for (String srt : factor) { | |
413 | - if (org.apache.commons.lang.StringUtils.isNotEmpty(srt)) { | |
414 | - BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(srt); | |
415 | - if (null != basicConfig && sb.indexOf(basicConfig.getName()) == -1) { | |
416 | - sb.append(basicConfig.getName()).append(','); | |
417 | - } | |
418 | - } | |
419 | - } | |
420 | - if (sb.toString().endsWith(",")) { | |
421 | - cjStatisticsListResult.setrRisk(sb.substring(0, sb.length() - 1)); | |
422 | - } else { | |
423 | - cjStatisticsListResult.setrRisk(sb.toString()); | |
424 | - } | |
425 | - } | |
426 | - String fxys = ""; | |
427 | - Map olevel = new HashMap(); | |
428 | - if (StringUtils.isNotEmpty(record.getfId())) { | |
429 | - String risk = null; | |
430 | - if (record.getType() == 2) { | |
431 | - AntExChuModel model = antExService.findOne(record.getfId()); | |
432 | - if (null != model) { | |
433 | - risk = model.getOtherHighRisk(); | |
434 | - } | |
435 | - } else if (record.getType() == 1) { | |
436 | - AntenatalExaminationModel model = antExService.findOneById(record.getfId()); | |
437 | - if (null != model) { | |
438 | - risk = model.getOtherRisk(); | |
439 | - } | |
440 | - } | |
399 | + //处理高危 | |
400 | + handleRisk(record,cjStatisticsListResult); | |
441 | 401 | |
442 | - try { | |
443 | - Map map = JsonUtil.str2Obj(risk, Map.class); | |
444 | - Object obj = map.get("fxysu"); | |
445 | - Object idObj1 = map.get("fyyse"); | |
446 | - if (null != obj) { | |
447 | - fxys = obj.toString(); | |
448 | - } | |
449 | - if (null != idObj1 && !"null".equals(idObj1.toString()) && !"".equals(idObj1.toString())) { | |
450 | - | |
451 | - BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(idObj1.toString()); | |
452 | - if (null != basicConfig) { | |
453 | - String name = basicConfig.getName(); | |
454 | - if (name.indexOf("预警") > -1) { | |
455 | - name = name.replace("预警", ""); | |
456 | - } | |
457 | - olevel.put("name", name); | |
458 | - olevel.put("color", "risk_" + RiskDefaultTypeEnum.getColor(name)); | |
459 | - } | |
460 | - } | |
461 | - } catch (Exception e1) { | |
462 | - } | |
463 | - } | |
464 | - if (org.apache.commons.lang.StringUtils.isEmpty(cjStatisticsListResult.getrRisk())) { | |
465 | - cjStatisticsListResult.setrRisk(fxys); | |
466 | - } else if (StringUtils.isNotEmpty(fxys)) { | |
467 | - cjStatisticsListResult.setrRisk(cjStatisticsListResult.getrRisk() + "," + fxys); | |
468 | - } | |
469 | - | |
470 | - | |
471 | - List level = new ArrayList(); | |
472 | - if(!olevel.isEmpty()){ | |
473 | - level.add(olevel); | |
474 | - } | |
475 | - try { | |
476 | - for (Object str : record.gethLevel()) { | |
477 | - if (null != str && StringUtils.isNotEmpty(str.toString())) { | |
478 | - BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(str.toString()); | |
479 | - if (null != basicConfig) { | |
480 | - Map map = new HashMap(); | |
481 | - String name = basicConfig.getName(); | |
482 | - if (name.indexOf("预警") > -1) { | |
483 | - name = name.replace("预警", ""); | |
484 | - } | |
485 | - map.put("name", name); | |
486 | - map.put("color", "risk_" + RiskDefaultTypeEnum.getColor(name)); | |
487 | - level.add(map); | |
488 | - } | |
489 | - } | |
490 | - } | |
491 | - } catch (Exception e) { | |
492 | - ExceptionUtils.catchException(e, "patients.getRiskLevelId error."); | |
493 | - } | |
494 | - cjStatisticsListResult.setrLevel(HighScoreResult.filter(level)); | |
495 | 402 | data.add(cjStatisticsListResult); |
496 | 403 | } |
497 | 404 | } |
... | ... | @@ -527,6 +434,48 @@ |
527 | 434 | } |
528 | 435 | return baseListResponse.setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS).setData(data).setPageInfo(antExRecordQuery.getPageInfo()); |
529 | 436 | } |
437 | + | |
438 | + | |
439 | + | |
440 | + private void handleRisk(AntExRecordModel e , CjStatisticsListResult antExManagerResult){ | |
441 | + if (StringUtils.isNotEmpty(e.getfId())) { | |
442 | + String risk = null; | |
443 | + if (e.getType() == 2) { | |
444 | + AntExChuModel model = antExService.findOne(e.getfId()); | |
445 | + if (null != model) { | |
446 | + risk = model.getOtherHighRisk(); | |
447 | + } | |
448 | + } else if (e.getType() == 1) { | |
449 | + AntenatalExaminationModel model = antExService.findOneById(e.getfId()); | |
450 | + if (null != model) { | |
451 | + risk = model.getOtherRisk(); | |
452 | + } | |
453 | + } | |
454 | + Map result = commonService.resolveOtherRisk(risk); | |
455 | + if(!result.isEmpty()){ | |
456 | + //高危因素名字 | |
457 | + String name =result.get("name").toString(); | |
458 | + String level =result.get("levelId").toString(); | |
459 | + String score =result.get("score").toString(); | |
460 | + | |
461 | + if(org.apache.commons.lang.StringUtils.isNotEmpty(level) &&!"null".equals(level)){ | |
462 | + e.gethLevel().add(level); | |
463 | + } | |
464 | + | |
465 | + //高危因素 | |
466 | + antExManagerResult.setrLevel(commonService.findRiskLevel(e.gethLevel())); | |
467 | + String ri= commonService.resloveFactor(e.gethRisk()); | |
468 | + if(ri.isEmpty()){ | |
469 | + ri=name; | |
470 | + }else if(StringUtils.isNotEmpty(name)){ | |
471 | + ri+=","+name; | |
472 | + } | |
473 | + antExManagerResult.setrRisk(ri); | |
474 | + antExManagerResult.setScore((e.gethScore()+NumberUtils.toInt(score,0))); | |
475 | + } | |
476 | + } | |
477 | + } | |
478 | + | |
530 | 479 | |
531 | 480 | public void exportFindAntEx(AntExManagerQueryRequest antExManagerQueryRequest, Integer id, boolean b, HttpServletResponse httpServletResponse) { |
532 | 481 |