Commit eeebe4831c4c2e57c859249161a101d25ed190ed

Authored by [wangbo]
1 parent 202c065be9

儿童报告内容替换

Showing 6 changed files with 141 additions and 24 deletions

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/BasicConfigServiceTest.java View file @ eeebe48
... ... @@ -4221,7 +4221,7 @@
4221 4221 for (int i = 1; i < rows; i++) {
4222 4222 System.out.println("rows=" + i);
4223 4223 QhdWeightConfigModel qhd = new QhdWeightConfigModel();
4224   -
  4224 + qhd.setIsHighRisk("0");
4225 4225 Cell[] cells = s.getRow(i);
4226 4226 if (cells.length > 0) {
4227 4227 //遍历每行中的每列
... ... @@ -4263,7 +4263,7 @@
4263 4263 for (int i = 1; i < rows1; i++) {
4264 4264 System.out.println("rows=" + i);
4265 4265 QhdWeightConfigModel qhd = new QhdWeightConfigModel();
4266   -
  4266 + qhd.setIsHighRisk("0");
4267 4267 Cell[] cells = s1.getRow(i);
4268 4268 if (cells.length > 0) {
4269 4269 //遍历每行中的每列
... ... @@ -5028,7 +5028,6 @@
5028 5028 }
5029 5029  
5030 5030  
5031   -
5032 5031 public static void baby35Report(String fileName) {
5033 5032 ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:/spring/applicationContext_biz_patient1.xml");
5034 5033 MongoTemplate mongoTemplate
... ... @@ -5075,7 +5074,6 @@
5075 5074 }
5076 5075  
5077 5076  
5078   -
5079 5077 Sheet s1 = wb.getSheet(1);
5080 5078 System.out.println(s1.getName() + " : ");
5081 5079 int rows1 = s1.getRows();
... ... @@ -5156,7 +5154,6 @@
5156 5154 }
5157 5155  
5158 5156  
5159   -
5160 5157 Sheet s3 = wb.getSheet(3);
5161 5158 System.out.println(s3.getName() + " : ");
5162 5159 int rows3 = s3.getRows();
... ... @@ -5361,6 +5358,55 @@
5361 5358 }
5362 5359 }
5363 5360  
  5361 + /***
  5362 + *
  5363 + *微信食谱摄入
  5364 + *
  5365 + */
  5366 + public static void dietaryIntake(String fileName) {
  5367 + ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:/spring/applicationContext_biz_patient1.xml");
  5368 + MongoTemplate mongoTemplate
  5369 + = (MongoTemplate) applicationContext.getBean("mongoTemplate");
  5370 + mongoTemplate.getDb().authenticate("platform", "platform123".toCharArray());
  5371 + File file = new File(fileName);
  5372 + Workbook wb = null;
  5373 + try {
  5374 + wb = Workbook.getWorkbook(file);
  5375 +
  5376 + Sheet s = wb.getSheet(0);
  5377 + System.out.println(s.getName() + " : ");
  5378 + int rows = s.getRows();
  5379 + if (rows > 0) {
  5380 + //遍历每行
  5381 + for (int i = 1; i < rows; i++) {
  5382 + System.out.println("rows=" + i);
  5383 + WeightConfigModel weightConfigModel = new WeightConfigModel();
  5384 + weightConfigModel.setType("0");
  5385 + weightConfigModel.setDietaryType(0);
  5386 + Cell[] cells = s.getRow(i);
  5387 + if (cells.length > 0) {
  5388 + for (int j = 0; j < cells.length; j++) {
  5389 + String str = cells[j].getContents().trim();
  5390 + switch (j) {
  5391 + case 0:
  5392 + weightConfigModel.setKcal(Double.valueOf(str));
  5393 + continue;
  5394 + case 1:
  5395 + List<String> list2 = Arrays.asList(str.split("\n"));
  5396 + weightConfigModel.setDietaryIntake(list2);
  5397 + continue;
  5398 +
  5399 + }
  5400 + }
  5401 + }
  5402 + mongoTemplate.save(weightConfigModel);
  5403 + }
  5404 + }
  5405 + } catch (Exception e) {
  5406 + e.printStackTrace();
  5407 + }
  5408 + }
  5409 +
5364 5410 public static void main(String[] args) {
5365 5411 //weightWeek("F:\\体重与营养管理\\体重与营养管理第三版(北方)改标红“、冰淇淋”-晓萌.xls");
5366 5412 // weightMange("F:\\体重与营养管理\\体重与营养管理第三版(北方)改标红“、冰淇淋”-晓萌.xls");
5367 5413  
... ... @@ -5381,9 +5427,11 @@
5381 5427 //saveCdgwOrg("F:\\承德工位\\qhdorg.xls");
5382 5428 //babyReport("G:\\儿童膳食报告.xls");
5383 5429 // saveQhdbabyDiaginose("F:\\承德工位\\秦皇岛儿童诊断 - 副本.xls");
  5430 + // saveQhdWeight("F:\\text.xls");
5384 5431  
5385   - //saveQhdWeight("F:\\text.xls");
5386   - //
  5432 + dietaryIntake("F:\\膳食摄入量推荐.xls");
  5433 +
  5434 +
5387 5435 //saveQhdbabyDiaginose("F:\\承德工位\\秦皇岛儿童诊断 - 副本.xls");
5388 5436  
5389 5437  
5390 5438  
... ... @@ -5391,9 +5439,9 @@
5391 5439 //saveEvaluationCriterionModel2("D:\\user\\workspace\\产品中心\\区域平台\\需求资料\\儿童智能等级.xls");
5392 5440 // saveEvaluationCriterionModel3("D:\\user\\workspace\\产品中心\\区域平台\\需求资料\\儿童神经心理发育情况.xls");
5393 5441 //saveQhdWeight("F:\\text.xls");
5394   -// saveQhdGaoWeiWeight("F:\秦皇岛高危版体重报告.xls");
  5442 + // saveQhdGaoWeiWeight("F:\秦皇岛高危版体重报告.xls");
5395 5443 // saveQhdWeight("F:\\text.xls");
5396   - baby35Report("C:\Users\Administrator\Desktop\doc\秦皇岛3-5月龄膳食报告\3-5月龄儿童膳食报告内容.xls");
  5444 + // baby35Report("C:\Users\Administrator\Desktop\doc\秦皇岛3-5月龄膳食报告\3-5月龄儿童膳食报告内容.xls");
5397 5445 }
5398 5446  
5399 5447 }
platform-dal/src/main/java/com/lyms/platform/pojo/WeightConfigModel.java View file @ eeebe48
... ... @@ -29,12 +29,33 @@
29 29 //菜谱
30 30 private List<Cookbook> cookbooks;
31 31  
32   - private String northSouth;//南北
  32 + private String northSouth;//南北
33 33 private List<String> earlySuggests;//早期建议
34 34 private List<String> middleSuggests;//中期建议
35 35 private List<String> laterSuggests;//晚期建议
36 36  
  37 + //20190729 修改膳食摄入量
  38 + private List<String> dietaryIntake;
37 39  
  40 + private Integer dietaryType;
  41 +
  42 +
  43 + public Integer getDietaryType() {
  44 + return dietaryType;
  45 + }
  46 +
  47 + public void setDietaryType(Integer dietaryType) {
  48 + this.dietaryType = dietaryType;
  49 + }
  50 +
  51 + public List<String> getDietaryIntake() {
  52 + return dietaryIntake;
  53 + }
  54 +
  55 + public void setDietaryIntake(List<String> dietaryIntake) {
  56 + this.dietaryIntake = dietaryIntake;
  57 + }
  58 +
38 59 public String getId() {
39 60 return id;
40 61 }
... ... @@ -76,7 +97,6 @@
76 97 }
77 98  
78 99  
79   -
80 100 public String getWeekContent() {
81 101 return weekContent;
82 102 }
83 103  
84 104  
... ... @@ -191,12 +211,13 @@
191 211 '}';
192 212 }
193 213  
194   - public static class Cookbook implements Serializable {
  214 + public static class Cookbook implements Serializable {
195 215 private String vegetable;//菜名称
196   - private String foodMaterial; //食材
  216 + private String foodMaterial; //食材
197 217 private List<String> makeMethod;//制作方法
198 218 private Double kcal; //整值卡路里
199   - private String northSouth;//南北
  219 + private String northSouth;//南北
  220 +
200 221 public String getNorthSouth() {
201 222 return northSouth;
202 223 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientWeightController.java View file @ eeebe48
... ... @@ -179,6 +179,17 @@
179 179 return patientWeightService.patientRecipeInfo(pid, 2, time);
180 180 }
181 181  
  182 + /***
  183 + * 生活方式建议
  184 + *
  185 + * **/
  186 + @ResponseBody
  187 + @RequestMapping(value = "/lifeStyle/info", method = RequestMethod.GET)
  188 + public BaseResponse lifeStyle() {
  189 + return patientWeightService.lifeStyle();
  190 + }
  191 +
  192 +
182 193 /**
183 194 * 膳食摄入量推荐
184 195 *
... ... @@ -281,8 +292,8 @@
281 292 @RequestMapping(value = "/qhdReport/{pid}", method = RequestMethod.GET)
282 293 @TokenRequired
283 294 public BaseResponse qhdReport(@PathVariable String pid,
284   - HttpServletRequest request,
285   - @RequestParam(value = "rid", required = false) String rid, String version) {
  295 + HttpServletRequest request,
  296 + @RequestParam(value = "rid", required = false) String rid, String version) {
286 297 if (pid.isEmpty() || "null".equals(pid)) {
287 298 return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.USER_PASSWORD_ERROR).setErrormsg("pid值不能为空!");
288 299 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/PatientWeightService.java View file @ eeebe48
... ... @@ -23,6 +23,8 @@
23 23  
24 24 BaseResponse patientRecipeInfo(String pid, Integer type, String time);
25 25  
  26 + BaseResponse lifeStyle();
  27 +
26 28 BaseResponse addOrUpdate(Integer userId, PatientWeight patientWeight, String doctorId);
27 29  
28 30 BaseResponse list(String key, String vcCardNo, Integer currentWeekStart, Integer currentWeekEnd, Integer age, Integer page, Integer limit, Integer userId);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/DefaultComputeKulServiceImpl.java View file @ eeebe48
... ... @@ -112,7 +112,6 @@
112 112 bw = new BigDecimal(Double.toString(beforeWeight));
113 113 } else if ("1".equals(version)) {
114 114 bw = new BigDecimal(Integer.parseInt(beforeHeight) - 105);
115   - System.out.println("==========>标准体重" + bw);
116 115 }
117 116  
118 117  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java View file @ eeebe48
... ... @@ -530,8 +530,13 @@
530 530 if (week > 5 && week < 41) {
531 531 double bmi = Double.parseDouble(patientWeight.getBmi());
532 532 Map<String, String> kmap = getComputeKul(Double.parseDouble(patientWeight.getBeforeWeight()),
533   - Double.parseDouble(nowWeight), week, bmi, patientWeight.getBregmatic());
  533 + Double.parseDouble(nowWeight), week, bmi, patientWeight.getBregmatic(), patientWeight.getBeforeHeight());
534 534  
  535 + if (3 == type) {
  536 + kmap.put("type", "3");
  537 + } else {
  538 + kmap.put("type", null);
  539 + }
535 540 if (1 == type) {
536 541 setGuide(week, map, patientWeight.getHospitalId()); // 设置指南
537 542 } else {
538 543  
... ... @@ -553,7 +558,27 @@
553 558 return new BaseObjectResponse().setData(map).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
554 559 }
555 560  
  561 + @Override
  562 + public BaseResponse lifeStyle() {
  563 + Map<String, List> map = new HashMap();
  564 + List<String> list = new ArrayList<>();
  565 + list.add("食物多样化");
  566 + list.add("平衡膳食模式是最大程度上保障人体营养需要和健康基础,每天膳食应包括谷薯类、蔬菜水果类、畜禽鱼蛋奶类、大豆类、坚果类,以保证糖类、蛋白质、脂肪、维生素、矿物质、水、膳食纤维的摄入,谷类为主,每日摄入多种类食物,不可挑食,规律饮食,多选择新鲜时令的当地的食物进行摄入。");
  567 + list.add("食物的选择");
  568 + list.add("牛奶、酸奶、奶酪、排骨、鱼虾类含钙及优质蛋白丰富可作为日常选择;咸菜、烟熏肉类含钠较多且不为新鲜食物,应减少食用;常选择粗粮杂豆类含膳食纤维丰富的食物可促进胃肠道运动,减少有害物质吸收;新鲜蔬菜水果含维生素及生物活性物质较多,应选择新鲜的蔬果食用。可选择脂肪酸比例较好含不饱和脂肪酸或多不饱和脂肪酸较多的橄榄油、亚麻籽油、葵花籽油等植物油,坚果虽然含不饱和脂肪酸丰富但要适量食用,减少食用动物肥肉。");
  569 + list.add("饮食习惯");
  570 + list.add("每日进餐次数可由孕前的3次增加至5-6次,每日可在3次正餐中间加2-3次的加餐,每餐时间间隔约2小时左右,每餐8-9分饱即可。宜选择天然食物作为加餐,并加餐在总的能量范围内,合理饮食应避免增重过快或消瘦的情况发生。每日食盐的摄入量5-6g,咸味调料如酱油味精等可减少放入,减少口味过重身体钠含量过多诱发水肿的风险。饮食不可过于油腻。如有过敏者需避免致敏食物或潜在致敏食物。");
  571 + list.add("远离烟、酒、咖啡因、高能量食物,低营养素的食物");
  572 + list.add("孕期绝对禁止抽烟、饮酒、咖啡浓茶、碳酸饮料的摄入,远离二手烟或烟污染严重的环境。学会阅读营养标签,营养成分表中高能量高脂肪和高钠的食物应限制其摄入量。保证每日2300ml左右水的摄入。");
  573 + list.add("保证食物的清洁卫生");
  574 + list.add("食物生熟要分开制作,肉类选择时可观察肌肉部分是否有光泽、红色均匀、脂肪白色(牛羊肉为淡黄色),外表微干或微湿润、不粘手,指压肌肉过后的凹陷立即恢复,具有畜禽应有的正常气味。新鲜的鸡蛋壳上有粉状物,手感发涩,不新鲜的鸡蛋蛋壳上有小孔,蛋黄分散,味臭。新鲜的鱼类有光泽鳞片完整眼球饱满,角膜透亮肌肉坚实有弹性,不新鲜的鱼类体表颜色泛红,眼球凹陷,肌肉松弛,有异味。奶类不新鲜有沉淀或粘稠不流动,有异味。");
  575 + list.add("规律的生活,适当的运动");
  576 + list.add("养成规律的睡眠习惯,早睡——11点以前入睡,避免熬夜;早起——7:30-8:00间起床吃早餐。每天根据自己的情况保证30-40分钟的中等强度运动");
  577 + map.put("lifeStyle", list);
  578 + return new BaseObjectResponse().setData(map).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
  579 + }
556 580  
  581 +
557 582 public BaseResponse patientBaseInfo(String pid) {
558 583 PatientWeight patientWeight = queryPatientWeight(pid);
559 584 Map<String, Object> map = new LinkedHashMap<>();
560 585  
... ... @@ -1102,13 +1127,14 @@
1102 1127  
1103 1128 private void setSuggest(Map<String, Object> map, WeightConfigModel configModel, int week) {
1104 1129 List<String> suggests = null;
1105   - if (week < 12) {
  1130 + /* if (week < 12) {
1106 1131 suggests = configModel.getEarlySuggests();
1107 1132 } else if (week <= 28) {
1108 1133 suggests = configModel.getMiddleSuggests();
1109 1134 } else {
1110 1135 suggests = configModel.getLaterSuggests();
1111   - }
  1136 + }*/
  1137 + suggests = configModel.getDietaryIntake();
1112 1138 map.put("suggest", suggests);
1113 1139 }
1114 1140  
... ... @@ -1630,8 +1656,12 @@
1630 1656 } else if (k1 > 3300) {
1631 1657 k1 = 3300;
1632 1658 }
1633   - Criteria criteria = Criteria.where("northSouth").is(northSouth).and("kcal").is(k1);
1634   -
  1659 + Criteria criteria = null;
  1660 + if ("3".equals((String) map.get("type"))) {
  1661 + criteria = Criteria.where("kcal").is(k1).and("dietaryType").is(0);
  1662 + } else {
  1663 + criteria = Criteria.where("northSouth").is(northSouth).and("kcal").is(k1);
  1664 + }
1635 1665 //如果传了高危因素id就按高危去查
1636 1666 if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(risk)) {
1637 1667 criteria = criteria.and("riskId").in(risk).and("type").is("1");
... ... @@ -1661,7 +1691,7 @@
1661 1691 * @return
1662 1692 */
1663 1693  
1664   - public Map<String, String> getComputeKul(double beforeWeight, double currentWeight, int week, double bmi, String bregmatic) {
  1694 + public Map<String, String> getComputeKul(double beforeWeight, double currentWeight, int week, double bmi, String bregmatic, String height) {
1665 1695 Map<String, String> map = new HashMap<>();
1666 1696  
1667 1697 double kulStart = 0;
... ... @@ -1736,7 +1766,13 @@
1736 1766  
1737 1767 BigDecimal b1 = new BigDecimal(Double.toString(addWeightStart));
1738 1768 BigDecimal b2 = new BigDecimal(Double.toString(addWeightEnd));
1739   - BigDecimal bw = new BigDecimal(Double.toString(beforeWeight));
  1769 + BigDecimal bw = null;
  1770 + if (bmi >= 25) {
  1771 + bw = new BigDecimal(Double.toString(Integer.valueOf(height) - 105));
  1772 + } else {
  1773 + bw = new BigDecimal(Double.toString(beforeWeight));
  1774 + }
  1775 +
1740 1776 double kstart = (bw.add(b1)).multiply(new BigDecimal(25)).doubleValue() + basekul;
1741 1777 double kend = (bw.add(b2)).multiply(new BigDecimal(25)).doubleValue() + basekul;
1742 1778