Commit d84b1ed2bd0beaf4b7857aac6efa148c8271e49a
1 parent
ecdb88a117
Exists in
master
and in
6 other branches
儿童报告
Showing 3 changed files with 129 additions and 70 deletions
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyNutritionFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BloodSugarServiceImpl.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyNutritionFacade.java
View file @
d84b1ed
... | ... | @@ -328,12 +328,13 @@ |
328 | 328 | String bmi = patientWeightService.getBmi(String.valueOf(model.getWeight()),String.valueOf(model.getHeight())); |
329 | 329 | String kaupEvaluate = getBabyStatus(month, baby.getSex(), model.getHeight(), model.getWeight(), bmi); |
330 | 330 | |
331 | - double kaul = getKal(month, model.getHeight(), model.getWeight(), baby.getSex(), kaupEvaluate); | |
331 | + double kaul = getKal(month, model.getWeight(), model.getHeight(), baby.getSex(), kaupEvaluate); | |
332 | 332 | |
333 | + double valueKaul = getBasicKaul(month, model.getWeight(), model.getHeight(), baby.getSex()); | |
333 | 334 | map.put("kaupEvaluate", kaupEvaluate); |
334 | 335 | map.put("month", month); |
335 | 336 | map.put("bmi", bmi); |
336 | - map.put("kaul", kaul); | |
337 | + map.put("kaul", valueKaul); | |
337 | 338 | data.put("baseInfo", map); |
338 | 339 | |
339 | 340 | if (month < 12) |
340 | 341 | |
341 | 342 | |
342 | 343 | |
... | ... | @@ -345,16 +346,15 @@ |
345 | 346 | String feedType = WyTypeEnums.getNameById(Integer.parseInt(model.getFeedType())); |
346 | 347 | ca.and("feedType").is(feedType); |
347 | 348 | |
348 | - BabyNutritionConfigModel babyNutritionConfig = mongoTemplate.findOne(Query.query(ca), | |
349 | - BabyNutritionConfigModel.class); | |
350 | - | |
351 | - //合理喂养 | |
352 | - data.put("hlFeed", babyNutritionConfig.getContentOne()); | |
353 | - | |
354 | 349 | } |
355 | 350 | |
351 | + BabyNutritionConfigModel babyNutritionConfig = mongoTemplate.findOne(Query.query(ca), | |
352 | + BabyNutritionConfigModel.class); | |
356 | 353 | |
354 | + //合理喂养 | |
355 | + data.put("hlFeed", babyNutritionConfig.getContentOne()); | |
357 | 356 | |
357 | + | |
358 | 358 | BabyNutritionConfigModel babyNutritionConfig1 = mongoTemplate.findOne( |
359 | 359 | Query.query(Criteria.where("monthAge").is(month).and("type").is(1)), BabyNutritionConfigModel.class); |
360 | 360 | |
361 | 361 | |
362 | 362 | |
... | ... | @@ -363,15 +363,20 @@ |
363 | 363 | |
364 | 364 | if (month > 5) |
365 | 365 | { |
366 | + Double val = getMathRound(kaul); | |
366 | 367 | BabyNutritionConfigModel babyNutritionConfig2 = mongoTemplate.findOne( |
367 | - Query.query(Criteria.where("monthAge").is(month).and("type").is(6)), BabyNutritionConfigModel.class); | |
368 | + Query.query(Criteria.where("monthAge").is(month).and("type").is(6).and("kcal").is(val)), BabyNutritionConfigModel.class); | |
368 | 369 | |
369 | - //食用须知 | |
370 | - data.put("syxz",babyNutritionConfig2.getContentOne()); | |
371 | - //辅食添加 | |
372 | - data.put("fstj",babyNutritionConfig2.getContentTwo()); | |
373 | - //辅食制作 | |
374 | - data.put("fszz",babyNutritionConfig2.getContentThree()); | |
370 | + if (babyNutritionConfig2 != null) | |
371 | + { | |
372 | + //食用须知 | |
373 | + data.put("syxz",babyNutritionConfig2.getContentOne()); | |
374 | + //辅食添加 | |
375 | + data.put("fstj",babyNutritionConfig2.getContentTwo()); | |
376 | + //辅食制作 | |
377 | + data.put("fszz",babyNutritionConfig2.getContentThree()); | |
378 | + } | |
379 | + | |
375 | 380 | } |
376 | 381 | |
377 | 382 | } |
... | ... | @@ -401,7 +406,7 @@ |
401 | 406 | } |
402 | 407 | |
403 | 408 | |
404 | - List<String> yys = getYys(month,kaul,model.getWeight()); | |
409 | + List<String> yys = getYys(month); | |
405 | 410 | //每日所需营养素 |
406 | 411 | data.put("yys",yys); |
407 | 412 | |
408 | 413 | |
409 | 414 | |
410 | 415 | |
411 | 416 | |
412 | 417 | |
... | ... | @@ -688,47 +693,76 @@ |
688 | 693 | } |
689 | 694 | |
690 | 695 | |
691 | - private List<String> getYys(int month,Double nl,Double weight){ | |
696 | + private List<String> getYys(int month){ | |
692 | 697 | List<String> list = new ArrayList<>(); |
693 | 698 | |
694 | 699 | if (month < 36) |
695 | 700 | { |
696 | - //总能量的50-70% | |
697 | - list.add("碳水化合物:"+handleData( nl,0.5,0.7)); | |
698 | - //总能量的7-20% | |
699 | - list.add("蛋白质:"+handleData( nl,0.07,0.2)+",平均每日约0.96g/kg"); | |
700 | - //总能量的20-35% | |
701 | - list.add("脂肪:"+handleData( nl,0.2,0.35)); | |
702 | - //总能量的4-8% | |
703 | - list.add("n-6:"+handleData( nl,0.04,0.08)); | |
704 | - //总能量的1% | |
705 | - list.add("N-3:"+handleData( nl,0.01)); | |
701 | + list.add("碳水化合物:总能量的50-70%"); | |
702 | + list.add("蛋白质:总能量的7-20%,平均每日约0.96g/kg"); | |
703 | + list.add("脂肪:总能量的20-35%"); | |
704 | + list.add("n-6:总能量的4-8%"); | |
705 | + list.add("N-3:总能量的1%"); | |
706 | 706 | list.add("无机物:钙的推荐摄入量为500mg,磷的推荐摄入量为500mg,钠的充分摄入为0.7g,氯的充分摄入量为1.1g,钾的充分摄入量为1.7g,镁的推荐摄入量为75mg,铁的推荐摄入量为6mg,锌的推荐摄入量为3mg,铜的推荐摄入量为290 μg,氟的充分摄入量为0.6mg,猛的充分摄入量为1.4mg,碘的推荐摄入量为80 μg,硒的推荐摄入量为20 μg"); |
707 | 707 | list.add("维生素:维生素A的推荐摄入量为300 μgRE,维生素D的充分摄入量为5 μg,维生素E的充分摄入量为5mg α-TE,维生素K的充分摄入量为25μg,维生素C的推荐摄入量为40mg,维生素B1的推荐摄入量为0.5mg,维生素B2(核黄素)的0.6mg,维生素B3烟酸的推荐摄入量为6mgNE,尼克酸的上限摄入量为10mg,尼克酰胺的上限摄入量为180mg,维生素B6的推荐摄入量0.6mg,叶酸的推荐摄入量为150μg DFE,维生素B12的推荐摄入量为0.9μg,泛酸的充分摄入量为2mg,维生素H的充分摄入量9μg"); |
708 | - //1岁120-135ml/kg/day;2岁115-125ml/kg/day | |
709 | - list.add("水分:1岁"+handleData(weight,120,135)+"ml/day;2岁"+handleData(weight,115,125)+"ml/kg/day"); | |
708 | + list.add("水分:1岁120-135ml/kg/day;2岁115-125ml/kg/day"); | |
710 | 709 | } |
711 | 710 | else |
712 | 711 | { |
713 | - //总能量的55-70% | |
714 | - list.add("碳水化合物:"+handleData( nl,0.55,0.7)); | |
715 | - //总能量的7-20% | |
716 | - list.add("蛋白质:"+handleData( nl,0.07,0.2)+",平均每日约0.88g/kg"); | |
717 | - //总能量的15-30% | |
718 | - list.add("脂肪:"+handleData( nl,0.15,0.3)); | |
719 | - //总能量的4-8% | |
720 | - list.add("n-6:"+handleData( nl,0.04,0.08)); | |
721 | - //总能量的1% | |
722 | - list.add("n-3:"+handleData( nl,0.01)); | |
712 | + list.add("碳水化合物:总能量的55-70%"); | |
713 | + list.add("蛋白质:总能量的7-20%,平均每日约0.88g/kg"); | |
714 | + list.add("脂肪:总能量的15-30%"); | |
715 | + list.add("n-6:总能量的4-8%"); | |
716 | + list.add("n-3:总能量的1%"); | |
723 | 717 | list.add("无机物:钙的推荐摄入量为600mg,磷的推荐摄入量为500mg,钠的充分摄入量为0.9g,氯的充分摄入量为1.4g,钾的充分摄入量为2.3g,镁的推荐摄入量为100mg,铁的推荐摄入量7mg,锌的推荐摄入量为4mg,铜的推荐摄入量为330 μg,氟的充分摄入量为0.8mg,猛的充分摄入量为2.0mg,碘的推荐摄入量为90 μg,硒的推荐摄入量为25 μg"); |
724 | 718 | list.add("维生素:维生素A的推荐摄入量为300 μgRE,维生素D的充分摄入量为5 μg,维生素E的充分摄入量为6mg α-TE,维生素K的充分摄入量为30μg,维生素C的推荐摄入量为40mg,维生素B1的推荐摄入量为0.5mg,维生素B2(核黄素)的0.7mg,维生素B3烟酸的推荐摄入量为7mgNE,尼克酸的上限摄入量为10mg,尼克酰胺的上限摄入量为250mg,维生素B6的推荐摄入量0.7mg,叶酸的推荐摄入量为180μg DFE,维生素B12的推荐摄入量为1.1μg,泛酸的充分摄入量为3mg,维生素H的充分摄入量11μg"); |
725 | - //90-100ml/kg/day | |
726 | - list.add("水分:"+handleData(weight,90,100)+"ml/day"); | |
719 | + list.add("水分:90-100ml/kg/day"); | |
727 | 720 | } |
728 | 721 | |
729 | 722 | return list; |
730 | 723 | } |
731 | 724 | |
725 | +// private List<String> getYys(int month,Double nl,Double weight){ | |
726 | +// List<String> list = new ArrayList<>(); | |
727 | +// | |
728 | +// if (month < 36) | |
729 | +// { | |
730 | +// //总能量的50-70% | |
731 | +// list.add("碳水化合物:"+handleData( nl,0.5,0.7)); | |
732 | +// //总能量的7-20% | |
733 | +// list.add("蛋白质:"+handleData( nl,0.07,0.2)+",平均每日约0.96g/kg"); | |
734 | +// //总能量的20-35% | |
735 | +// list.add("脂肪:"+handleData( nl,0.2,0.35)); | |
736 | +// //总能量的4-8% | |
737 | +// list.add("n-6:"+handleData( nl,0.04,0.08)); | |
738 | +// //总能量的1% | |
739 | +// list.add("N-3:"+handleData( nl,0.01)); | |
740 | +// list.add("无机物:钙的推荐摄入量为500mg,磷的推荐摄入量为500mg,钠的充分摄入为0.7g,氯的充分摄入量为1.1g,钾的充分摄入量为1.7g,镁的推荐摄入量为75mg,铁的推荐摄入量为6mg,锌的推荐摄入量为3mg,铜的推荐摄入量为290 μg,氟的充分摄入量为0.6mg,猛的充分摄入量为1.4mg,碘的推荐摄入量为80 μg,硒的推荐摄入量为20 μg"); | |
741 | +// list.add("维生素:维生素A的推荐摄入量为300 μgRE,维生素D的充分摄入量为5 μg,维生素E的充分摄入量为5mg α-TE,维生素K的充分摄入量为25μg,维生素C的推荐摄入量为40mg,维生素B1的推荐摄入量为0.5mg,维生素B2(核黄素)的0.6mg,维生素B3烟酸的推荐摄入量为6mgNE,尼克酸的上限摄入量为10mg,尼克酰胺的上限摄入量为180mg,维生素B6的推荐摄入量0.6mg,叶酸的推荐摄入量为150μg DFE,维生素B12的推荐摄入量为0.9μg,泛酸的充分摄入量为2mg,维生素H的充分摄入量9μg"); | |
742 | +// //1岁120-135ml/kg/day;2岁115-125ml/kg/day | |
743 | +// list.add("水分:1岁"+handleData(weight,120,135)+"ml/day;2岁"+handleData(weight,115,125)+"ml/kg/day"); | |
744 | +// } | |
745 | +// else | |
746 | +// { | |
747 | +// //总能量的55-70% | |
748 | +// list.add("碳水化合物:"+handleData( nl,0.55,0.7)); | |
749 | +// //总能量的7-20% | |
750 | +// list.add("蛋白质:"+handleData( nl,0.07,0.2)+",平均每日约0.88g/kg"); | |
751 | +// //总能量的15-30% | |
752 | +// list.add("脂肪:"+handleData( nl,0.15,0.3)); | |
753 | +// //总能量的4-8% | |
754 | +// list.add("n-6:"+handleData( nl,0.04,0.08)); | |
755 | +// //总能量的1% | |
756 | +// list.add("n-3:"+handleData( nl,0.01)); | |
757 | +// list.add("无机物:钙的推荐摄入量为600mg,磷的推荐摄入量为500mg,钠的充分摄入量为0.9g,氯的充分摄入量为1.4g,钾的充分摄入量为2.3g,镁的推荐摄入量为100mg,铁的推荐摄入量7mg,锌的推荐摄入量为4mg,铜的推荐摄入量为330 μg,氟的充分摄入量为0.8mg,猛的充分摄入量为2.0mg,碘的推荐摄入量为90 μg,硒的推荐摄入量为25 μg"); | |
758 | +// list.add("维生素:维生素A的推荐摄入量为300 μgRE,维生素D的充分摄入量为5 μg,维生素E的充分摄入量为6mg α-TE,维生素K的充分摄入量为30μg,维生素C的推荐摄入量为40mg,维生素B1的推荐摄入量为0.5mg,维生素B2(核黄素)的0.7mg,维生素B3烟酸的推荐摄入量为7mgNE,尼克酸的上限摄入量为10mg,尼克酰胺的上限摄入量为250mg,维生素B6的推荐摄入量0.7mg,叶酸的推荐摄入量为180μg DFE,维生素B12的推荐摄入量为1.1μg,泛酸的充分摄入量为3mg,维生素H的充分摄入量11μg"); | |
759 | +// //90-100ml/kg/day | |
760 | +// list.add("水分:"+handleData(weight,90,100)+"ml/day"); | |
761 | +// } | |
762 | + | |
763 | +// return list; | |
764 | +// } | |
765 | + | |
732 | 766 | private String handleData(Double nl,double up,double down) |
733 | 767 | { |
734 | 768 | return String.format("%.2f",(nl * down))+"-"+String.format("%.2f",(nl * up)); |
... | ... | @@ -856,6 +890,19 @@ |
856 | 890 | return md; |
857 | 891 | } |
858 | 892 | } |
893 | + | |
894 | + private Double getMathRound(Double kcal) { | |
895 | + if ((kcal) % 100 == 0) | |
896 | + { | |
897 | + return kcal; | |
898 | + } | |
899 | + else | |
900 | + { | |
901 | + kcal+=50; | |
902 | + } | |
903 | + return kcal; | |
904 | + } | |
905 | + | |
859 | 906 | |
860 | 907 | |
861 | 908 | /** |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BloodSugarServiceImpl.java
View file @
d84b1ed
... | ... | @@ -517,7 +517,7 @@ |
517 | 517 | Map<String, List<BloodSugar>> temp = new TreeMap<>(new Comparator<String>() { |
518 | 518 | @Override |
519 | 519 | public int compare(String o1, String o2) { |
520 | - return o2.compareTo(o1); | |
520 | + return DateUtil.parseYMD(o2).compareTo(DateUtil.parseYMD(o1)); | |
521 | 521 | } |
522 | 522 | }); |
523 | 523 | for (Map.Entry<String, List<BloodSugar>> entry : datas.entrySet()) { |
... | ... | @@ -584,7 +584,7 @@ |
584 | 584 | |
585 | 585 | private Map<String, List<BloodSugar>> doHandle(Map<String, List<BloodSugar>> maps,String lastDate) |
586 | 586 | { |
587 | - Map<String, List<BloodSugar>> result = new HashMap<>(); | |
587 | + Map<String, List<BloodSugar>> result = new LinkedHashMap<>(); | |
588 | 588 | if (maps.size() > 0 && maps.size() >= 3) { |
589 | 589 | int index = 0; |
590 | 590 | for (String key : maps.keySet()) { |
... | ... | @@ -1488,8 +1488,6 @@ |
1488 | 1488 | BloodSugar bloodSugar1 = sugarList.get(0); |
1489 | 1489 | if (type == 3) |
1490 | 1490 | { |
1491 | - | |
1492 | - boolean isContinue = false; | |
1493 | 1491 | Map<String, List<BloodSugar>> maps = new HashMap<>(); |
1494 | 1492 | if (CollectionUtils.isNotEmpty(sugarList)) |
1495 | 1493 | { |
1496 | 1494 | |
... | ... | @@ -1507,30 +1505,12 @@ |
1507 | 1505 | maps = sortMapByKey(maps); |
1508 | 1506 | maps = doHandle(maps, bloodSugars.get(0).getCreatYmdDate()); |
1509 | 1507 | if (maps.size() > 0 && maps.size() >= 3) { |
1510 | - int count = 0; | |
1511 | - for (String key1 : maps.keySet()) { | |
1512 | - List<BloodSugar> bss = maps.get(key1); | |
1513 | - if (CollectionUtils.isNotEmpty(bss)) | |
1514 | - { | |
1515 | - for (BloodSugar bs : bss) | |
1516 | - { | |
1517 | - int result = getBloodSugarStatus(bs.getBloodSugarType(),Float.parseFloat(bs.getBloodSugar())); | |
1518 | - if (result != 0) | |
1519 | - { | |
1520 | - count++; | |
1521 | - break; | |
1522 | - } | |
1523 | - } | |
1524 | - } | |
1525 | - if (count >= 3) | |
1526 | - { | |
1527 | - isContinue = true; | |
1528 | - break; | |
1529 | - } | |
1530 | - } | |
1508 | + if (isContinuc(maps) < 3) | |
1509 | + { | |
1510 | + continue; | |
1511 | + } | |
1531 | 1512 | } |
1532 | - | |
1533 | - if (!isContinue) | |
1513 | + else | |
1534 | 1514 | { |
1535 | 1515 | continue; |
1536 | 1516 | } |
... | ... | @@ -1561,6 +1541,38 @@ |
1561 | 1541 | } |
1562 | 1542 | } |
1563 | 1543 | return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(datas); |
1544 | + } | |
1545 | + | |
1546 | + | |
1547 | + private int isContinuc(Map<String, List<BloodSugar>> maps) | |
1548 | + { | |
1549 | + boolean isContinue = true; | |
1550 | + int count = 0; | |
1551 | + for (String key1 : maps.keySet()) { | |
1552 | + List<BloodSugar> bss = maps.get(key1); | |
1553 | + if (CollectionUtils.isNotEmpty(bss)) | |
1554 | + { | |
1555 | + for (BloodSugar bs : bss) | |
1556 | + { | |
1557 | + int result = getBloodSugarStatus(bs.getBloodSugarType(),Float.parseFloat(bs.getBloodSugar())); | |
1558 | + if (result != 0) | |
1559 | + { | |
1560 | + count++; | |
1561 | + break; | |
1562 | + } | |
1563 | + else | |
1564 | + { | |
1565 | + isContinue = false; | |
1566 | + break; | |
1567 | + } | |
1568 | + } | |
1569 | + if (!isContinue) | |
1570 | + { | |
1571 | + return 0; | |
1572 | + } | |
1573 | + } | |
1574 | + } | |
1575 | + return count; | |
1564 | 1576 | } |
1565 | 1577 | |
1566 | 1578 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
View file @
d84b1ed
... | ... | @@ -304,7 +304,7 @@ |
304 | 304 | java.text.DecimalFormat df = new java.text.DecimalFormat("#.#"); |
305 | 305 | df.setRoundingMode(RoundingMode.FLOOR); |
306 | 306 | double db = Math.pow(Double.parseDouble(height) / 100, 2); |
307 | - db = Double.valueOf(String.format("%.2f", db)); | |
307 | + db = Double.valueOf(String.format("%.4f", db)); | |
308 | 308 | double tzzs = Double.parseDouble(weight) / db; |
309 | 309 | return df.format(tzzs); |
310 | 310 | } |