Commit 2304311f5d95d4cf8d71424b216430f588843651
1 parent
8e0a508fbd
Exists in
master
and in
6 other branches
美生县医院系统数据分析报告-2.2.1.本月高危孕妇分布情况-详情开发
Showing 3 changed files with 100 additions and 9 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ReportController.java
View file @
2304311
| ... | ... | @@ -545,6 +545,25 @@ |
| 545 | 545 | @RequestParam(required = true)Date endDate) { |
| 546 | 546 | return reportService.getAntExChuDetail(hospitalId, startDate, endDate); |
| 547 | 547 | } |
| 548 | + /** | |
| 549 | + * 统计管理-孕产妇数据统计-初诊详情 | |
| 550 | + * | |
| 551 | + * @param hospitalId | |
| 552 | + * @param startDate | |
| 553 | + * @param endDate | |
| 554 | + * @return | |
| 555 | + */ | |
| 556 | + @RequestMapping(value = "/getHighRiskDetail", method = RequestMethod.GET) | |
| 557 | + @ResponseBody | |
| 558 | + @TokenRequired | |
| 559 | + public BaseResponse getHighRiskDetail(@RequestParam(required = true)String hospitalId, | |
| 560 | + @RequestParam(required = true)String riskTyep, | |
| 561 | + @RequestParam(required = true)Date startDate, | |
| 562 | + @RequestParam(required = true)Date endDate, | |
| 563 | + @RequestParam(required = true)Integer page, | |
| 564 | + @RequestParam(required = true)Integer limit) { | |
| 565 | + return reportService.getHighRiskDetail(hospitalId,riskTyep, startDate, endDate, page, limit); | |
| 566 | + } | |
| 548 | 567 | |
| 549 | 568 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/IReportService.java
View file @
2304311
| ... | ... | @@ -113,5 +113,7 @@ |
| 113 | 113 | BaseResponse getMaternityDueWeek(String hospitalId, Date startDate, Date endDate); |
| 114 | 114 | |
| 115 | 115 | BaseResponse getAntExChuDetail(String hospitalId, Date startDate, Date endDate); |
| 116 | + | |
| 117 | + BaseResponse getHighRiskDetail(String hospitalId,String riskTyep, Date startDate, Date endDate,Integer page,Integer limit); | |
| 116 | 118 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java
View file @
2304311
| ... | ... | @@ -4,10 +4,7 @@ |
| 4 | 4 | import com.alibaba.fastjson.JSONObject; |
| 5 | 5 | import com.lyms.hospitalapi.pojo.ReportModel; |
| 6 | 6 | import com.lyms.platform.biz.AntExChuModelTemp; |
| 7 | -import com.lyms.platform.biz.service.ApplyOrderService; | |
| 8 | -import com.lyms.platform.biz.service.BasicConfigService; | |
| 9 | -import com.lyms.platform.biz.service.CommonService; | |
| 10 | -import com.lyms.platform.biz.service.PatientWeightService2; | |
| 7 | +import com.lyms.platform.biz.service.*; | |
| 11 | 8 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 12 | 9 | import com.lyms.platform.common.enums.*; |
| 13 | 10 | import com.lyms.platform.common.result.*; |
| ... | ... | @@ -27,6 +24,9 @@ |
| 27 | 24 | import com.lyms.platform.permission.service.OrganizationService; |
| 28 | 25 | import com.lyms.platform.permission.service.UsersService; |
| 29 | 26 | import com.lyms.platform.pojo.*; |
| 27 | +import com.lyms.platform.query.AntExChuQuery; | |
| 28 | +import com.lyms.platform.query.AntExRecordQuery; | |
| 29 | +import com.lyms.platform.query.PatientsQuery; | |
| 30 | 30 | import com.lyms.platform.query.SieveApplyOrderQuery; |
| 31 | 31 | import com.lymsh.platform.reportdata.model.echarts.Series; |
| 32 | 32 | import org.apache.commons.collections.*; |
| 33 | 33 | |
| ... | ... | @@ -98,9 +98,13 @@ |
| 98 | 98 | @Autowired |
| 99 | 99 | @Qualifier("commonThreadPool") |
| 100 | 100 | private ThreadPoolTaskExecutor commonThreadPool; |
| 101 | + | |
| 101 | 102 | @Autowired |
| 102 | 103 | private BasicConfigService basicConfigService; |
| 103 | 104 | |
| 105 | + @Autowired | |
| 106 | + private AntExRecordService recordService; | |
| 107 | + | |
| 104 | 108 | private static final Map<String, String> colorMap = new HashMap<>(); |
| 105 | 109 | |
| 106 | 110 | /** |
| 107 | 111 | |
| 108 | 112 | |
| 109 | 113 | |
| 110 | 114 | |
| ... | ... | @@ -4640,19 +4644,85 @@ |
| 4640 | 4644 | return br; |
| 4641 | 4645 | } |
| 4642 | 4646 | |
| 4647 | + @Override | |
| 4648 | + public BaseResponse getHighRiskDetail(String hospitalId, String riskTyep, Date startDate, Date endDate,Integer page,Integer limit) { | |
| 4649 | + BaseListResponse br = new BaseListResponse(); | |
| 4650 | + List <Map <String, Object>> antExRecordResult=new ArrayList<>(); | |
| 4651 | + //初诊 | |
| 4652 | + AntExRecordQuery antExRecordQuery = new AntExRecordQuery(); | |
| 4653 | + antExRecordQuery.setCheckTimeStart(startDate); | |
| 4654 | + antExRecordQuery.setCheckTimeEnd(endDate); | |
| 4655 | + antExRecordQuery.setHospitalId(hospitalId); | |
| 4656 | + switch (riskTyep){ | |
| 4657 | + case "risk_green": | |
| 4658 | + antExRecordQuery.setLevelId("e637b361-99cf-41eb-84f2-f0dab596e928"); | |
| 4659 | + break; | |
| 4660 | + case "risk_yellow": | |
| 4661 | + antExRecordQuery.setLevelId("315107bd-91fe-42a1-9237-752f3c046a40"); | |
| 4662 | + break; | |
| 4663 | + case "risk_orange": | |
| 4664 | + antExRecordQuery.setLevelId("49a36aea-c5b6-4162-87d2-9eb3c6ec00c2"); | |
| 4665 | + break; | |
| 4666 | + case "risk_red": | |
| 4667 | + antExRecordQuery.setLevelId("eb146c03-b19f-4e28-b85f-fda574b2283b"); | |
| 4668 | + break; | |
| 4669 | + case "risk_purple": | |
| 4670 | + antExRecordQuery.setLevelId("224b2329-cb82-4da3-a071-8527f8283aab"); | |
| 4671 | + break; | |
| 4672 | + } | |
| 4673 | + antExRecordQuery.setNeed("yes"); | |
| 4674 | + antExRecordQuery.setPage(page); | |
| 4675 | + antExRecordQuery.setLimit(limit); | |
| 4676 | + List<AntExRecordModel> antExRecordModelList = recordService.queryAntExRecords(antExRecordQuery, Sort.Direction.DESC, "created"); | |
| 4677 | + for (AntExRecordModel antExRecordModel : antExRecordModelList) { | |
| 4678 | + Map<String,Object>map =new HashMap<>(); | |
| 4679 | + map.put("name", antExRecordModel.getName()); | |
| 4680 | + //生日 | |
| 4681 | + int days = DateUtil.getDays(antExRecordModel.getLastMenses(),antExRecordModel.getBuildTime() ); | |
| 4682 | + map.put("dueWeek", com.lyms.platform.common.utils.StringUtils.dueWeek(days)); | |
| 4683 | + map.put("age", DateUtil.getAge(antExRecordModel.getBrith())); | |
| 4684 | + //居住地 | |
| 4685 | + String liveAddress = CommonsHelper.getResidence(antExRecordModel.getProvinceId(), antExRecordModel.getCityId(), | |
| 4686 | + antExRecordModel.getAreaId(), antExRecordModel.getStreetId(), antExRecordModel.getAddress(), basicConfigService); | |
| 4687 | + map.put("liveAddress", liveAddress); | |
| 4688 | + map.put("nextCheckTime", DateUtil.getyyyy_MM_dd(antExRecordModel.getNextCheckTime())); | |
| 4689 | + //高危因素 | |
| 4690 | + List<Map<String, Object>> risk = getRisk(antExRecordModel.gethRisk()); | |
| 4691 | + for (Map<String, Object> stringObjectMap : risk) { | |
| 4692 | + if(stringObjectMap.get("color").equals(riskTyep)){ | |
| 4693 | + map.put("highRiskResult", stringObjectMap.get("name")); | |
| 4694 | + } | |
| 4695 | + } | |
| 4696 | + antExRecordResult.add(map); | |
| 4697 | + } | |
| 4698 | + | |
| 4699 | + br.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 4700 | + br.setErrormsg("成功"); | |
| 4701 | + br.setData(antExRecordResult); | |
| 4702 | + br.setPageInfo(antExRecordQuery.getPageInfo()); | |
| 4703 | + return br; | |
| 4704 | + } | |
| 4705 | + | |
| 4643 | 4706 | /** |
| 4644 | 4707 | * 解析高危,返回名字和颜色 |
| 4645 | 4708 | * @param highRisk |
| 4646 | 4709 | * @return |
| 4647 | 4710 | */ |
| 4648 | - public List <Map <String, Object>> getRisk(String highRisk){ | |
| 4711 | + public List <Map <String, Object>> getRisk(Object highRisk){ | |
| 4649 | 4712 | HighScoreResult highScoreResult = null; |
| 4650 | - if (StringUtils.isNotEmpty(highRisk)) { | |
| 4651 | - List <String> ids = JsonUtil.toList(highRisk, String.class); | |
| 4652 | - if (CollectionUtils.isNotEmpty(ids)) { | |
| 4653 | - highScoreResult = ResolveUtils.queryRisk(ids, true, basicConfigService); | |
| 4713 | + if(highRisk instanceof String){ | |
| 4714 | + if (null!=highRisk) { | |
| 4715 | + List <String> ids = JsonUtil.toList(highRisk.toString(), String.class); | |
| 4716 | + if (CollectionUtils.isNotEmpty(ids)) { | |
| 4717 | + highScoreResult = ResolveUtils.queryRisk(ids, true, basicConfigService); | |
| 4718 | + } | |
| 4654 | 4719 | } |
| 4720 | + }else if (highRisk instanceof List){ | |
| 4721 | + if (null!=highRisk) { | |
| 4722 | + highScoreResult = ResolveUtils.queryRisk((List<String>) highRisk, true, basicConfigService); | |
| 4723 | + } | |
| 4655 | 4724 | } |
| 4725 | + | |
| 4656 | 4726 | return ResolveUtils.queryHighRisk(highScoreResult); |
| 4657 | 4727 | } |
| 4658 | 4728 | } |