Commit af0f9213f1b03fd12bf8089091f72a6cb9265abc
1 parent
9ca5a5eecb
Exists in
master
and in
6 other branches
bbbbbb
Showing 3 changed files with 55 additions and 43 deletions
platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java
View file @
af0f921
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
View file @
af0f921
| ... | ... | @@ -264,7 +264,7 @@ |
| 264 | 264 | return RespBuilder.buildSuccess(pageResult); |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | - // 体质指数(BMI)=体重(kg)÷身高^2(m) | |
| 267 | + // 体质指数(BMI)=孕前体重(kg)÷孕前身高^2(m) | |
| 268 | 268 | public static String getBmi(String weight, String height) { |
| 269 | 269 | if(StringUtils.isNotBlank(weight) && height != null) { |
| 270 | 270 | Double w = Double.parseDouble(weight); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java
View file @
af0f921
| ... | ... | @@ -602,8 +602,11 @@ |
| 602 | 602 | String hospitalId = autoMatchFacade.getHospitalId(userId); |
| 603 | 603 | List<Map<String, Object>> restList = new ArrayList<>(); |
| 604 | 604 | Patients p = mongoTemplate.findById(parentId, Patients.class); |
| 605 | - AntExChuModel antExChuModel = mongoTemplate.findOne(Query.query(Criteria.where("parentId").is(parentId).and("yn").is(1).and("hospitalId").is(hospitalId)).with(new Sort(Sort.Direction.DESC, "checkTime")), AntExChuModel.class); | |
| 606 | - List<AntenatalExaminationModel> antexModels = mongoTemplate.find(Query.query(Criteria.where("parentId").is(parentId).and("yn").is(1).and("hospitalId").is(hospitalId)).with(new Sort(Sort.Direction.DESC, "checkTime")), AntenatalExaminationModel.class); | |
| 605 | + if(p == null) { | |
| 606 | + return RespBuilder.buildSuccess(); | |
| 607 | + } | |
| 608 | + AntExChuModel antExChuModel = mongoTemplate.findOne(Query.query(Criteria.where("parentId").is(p.getId()).and("yn").is(1).and("hospitalId").is(hospitalId)).with(new Sort(Sort.Direction.DESC, "checkTime")), AntExChuModel.class); | |
| 609 | + List<AntenatalExaminationModel> antexModels = mongoTemplate.find(Query.query(Criteria.where("parentId").is(p.getId()).and("yn").is(1).and("hospitalId").is(hospitalId)).with(new Sort(Sort.Direction.ASC, "checkDate")), AntenatalExaminationModel.class); | |
| 607 | 610 | |
| 608 | 611 | Map<String, Object> xyMap = new HashMap<>(); |
| 609 | 612 | List<Integer> szyMin = new ArrayList<>(); |
| 610 | 613 | |
| 611 | 614 | |
| 612 | 615 | |
| 613 | 616 | |
| 614 | 617 | |
| 615 | 618 | |
| 616 | 619 | |
| 617 | 620 | |
| 618 | 621 | |
| 619 | 622 | |
| 620 | 623 | |
| 621 | 624 | |
| 622 | 625 | |
| 623 | 626 | |
| ... | ... | @@ -628,87 +631,89 @@ |
| 628 | 631 | Map<Integer, String> weights = new LinkedHashMap<>(); |
| 629 | 632 | boolean tzFlag = antExChuModel == null || StringUtils.isEmpty(antExChuModel.getYqWeight()) || StringUtils.isEmpty(antExChuModel.getHeight()) ? false : true; |
| 630 | 633 | |
| 631 | - for (AntenatalExaminationModel antexModel : antexModels) { | |
| 634 | + // 添加初诊list | |
| 635 | + if(antExChuModel != null) { | |
| 632 | 636 | Map<String, Object> temp = new HashMap<>(); |
| 633 | - Integer week = DateUtil.getWeek(p.getLastMenses(), antexModel.getCheckDate()); | |
| 634 | - temp.put("checkTime", DateUtil.getyyyy_MM_dd(antexModel.getCheckDate())); | |
| 635 | - temp.put("week", week); | |
| 636 | - temp.put("weight", antexModel.getWeight()); | |
| 637 | - temp.put("bp", parseNull(JSONObject.parseObject(antexModel.getBp()).getString("ssy"), "--") + "/" + parseNull(JSONObject.parseObject(antexModel.getBp()).getString("szy"), "--")); | |
| 638 | - temp.put("gonggao", antexModel.getGongGao()); | |
| 639 | - temp.put("abdominalCircumference", antexModel.getAbdominalCircumference());// 腹围 | |
| 637 | + temp.put("checkTime", DateUtil.getyyyy_MM_dd(antExChuModel.getCheckTime())); | |
| 638 | + Integer week = DateUtil.getWeek2(p.getLastMenses(), antExChuModel.getCheckTime()); | |
| 639 | + temp.put("week", DateUtil.getWeekDesc(p.getLastMenses(), antExChuModel.getCheckTime())); | |
| 640 | + temp.put("weight", antExChuModel.getWeight()); | |
| 641 | + temp.put("bp", parseNull(JSONObject.parseObject(antExChuModel.getBp()).getString("ssy"), "--") + "/" + parseNull(JSONObject.parseObject(antExChuModel.getBp()).getString("szy"), "--")); | |
| 642 | + temp.put("gonggao", antExChuModel.getGonggao()); | |
| 643 | + temp.put("abdominalCircumference", antExChuModel.getFuwei());// 腹围 | |
| 640 | 644 | |
| 641 | - List<Map> tireData = antexModel.getTireData(); | |
| 645 | + List<Map> tireData = antExChuModel.getPlacentas(); | |
| 642 | 646 | String fetalPosition = ""; |
| 643 | 647 | String heartRate = ""; |
| 644 | 648 | String fetalPresentation = ""; |
| 645 | 649 | if(CollectionUtils.isNotEmpty(tireData)) { |
| 646 | 650 | for (Map tireDatum : tireData) { |
| 647 | - fetalPosition = fetalPosition.length() > 0 ? "/" + tireDatum.get("fetalPosition") : tireDatum.get("fetalPosition") + ""; | |
| 648 | - heartRate = heartRate.length() > 0 ? "/" + tireDatum.get("heartRate") : tireDatum.get("heartRate") + ""; | |
| 649 | - fetalPresentation = fetalPresentation.length() > 0 ? "/" + FetalEnums.getTitle2((String) tireDatum.get("fetalPosition")) : FetalEnums.getTitle2((String) tireDatum.get("fetalPosition")); | |
| 651 | + fetalPosition = fetalPosition.length() > 0 ? fetalPosition + "/" + tireDatum.get("fetalPosition") : tireDatum.get("fetalPosition") + ""; | |
| 652 | + heartRate = heartRate.length() > 0 ? heartRate + "/" + tireDatum.get("heartRate") : tireDatum.get("heartRate") + ""; | |
| 653 | + fetalPresentation = fetalPresentation.length() > 0 ? fetalPresentation + "/" + FetalEnums.getTitle2((String) tireDatum.get("fetalPosition")) : FetalEnums.getTitle2((String) tireDatum.get("fetalPosition")); | |
| 650 | 654 | } |
| 651 | 655 | } else { |
| 652 | 656 | fetalPosition = "--"; |
| 653 | 657 | heartRate = "--"; |
| 654 | 658 | fetalPresentation = "--"; |
| 655 | 659 | } |
| 660 | + | |
| 656 | 661 | temp.put("fetalPosition", fetalPosition); // 胎位 |
| 657 | 662 | temp.put("heartRate", heartRate); // 胎心 |
| 658 | 663 | temp.put("fetalPresentation", fetalPresentation); // 先露 |
| 659 | - temp.put("edema",FuZhongEnums.getName(antexModel.getEdema())); // 水肿 | |
| 660 | - temp.put("urineProtein", antexModel.getUrineProtein()); // 尿蛋白 | |
| 661 | - temp.put("hemoglobin", antexModel.getHemoglobin()); // 血红素 | |
| 664 | + temp.put("edema",FuZhongEnums.getName(antExChuModel.getEdema())); // 水肿 | |
| 665 | + temp.put("urineProtein", antExChuModel.getNdb()); // 尿蛋白 | |
| 666 | + temp.put("hemoglobin", antExChuModel.getXhdb()); // 血红素 | |
| 662 | 667 | |
| 663 | 668 | ssy.set(week, parseNull(JSONObject.parseObject(antExChuModel.getBp()).getString("ssy"), 0)); |
| 664 | 669 | szy.set(week, parseNull(JSONObject.parseObject(antExChuModel.getBp()).getString("szy"), 0)); |
| 665 | - if(tzFlag && antexModel.getWeight() != null) { | |
| 666 | - weights.put(DateUtil.getWeek2(p.getLastMenses(), antexModel.getCheckDate()), antexModel.getWeight() + ""); | |
| 667 | - } | |
| 668 | 670 | |
| 669 | 671 | restList.add(temp); |
| 670 | 672 | } |
| 671 | 673 | |
| 672 | - // 添加初诊list | |
| 673 | - if(antExChuModel != null) { | |
| 674 | + for (AntenatalExaminationModel antexModel : antexModels) { | |
| 674 | 675 | Map<String, Object> temp = new HashMap<>(); |
| 675 | - temp.put("checkTime", DateUtil.getyyyy_MM_dd(antExChuModel.getCheckTime())); | |
| 676 | - Integer week = DateUtil.getWeek(p.getLastMenses(), antExChuModel.getCheckTime()); | |
| 677 | - temp.put("week", week); | |
| 678 | - temp.put("weight", antExChuModel.getWeight()); | |
| 679 | - temp.put("bp", parseNull(JSONObject.parseObject(antExChuModel.getBp()).getString("ssy"), "--") + "/" + parseNull(JSONObject.parseObject(antExChuModel.getBp()).getString("szy"), "--")); | |
| 680 | - temp.put("gonggao", antExChuModel.getGonggao()); | |
| 681 | - temp.put("abdominalCircumference", antExChuModel.getFuwei());// 腹围 | |
| 676 | + Integer week = DateUtil.getWeek2(p.getLastMenses(), antexModel.getCheckDate()); | |
| 677 | + temp.put("checkTime", DateUtil.getyyyy_MM_dd(antexModel.getCheckDate())); | |
| 678 | + temp.put("week", DateUtil.getWeekDesc(p.getLastMenses(), antexModel.getCheckDate())); | |
| 679 | + temp.put("weight", antexModel.getWeight()); | |
| 680 | + temp.put("bp", parseNull(JSONObject.parseObject(antexModel.getBp()).getString("ssy"), "--") + "/" + parseNull(JSONObject.parseObject(antexModel.getBp()).getString("szy"), "--")); | |
| 681 | + temp.put("gonggao", antexModel.getGongGao()); | |
| 682 | + temp.put("abdominalCircumference", antexModel.getAbdominalCircumference());// 腹围 | |
| 682 | 683 | |
| 683 | - List<Map> tireData = antExChuModel.getPlacentas(); | |
| 684 | - String fetalPosition = ""; | |
| 685 | - String heartRate = ""; | |
| 686 | - String fetalPresentation = ""; | |
| 684 | + List<Map> tireData = antexModel.getTireData(); | |
| 685 | + String fetalPosition = ""; // 胎位 | |
| 686 | + String heartRate = ""; // 胎心 | |
| 687 | + String fetalPresentation = ""; // 先露 | |
| 687 | 688 | if(CollectionUtils.isNotEmpty(tireData)) { |
| 688 | 689 | for (Map tireDatum : tireData) { |
| 689 | - fetalPosition = fetalPosition.length() > 0 ? "/" + tireDatum.get("fetalPosition") : tireDatum.get("fetalPosition") + ""; | |
| 690 | - heartRate = heartRate.length() > 0 ? "/" + tireDatum.get("heartRate") : tireDatum.get("heartRate") + ""; | |
| 691 | - fetalPresentation = fetalPresentation.length() > 0 ? "/" + FetalEnums.getTitle2((String) tireDatum.get("fetalPosition")) : FetalEnums.getTitle2((String) tireDatum.get("fetalPosition")); | |
| 690 | + fetalPosition = fetalPosition.length() > 0 ? fetalPosition + "/" + tireDatum.get("fetalPosition") : tireDatum.get("fetalPosition") + ""; | |
| 691 | + heartRate = heartRate.length() > 0 ? heartRate + "/" + tireDatum.get("heartRate") : tireDatum.get("heartRate") + ""; | |
| 692 | + fetalPresentation = fetalPresentation.length() > 0 ? fetalPresentation + "/" + FetalEnums.getTitle2((String) tireDatum.get("fetalPosition")) : FetalEnums.getTitle2((String) tireDatum.get("fetalPosition")); | |
| 692 | 693 | } |
| 693 | 694 | } else { |
| 694 | 695 | fetalPosition = "--"; |
| 695 | 696 | heartRate = "--"; |
| 696 | 697 | fetalPresentation = "--"; |
| 697 | 698 | } |
| 698 | - | |
| 699 | 699 | temp.put("fetalPosition", fetalPosition); // 胎位 |
| 700 | 700 | temp.put("heartRate", heartRate); // 胎心 |
| 701 | 701 | temp.put("fetalPresentation", fetalPresentation); // 先露 |
| 702 | - temp.put("edema",FuZhongEnums.getName(antExChuModel.getEdema())); // 水肿 | |
| 703 | - temp.put("urineProtein", antExChuModel.getNdb()); // 尿蛋白 | |
| 704 | - temp.put("hemoglobin", antExChuModel.getXhdb()); // 血红素 | |
| 702 | + temp.put("edema",FuZhongEnums.getName(antexModel.getEdema())); // 水肿 | |
| 703 | + temp.put("urineProtein", antexModel.getUrineProtein()); // 尿蛋白 | |
| 704 | + temp.put("hemoglobin", antexModel.getHemoglobin()); // 血红素 | |
| 705 | 705 | |
| 706 | - ssy.set(week, parseNull(JSONObject.parseObject(antExChuModel.getBp()).getString("ssy"), 0)); | |
| 707 | - szy.set(week, parseNull(JSONObject.parseObject(antExChuModel.getBp()).getString("szy"), 0)); | |
| 706 | + ssy.set(week, parseNull(JSONObject.parseObject(antexModel.getBp()).getString("ssy"), 0)); | |
| 707 | + szy.set(week, parseNull(JSONObject.parseObject(antexModel.getBp()).getString("szy"), 0)); | |
| 708 | + if(tzFlag && antexModel.getWeight() != null) { | |
| 709 | + weights.put(DateUtil.getWeek2(p.getLastMenses(), antexModel.getCheckDate()), antexModel.getWeight() + ""); | |
| 710 | + } | |
| 708 | 711 | |
| 709 | 712 | restList.add(temp); |
| 710 | 713 | } |
| 711 | 714 | |
| 715 | + | |
| 716 | + | |
| 712 | 717 | /*if (MapUtils.isNotEmpty(dayWeights)) { |
| 713 | 718 | Set<Map.Entry<String, String>> entries = dayWeights.entrySet(); |
| 714 | 719 | for (Map.Entry<String, String> entry : entries) { |
| ... | ... | @@ -798,6 +803,12 @@ |
| 798 | 803 | series.put("dayWeights", restList); |
| 799 | 804 | |
| 800 | 805 | reportModel.put("series", series); |
| 806 | + | |
| 807 | + if(bmiD == 20D) { | |
| 808 | + title = "孕前BMI:--"; | |
| 809 | + } else { | |
| 810 | + title = "孕前BMI:" + bmiD; | |
| 811 | + } | |
| 801 | 812 | |
| 802 | 813 | reportModel.put("title", title); |
| 803 | 814 | reportModel.put("color", color); |