Commit 662bc4d27931055a67595f862d51a793aee256c3
1 parent
4a3a71493c
Exists in
master
and in
6 other branches
体重修改
Showing 1 changed file with 120 additions and 12 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
View file @
662bc4d
| ... | ... | @@ -1006,7 +1006,10 @@ |
| 1006 | 1006 | //威海市妇幼热量单独计算 |
| 1007 | 1007 | if ("2100001635".equals(hospitalId)) { |
| 1008 | 1008 | kmap = getWhComputeKul(week, Double.parseDouble(patientWeight.getNowWeight()), Double.parseDouble(patientWeight.getBeforeWeight()), patientWeight.getBregmatic(), bmi); |
| 1009 | - } else { | |
| 1009 | + }else if ("216".equals(hospitalId)) { //临西县热量单独计算 | |
| 1010 | + kmap = getLxComputeKul(week, Double.parseDouble(patientWeight.getNowWeight()), Double.parseDouble(patientWeight.getBeforeWeight()), patientWeight.getBregmatic(), bmi); | |
| 1011 | + } | |
| 1012 | + else { | |
| 1010 | 1013 | kmap = computeKulServiceManager.getComputeKulByRisk(rid).getComputeKul(Double.parseDouble(patientWeight.getBeforeWeight()), |
| 1011 | 1014 | Double.parseDouble(patientWeight.getNowWeight()), week, bmi, patientWeight.getBregmatic(), patientWeight.getBeforeHeight(), version); |
| 1012 | 1015 | } |
| ... | ... | @@ -1485,7 +1488,7 @@ |
| 1485 | 1488 | String hospitalId = kmap.get("hospitalId"); |
| 1486 | 1489 | String kcal = ""; |
| 1487 | 1490 | //临西热量计算 |
| 1488 | - if (StringUtils.isNotEmpty(hospitalId) && "2100001306".equals(hospitalId) && "1500".equals(kmap.get("kulStart"))) | |
| 1491 | + if (StringUtils.isNotEmpty(hospitalId) && "216".equals(hospitalId) && "1500".equals(kmap.get("kulStart"))) | |
| 1489 | 1492 | { |
| 1490 | 1493 | kcal = Math.round(Double.parseDouble(kmap.get("kulStart")))+""; |
| 1491 | 1494 | } |
| ... | ... | @@ -2059,16 +2062,6 @@ |
| 2059 | 2062 | } else if (k1 > 3300) { |
| 2060 | 2063 | k1 = 3300; |
| 2061 | 2064 | } |
| 2062 | - String hospitalId = map.get("hospitalId"); | |
| 2063 | - //临西热量计算 | |
| 2064 | - if (StringUtils.isNotEmpty(hospitalId) && "2100001306".equals(hospitalId)) | |
| 2065 | - { | |
| 2066 | - if (k1 < 1500) | |
| 2067 | - { | |
| 2068 | - map.put("kulStart","1500"); | |
| 2069 | - k1 = 1500; | |
| 2070 | - } | |
| 2071 | - } | |
| 2072 | 2065 | |
| 2073 | 2066 | Criteria criteria = null; |
| 2074 | 2067 | if ("3".equals((String) map.get("type"))) { |
| ... | ... | @@ -2297,6 +2290,121 @@ |
| 2297 | 2290 | kulStart = currentWeight * 20 + 450; |
| 2298 | 2291 | } |
| 2299 | 2292 | } |
| 2293 | + kulEnd = kulStart; | |
| 2294 | + map.put("kulStart", String.valueOf(kulStart)); | |
| 2295 | + map.put("kulEnd", String.valueOf(kulEnd)); | |
| 2296 | + map.put("status", status); | |
| 2297 | + return map; | |
| 2298 | + } | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + public Map<String, String> getLxComputeKul(int week, double currentWeight, double beforeWeight, String bregmatic, double bmiD) { | |
| 2303 | + | |
| 2304 | + String bmiStr = null; | |
| 2305 | + //空和1表示单胎 | |
| 2306 | + if (!StringUtils.isNotEmpty(bregmatic) || "1".equals(bregmatic)) { | |
| 2307 | + if (bmiD < 18.5) { | |
| 2308 | + bmiStr = "BMI<18.5"; | |
| 2309 | + } else if (bmiD >= 18.5 && bmiD <= 24.9) { | |
| 2310 | + bmiStr = "BMI=18.5-24.9"; | |
| 2311 | + } else if (bmiD > 24.9 && bmiD < 30) { | |
| 2312 | + bmiStr = "BMI=25-29.9"; | |
| 2313 | + } else if (bmiD >= 30) { | |
| 2314 | + bmiStr = "BMI≥30"; | |
| 2315 | + } | |
| 2316 | + } else { | |
| 2317 | + if (bmiD <= 24.9) { | |
| 2318 | + bmiStr = "BMI≤24.9"; | |
| 2319 | + } else if (bmiD >= 25 && bmiD <= 29.9) { | |
| 2320 | + bmiStr = "BMI=25-29.9"; | |
| 2321 | + } else if (bmiD >= 30) { | |
| 2322 | + bmiStr = "BMI≥30"; | |
| 2323 | + } | |
| 2324 | + } | |
| 2325 | + | |
| 2326 | + Map<String, Object> series = new LinkedHashMap<>(); | |
| 2327 | + getSeries(series, bmiStr, bregmatic); | |
| 2328 | + | |
| 2329 | + | |
| 2330 | + List<Double> highMap = (List<Double>) series.get("highData"); | |
| 2331 | + List<Double> lowMap = (List<Double>) series.get("lowData"); | |
| 2332 | + | |
| 2333 | + Map<String, String> map = new HashMap<>(); | |
| 2334 | + | |
| 2335 | + if (week > 40) { | |
| 2336 | + return map; | |
| 2337 | + } | |
| 2338 | + | |
| 2339 | + double kulStart = 0; | |
| 2340 | + double kulEnd = 0; | |
| 2341 | + String status = ""; | |
| 2342 | + | |
| 2343 | + double add = Double.valueOf(String.format("%.2f", currentWeight - beforeWeight)); | |
| 2344 | + | |
| 2345 | + double hvalue = highMap.get(week - 1); | |
| 2346 | + double lvalue = lowMap.get(week - 1); | |
| 2347 | + | |
| 2348 | + //孕早期 | |
| 2349 | + if (week <= 11) { | |
| 2350 | + if (add <= hvalue) { | |
| 2351 | + if (bmiD < 18.5) { | |
| 2352 | + kulStart = (currentWeight - 105) * 37; | |
| 2353 | + } else if (bmiD >= 18.5 && bmiD <= 24.9) { | |
| 2354 | + kulStart = (currentWeight - 105) * 33; | |
| 2355 | + } else if (bmiD >= 25) { | |
| 2356 | + kulStart = (currentWeight - 105) * 28; | |
| 2357 | + } | |
| 2358 | + } | |
| 2359 | + else | |
| 2360 | + { | |
| 2361 | + if (bmiD < 18.5) { | |
| 2362 | + kulStart = (currentWeight - 105) * 35; | |
| 2363 | + } else if (bmiD >= 18.5 && bmiD <= 24.9) { | |
| 2364 | + kulStart = (currentWeight - 105) * 30; | |
| 2365 | + } else if (bmiD >= 25) { | |
| 2366 | + kulStart = (currentWeight - 105) * 25; | |
| 2367 | + } | |
| 2368 | + } | |
| 2369 | + } | |
| 2370 | + //孕中期 | |
| 2371 | + else if (week < 28) { | |
| 2372 | + int addKal = week < 28 ? 200 : 400; | |
| 2373 | + if (add <= hvalue) { | |
| 2374 | + if (bmiD < 18.5) | |
| 2375 | + { | |
| 2376 | + kulStart = (currentWeight - 105) * 37 + addKal; | |
| 2377 | + } else if (bmiD >= 18.5 && bmiD <= 24.9) { | |
| 2378 | + kulStart = (currentWeight - 105) * 33 + addKal; | |
| 2379 | + } else if (bmiD >= 25) { | |
| 2380 | + kulStart = (currentWeight - 105) * 28 + addKal; | |
| 2381 | + } | |
| 2382 | + } | |
| 2383 | + else | |
| 2384 | + { | |
| 2385 | + if (bmiD < 18.5) | |
| 2386 | + { | |
| 2387 | + kulStart = (currentWeight - 105) * 35 + addKal; | |
| 2388 | + } else if (bmiD >= 18.5 && bmiD <= 24.9) { | |
| 2389 | + kulStart = (currentWeight - 105) * 30 + addKal; | |
| 2390 | + } else if (bmiD >= 25) { | |
| 2391 | + kulStart = (currentWeight - 105) * 25 + addKal; | |
| 2392 | + } | |
| 2393 | + } | |
| 2394 | + if (kulStart < 1500) | |
| 2395 | + { | |
| 2396 | + kulStart = 1500; | |
| 2397 | + } | |
| 2398 | + } | |
| 2399 | + | |
| 2400 | + if (add < lvalue) { | |
| 2401 | + status = "低于"; | |
| 2402 | + } else if (add >= lvalue && add <= hvalue) { | |
| 2403 | + status = "处于"; | |
| 2404 | + } else { | |
| 2405 | + status = "高于"; | |
| 2406 | + } | |
| 2407 | + | |
| 2300 | 2408 | kulEnd = kulStart; |
| 2301 | 2409 | map.put("kulStart", String.valueOf(kulStart)); |
| 2302 | 2410 | map.put("kulEnd", String.valueOf(kulEnd)); |