Commit 098ad7cf8d7ebb535336f0e7523b9230f43186c3
1 parent
2fa57b1734
Exists in
master
and in
6 other branches
体重管理
Showing 1 changed file with 26 additions and 21 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
View file @
098ad7c
... | ... | @@ -405,29 +405,34 @@ |
405 | 405 | } |
406 | 406 | map.put("pregnancy", pregnancy); |
407 | 407 | if(week != null && StringUtils.isNotEmpty(patientWeight.getBmi())) { |
408 | - String weightType = ""; | |
409 | - //体重正常 过轻 过重 是依据孕妇BMI指数来的。 | |
410 | - //BMI计算方式:BMI=孕前体重(kg)/【身高(m)×身高(m)】 | |
411 | - //对应范围:BMI<18.5对应体重过轻 BMI=18.5-24.9对应正常体重 BMI>25对应体重过重 | |
412 | - double bmi = Double.parseDouble(patientWeight.getBmi()); | |
413 | - if (bmi < 18.5) | |
414 | - { | |
415 | - weightType = "过轻"; | |
416 | - } | |
417 | - else if (bmi >= 18.5 && bmi <= 24.9) | |
418 | - { | |
419 | - weightType = "正常"; | |
420 | - } | |
421 | - else if (bmi > 25) | |
422 | - { | |
423 | - weightType = "过重"; | |
424 | - } | |
425 | - WeightManageConfigModel configModel = getWeightConfig(String.valueOf(week),weightType); | |
408 | + | |
426 | 409 | setInfo(week, map); // 设置孕期相关营养信息 |
427 | - setRecipe(map, configModel); // 设置食谱 | |
428 | 410 | setGuide(week, map); // 设置指南 |
429 | - setSuggest(map, configModel); // 设置建议 | |
430 | - setCookbook(map, configModel); // 设置菜谱 | |
411 | + if (week > 11) | |
412 | + { | |
413 | + String weightType = ""; | |
414 | + //体重正常 过轻 过重 是依据孕妇BMI指数来的。 | |
415 | + //BMI计算方式:BMI=孕前体重(kg)/【身高(m)×身高(m)】 | |
416 | + //对应范围:BMI<18.5对应体重过轻 BMI=18.5-24.9对应正常体重 BMI>25对应体重过重 | |
417 | + double bmi = Double.parseDouble(patientWeight.getBmi()); | |
418 | + if (bmi < 18.5) | |
419 | + { | |
420 | + weightType = "过轻"; | |
421 | + } | |
422 | + else if (bmi >= 18.5 && bmi <= 24.9) | |
423 | + { | |
424 | + weightType = "正常"; | |
425 | + } | |
426 | + else if (bmi > 25) | |
427 | + { | |
428 | + weightType = "过重"; | |
429 | + } | |
430 | + WeightManageConfigModel configModel = getWeightConfig(String.valueOf(week),weightType); | |
431 | + setRecipe(map, configModel); // 设置食谱 | |
432 | + setSuggest(map, configModel); // 设置建议 | |
433 | + setCookbook(map, configModel); // 设置菜谱 | |
434 | + } | |
435 | + | |
431 | 436 | } |
432 | 437 | |
433 | 438 | Map<String, String> dayWeights = patientWeight.getDayWeights(); |