Commit ae0d05114145551b91a496a756b25f1bf6c67919

Authored by jiangjiazhi
1 parent e0c4c6df78

修改新电子病历

Showing 1 changed file with 47 additions and 24 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java View file @ ae0d051
... ... @@ -387,18 +387,7 @@
387 387 quanPatientsResult.setlName(patients.getBookbuildingDoctor());
388 388 }
389 389 }
390   - if (StringUtils.isNotEmpty(patients.getLastCheckEmployeeId())) {
391   - if (NumberUtils.isNumber(patients.getLastCheckEmployeeId())) {
392   - Users users = usersService.getUsers(NumberUtils.toInt(patients.getLastCheckEmployeeId()));
393   - if (null != users) {
394   - quanPatientsResult.setCheckDoctor(users.getName());
395   - } else {
396   - quanPatientsResult.setCheckDoctor(patients.getLastCheckEmployeeId());
397   - }
398   - } else {
399   - quanPatientsResult.setCheckDoctor(patients.getLastCheckEmployeeId());
400   - }
401   - }
  390 +
402 391 antExQuery.setHospitalId(null);
403 392 //复诊次数
404 393 int i = antExService.queryAntenatalExaminationCount(antExQuery.convertToQuery());
405 394  
... ... @@ -424,10 +413,36 @@
424 413 List<AntenatalExaminationModel> examinationModels = antExService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created"));
425 414 if (CollectionUtils.isNotEmpty(examinationModels)) {
426 415 nextCheckTime = DateUtil.getyyyy_MM_dd(examinationModels.get(0).getNextCheckTime());
  416 +
  417 + if (StringUtils.isNotEmpty(examinationModels.get(0).getCheckDoctor())) {
  418 + if (NumberUtils.isNumber(examinationModels.get(0).getCheckDoctor())) {
  419 + Users users = usersService.getUsers(NumberUtils.toInt(examinationModels.get(0).getCheckDoctor()));
  420 + if (null != users) {
  421 + quanPatientsResult.setCheckDoctor(users.getName());
  422 + } else {
  423 + quanPatientsResult.setCheckDoctor(examinationModels.get(0).getCheckDoctor());
  424 + }
  425 + } else {
  426 + quanPatientsResult.setCheckDoctor(examinationModels.get(0).getCheckDoctor());
  427 + }
  428 + }
  429 +
427 430 } else {
428 431 List<AntExChuModel> list = antExService.queryAntExChu(antExChuQuery);
429 432 if (CollectionUtils.isNotEmpty(list)) {
430 433 nextCheckTime = DateUtil.getyyyy_MM_dd(list.get(0).getNextCheckTime());
  434 + if (StringUtils.isNotEmpty(list.get(0).getProdDoctor())) {
  435 + if (NumberUtils.isNumber(list.get(0).getProdDoctor())) {
  436 + Users users = usersService.getUsers(NumberUtils.toInt(list.get(0).getProdDoctor()));
  437 + if (null != users) {
  438 + quanPatientsResult.setCheckDoctor(users.getName());
  439 + } else {
  440 + quanPatientsResult.setCheckDoctor(list.get(0).getProdDoctor());
  441 + }
  442 + } else {
  443 + quanPatientsResult.setCheckDoctor(list.get(0).getProdDoctor());
  444 + }
  445 + }
431 446 }
432 447 }
433 448 HighScoreResult highScoreResult = antenatalExaminationFacade.findLastRisk(patients.getPid(), true);
... ... @@ -464,18 +479,8 @@
464 479 riskPatientsResult.setlName(patients.getBookbuildingDoctor());
465 480 }
466 481 }
467   - if (StringUtils.isNotEmpty(patients.getLastCheckEmployeeId())) {
468   - if (NumberUtils.isNumber(patients.getLastCheckEmployeeId())) {
469   - Users users = usersService.getUsers(NumberUtils.toInt(patients.getLastCheckEmployeeId()));
470   - if (null != users) {
471   - riskPatientsResult.setCheckDoctor(users.getName());
472   - } else {
473   - riskPatientsResult.setCheckDoctor(patients.getLastCheckEmployeeId());
474   - }
475   - } else {
476   - riskPatientsResult.setCheckDoctor(patients.getLastCheckEmployeeId());
477   - }
478   - }
  482 +
  483 +
479 484 antExQuery.setPid(patients.getPid());
480 485 antExQuery.setYn(YnEnums.YES.getId());
481 486 antExQuery.setHospitalId(null);
482 487  
483 488  
484 489  
... ... @@ -496,15 +501,33 @@
496 501 riskPatientsResult.setcTimes(i + b);
497 502 riskPatientsResult.setcHTimes(chi+chb);
498 503 String nextCheckTime = "";
  504 +
499 505 List<AntenatalExaminationModel> examinationModels = antExService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created"));
500 506 if (CollectionUtils.isNotEmpty(examinationModels)) {
  507 + if (NumberUtils.isNumber(examinationModels.get(0).getCheckDoctor())){
  508 + Users users = usersService.getUsers(NumberUtils.toInt(examinationModels.get(0).getCheckDoctor()));
  509 + if (null != users) {
  510 + riskPatientsResult.setCheckDoctor(users.getName());
  511 + } else {
  512 + riskPatientsResult.setCheckDoctor(examinationModels.get(0).getCheckDoctor());
  513 + }
  514 + }
501 515 nextCheckTime = DateUtil.getyyyy_MM_dd(examinationModels.get(0).getNextCheckTime());
502 516 } else {
503 517 List<AntExChuModel> list = antExService.queryAntExChu(antExChuQuery);
504 518 if (CollectionUtils.isNotEmpty(list)) {
505 519 nextCheckTime = DateUtil.getyyyy_MM_dd(list.get(0).getNextCheckTime());
  520 + if (NumberUtils.isNumber(list.get(0).getProdDoctor())){
  521 + Users users = usersService.getUsers(NumberUtils.toInt(list.get(0).getProdDoctor()));
  522 + if (null != users) {
  523 + riskPatientsResult.setCheckDoctor(users.getName());
  524 + } else {
  525 + riskPatientsResult.setCheckDoctor(list.get(0).getProdDoctor());
  526 + }
  527 + }
506 528 }
507 529 }
  530 +
508 531 riskPatientsResult.setcTime(nextCheckTime);
509 532 riskPatientsResult.setrFactor(highScoreResult.gethighRiskStr());
510 533 riskPatientsResult.setrLevel(highScoreResult.filter(highScoreResult.getLevel()));