Commit 452f20c82b72bba3cd65098bd9ed6d3aa5c83134
1 parent
3a3214e02e
Exists in
master
and in
1 other branch
code update
Showing 3 changed files with 105 additions and 57 deletions
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/BabyCheckService.java
View file @
452f20c
| ... | ... | @@ -69,6 +69,15 @@ |
| 69 | 69 | return babyAwDao.queryAwByHeight(condition.toMongoQuery()); |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | + public List<AwModel> queryBabyHealthConfig(Integer agetType, Integer sex,Integer type,Double height) { | |
| 73 | + MongoCondition condition = MongoCondition.newInstance(); | |
| 74 | + condition = condition.and("agetType", agetType, MongoOper.IS); | |
| 75 | + condition = condition.and("sex", sex, MongoOper.IS); | |
| 76 | + condition = condition.and("type", type, MongoOper.IS); | |
| 77 | + condition = condition.and("height", height, MongoOper.IS); | |
| 78 | + return babyAwDao.queryAwByHeight(condition.toMongoQuery()); | |
| 79 | + } | |
| 80 | + | |
| 72 | 81 | public List<BabyCheckModel> queryLastCheck(List<String> ids) { |
| 73 | 82 | return babyCheckDao.queryLastCheck(ids); |
| 74 | 83 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyCheckController.java
View file @
452f20c
| ... | ... | @@ -122,8 +122,10 @@ |
| 122 | 122 | @ResponseBody |
| 123 | 123 | public BaseObjectResponse queryHWByHeight( |
| 124 | 124 | @RequestParam(required = true) Double height, |
| 125 | - @RequestParam(required = true) Integer sex){ | |
| 126 | - return babyCheckFacade.queryHWByHeight(height, sex); | |
| 125 | + @RequestParam(required = true) Double weight, | |
| 126 | + @RequestParam(required = true) Integer sex, | |
| 127 | + @RequestParam(required = true) String birth){ | |
| 128 | + return babyCheckFacade.queryHWByHeight(height,weight, sex,birth); | |
| 127 | 129 | |
| 128 | 130 | } |
| 129 | 131 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java
View file @
452f20c
| ... | ... | @@ -854,18 +854,57 @@ |
| 854 | 854 | * @param sex |
| 855 | 855 | * @return |
| 856 | 856 | */ |
| 857 | - public BaseObjectResponse queryHWByHeight(Double height, Integer sex) { | |
| 857 | + public BaseObjectResponse queryHWByHeight(Double height,Double value, Integer sex,String birth) { | |
| 858 | 858 | |
| 859 | 859 | Double hw = getHw(height); |
| 860 | - String value = ""; | |
| 861 | - List<HwModel> hws = babyCheckService.queryHWByHeight(hw,sex); | |
| 862 | - if(CollectionUtils.isNotEmpty(hws)) | |
| 860 | + | |
| 861 | + //计算儿童的月龄 | |
| 862 | + int monthAge = DateUtil.getBabyAgeMonth(DateUtil.parseYMD(birth), new Date()); | |
| 863 | + int ageType = 0; | |
| 864 | + if (monthAge > 24) | |
| 863 | 865 | { |
| 864 | - value = String.valueOf(hws.get(0).getMiddleSd()); | |
| 866 | + ageType = 1; | |
| 865 | 867 | } |
| 866 | 868 | |
| 869 | + //查询该月龄的年龄别体重值 | |
| 870 | + List<AwModel> list = babyCheckService.queryBabyHealthConfig(ageType,sex,3,hw); | |
| 871 | + | |
| 872 | + String res = ""; | |
| 873 | + if (CollectionUtils.isNotEmpty(list)) { | |
| 874 | + AwModel model = list.get(0); | |
| 875 | + | |
| 876 | + if (model.getPthreeDs() < value) | |
| 877 | + { | |
| 878 | + res = "上"; | |
| 879 | + } | |
| 880 | + else if (model.getPthreeDs() >=value && value > model.getPtwoDs()) | |
| 881 | + { | |
| 882 | + res = "中上"; | |
| 883 | + } | |
| 884 | + else if (model.getPtwoDs() >=value && value > model.getPoneDs()) | |
| 885 | + { | |
| 886 | + res = "中+"; | |
| 887 | + } | |
| 888 | + else if (model.getPoneDs() >=value && value >= model.getRoneDs()) | |
| 889 | + { | |
| 890 | + res = "中"; | |
| 891 | + } | |
| 892 | + else if (model.getRoneDs() >value && value >= model.getRtwoDs()) | |
| 893 | + { | |
| 894 | + res = "中-"; | |
| 895 | + } | |
| 896 | + else if (model.getRtwoDs() >value && value >= model.getRthreeDs()) | |
| 897 | + { | |
| 898 | + res = "中下"; | |
| 899 | + } | |
| 900 | + else if (model.getRtwoDs() >value) | |
| 901 | + { | |
| 902 | + res = "下"; | |
| 903 | + } | |
| 904 | + } | |
| 905 | + | |
| 867 | 906 | BaseObjectResponse br = new BaseObjectResponse(); |
| 868 | - br.setData(value); | |
| 907 | + br.setData(res); | |
| 869 | 908 | br.setErrorcode(ErrorCodeConstants.SUCCESS); |
| 870 | 909 | br.setErrormsg("成功"); |
| 871 | 910 | return br; |
| 872 | 911 | |
| 873 | 912 | |
| 874 | 913 | |
| 875 | 914 | |
| 876 | 915 | |
| 877 | 916 | |
| 878 | 917 | |
| 879 | 918 | |
| 880 | 919 | |
| 881 | 920 | |
| 882 | 921 | |
| 883 | 922 | |
| 884 | 923 | |
| 885 | 924 | |
| 886 | 925 | |
| 887 | 926 | |
| 888 | 927 | |
| 889 | 928 | |
| 890 | 929 | |
| ... | ... | @@ -919,75 +958,73 @@ |
| 919 | 958 | public BaseObjectResponse queryGrowthEvaluate(Double height, Integer sex, String birth,Double weight) { |
| 920 | 959 | |
| 921 | 960 | List<String> growthEvaluate = new ArrayList<>(); |
| 922 | - | |
| 923 | - | |
| 924 | 961 | Double hw = getHw(height); |
| 925 | - Double value = null; | |
| 926 | - HwModel hmodel = null; | |
| 927 | 962 | |
| 928 | - //身长别体重 | |
| 929 | - List<HwModel> hws = babyCheckService.queryHWByHeight(hw, sex); | |
| 930 | - if(CollectionUtils.isNotEmpty(hws)) | |
| 963 | + //计算儿童的月龄 | |
| 964 | + int monthAge = DateUtil.getBabyAgeMonth(DateUtil.parseYMD(birth), new Date()); | |
| 965 | + int ageType = 0; | |
| 966 | + if (monthAge > 24) | |
| 931 | 967 | { |
| 932 | - hmodel = hws.get(0); | |
| 933 | - value = hmodel.getMiddleSd(); | |
| 968 | + ageType = 1; | |
| 934 | 969 | } |
| 935 | 970 | |
| 936 | - | |
| 937 | - //计算儿童的月龄 | |
| 938 | - int monthAge = DateUtil.getBabyAgeMonth(DateUtil.parseYMD(birth), new Date()); | |
| 939 | - | |
| 940 | - | |
| 941 | 971 | //查询该月龄的年龄别体重值 |
| 942 | - List<AwModel> aws = babyCheckService.queryBabyHealthConfig(monthAge, sex,0); | |
| 943 | - if (CollectionUtils.isNotEmpty(aws) && aws.size() > 1) | |
| 972 | + List<AwModel> list = babyCheckService.queryBabyHealthConfig(ageType, sex, 3, hw); | |
| 973 | + | |
| 974 | + if(CollectionUtils.isNotEmpty(list)) | |
| 944 | 975 | { |
| 945 | - AwModel model = aws.get(0); | |
| 946 | - AwModel model1 = aws.get(1); | |
| 976 | + Double value = list.get(0).getMiddleDs(); | |
| 947 | 977 | |
| 948 | - if(model.getType() == 1) | |
| 978 | + //查询该月龄的年龄别体重值 | |
| 979 | + List<AwModel> aws = babyCheckService.queryBabyHealthConfig(monthAge, sex,0); | |
| 980 | + if (CollectionUtils.isNotEmpty(aws) && aws.size() > 1) | |
| 949 | 981 | { |
| 950 | - model = aws.get(1); | |
| 951 | - model1 = aws.get(0); | |
| 952 | - } | |
| 982 | + AwModel model = aws.get(0); | |
| 983 | + AwModel model1 = aws.get(1); | |
| 953 | 984 | |
| 954 | - //低于参考人群的年龄别体重的M -2s | |
| 955 | - if (model.getRtwoDs() > weight) | |
| 956 | - { | |
| 957 | - growthEvaluate.add("低体重"); | |
| 958 | - } | |
| 959 | - if (value != null) | |
| 960 | - { | |
| 961 | - //中位数百分比 | |
| 962 | - Double mp = weight/value; | |
| 963 | - if (mp < 0.8) | |
| 985 | + if(model.getType() == 1) | |
| 964 | 986 | { |
| 965 | - growthEvaluate.add("重度消瘦"); | |
| 987 | + model = aws.get(1); | |
| 988 | + model1 = aws.get(0); | |
| 966 | 989 | } |
| 967 | - else if (0.8 <= mp && mp < 0.9) | |
| 990 | + | |
| 991 | + //低于参考人群的年龄别体重的M -2s | |
| 992 | + if (model.getRtwoDs() > weight) | |
| 968 | 993 | { |
| 969 | - growthEvaluate.add("轻度消瘦"); | |
| 994 | + growthEvaluate.add("低体重"); | |
| 970 | 995 | } |
| 971 | - else if (1.1 < mp && mp <= 1.2) | |
| 996 | + if (value != null) | |
| 972 | 997 | { |
| 973 | - growthEvaluate.add("超重"); | |
| 998 | + //中位数百分比 | |
| 999 | + Double mp = weight/value; | |
| 1000 | + if (mp < 0.8) | |
| 1001 | + { | |
| 1002 | + growthEvaluate.add("重度消瘦"); | |
| 1003 | + } | |
| 1004 | + else if (0.8 <= mp && mp < 0.9) | |
| 1005 | + { | |
| 1006 | + growthEvaluate.add("轻度消瘦"); | |
| 1007 | + } | |
| 1008 | + else if (1.1 < mp && mp <= 1.2) | |
| 1009 | + { | |
| 1010 | + growthEvaluate.add("超重"); | |
| 1011 | + } | |
| 1012 | + else if ( mp > 1.2) | |
| 1013 | + { | |
| 1014 | + growthEvaluate.add("肥胖"); | |
| 1015 | + } | |
| 974 | 1016 | } |
| 975 | - else if ( mp > 1.2) | |
| 1017 | + | |
| 1018 | + if (weight > list.get(0).getPtwoDs() && height < model1.getRtwoDs()) | |
| 976 | 1019 | { |
| 977 | - growthEvaluate.add("肥胖"); | |
| 1020 | + growthEvaluate.add("生长迟缓"); | |
| 978 | 1021 | } |
| 1022 | + if (weight < list.get(0).getPtwoDs() && height < model1.getRtwoDs()) | |
| 1023 | + { | |
| 1024 | + growthEvaluate.add("慢性严重营养不良"); | |
| 1025 | + } | |
| 979 | 1026 | } |
| 980 | - | |
| 981 | - if (weight > hmodel.getPlusSd() && height < model1.getRtwoDs()) | |
| 982 | - { | |
| 983 | - growthEvaluate.add("生长迟缓"); | |
| 984 | - } | |
| 985 | - if (weight < hmodel.getPlusSd() && height < model1.getRtwoDs()) | |
| 986 | - { | |
| 987 | - growthEvaluate.add("慢性严重营养不良"); | |
| 988 | - } | |
| 989 | 1027 | } |
| 990 | - | |
| 991 | 1028 | BaseObjectResponse br = new BaseObjectResponse(); |
| 992 | 1029 | br.setData(growthEvaluate); |
| 993 | 1030 | br.setErrorcode(ErrorCodeConstants.SUCCESS); |