Commit d29956b7bae8c55469331886e9b95d64e254167d

Authored by liquanyu
1 parent 855bb0c3ac

测量

Showing 3 changed files with 38 additions and 13 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientWeightController.java View file @ d29956b
... ... @@ -95,8 +95,9 @@
95 95 HttpServletRequest request,
96 96 @RequestParam(value = "rid", required = false) String rid,
97 97 @RequestParam(value = "doctorId") String doctorId,
  98 + @RequestParam(value = "beforeWeight",required = false) String beforeWeight,
98 99 String version) {
99   - return patientWeightService.report(id, getUserId(request), rid, version, doctorId);
  100 + return patientWeightService.report(id, getUserId(request), rid, version, doctorId,beforeWeight);
100 101 }
101 102  
102 103  
103 104  
... ... @@ -274,11 +275,13 @@
274 275 @TokenRequired
275 276 public BaseResponse getWeightsReport(@PathVariable String pid,
276 277 HttpServletRequest request,
277   - @RequestParam(value = "rid", required = false) String rid, String version, @RequestParam(value = "doctorId") String doctorId) {
  278 + @RequestParam(value = "rid", required = false) String rid, String version,
  279 + @RequestParam(value = "beforeWeight",required = false) String beforeWeight,
  280 + @RequestParam(value = "doctorId") String doctorId) {
278 281 if (pid.isEmpty() || "null".equals(pid)) {
279 282 return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.USER_PASSWORD_ERROR).setErrormsg("pid值不能为空!");
280 283 }
281   - return patientWeightService.getWeightsReport(pid, getUserId(request), rid, version, doctorId);
  284 + return patientWeightService.getWeightsReport(pid, getUserId(request), rid, version, doctorId,beforeWeight);
282 285 }
283 286  
284 287  
285 288  
... ... @@ -293,11 +296,13 @@
293 296 @TokenRequired
294 297 public BaseResponse qhdReport(@PathVariable String pid,
295 298 HttpServletRequest request,
296   - @RequestParam(value = "rid", required = false) String rid, String version, @RequestParam(value = "doctorId") String doctorId) {
  299 + @RequestParam(value = "rid", required = false) String rid, String version,
  300 + @RequestParam(value = "beforeWeight",required = false) String beforeWeight,
  301 + @RequestParam(value = "doctorId") String doctorId) {
297 302 if (pid.isEmpty() || "null".equals(pid)) {
298 303 return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.USER_PASSWORD_ERROR).setErrormsg("pid值不能为空!");
299 304 }
300   - return patientWeightService.qhdHighRiskReport(pid, getUserId(request), rid, version, doctorId);
  305 + return patientWeightService.qhdHighRiskReport(pid, getUserId(request), rid, version, doctorId,beforeWeight);
301 306 }
302 307  
303 308 /**
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/PatientWeightService.java View file @ d29956b
... ... @@ -35,7 +35,7 @@
35 35  
36 36 BaseResponse delete(String id);
37 37  
38   - BaseResponse report(String id, Integer userId, String rid, String version, String doctorId);
  38 + BaseResponse report(String id, Integer userId, String rid, String version, String doctorId,String beforeWeight);
39 39  
40 40  
41 41 BaseResponse wxReport(String pid);
42 42  
... ... @@ -60,9 +60,9 @@
60 60  
61 61 public void getSeries(Map<String, Object> series, String bmiStr, String bregmatic);
62 62  
63   - BaseResponse getWeightsReport(String pid, Integer userId, String rid, String version, String doctorId);
  63 + BaseResponse getWeightsReport(String pid, Integer userId, String rid, String version, String doctorId,String beforeWeight);
64 64  
65   - BaseResponse qhdHighRiskReport(String pid, Integer userId, String rid, String version, String doctorId);
  65 + BaseResponse qhdHighRiskReport(String pid, Integer userId, String rid, String version, String doctorId,String beforeWeight);
66 66  
67 67 public void setReport(Map<String, Object> restMap, Map<Integer, String> weights, String beforeWeight,
68 68 String bmi, Map<String, String> dayWeights, String bregmatic);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java View file @ d29956b
... ... @@ -634,15 +634,32 @@
634 634 return new BaseObjectResponse().setData(map).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
635 635 }
636 636  
  637 +
  638 + public void updateWeight(String beforeWeight,PatientWeight patientWeight)
  639 + {
  640 + if (patientWeight != null && StringUtils.isNotEmpty(beforeWeight) && StringUtils.isNotEmpty(patientWeight.getBeforeHeight()))
  641 + {
  642 + PatientWeight patientWeightBefore = new PatientWeight();
  643 + patientWeightBefore.setBeforeWeight(beforeWeight);
  644 + patientWeightBefore.setBmi(getBmi(beforeWeight,patientWeight.getBeforeHeight()));
  645 + patientWeightService2.update(Query.query(Criteria.where("_id").is(patientWeight.getId())), patientWeightBefore);
  646 + }
  647 + }
  648 +
  649 +
637 650 @Override
638   - public BaseResponse report(String id, Integer userId, String rid, String version, String doctorId) {
  651 + public BaseResponse report(String id, Integer userId, String rid, String version, String doctorId,String beforeWeight) {
639 652 String hospitalId = autoMatchFacade.getHospitalId(userId);
640 653 Organization org = organizationService.getOrganization(Integer.parseInt(hospitalId));
641 654  
642 655  
643 656 BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(org.getProvinceId());
644 657  
  658 +
645 659 PatientWeight patientWeight = mongoTemplate.findById(id, PatientWeight.class);
  660 +
  661 + updateWeight( beforeWeight, patientWeight);
  662 +
646 663 if (patientWeight != null) {
647 664 Map<String, Object> map = new LinkedHashMap<>();
648 665 Patients patients = mongoTemplate.findById(patientWeight.getPatientId(), Patients.class);
649 666  
... ... @@ -2198,10 +2215,13 @@
2198 2215 }
2199 2216  
2200 2217 @Override
2201   - public BaseResponse getWeightsReport(String pid, Integer userId, String rid, String version, String doctorId) {
  2218 + public BaseResponse getWeightsReport(String pid, Integer userId, String rid, String version, String doctorId,String beforeWeight) {
2202 2219 Map<String, Map<Integer, Double>> series = new HashMap<>();
2203 2220 Map<String, Map<String, Object>> datas = new TreeMap<>();
2204 2221 PatientWeight patientWeight = mongoTemplate.findOne(Query.query(Criteria.where("_id").is(pid)), PatientWeight.class);
  2222 +
  2223 + updateWeight(beforeWeight,patientWeight);
  2224 +
2205 2225 //1.获取该孕妇是否有推荐的高危项
2206 2226 Patients patients = mongoTemplate.findOne(Query.query(Criteria.where("_id").is(patientWeight.getPatientId())), Patients.class);
2207 2227 //1.1获取到这孕妇所有的高危因素id
... ... @@ -2335,7 +2355,7 @@
2335 2355 }
2336 2356 }
2337 2357 if (datas.size() == 0) {
2338   - BaseResponse baseResponse = this.report(pid, userId, rid, version, doctorId);
  2358 + BaseResponse baseResponse = this.report(pid, userId, rid, version, doctorId,beforeWeight);
2339 2359 return baseResponse;
2340 2360 }
2341 2361 //同时出现高血压和肝硬化或肝功能不全则按照肝硬化或肝功能不全
... ... @@ -2355,7 +2375,7 @@
2355 2375 * 秦皇岛高危报告
2356 2376 */
2357 2377 @Override
2358   - public BaseResponse qhdHighRiskReport(String pid, Integer userId, String rid, String version, String doctorId) {
  2378 + public BaseResponse qhdHighRiskReport(String pid, Integer userId, String rid, String version, String doctorId,String beforeWeight) {
2359 2379 Map<String, Map<Integer, Double>> series = new HashMap<>();
2360 2380 Map<String, Map<String, Object>> datas = new TreeMap<>();
2361 2381 PatientWeight patientWeight = mongoTemplate.findOne(Query.query(Criteria.where("_id").is(pid)), PatientWeight.class);
... ... @@ -2457,7 +2477,7 @@
2457 2477 }
2458 2478 }
2459 2479 if (datas.size() == 0) {
2460   - BaseResponse baseResponse = this.report(pid, userId, rid, "1", doctorId);
  2480 + BaseResponse baseResponse = this.report(pid, userId, rid, "1", doctorId,beforeWeight);
2461 2481 return baseResponse;
2462 2482 }
2463 2483 /*//同时出现高血压和肝硬化或肝功能不全则按照肝硬化或肝功能不全