Commit d499121b1b733654df75ce79faece96a2301480b
1 parent
7dcebaa21c
Exists in
master
and in
6 other branches
纠正月龄,体格发育评价
Showing 7 changed files with 327 additions and 106 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/BasicConfigServiceTest.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/BabyCheckService.java
- platform-dal/src/main/java/com/lyms/platform/pojo/AwModel.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyCheckController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BabyBasicResult.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/BasicConfigServiceTest.java
View file @
d499121
| ... | ... | @@ -1296,11 +1296,88 @@ |
| 1296 | 1296 | |
| 1297 | 1297 | |
| 1298 | 1298 | |
| 1299 | + //早产儿体重百分位数值表(男、女) | |
| 1300 | + public static void zcet(String fileName) | |
| 1301 | + { | |
| 1302 | + File file = new File(fileName); | |
| 1303 | + Workbook wb = null; | |
| 1304 | + try { | |
| 1305 | + wb = Workbook.getWorkbook(file); | |
| 1306 | + ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:/spring/applicationContext_biz_patient1.xml"); | |
| 1307 | + MongoTemplate mongoTemplate | |
| 1308 | + = (MongoTemplate) applicationContext.getBean("mongoTemplate"); | |
| 1309 | + mongoTemplate.getDb().authenticate("platform", "platform123".toCharArray()); | |
| 1310 | + | |
| 1311 | + Sheet s1 = wb.getSheet(0); | |
| 1312 | + int rows1 = s1.getRows(); | |
| 1313 | + if(rows1 > 0){ | |
| 1314 | + //遍历每行 | |
| 1315 | + for(int i = 0 ;i < rows1 ; i++){ | |
| 1316 | + System.out.println("rows="+i); | |
| 1317 | + AwModel awModel = new AwModel(); | |
| 1318 | + awModel.setType(4); | |
| 1319 | + Cell[] cells = s1.getRow(i); | |
| 1320 | + if(cells.length > 0){ | |
| 1321 | + //遍历每行中的每列 | |
| 1322 | + for (int j = 0 ; j < cells.length ; j ++) | |
| 1323 | + { | |
| 1324 | + String str = cells[j].getContents().trim(); | |
| 1325 | + if (!com.lyms.platform.common.utils.StringUtils.isNotEmpty(str)) | |
| 1326 | + { | |
| 1327 | + continue; | |
| 1328 | + } | |
| 1329 | + switch (j) | |
| 1330 | + { | |
| 1331 | + case 0: | |
| 1332 | + awModel.setWeek(Integer.valueOf(str)); | |
| 1333 | + continue; | |
| 1334 | + case 1: | |
| 1335 | + awModel.setRthreeDs(Double.valueOf(str)/1000); | |
| 1336 | + continue; | |
| 1337 | + case 2: | |
| 1338 | + awModel.setRtwoDs(Double.valueOf(str)/1000); | |
| 1339 | + continue; | |
| 1340 | + case 3: | |
| 1341 | + awModel.setRoneDs(Double.valueOf(str)/1000); | |
| 1342 | + continue; | |
| 1343 | + case 4: | |
| 1344 | + awModel.setMiddleDs(Double.valueOf(str)/1000); | |
| 1345 | + continue; | |
| 1346 | + case 5: | |
| 1347 | + awModel.setPoneDs(Double.valueOf(str)/1000); | |
| 1348 | + continue; | |
| 1349 | + case 6: | |
| 1350 | + awModel.setPtwoDs(Double.valueOf(str)/1000); | |
| 1351 | + continue; | |
| 1352 | + case 7: | |
| 1353 | + awModel.setPthreeDs(Double.valueOf(str)/1000); | |
| 1354 | + continue; | |
| 1355 | + case 8: | |
| 1356 | + awModel.setSex(Integer.valueOf(str)); | |
| 1357 | + continue; | |
| 1358 | + } | |
| 1359 | + } | |
| 1360 | + } | |
| 1361 | + mongoTemplate.save(awModel); | |
| 1362 | + } | |
| 1363 | + } | |
| 1364 | + | |
| 1365 | + } catch (IOException e) { | |
| 1366 | + e.printStackTrace(); | |
| 1367 | + } catch (BiffException e) { | |
| 1368 | + e.printStackTrace(); | |
| 1369 | + } | |
| 1370 | + | |
| 1371 | + } | |
| 1372 | + | |
| 1373 | + | |
| 1299 | 1374 | public static void main(String[] args) { |
| 1300 | 1375 | // weightWeek("F:\\体重与营养管理\\体重与营养管理第三版(北方)改标红“、冰淇淋”-晓萌.xls"); |
| 1301 | 1376 | // weightMange("F:\\体重与营养管理\\体重与营养管理第三版(北方)改标红“、冰淇淋”-晓萌.xls"); |
| 1302 | 1377 | // weightFood("F:\\体重与营养管理\\体重与营养管理第三版(北方)改标红“、冰淇淋”-晓萌.xls"); |
| 1303 | - bloodSugar("F:\\血糖报告\\血糖报告\\血糖报告基础数据格式(2).xls"); | |
| 1378 | +// bloodSugar("F:\\血糖报告\\血糖报告\\血糖报告基础数据格式(2).xls"); | |
| 1379 | + | |
| 1380 | + zcet("F:\\儿童发育\\早产儿体重百分位数值表(男女).xls"); | |
| 1304 | 1381 | } |
| 1305 | 1382 | |
| 1306 | 1383 | public static void addBaby(ApplicationContext applicationContext) { |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/BabyCheckService.java
View file @
d499121
| ... | ... | @@ -75,6 +75,14 @@ |
| 75 | 75 | return babyAwDao.queryAwByHeight(condition.toMongoQuery()); |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | + public List<AwModel> queryBabyHealthConfigWeek(Integer week, Integer sex,Integer type) { | |
| 79 | + MongoCondition condition = MongoCondition.newInstance(); | |
| 80 | + condition = condition.and("week", week, MongoOper.IS); | |
| 81 | + condition = condition.and("sex", sex, MongoOper.IS); | |
| 82 | + condition = condition.and("type", type, MongoOper.IS); | |
| 83 | + return babyAwDao.queryAwByHeight(condition.toMongoQuery()); | |
| 84 | + } | |
| 85 | + | |
| 78 | 86 | public List<AwModel> queryBabyHealthConfig(Integer ageType, Integer sex,Integer type,Double height) { |
| 79 | 87 | MongoCondition condition = MongoCondition.newInstance(); |
| 80 | 88 | condition = condition.and("ageType", ageType, MongoOper.IS); |
platform-dal/src/main/java/com/lyms/platform/pojo/AwModel.java
View file @
d499121
| ... | ... | @@ -23,13 +23,23 @@ |
| 23 | 23 | private Double poneDs; |
| 24 | 24 | private Double ptwoDs; |
| 25 | 25 | private Double pthreeDs; |
| 26 | - //0 体重标准差数值表 1 身长/身高标准差数值表 2 头围标准差数值表 3身高别体重 | |
| 26 | + //0 体重标准差数值表 1 身长/身高标准差数值表 2 头围标准差数值表 3身高别体重 4 早产儿体重百分位数值表(男、女) | |
| 27 | 27 | private Integer type; |
| 28 | 28 | |
| 29 | 29 | private Double height; |
| 30 | 30 | |
| 31 | 31 | //0 0-2岁 1 2-5岁 |
| 32 | 32 | private Integer ageType; |
| 33 | + | |
| 34 | + private Integer week; | |
| 35 | + | |
| 36 | + public Integer getWeek() { | |
| 37 | + return week; | |
| 38 | + } | |
| 39 | + | |
| 40 | + public void setWeek(Integer week) { | |
| 41 | + this.week = week; | |
| 42 | + } | |
| 33 | 43 | |
| 34 | 44 | public Double getHeight() { |
| 35 | 45 | return height; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyCheckController.java
View file @
d499121
| ... | ... | @@ -151,8 +151,9 @@ |
| 151 | 151 | @RequestParam(required = true) Double height, |
| 152 | 152 | @RequestParam(required = true) Double weight, |
| 153 | 153 | @RequestParam(required = true) Integer sex, |
| 154 | - @RequestParam(required = true) String birth){ | |
| 155 | - return babyCheckFacade.queryHWByHeight(height, weight, sex, birth); | |
| 154 | + @RequestParam(required = true) String birth, | |
| 155 | + @RequestParam(required = false) Integer correctAge){ | |
| 156 | + return babyCheckFacade.queryHWByHeight(height, weight, sex, birth,correctAge); | |
| 156 | 157 | |
| 157 | 158 | } |
| 158 | 159 | |
| ... | ... | @@ -169,8 +170,10 @@ |
| 169 | 170 | public BaseObjectResponse queryBabyHealthStatus(@RequestParam(required = true) Double value, |
| 170 | 171 | @RequestParam(required = true) Integer sex, |
| 171 | 172 | @RequestParam(required = true) Integer type, |
| 172 | - @RequestParam(required = true) String birth){ | |
| 173 | - return babyCheckFacade.queryBabyHealthStatus(birth, value, sex, type); | |
| 173 | + @RequestParam(required = true) String birth, | |
| 174 | + @RequestParam(required = false) String babyId, | |
| 175 | + @RequestParam(required = false) Integer correctAge){ | |
| 176 | + return babyCheckFacade.queryBabyHealthStatus(birth, value, sex, type,correctAge,babyId); | |
| 174 | 177 | |
| 175 | 178 | } |
| 176 | 179 | |
| ... | ... | @@ -186,8 +189,9 @@ |
| 186 | 189 | @RequestMapping(value = "/queryGrowthEvaluate", method = RequestMethod.GET) |
| 187 | 190 | @ResponseBody |
| 188 | 191 | public BaseObjectResponse queryGrowthEvaluate(@RequestParam(required = true) Double height,@RequestParam(required = true) Integer sex |
| 189 | - ,@RequestParam(required = true) String birth,@RequestParam(required = true) Double weight){ | |
| 190 | - return babyCheckFacade.queryGrowthEvaluate(height, sex, birth, weight); | |
| 192 | + ,@RequestParam(required = true) String birth,@RequestParam(required = true) Double weight, | |
| 193 | + @RequestParam(required = false) Integer correctAge){ | |
| 194 | + return babyCheckFacade.queryGrowthEvaluate(height, sex, birth, weight, correctAge); | |
| 191 | 195 | |
| 192 | 196 | } |
| 193 | 197 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
View file @
d499121
| ... | ... | @@ -1199,92 +1199,92 @@ |
| 1199 | 1199 | * @param hid |
| 1200 | 1200 | * @return |
| 1201 | 1201 | */ |
| 1202 | - @RequestMapping(value = "/updateBabyGrowth", method = RequestMethod.GET) | |
| 1203 | - @ResponseBody | |
| 1204 | - public String updateBabyGrowth(@RequestParam(required = true) String hid) { | |
| 1205 | - | |
| 1206 | - BabyModelQuery babyModelQuery = new BabyModelQuery(); | |
| 1207 | - babyModelQuery.setYn(YnEnums.YES.getId()); | |
| 1208 | - babyModelQuery.setHospitalId(hid); | |
| 1209 | - | |
| 1210 | - List<BabyModel> models = babyBookbuildingService.queryBabyBuildByCond(babyModelQuery); | |
| 1211 | - if (CollectionUtils.isNotEmpty(models)) { | |
| 1212 | - int batchSize = 200; | |
| 1213 | - int end = 0; | |
| 1214 | - for (int i = 0; i < models.size(); i += batchSize) { | |
| 1215 | - end = (end + batchSize); | |
| 1216 | - if (end > models.size()) { | |
| 1217 | - end = models.size(); | |
| 1218 | - } | |
| 1219 | - System.out.println("start:" + i + ",end:" + end); | |
| 1220 | - final List<BabyModel> tempList = models.subList(i, end); | |
| 1221 | - new Thread(new Runnable() { | |
| 1222 | - @Override | |
| 1223 | - public void run() { | |
| 1224 | - if (CollectionUtils.isNotEmpty(tempList)) { | |
| 1225 | - for (BabyModel babyModel : tempList) { | |
| 1226 | - if (babyModel != null) { | |
| 1227 | - BabyCheckModelQuery query = new BabyCheckModelQuery(); | |
| 1228 | - query.setYn(YnEnums.YES.getId()); | |
| 1229 | - query.setBuildId(babyModel.getId()); | |
| 1230 | - | |
| 1231 | - List<BabyCheckModel> checkModels = babyCheckService.queryBabyCheckRecord(query); | |
| 1232 | - if (CollectionUtils.isNotEmpty(checkModels)) { | |
| 1233 | - for (BabyCheckModel checkModel : checkModels) { | |
| 1234 | - String height = checkModel.getHeight(); | |
| 1235 | - String birth = DateUtil.getyyyy_MM_dd(babyModel.getBirth()); | |
| 1236 | - if (!com.lyms.platform.common.utils.StringUtils.isNotEmpty(birth)) { | |
| 1237 | - continue; | |
| 1238 | - } | |
| 1239 | - // type 0 体重标准差数值表 1 身长/身高标准差数值表 2 头围标准差数值表 3身高别体重 | |
| 1240 | - if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(height)) { | |
| 1241 | - String value = babyCheckFacade.getGrowthValue(birth, Double.parseDouble(height), babyModel.getSex(), 1); | |
| 1242 | - checkModel.setHeightEvaluate(value); | |
| 1243 | - | |
| 1244 | - } | |
| 1245 | - String head = checkModel.getHead(); | |
| 1246 | - if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(head)) { | |
| 1247 | - String value = babyCheckFacade.getGrowthValue(birth, Double.parseDouble(head), babyModel.getSex(), 2); | |
| 1248 | - checkModel.setHeadEvaluate(value); | |
| 1249 | - } | |
| 1250 | - | |
| 1251 | - String weight = checkModel.getWeight(); | |
| 1252 | - if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(weight)) { | |
| 1253 | - String value = babyCheckFacade.getGrowthValue(birth, Double.parseDouble(weight), babyModel.getSex(), 0); | |
| 1254 | - checkModel.setWeightEvaluate(value); | |
| 1255 | - } | |
| 1256 | - | |
| 1257 | - if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(height) && | |
| 1258 | - com.lyms.platform.common.utils.StringUtils.isNotEmpty(weight)) { | |
| 1259 | - //发育评价 | |
| 1260 | - List<String> growthEvaluate = babyCheckFacade.getBabyGrowthEvaluate(Double.parseDouble(height), babyModel.getSex(), birth, Double.parseDouble(weight)); | |
| 1261 | - if (CollectionUtils.isNotEmpty(growthEvaluate)) { | |
| 1262 | - checkModel.setGrowthEvaluate(JsonUtil.array2JsonString(growthEvaluate)); | |
| 1263 | - } | |
| 1264 | - | |
| 1265 | - String hw = babyCheckFacade.getBabyHW(Double.parseDouble(height), Double.parseDouble(weight), babyModel.getSex(), birth); | |
| 1266 | - checkModel.setHeightWeight(hw); | |
| 1267 | - | |
| 1268 | - } | |
| 1269 | - checkModel.setHospitalId(checkModel.getHospitalId()); | |
| 1270 | - checkModel.setBirth(babyModel.getBirth()); | |
| 1271 | - | |
| 1272 | - checkModel.setCheckMonth(DateUtil.getBabyAgeMonth(babyModel.getBirth(), checkModel.getCheckDate())); | |
| 1273 | - babyCheckService.updateBabyCheck(checkModel, checkModel.getId()); | |
| 1274 | - } | |
| 1275 | - } | |
| 1276 | - } | |
| 1277 | - } | |
| 1278 | - } | |
| 1279 | - } | |
| 1280 | - }).start(); | |
| 1281 | - } | |
| 1282 | - | |
| 1283 | - } | |
| 1284 | - | |
| 1285 | - | |
| 1286 | - return "updateBabyGrowth finish"; | |
| 1287 | - } | |
| 1202 | +// @RequestMapping(value = "/updateBabyGrowth", method = RequestMethod.GET) | |
| 1203 | +// @ResponseBody | |
| 1204 | +// public String updateBabyGrowth(@RequestParam(required = true) String hid) { | |
| 1205 | +// | |
| 1206 | +// BabyModelQuery babyModelQuery = new BabyModelQuery(); | |
| 1207 | +// babyModelQuery.setYn(YnEnums.YES.getId()); | |
| 1208 | +// babyModelQuery.setHospitalId(hid); | |
| 1209 | +// | |
| 1210 | +// List<BabyModel> models = babyBookbuildingService.queryBabyBuildByCond(babyModelQuery); | |
| 1211 | +// if (CollectionUtils.isNotEmpty(models)) { | |
| 1212 | +// int batchSize = 200; | |
| 1213 | +// int end = 0; | |
| 1214 | +// for (int i = 0; i < models.size(); i += batchSize) { | |
| 1215 | +// end = (end + batchSize); | |
| 1216 | +// if (end > models.size()) { | |
| 1217 | +// end = models.size(); | |
| 1218 | +// } | |
| 1219 | +// System.out.println("start:" + i + ",end:" + end); | |
| 1220 | +// final List<BabyModel> tempList = models.subList(i, end); | |
| 1221 | +// new Thread(new Runnable() { | |
| 1222 | +// @Override | |
| 1223 | +// public void run() { | |
| 1224 | +// if (CollectionUtils.isNotEmpty(tempList)) { | |
| 1225 | +// for (BabyModel babyModel : tempList) { | |
| 1226 | +// if (babyModel != null) { | |
| 1227 | +// BabyCheckModelQuery query = new BabyCheckModelQuery(); | |
| 1228 | +// query.setYn(YnEnums.YES.getId()); | |
| 1229 | +// query.setBuildId(babyModel.getId()); | |
| 1230 | +// | |
| 1231 | +// List<BabyCheckModel> checkModels = babyCheckService.queryBabyCheckRecord(query); | |
| 1232 | +// if (CollectionUtils.isNotEmpty(checkModels)) { | |
| 1233 | +// for (BabyCheckModel checkModel : checkModels) { | |
| 1234 | +// String height = checkModel.getHeight(); | |
| 1235 | +// String birth = DateUtil.getyyyy_MM_dd(babyModel.getBirth()); | |
| 1236 | +// if (!com.lyms.platform.common.utils.StringUtils.isNotEmpty(birth)) { | |
| 1237 | +// continue; | |
| 1238 | +// } | |
| 1239 | +// // type 0 体重标准差数值表 1 身长/身高标准差数值表 2 头围标准差数值表 3身高别体重 | |
| 1240 | +// if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(height)) { | |
| 1241 | +// String value = babyCheckFacade.getGrowthValue1(birth, Double.parseDouble(height), babyModel.getSex(), 1, null); | |
| 1242 | +// checkModel.setHeightEvaluate(value); | |
| 1243 | +// | |
| 1244 | +// } | |
| 1245 | +// String head = checkModel.getHead(); | |
| 1246 | +// if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(head)) { | |
| 1247 | +// String value = babyCheckFacade.getGrowthValue1(birth, Double.parseDouble(head), babyModel.getSex(), 2, null); | |
| 1248 | +// checkModel.setHeadEvaluate(value); | |
| 1249 | +// } | |
| 1250 | +// | |
| 1251 | +// String weight = checkModel.getWeight(); | |
| 1252 | +// if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(weight)) { | |
| 1253 | +// String value = babyCheckFacade.getGrowthValue1(birth, Double.parseDouble(weight), babyModel.getSex(), 0,null); | |
| 1254 | +// checkModel.setWeightEvaluate(value); | |
| 1255 | +// } | |
| 1256 | +// | |
| 1257 | +// if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(height) && | |
| 1258 | +// com.lyms.platform.common.utils.StringUtils.isNotEmpty(weight)) { | |
| 1259 | +// //发育评价 | |
| 1260 | +// List<String> growthEvaluate = babyCheckFacade.getBabyGrowthEvaluate(Double.parseDouble(height), babyModel.getSex(), birth, Double.parseDouble(weight),null); | |
| 1261 | +// if (CollectionUtils.isNotEmpty(growthEvaluate)) { | |
| 1262 | +// checkModel.setGrowthEvaluate(JsonUtil.array2JsonString(growthEvaluate)); | |
| 1263 | +// } | |
| 1264 | +// | |
| 1265 | +// String hw = babyCheckFacade.getBabyHW(Double.parseDouble(height), Double.parseDouble(weight), babyModel.getSex(), birth,null); | |
| 1266 | +// checkModel.setHeightWeight(hw); | |
| 1267 | +// | |
| 1268 | +// } | |
| 1269 | +// checkModel.setHospitalId(checkModel.getHospitalId()); | |
| 1270 | +// checkModel.setBirth(babyModel.getBirth()); | |
| 1271 | +// | |
| 1272 | +// checkModel.setCheckMonth(DateUtil.getBabyAgeMonth(babyModel.getBirth(), checkModel.getCheckDate())); | |
| 1273 | +// babyCheckService.updateBabyCheck(checkModel, checkModel.getId()); | |
| 1274 | +// } | |
| 1275 | +// } | |
| 1276 | +// } | |
| 1277 | +// } | |
| 1278 | +// } | |
| 1279 | +// } | |
| 1280 | +// }).start(); | |
| 1281 | +// } | |
| 1282 | +// | |
| 1283 | +// } | |
| 1284 | +// | |
| 1285 | +// | |
| 1286 | +// return "updateBabyGrowth finish"; | |
| 1287 | +// } | |
| 1288 | 1288 | |
| 1289 | 1289 | |
| 1290 | 1290 | /** |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java
View file @
d499121
| ... | ... | @@ -799,6 +799,29 @@ |
| 799 | 799 | } |
| 800 | 800 | } |
| 801 | 801 | |
| 802 | + String c = ""; | |
| 803 | + if (model.getDueWeek() != null) | |
| 804 | + { | |
| 805 | + Integer days = model.getDueWeek()*7 + (model.getDueDay() == null ? 0 : model.getDueDay()); | |
| 806 | + if ((DateUtil.daysBetween(model.getBirth(),new Date())+days) < 280) | |
| 807 | + { | |
| 808 | + base.setIsCorrectMonthAge(1); | |
| 809 | + //纠正胎龄 | |
| 810 | + c = "孕"+(days/7)+"周"+(days%7 == 0 ? "" : days%7+"天"); | |
| 811 | + } | |
| 812 | + else | |
| 813 | + { | |
| 814 | + //纠正月龄 | |
| 815 | + if (StringUtils.isNotEmpty(base.getDueDate())) | |
| 816 | + { | |
| 817 | + base.setIsCorrectMonthAge(2); | |
| 818 | + DateUtil.getMonthDesc(DateUtil.parseYMD(base.getDueDate()),new Date()); | |
| 819 | + } | |
| 820 | + } | |
| 821 | + } | |
| 822 | + base.setCorrectValue(c); | |
| 823 | + | |
| 824 | + | |
| 802 | 825 | base.setBirthday(DateUtil.getyyyy_MM_dd(model.getBirth())); |
| 803 | 826 | base.setSourceId(org.apache.commons.lang.StringUtils.isNotEmpty(model.getSource()) ? model.getSource() : model.getId()); |
| 804 | 827 | if (model.getPid() != null) { |
| 805 | 828 | |
| ... | ... | @@ -1384,10 +1407,10 @@ |
| 1384 | 1407 | * @param sex |
| 1385 | 1408 | * @return |
| 1386 | 1409 | */ |
| 1387 | - public BaseObjectResponse queryHWByHeight(Double height, Double weight, Integer sex, String birth) { | |
| 1410 | + public BaseObjectResponse queryHWByHeight(Double height, Double weight, Integer sex, String birth,Integer correctAge) { | |
| 1388 | 1411 | |
| 1389 | 1412 | |
| 1390 | - String res = getBabyHW(height, weight, sex, birth); | |
| 1413 | + String res = getBabyHW(height, weight, sex, birth,correctAge); | |
| 1391 | 1414 | BaseObjectResponse br = new BaseObjectResponse(); |
| 1392 | 1415 | br.setData(res); |
| 1393 | 1416 | br.setErrorcode(ErrorCodeConstants.SUCCESS); |
| 1394 | 1417 | |
| 1395 | 1418 | |
| ... | ... | @@ -1396,11 +1419,15 @@ |
| 1396 | 1419 | } |
| 1397 | 1420 | |
| 1398 | 1421 | |
| 1399 | - public String getBabyHW(Double height, Double weight, Integer sex, String birth) { | |
| 1422 | + public String getBabyHW(Double height, Double weight, Integer sex, String birth,Integer correctAge) { | |
| 1400 | 1423 | Double hw = getHw(height); |
| 1401 | 1424 | |
| 1425 | + | |
| 1426 | + Date birthday = DateUtil.addDay(DateUtil.parseYMD(birth), Math.abs(correctAge == null ? 0 : correctAge)); | |
| 1427 | + | |
| 1402 | 1428 | //计算儿童的月龄 |
| 1403 | - int monthAge = DateUtil.getBabyAgeMonth(DateUtil.parseYMD(birth), new Date()); | |
| 1429 | + int monthAge = DateUtil.getBabyAgeMonth(birthday, new Date()); | |
| 1430 | +// int monthAge = DateUtil.getBabyAgeMonth(DateUtil.parseYMD(birth), new Date()); | |
| 1404 | 1431 | int ageType = 0; |
| 1405 | 1432 | if (monthAge > 24) { |
| 1406 | 1433 | ageType = 1; |
| 1407 | 1434 | |
| ... | ... | @@ -1474,9 +1501,9 @@ |
| 1474 | 1501 | * @param birth |
| 1475 | 1502 | * @return |
| 1476 | 1503 | */ |
| 1477 | - public BaseObjectResponse queryGrowthEvaluate(Double height, Integer sex, String birth, Double weight) { | |
| 1504 | + public BaseObjectResponse queryGrowthEvaluate(Double height, Integer sex, String birth, Double weight,Integer correctAge) { | |
| 1478 | 1505 | |
| 1479 | - List<String> list = getBabyGrowthEvaluate(height, sex, birth, weight); | |
| 1506 | + List<String> list = getBabyGrowthEvaluate(height, sex, birth, weight, correctAge); | |
| 1480 | 1507 | BaseObjectResponse br = new BaseObjectResponse(); |
| 1481 | 1508 | br.setData(list); |
| 1482 | 1509 | br.setErrorcode(ErrorCodeConstants.SUCCESS); |
| 1483 | 1510 | |
| 1484 | 1511 | |
| ... | ... | @@ -1500,12 +1527,16 @@ |
| 1500 | 1527 | * |
| 1501 | 1528 | * @return |
| 1502 | 1529 | */ |
| 1503 | - public List<String> getBabyGrowthEvaluate(Double height, Integer sex, String birth, Double weight) { | |
| 1530 | + public List<String> getBabyGrowthEvaluate(Double height, Integer sex, String birth, Double weight,Integer correctAge) { | |
| 1504 | 1531 | List<String> growthEvaluate = new ArrayList<>(); |
| 1505 | 1532 | Double hw = getHw(height); |
| 1506 | 1533 | |
| 1534 | + Date birthday = DateUtil.addDay(DateUtil.parseYMD(birth), Math.abs(correctAge == null ? 0 : correctAge)); | |
| 1535 | + | |
| 1507 | 1536 | //计算儿童的月龄 |
| 1508 | - int monthAge = DateUtil.getBabyAgeMonth(DateUtil.parseYMD(birth), new Date()); | |
| 1537 | + int monthAge = DateUtil.getBabyAgeMonth(birthday, new Date()); | |
| 1538 | + | |
| 1539 | + //int monthAge = DateUtil.getBabyAgeMonth(DateUtil.parseYMD(birth), new Date()); | |
| 1509 | 1540 | int ageType = 0; |
| 1510 | 1541 | if (monthAge > 24) { |
| 1511 | 1542 | ageType = 1; |
| ... | ... | @@ -1621,8 +1652,18 @@ |
| 1621 | 1652 | return objectResponse; |
| 1622 | 1653 | } |
| 1623 | 1654 | |
| 1624 | - public BaseObjectResponse queryBabyHealthStatus(String birth, Double value, Integer sex, Integer type) { | |
| 1625 | - String res = getGrowthValue(birth, value, sex, type); | |
| 1655 | + public BaseObjectResponse queryBabyHealthStatus(String birth, Double value, Integer sex, Integer type,Integer correctAge,String babyId) { | |
| 1656 | + String res = ""; | |
| 1657 | + //体重 | |
| 1658 | + if (type == 0) | |
| 1659 | + { | |
| 1660 | + res = getGrowthValue(birth, value, sex,correctAge,babyId); | |
| 1661 | + } | |
| 1662 | + else | |
| 1663 | + { | |
| 1664 | + res = getGrowthValue1(birth, value, sex, type, correctAge); | |
| 1665 | + } | |
| 1666 | + | |
| 1626 | 1667 | BaseObjectResponse objectResponse = new BaseObjectResponse(); |
| 1627 | 1668 | objectResponse.setData(res); |
| 1628 | 1669 | objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); |
| 1629 | 1670 | |
| ... | ... | @@ -1631,9 +1672,68 @@ |
| 1631 | 1672 | } |
| 1632 | 1673 | |
| 1633 | 1674 | |
| 1634 | - public String getGrowthValue(String birth, Double value, Integer sex, Integer type) { | |
| 1675 | + public String getGrowthValue(String birth, Double value, Integer sex,Integer correctAge,String babyId) { | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + BabyModelQuery babyQuery = new BabyModelQuery(); | |
| 1679 | + babyQuery.setId(babyId); | |
| 1680 | + babyQuery.setYn(YnEnums.YES.getId()); | |
| 1681 | + //查询儿童的基本信息 | |
| 1682 | + List<BabyModel> models = babyBookbuildingService.queryBabyBuildByCond(babyQuery, "created", Sort.Direction.DESC); | |
| 1683 | + | |
| 1684 | + List<AwModel> list = null; | |
| 1685 | + if (CollectionUtils.isNotEmpty(models) && models.get(0).getDueWeek() != null && correctAge != null) | |
| 1686 | + { | |
| 1687 | + Integer days = DateUtil.daysBetween(DateUtil.parseYMD(birth), new Date()); | |
| 1688 | + if (models.get(0).getDueDay() != null) | |
| 1689 | + { | |
| 1690 | + days+=models.get(0).getDueDay(); | |
| 1691 | + } | |
| 1692 | + Integer week = models.get(0).getDueWeek() + days/7; | |
| 1693 | + | |
| 1694 | + //查询该月龄的年龄别体重值 | |
| 1695 | + list = babyCheckService.queryBabyHealthConfigWeek(week, sex, 4); | |
| 1696 | + } | |
| 1697 | + else | |
| 1698 | + { | |
| 1699 | + //Date birthday = DateUtil.addDay(DateUtil.parseYMD(birth),Math.abs(correctAge == null ? 0 : correctAge)); | |
| 1700 | + //计算儿童的月龄 | |
| 1701 | + int monthAge = DateUtil.getBabyAgeMonth(DateUtil.parseYMD(birth), new Date()); | |
| 1702 | + //查询该月龄的年龄别体重值 | |
| 1703 | + list = babyCheckService.queryBabyHealthConfig(monthAge, sex, 0); | |
| 1704 | + } | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + String res = ""; | |
| 1708 | + if (CollectionUtils.isNotEmpty(list)) { | |
| 1709 | + AwModel model = list.get(0); | |
| 1710 | + | |
| 1711 | + if (model.getPthreeDs() < value) { | |
| 1712 | + res = "上"; | |
| 1713 | + } else if (model.getPthreeDs() >= value && value > model.getPtwoDs()) { | |
| 1714 | + res = "中上"; | |
| 1715 | + } else if (model.getPtwoDs() >= value && value > model.getPoneDs()) { | |
| 1716 | + res = "中+"; | |
| 1717 | + } else if (model.getPoneDs() >= value && value >= model.getRoneDs()) { | |
| 1718 | + res = "中"; | |
| 1719 | + } else if (model.getRoneDs() > value && value >= model.getRtwoDs()) { | |
| 1720 | + res = "中-"; | |
| 1721 | + } else if (model.getRtwoDs() > value && value >= model.getRthreeDs()) { | |
| 1722 | + res = "中下"; | |
| 1723 | + } else if (model.getRtwoDs() > value) { | |
| 1724 | + res = "下"; | |
| 1725 | + } | |
| 1726 | + } | |
| 1727 | + | |
| 1728 | + return res; | |
| 1729 | + | |
| 1730 | + } | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + public String getGrowthValue1(String birth, Double value, Integer sex, Integer type,Integer correctAge) { | |
| 1734 | + Date birthday = DateUtil.addDay(DateUtil.parseYMD(birth),Math.abs(correctAge == null ? 0 : correctAge)); | |
| 1635 | 1735 | //计算儿童的月龄 |
| 1636 | - int monthAge = DateUtil.getBabyAgeMonth(DateUtil.parseYMD(birth), new Date()); | |
| 1736 | + int monthAge = DateUtil.getBabyAgeMonth(birthday, new Date()); | |
| 1637 | 1737 | |
| 1638 | 1738 | |
| 1639 | 1739 | //查询该月龄的年龄别体重值 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BabyBasicResult.java
View file @
d499121
| ... | ... | @@ -63,6 +63,28 @@ |
| 63 | 63 | */ |
| 64 | 64 | private Integer dataStatus; |
| 65 | 65 | |
| 66 | + | |
| 67 | + //属于纠正月龄或者是纠正胎龄 1 纠正胎龄 2 纠正月龄 | |
| 68 | + private Integer isCorrectMonthAge; | |
| 69 | + | |
| 70 | + private String correctValue; | |
| 71 | + | |
| 72 | + public Integer getIsCorrectMonthAge() { | |
| 73 | + return isCorrectMonthAge; | |
| 74 | + } | |
| 75 | + | |
| 76 | + public void setIsCorrectMonthAge(Integer isCorrectMonthAge) { | |
| 77 | + this.isCorrectMonthAge = isCorrectMonthAge; | |
| 78 | + } | |
| 79 | + | |
| 80 | + public String getCorrectValue() { | |
| 81 | + return correctValue; | |
| 82 | + } | |
| 83 | + | |
| 84 | + public void setCorrectValue(String correctValue) { | |
| 85 | + this.correctValue = correctValue; | |
| 86 | + } | |
| 87 | + | |
| 66 | 88 | public Integer getYn() { |
| 67 | 89 | return yn; |
| 68 | 90 | } |