Commit f88c123835d3df71e3f8b65896627cf979dcdfd1

Authored by shiyang
1 parent 1894b4669f

滦平-孕产贫血统计

Showing 4 changed files with 108 additions and 8 deletions

platform-dal/src/main/java/com/lyms/platform/pojo/AntExChuModel.java View file @ f88c123
... ... @@ -487,6 +487,16 @@
487 487  
488 488 private String teamId;//医生团队
489 489 private String reason;//换团队的原因
  490 + //统计筛选时间
  491 + private String checkTimeString;
  492 +
  493 + public String getCheckTimeString() {
  494 + return checkTimeString;
  495 + }
  496 +
  497 + public void setCheckTimeString(String checkTimeString) {
  498 + this.checkTimeString = checkTimeString;
  499 + }
490 500  
491 501 public String getTeamId() {
492 502 return teamId;
platform-dal/src/main/java/com/lyms/platform/query/AntExChuQuery.java View file @ f88c123
... ... @@ -58,14 +58,17 @@
58 58 private List<String> notHivkt;
59 59  
60 60 private String xhdb;
  61 + //滦平统计用
  62 + private String lpXhdbStart;
  63 + private String lpXhdbEnd;
61 64  
62   - private Integer xhdbXiao;
  65 + private String xhdbXiao;
63 66  
64   - public Integer getXhdbXiao() {
  67 + public String getXhdbXiao() {
65 68 return xhdbXiao;
66 69 }
67 70  
68   - public void setXhdbXiao(Integer xhdbXiao) {
  71 + public void setXhdbXiao(String xhdbXiao) {
69 72 this.xhdbXiao = xhdbXiao;
70 73 }
71 74  
... ... @@ -77,6 +80,22 @@
77 80 this.xhdb = xhdb;
78 81 }
79 82  
  83 + public String getLpXhdbStart() {
  84 + return lpXhdbStart;
  85 + }
  86 +
  87 + public void setLpXhdbStart(String lpXhdbStart) {
  88 + this.lpXhdbStart = lpXhdbStart;
  89 + }
  90 +
  91 + public String getLpXhdbEnd() {
  92 + return lpXhdbEnd;
  93 + }
  94 +
  95 + public void setLpXhdbEnd(String lpXhdbEnd) {
  96 + this.lpXhdbEnd = lpXhdbEnd;
  97 + }
  98 +
80 99 public List<String> getYgbmkyList() {
81 100 return ygbmkyList;
82 101 }
... ... @@ -361,7 +380,7 @@
361 380  
362 381 if (null != end) {
363 382 if (null != c) {
364   - c = c.lte(end);
  383 + c = c.and("checkTime").lte(end);
365 384 } else {
366 385 c = Criteria.where("checkTime").lte(end);
367 386 }
... ... @@ -370,7 +389,7 @@
370 389  
371 390 if (null != nextCheckTimeStart && nextCheckTimeEnd != null) {
372 391 if (null != c) {
373   - c = c.where("nextCheckTime").gte(nextCheckTimeStart).lte(nextCheckTimeEnd);
  392 + c = c.and("nextCheckTime").gte(nextCheckTimeStart).lte(nextCheckTimeEnd);
374 393 } else {
375 394 c = Criteria.where("nextCheckTime").gte(nextCheckTimeStart).lte(nextCheckTimeEnd);
376 395 }
... ... @@ -378,7 +397,7 @@
378 397  
379 398 if (null != checkTimeStart && checkTimeEnd != null) {
380 399 if (null != c) {
381   - c = c.where("checkTime").gte(checkTimeStart).lte(checkTimeEnd);
  400 + c = c.and("checkTime").gte(checkTimeStart).lte(checkTimeEnd);
382 401 } else {
383 402 c = Criteria.where("checkTime").gte(checkTimeStart).lte(checkTimeEnd);
384 403 }
385 404  
... ... @@ -386,14 +405,14 @@
386 405  
387 406 if (null != createdTimeStart && createdTimeEnd != null) {
388 407 if (null != c) {
389   - c = c.where("created").gte(createdTimeStart).lte(createdTimeEnd);
  408 + c = c.and("created").gte(createdTimeStart).lte(createdTimeEnd);
390 409 } else {
391 410 c = Criteria.where("created").gte(createdTimeStart).lte(createdTimeEnd);
392 411 }
393 412 }
394 413 if (null != modifiedStart && modifiedEnd != null) {
395 414 if (null != c) {
396   - c = c.where("modified").gte(modifiedStart).lte(modifiedEnd);
  415 + c = c.and("modified").gte(modifiedStart).lte(modifiedEnd);
397 416 } else {
398 417 c = Criteria.where("modified").gte(modifiedStart).lte(modifiedEnd);
399 418 }
... ... @@ -403,6 +422,13 @@
403 422 MongoCondition mongoCondition = new MongoCondition("modified", gteModified, MongoOper.GTE);
404 423 MongoCondition condition2 = new MongoCondition("created", gteCreated, MongoOper.GTE);
405 424 condition = condition.orCondition(new MongoCondition[]{mongoCondition, condition2});
  425 + }
  426 + if (null != lpXhdbStart&&null!=lpXhdbEnd) {
  427 + if (null != c) {
  428 + c = c.and("xhdb").gte(lpXhdbStart).lte(lpXhdbEnd);
  429 + } else {
  430 + c = Criteria.where("xhdb").gte(lpXhdbStart).lte(lpXhdbEnd);
  431 + }
406 432 }
407 433  
408 434 if (null != c) {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ViewController.java View file @ f88c123
1 1 package com.lyms.platform.operate.web.controller;
2 2  
3 3 import com.aspose.words.*;
  4 +import com.lyms.platform.biz.AntExChuModelTemp;
4 5 import com.lyms.platform.common.annotation.TokenRequired;
5 6 import com.lyms.platform.common.base.BaseController;
6 7 import com.lyms.platform.common.base.LoginContext;
... ... @@ -13,6 +14,7 @@
13 14 import com.lyms.platform.operate.web.facade.MatdeliverFollowFacade;
14 15 import com.lyms.platform.operate.web.facade.ViewFacade;
15 16 import com.lyms.platform.operate.web.request.RisInfoModelRequest;
  17 +import com.lyms.platform.pojo.AntExChuModel;
16 18 import com.lyms.platform.query.BabyModelQuery;
17 19 import org.springframework.beans.factory.annotation.Autowired;
18 20 import org.springframework.stereotype.Controller;
... ... @@ -1225,5 +1227,17 @@
1225 1227 return viewFacade.getBabyScreening(cardNo);
1226 1228 }
1227 1229  
  1230 + /**
  1231 + * 统计管理-孕期贫血统计
  1232 + *统计初诊血红蛋白值得范围
  1233 + * @param antExChuModel
  1234 + * @return
  1235 + */
  1236 + @RequestMapping(value = "/getChuXhdb", method = RequestMethod.GET)
  1237 + @ResponseBody
  1238 + @TokenRequired
  1239 + public BaseResponse getChuXhdb(AntExChuModel antExChuModel) {
  1240 + return viewFacade.getChuXhdb(antExChuModel);
  1241 + }
1228 1242 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java View file @ f88c123
... ... @@ -9,6 +9,7 @@
9 9 import java.util.*;
10 10  
11 11 import com.lyms.hospitalapi.qhdfy.QhdfyHisService;
  12 +import com.lyms.platform.biz.AntExChuModelTemp;
12 13 import com.lyms.platform.common.constants.*;
13 14 import com.lyms.platform.common.enums.*;
14 15 import com.lyms.platform.common.utils.*;
... ... @@ -35,6 +36,9 @@
35 36 import org.springframework.beans.factory.annotation.Qualifier;
36 37 import org.springframework.data.domain.Sort;
37 38 import org.springframework.data.mongodb.core.MongoTemplate;
  39 +import org.springframework.data.mongodb.core.aggregation.Aggregation;
  40 +import org.springframework.data.mongodb.core.aggregation.AggregationOperation;
  41 +import org.springframework.data.mongodb.core.aggregation.AggregationResults;
38 42 import org.springframework.data.mongodb.core.query.Criteria;
39 43 import org.springframework.data.mongodb.core.query.Query;
40 44 import org.springframework.stereotype.Component;
... ... @@ -8782,6 +8786,52 @@
8782 8786  
8783 8787 }
8784 8788 return data;
  8789 + }
  8790 +
  8791 + public BaseResponse getChuXhdb(AntExChuModel antExChuModel) {
  8792 + BaseResponse br = new BaseResponse();
  8793 + Map<String,Object>map =new HashMap<>();
  8794 + AntExChuQuery antExChuQuery=new AntExChuQuery();
  8795 + //检查时间筛选
  8796 + if (StringUtils.isNotEmpty(antExChuModel.getCheckTimeString())) {
  8797 + try {
  8798 + antExChuQuery.setCheckTimeStart(DateUtil.getSNDate(antExChuModel.getCheckTimeString())[0]);
  8799 + antExChuQuery.setCheckTimeEnd(DateUtil.getSNDate(antExChuModel.getCheckTimeString())[1]);
  8800 + } catch (Exception e) {
  8801 + // 什么都不做,这里是数据传入错误了
  8802 + }
  8803 + }
  8804 + antExChuQuery.setHospitalId(antExChuModel.getHospitalId());
  8805 + //轻度妊娠期贫血(100-109g/l)
  8806 + antExChuQuery.setLpXhdbStart("100");
  8807 + antExChuQuery.setLpXhdbEnd("109");
  8808 + System.out.println(antExChuQuery.convertToQuery().convertToMongoQuery().toString());
  8809 + Long light = mongoTemplate.count(antExChuQuery.convertToQuery().convertToMongoQuery(), AntExChuModel.class);
  8810 + map.put("light",light);
  8811 + //中度妊娠期贫血(70-99g/l)
  8812 + antExChuQuery.setLpXhdbStart("70");
  8813 + antExChuQuery.setLpXhdbEnd("99");
  8814 + System.out.println(antExChuQuery.convertToQuery().convertToMongoQuery().toString());
  8815 + Long middle = mongoTemplate.count(antExChuQuery.convertToQuery().convertToMongoQuery(), AntExChuModel.class);
  8816 + map.put("middle",middle);
  8817 + //重度妊娠期贫血(40-69g/l)
  8818 + antExChuQuery.setLpXhdbStart("40");
  8819 + antExChuQuery.setLpXhdbEnd("69");
  8820 + System.out.println(antExChuQuery.convertToQuery().convertToMongoQuery().toString());
  8821 + Long matter = mongoTemplate.count(antExChuQuery.convertToQuery().convertToMongoQuery(), AntExChuModel.class);
  8822 + map.put("matter",matter);
  8823 + //极重度贫血(<40g/l)
  8824 + antExChuQuery.setXhdbXiao("40");
  8825 + antExChuQuery.setLpXhdbStart(null);
  8826 + antExChuQuery.setLpXhdbEnd(null);
  8827 + System.out.println(antExChuQuery.convertToQuery().convertToMongoQuery().toString());
  8828 + Long severity = mongoTemplate.count(antExChuQuery.convertToQuery().convertToMongoQuery(), AntExChuModel.class);
  8829 + map.put("severity",severity);
  8830 + br.setErrorcode(ErrorCodeConstants.SUCCESS);
  8831 + br.setErrormsg("成功");
  8832 + br.setObject(map);
  8833 + return br;
  8834 +
8785 8835 }
8786 8836 }