From 662bc4d27931055a67595f862d51a793aee256c3 Mon Sep 17 00:00:00 2001 From: liquanyu Date: Wed, 14 Oct 2020 16:59:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=93=E9=87=8D=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/service/impl/PatientWeightServiceImpl.java | 132 +++++++++++++++++++-- 1 file changed, 120 insertions(+), 12 deletions(-) diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java index 57d715d..7fb064b 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java @@ -1006,7 +1006,10 @@ public class PatientWeightServiceImpl extends BaseServiceImpl implements Patient //威海市妇幼热量单独计算 if ("2100001635".equals(hospitalId)) { kmap = getWhComputeKul(week, Double.parseDouble(patientWeight.getNowWeight()), Double.parseDouble(patientWeight.getBeforeWeight()), patientWeight.getBregmatic(), bmi); - } else { + }else if ("216".equals(hospitalId)) { //临西县热量单独计算 + kmap = getLxComputeKul(week, Double.parseDouble(patientWeight.getNowWeight()), Double.parseDouble(patientWeight.getBeforeWeight()), patientWeight.getBregmatic(), bmi); + } + else { kmap = computeKulServiceManager.getComputeKulByRisk(rid).getComputeKul(Double.parseDouble(patientWeight.getBeforeWeight()), Double.parseDouble(patientWeight.getNowWeight()), week, bmi, patientWeight.getBregmatic(), patientWeight.getBeforeHeight(), version); } @@ -1485,7 +1488,7 @@ public class PatientWeightServiceImpl extends BaseServiceImpl implements Patient String hospitalId = kmap.get("hospitalId"); String kcal = ""; //临西热量计算 - if (StringUtils.isNotEmpty(hospitalId) && "2100001306".equals(hospitalId) && "1500".equals(kmap.get("kulStart"))) + if (StringUtils.isNotEmpty(hospitalId) && "216".equals(hospitalId) && "1500".equals(kmap.get("kulStart"))) { kcal = Math.round(Double.parseDouble(kmap.get("kulStart")))+""; } @@ -2059,16 +2062,6 @@ public class PatientWeightServiceImpl extends BaseServiceImpl implements Patient } else if (k1 > 3300) { k1 = 3300; } - String hospitalId = map.get("hospitalId"); - //临西热量计算 - if (StringUtils.isNotEmpty(hospitalId) && "2100001306".equals(hospitalId)) - { - if (k1 < 1500) - { - map.put("kulStart","1500"); - k1 = 1500; - } - } Criteria criteria = null; if ("3".equals((String) map.get("type"))) { @@ -2305,6 +2298,121 @@ public class PatientWeightServiceImpl extends BaseServiceImpl implements Patient } + + public Map getLxComputeKul(int week, double currentWeight, double beforeWeight, String bregmatic, double bmiD) { + + String bmiStr = null; + //空和1表示单胎 + if (!StringUtils.isNotEmpty(bregmatic) || "1".equals(bregmatic)) { + if (bmiD < 18.5) { + bmiStr = "BMI<18.5"; + } else if (bmiD >= 18.5 && bmiD <= 24.9) { + bmiStr = "BMI=18.5-24.9"; + } else if (bmiD > 24.9 && bmiD < 30) { + bmiStr = "BMI=25-29.9"; + } else if (bmiD >= 30) { + bmiStr = "BMI≥30"; + } + } else { + if (bmiD <= 24.9) { + bmiStr = "BMI≤24.9"; + } else if (bmiD >= 25 && bmiD <= 29.9) { + bmiStr = "BMI=25-29.9"; + } else if (bmiD >= 30) { + bmiStr = "BMI≥30"; + } + } + + Map series = new LinkedHashMap<>(); + getSeries(series, bmiStr, bregmatic); + + + List highMap = (List) series.get("highData"); + List lowMap = (List) series.get("lowData"); + + Map map = new HashMap<>(); + + if (week > 40) { + return map; + } + + double kulStart = 0; + double kulEnd = 0; + String status = ""; + + double add = Double.valueOf(String.format("%.2f", currentWeight - beforeWeight)); + + double hvalue = highMap.get(week - 1); + double lvalue = lowMap.get(week - 1); + + //孕早期 + if (week <= 11) { + if (add <= hvalue) { + if (bmiD < 18.5) { + kulStart = (currentWeight - 105) * 37; + } else if (bmiD >= 18.5 && bmiD <= 24.9) { + kulStart = (currentWeight - 105) * 33; + } else if (bmiD >= 25) { + kulStart = (currentWeight - 105) * 28; + } + } + else + { + if (bmiD < 18.5) { + kulStart = (currentWeight - 105) * 35; + } else if (bmiD >= 18.5 && bmiD <= 24.9) { + kulStart = (currentWeight - 105) * 30; + } else if (bmiD >= 25) { + kulStart = (currentWeight - 105) * 25; + } + } + } + //孕中期 + else if (week < 28) { + int addKal = week < 28 ? 200 : 400; + if (add <= hvalue) { + if (bmiD < 18.5) + { + kulStart = (currentWeight - 105) * 37 + addKal; + } else if (bmiD >= 18.5 && bmiD <= 24.9) { + kulStart = (currentWeight - 105) * 33 + addKal; + } else if (bmiD >= 25) { + kulStart = (currentWeight - 105) * 28 + addKal; + } + } + else + { + if (bmiD < 18.5) + { + kulStart = (currentWeight - 105) * 35 + addKal; + } else if (bmiD >= 18.5 && bmiD <= 24.9) { + kulStart = (currentWeight - 105) * 30 + addKal; + } else if (bmiD >= 25) { + kulStart = (currentWeight - 105) * 25 + addKal; + } + } + if (kulStart < 1500) + { + kulStart = 1500; + } + } + + if (add < lvalue) { + status = "低于"; + } else if (add >= lvalue && add <= hvalue) { + status = "处于"; + } else { + status = "高于"; + } + + kulEnd = kulStart; + map.put("kulStart", String.valueOf(kulStart)); + map.put("kulEnd", String.valueOf(kulEnd)); + map.put("status", status); + return map; + } + + /** * 获取高危的饮食原则 * -- 1.8.3.1