Commit da6ca2b2f6a9738d7a0b6a65959cdbf6b784e720

Authored by liquanyu
1 parent 418ae54abf

高危检查列表

Showing 2 changed files with 83 additions and 0 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntenatalExaminationController.java View file @ da6ca2b
... ... @@ -405,5 +405,21 @@
405 405 }
406 406  
407 407  
  408 + /**
  409 + * 查询某段返回内的高危孕妇
  410 + * @param antExManagerQueryRequest
  411 + * @param request
  412 + * @return
  413 + */
  414 + @RequestMapping(method = RequestMethod.GET, value = "/antex/getRangeRiskAntexlist")
  415 + @ResponseBody
  416 + @TokenRequired
  417 + public BaseResponse getRangeRiskAntexlist(@Valid AntExManagerQueryRequest antExManagerQueryRequest,HttpServletRequest request){
  418 + LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
  419 + return antExRecordFacade.getRangeRiskAntexlist(antExManagerQueryRequest, loginState.getId());
  420 + }
  421 +
  422 +
  423 +
408 424 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.java View file @ da6ca2b
... ... @@ -623,5 +623,72 @@
623 623 }
624 624  
625 625 }
  626 +
  627 + public BaseResponse getRangeRiskAntexlist(AntExManagerQueryRequest antExManagerQueryRequest, Integer userId) {
  628 +
  629 + AntExRecordQuery antExRecordQuery = new AntExRecordQuery();
  630 +
  631 + String hospitalId = autoMatchFacade.getHospitalId(userId);
  632 +
  633 + //产检日期
  634 + if (org.apache.commons.lang.StringUtils.isNotEmpty(antExManagerQueryRequest.getcTime())) {
  635 + String nextDateStr = antExManagerQueryRequest.getcTime();
  636 + String[] dates = nextDateStr.split(" - ");
  637 +
  638 + antExRecordQuery.setCheckTimeStart(DateUtil.parseYMD(dates[0]));
  639 + if (dates.length == 2) {
  640 + antExRecordQuery.setCheckTimeEnd(DateUtil.parseYMD(dates[1]));
  641 + }
  642 + }
  643 +
  644 + Map<String,List<AntExRecordModel>> map = new HashMap<>();
  645 +
  646 + antExRecordQuery.setHospitalId(hospitalId);
  647 + List<AntExRecordModel> antExRecordModelList = recordService.queryAntExRecords(antExRecordQuery);
  648 + if (CollectionUtils.isNotEmpty(antExRecordModelList))
  649 + {
  650 + for (AntExRecordModel recordModel : antExRecordModelList)
  651 + {
  652 + List<AntExRecordModel> list = map.get(recordModel.getParentId());
  653 + if (!CollectionUtils.isNotEmpty(list))
  654 + {
  655 + list = new ArrayList<>();
  656 + }
  657 + list.add(recordModel);
  658 + map.put(recordModel.getParentId(),list);
  659 + }
  660 + }
  661 +
  662 + List<AntExRecordModel> riskList = new ArrayList<>();
  663 +
  664 + if (map.size() > 0)
  665 + {
  666 + for (String patientId : map.keySet())
  667 + {
  668 + List<AntExRecordModel> list = map.get(patientId);
  669 + if (CollectionUtils.isNotEmpty(list))
  670 + {
  671 + if (list.size() == 1)
  672 + {
  673 + AntExRecordModel after = list.get(0);
  674 + if (!(after.gethRisk() != null && after.gethRisk().contains("d42eec03-aa86-45b8-a4e0-78a0ff365fb6"))
  675 + || !CollectionUtils.isNotEmpty(after.gethRisk()))
  676 + {
  677 + riskList.add(after);
  678 + }
  679 +
  680 + }
  681 + else if (list.size() == 2)
  682 + {
  683 + AntExRecordModel after = list.get(0);
  684 + AntExRecordModel before = list.get(1);
  685 + }
  686 + }
  687 + }
  688 + }
  689 +
  690 +
  691 + return null;
  692 + }
626 693 }