Commit b6f14769392f60d2617695e8a68815ff138faeb0

Authored by shiyang
1 parent 8c3899a58f

滦平-儿童贫血统计

Showing 4 changed files with 167 additions and 4 deletions

platform-dal/src/main/java/com/lyms/platform/query/AntExChuQuery.java View file @ b6f1476
... ... @@ -380,7 +380,7 @@
380 380  
381 381 if (null != end) {
382 382 if (null != c) {
383   - c = c.and("checkTime").lte(end);
  383 + c = c.lte(end);
384 384 } else {
385 385 c = Criteria.where("checkTime").lte(end);
386 386 }
platform-dal/src/main/java/com/lyms/platform/query/BabyCheckModelQuery.java View file @ b6f1476
... ... @@ -5,6 +5,7 @@
5 5 import com.lyms.platform.common.dao.operator.MongoCondition;
6 6 import com.lyms.platform.common.dao.operator.MongoOper;
7 7 import com.lyms.platform.common.dao.operator.MongoQuery;
  8 +import com.lyms.platform.common.utils.StringUtils;
8 9 import org.springframework.data.mongodb.core.query.Criteria;
9 10  
10 11 import java.util.Arrays;
... ... @@ -89,6 +90,35 @@
89 90 private Date modifiedEnd;
90 91 private Integer highRisk;
91 92  
  93 + //滦平儿保血红蛋白统计
  94 + private String hemoglobinStart;
  95 + private String hemoglobinEnd;
  96 + private String hemoglobinLt;
  97 +
  98 + public String getHemoglobinLt() {
  99 + return hemoglobinLt;
  100 + }
  101 +
  102 + public void setHemoglobinLt(String hemoglobinLt) {
  103 + this.hemoglobinLt = hemoglobinLt;
  104 + }
  105 +
  106 + public String getHemoglobinStart() {
  107 + return hemoglobinStart;
  108 + }
  109 +
  110 + public void setHemoglobinStart(String hemoglobinStart) {
  111 + this.hemoglobinStart = hemoglobinStart;
  112 + }
  113 +
  114 + public String getHemoglobinEnd() {
  115 + return hemoglobinEnd;
  116 + }
  117 +
  118 + public void setHemoglobinEnd(String hemoglobinEnd) {
  119 + this.hemoglobinEnd = hemoglobinEnd;
  120 + }
  121 +
92 122 public Integer getHighRisk() {
93 123 return highRisk;
94 124 }
... ... @@ -178,6 +208,9 @@
178 208 MongoCondition condition2 = new MongoCondition("created", gteCreated, MongoOper.GTE);
179 209 condition = condition.orCondition(new MongoCondition[]{mongoCondition, condition2});
180 210 }
  211 + if(StringUtils.isNotEmpty(hemoglobinLt)){
  212 + condition=condition.and("hemoglobin", hemoglobinLt, MongoOper.LT);
  213 + }
181 214  
182 215 Criteria c = null;
183 216 if (null != birthStart) {
... ... @@ -226,7 +259,7 @@
226 259  
227 260 if(null != createdTimeStart && createdTimeEnd != null){
228 261 if(null != c){
229   - c = c.where("created").gte(createdTimeStart).lte(createdTimeEnd);
  262 + c = c.and("created").gte(createdTimeStart).lte(createdTimeEnd);
230 263 }else{
231 264 c = Criteria.where("created").gte(createdTimeStart).lte(createdTimeEnd);
232 265 }
233 266  
... ... @@ -234,12 +267,19 @@
234 267  
235 268 if(null != modifiedStart && modifiedEnd != null){
236 269 if(null != c){
237   - c = c.where("modified").gte(modifiedStart).lte(modifiedEnd);
  270 + c = c.and("modified").gte(modifiedStart).lte(modifiedEnd);
238 271 }else{
239 272 c = Criteria.where("modified").gte(modifiedStart).lte(modifiedEnd);
240 273 }
241 274 }
242 275  
  276 + if(null != hemoglobinStart && hemoglobinEnd != null){
  277 + if(null != c){
  278 + c = c.and("hemoglobin").gte(hemoglobinStart).lte(hemoglobinEnd);
  279 + }else{
  280 + c = Criteria.where("hemoglobin").gte(createdTimeStart).lte(createdTimeEnd);
  281 + }
  282 + }
243 283  
244 284 if (c != null) {
245 285 return new MongoCondition(c.andOperator(condition.getCriteria())).toMongoQuery();
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyCheckController.java View file @ b6f1476
... ... @@ -16,6 +16,7 @@
16 16 import com.lyms.platform.operate.web.request.*;
17 17 import com.lyms.platform.operate.web.service.PatientWeightService;
18 18 import com.lyms.platform.permission.service.CouponService;
  19 +import com.lyms.platform.pojo.AntExChuModel;
19 20 import org.springframework.beans.factory.annotation.Autowired;
20 21 import org.springframework.stereotype.Controller;
21 22 import org.springframework.web.bind.annotation.*;
... ... @@ -628,6 +629,18 @@
628 629 return babyCheckFacade.getBabyDoctorCount(checkTime, getUserId(request));
629 630 }
630 631  
631   -
  632 + /**
  633 + * 儿童统计管理-儿童贫血统计
  634 + * 儿保检查记录中统计
  635 + * @param
  636 + * @return
  637 + */
  638 + @RequestMapping(value = "/getBabyCheckHemoglobin", method = RequestMethod.GET)
  639 + @ResponseBody
  640 + @TokenRequired
  641 + public BaseResponse getBabyCheckHemoglobin(@RequestParam(required = true) String hospitalId,
  642 + @RequestParam(required = true) String checkTime) {
  643 + return babyCheckFacade.getBabyCheckHemoglobin(hospitalId,checkTime);
  644 + }
632 645 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java View file @ b6f1476
... ... @@ -4645,5 +4645,115 @@
4645 4645 return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setData(datas).setErrormsg("成功");
4646 4646  
4647 4647 }
  4648 +
  4649 + public BaseResponse getBabyCheckHemoglobin(String hospitalId, String checkTime) {
  4650 + BaseResponse br=new BaseResponse();
  4651 + List<Map<String,Object>> mapList=new ArrayList<>();
  4652 + BabyCheckModelQuery query = new BabyCheckModelQuery();
  4653 + if (null != checkTime) {
  4654 + try {
  4655 + query.setCheckDateStart(DateUtil.getSNDate(checkTime)[0]);
  4656 + query.setCheckDateEnd(DateUtil.getSNDate(checkTime)[1]);
  4657 + } catch (Exception e) {
  4658 + }
  4659 + }
  4660 + query.setHospitalId(hospitalId);
  4661 + int total=0;
  4662 + for (int i=1;i<=6;i++){
  4663 + Map<String,Object>map =new HashMap<>();
  4664 + int cms=0,cme=0;
  4665 + //全区间总数
  4666 + if(i==6){
  4667 + map.put("zTotal", total);
  4668 + mapList.add(map);
  4669 + break;
  4670 + }
  4671 + String lightHls="0",lightHln="0";
  4672 + String middleHls="0",middleHln="0";
  4673 + String matterHls="0",matterHln="0";
  4674 + String severityHll="0";
  4675 + switch (i){
  4676 + case 1:
  4677 + /**
  4678 + * 1-4个月
  4679 + */
  4680 + cms=1;cme=4;
  4681 + middleHls="60";middleHln="89";
  4682 + matterHls="30";matterHln="59";severityHll="30";
  4683 + break;
  4684 + case 2:
  4685 + /**
  4686 + * 4-6个月
  4687 + */
  4688 + cms=4;cme=6;
  4689 + //(90-100g/l)
  4690 + lightHls="90";lightHln="100"; middleHls="60";middleHln="89";
  4691 + matterHls="30";matterHln="59";severityHll="30";
  4692 + break;
  4693 + case 3:
  4694 + /**
  4695 + * 6-59个月
  4696 + */
  4697 + cms=6;cme=72;
  4698 + //(90-110g/l)
  4699 + lightHls="90";lightHln="110"; middleHls="60";middleHln="89";
  4700 + matterHls="30";matterHln="59";severityHll="30";
  4701 + break;
  4702 + case 4:
  4703 + /**
  4704 + * 6-11岁
  4705 + */
  4706 + cms=72;cme=132;
  4707 + //(90-115g/l)
  4708 + lightHls="90";lightHln="115"; middleHls="60";middleHln="89";
  4709 + matterHls="30";matterHln="59";severityHll="30";
  4710 + break;
  4711 + case 5:
  4712 + /**
  4713 + * 12-14岁
  4714 + */
  4715 + cms=144;cme=168;
  4716 + //(90-120g/l)
  4717 + lightHls="90";lightHln="120"; middleHls="60";middleHln="89";
  4718 + matterHls="30";matterHln="59";severityHll="30";
  4719 + break;
  4720 + }
  4721 + query.setCheckMonthStart(cms);
  4722 + query.setCheckMonthEnd(cme);
  4723 + //轻度贫血
  4724 + query.setHemoglobinStart(lightHls);
  4725 + query.setHemoglobinEnd(lightHln);
  4726 + int light =babyCheckService.queryBabyCheckCount(query);
  4727 + map.put("light",light);
  4728 + //中度贫血
  4729 + query.setHemoglobinStart(middleHls);
  4730 + query.setHemoglobinEnd(middleHln);
  4731 + int middle =babyCheckService.queryBabyCheckCount(query);
  4732 + map.put("middle",middle);
  4733 + //重度贫血
  4734 + query.setHemoglobinStart(matterHls);
  4735 + query.setHemoglobinEnd(matterHls);
  4736 + int matter =babyCheckService.queryBabyCheckCount(query);
  4737 + map.put("matter",matter);
  4738 + //极重度贫血
  4739 + query.setHemoglobinLt(severityHll);
  4740 + query.setHemoglobinStart(null);
  4741 + query.setHemoglobinEnd(null);
  4742 + int severity =babyCheckService.queryBabyCheckCount(query);
  4743 + map.put("severity",severity);
  4744 + //月龄区间总数
  4745 + map.put("total",light+middle+matter+severity);
  4746 + if(cms==1){
  4747 + map.put("total",middle+matter+severity);
  4748 + }
  4749 + //汇总总数
  4750 + total+=Integer.parseInt(map.get("total").toString());
  4751 + mapList.add(map);
  4752 + }
  4753 + br.setErrorcode(ErrorCodeConstants.SUCCESS);
  4754 + br.setErrormsg("成功");
  4755 + br.setObject(mapList);
  4756 + return br;
  4757 + }
4648 4758 }