Commit 405fd0a9153116bd055f6c56a007511ee5561048

Authored by liquanyu
1 parent ad5cb99000

update

Showing 3 changed files with 42 additions and 17 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientWeightController.java View file @ 405fd0a
... ... @@ -96,8 +96,10 @@
96 96 @RequestParam(value = "rid", required = false) String rid,
97 97 @RequestParam(value = "doctorId") String doctorId,
98 98 @RequestParam(value = "beforeWeight",required = false) String beforeWeight,
  99 + @RequestParam(value = "bregmatic",required = false) String bregmatic,
  100 + @RequestParam(value = "bregmaticOther",required = false) String bregmaticOther,
99 101 String version) {
100   - return patientWeightService.report(id, getUserId(request), rid, version, doctorId,beforeWeight);
  102 + return patientWeightService.report(id, getUserId(request), rid, version, doctorId,beforeWeight,bregmatic,bregmaticOther);
101 103 }
102 104  
103 105  
104 106  
... ... @@ -277,11 +279,13 @@
277 279 HttpServletRequest request,
278 280 @RequestParam(value = "rid", required = false) String rid, String version,
279 281 @RequestParam(value = "beforeWeight",required = false) String beforeWeight,
  282 + @RequestParam(value = "bregmatic",required = false) String bregmatic,
  283 + @RequestParam(value = "bregmaticOther",required = false) String bregmaticOther,
280 284 @RequestParam(value = "doctorId") String doctorId) {
281 285 if (pid.isEmpty() || "null".equals(pid)) {
282 286 return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.USER_PASSWORD_ERROR).setErrormsg("pid值不能为空!");
283 287 }
284   - return patientWeightService.getWeightsReport(pid, getUserId(request), rid, version, doctorId,beforeWeight);
  288 + return patientWeightService.getWeightsReport(pid, getUserId(request), rid, version, doctorId,beforeWeight,bregmatic,bregmaticOther);
285 289 }
286 290  
287 291  
288 292  
... ... @@ -298,11 +302,13 @@
298 302 HttpServletRequest request,
299 303 @RequestParam(value = "rid", required = false) String rid, String version,
300 304 @RequestParam(value = "beforeWeight",required = false) String beforeWeight,
  305 + @RequestParam(value = "bregmatic",required = false) String bregmatic,
  306 + @RequestParam(value = "bregmaticOther",required = false) String bregmaticOther,
301 307 @RequestParam(value = "doctorId") String doctorId) {
302 308 if (pid.isEmpty() || "null".equals(pid)) {
303 309 return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.USER_PASSWORD_ERROR).setErrormsg("pid值不能为空!");
304 310 }
305   - return patientWeightService.qhdHighRiskReport(pid, getUserId(request), rid, version, doctorId,beforeWeight);
  311 + return patientWeightService.qhdHighRiskReport(pid, getUserId(request), rid, version, doctorId,beforeWeight,bregmatic,bregmaticOther);
306 312 }
307 313  
308 314 /**
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/PatientWeightService.java View file @ 405fd0a
... ... @@ -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,String beforeWeight);
  38 + BaseResponse report(String id, Integer userId, String rid, String version, String doctorId,String beforeWeight,String bregmatic,String bregmaticOther);
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,String beforeWeight);
  63 + BaseResponse getWeightsReport(String pid, Integer userId, String rid, String version, String doctorId,String beforeWeight,String bregmatic,String bregmaticOther);
64 64  
65   - BaseResponse qhdHighRiskReport(String pid, Integer userId, String rid, String version, String doctorId,String beforeWeight);
  65 + BaseResponse qhdHighRiskReport(String pid, Integer userId, String rid, String version, String doctorId,String beforeWeight,String bregmatic,String bregmaticOther);
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 @ 405fd0a
... ... @@ -635,20 +635,39 @@
635 635 }
636 636  
637 637  
638   - public void updateWeight(String beforeWeight,PatientWeight patientWeight)
  638 + public void updateWeight(String beforeWeight,PatientWeight patientWeight,String bregmatic,String bregmaticOther)
639 639 {
  640 + boolean isUpdate = false;
  641 + PatientWeight patientWeightBefore = new PatientWeight();
  642 +
640 643 if (patientWeight != null && StringUtils.isNotEmpty(beforeWeight) && StringUtils.isNotEmpty(patientWeight.getBeforeHeight()))
641 644 {
642   - PatientWeight patientWeightBefore = new PatientWeight();
  645 + isUpdate = true;
643 646 patientWeightBefore.setBeforeWeight(beforeWeight);
644   - patientWeightBefore.setBmi(getBmi(beforeWeight,patientWeight.getBeforeHeight()));
  647 + String bmi = getBmi(beforeWeight, patientWeight.getBeforeHeight());
  648 + patientWeightBefore.setBmi(bmi);
  649 + patientWeight.setBeforeWeight(beforeWeight);
  650 + patientWeight.setBmi(bmi);
  651 + }
  652 +
  653 + if (StringUtils.isNotEmpty(bregmatic))
  654 + {
  655 + patientWeightBefore.setBregmatic(bregmatic);
  656 + patientWeightBefore.setBregmaticOther(bregmaticOther);
  657 +
  658 + patientWeight.setBregmatic(bregmatic);
  659 + patientWeight.setBregmaticOther(bregmaticOther);
  660 + }
  661 +
  662 + if (isUpdate)
  663 + {
645 664 patientWeightService2.update(Query.query(Criteria.where("_id").is(patientWeight.getId())), patientWeightBefore);
646 665 }
647 666 }
648 667  
649 668  
650 669 @Override
651   - public BaseResponse report(String id, Integer userId, String rid, String version, String doctorId,String beforeWeight) {
  670 + public BaseResponse report(String id, Integer userId, String rid, String version, String doctorId,String beforeWeight,String bregmatic,String bregmaticOther) {
652 671 String hospitalId = autoMatchFacade.getHospitalId(userId);
653 672 Organization org = organizationService.getOrganization(Integer.parseInt(hospitalId));
654 673  
... ... @@ -658,7 +677,7 @@
658 677  
659 678 PatientWeight patientWeight = mongoTemplate.findById(id, PatientWeight.class);
660 679  
661   - updateWeight( beforeWeight, patientWeight);
  680 + updateWeight(beforeWeight, patientWeight, bregmatic, bregmaticOther);
662 681  
663 682 if (patientWeight != null) {
664 683 Map<String, Object> map = new LinkedHashMap<>();
665 684  
... ... @@ -2215,12 +2234,12 @@
2215 2234 }
2216 2235  
2217 2236 @Override
2218   - public BaseResponse getWeightsReport(String pid, Integer userId, String rid, String version, String doctorId,String beforeWeight) {
  2237 + public BaseResponse getWeightsReport(String pid, Integer userId, String rid, String version, String doctorId,String beforeWeight,String bregmatic1,String bregmaticOther) {
2219 2238 Map<String, Map<Integer, Double>> series = new HashMap<>();
2220 2239 Map<String, Map<String, Object>> datas = new TreeMap<>();
2221 2240 PatientWeight patientWeight = mongoTemplate.findOne(Query.query(Criteria.where("_id").is(pid)), PatientWeight.class);
2222 2241  
2223   - updateWeight(beforeWeight,patientWeight);
  2242 + updateWeight(beforeWeight,patientWeight, bregmatic1, bregmaticOther);
2224 2243  
2225 2244 //1.获取该孕妇是否有推荐的高危项
2226 2245 Patients patients = mongoTemplate.findOne(Query.query(Criteria.where("_id").is(patientWeight.getPatientId())), Patients.class);
... ... @@ -2355,7 +2374,7 @@
2355 2374 }
2356 2375 }
2357 2376 if (datas.size() == 0) {
2358   - BaseResponse baseResponse = this.report(pid, userId, rid, version, doctorId,beforeWeight);
  2377 + BaseResponse baseResponse = this.report(pid, userId, rid, version, doctorId,beforeWeight, bregmatic, bregmaticOther);
2359 2378 return baseResponse;
2360 2379 }
2361 2380 //同时出现高血压和肝硬化或肝功能不全则按照肝硬化或肝功能不全
2362 2381  
... ... @@ -2375,12 +2394,12 @@
2375 2394 * 秦皇岛高危报告
2376 2395 */
2377 2396 @Override
2378   - public BaseResponse qhdHighRiskReport(String pid, Integer userId, String rid, String version, String doctorId,String beforeWeight) {
  2397 + public BaseResponse qhdHighRiskReport(String pid, Integer userId, String rid, String version, String doctorId,String beforeWeight,String bregmatic1,String bregmaticOther) {
2379 2398 Map<String, Map<Integer, Double>> series = new HashMap<>();
2380 2399 Map<String, Map<String, Object>> datas = new TreeMap<>();
2381 2400 PatientWeight patientWeight = mongoTemplate.findOne(Query.query(Criteria.where("_id").is(pid)), PatientWeight.class);
2382 2401  
2383   - updateWeight(beforeWeight,patientWeight);
  2402 + updateWeight(beforeWeight,patientWeight, bregmatic1, bregmaticOther);
2384 2403  
2385 2404 //1.获取该孕妇是否有推荐的高危项
2386 2405 Patients patients = mongoTemplate.findOne(Query.query(Criteria.where("_id").is(patientWeight.getPatientId())), Patients.class);
... ... @@ -2480,7 +2499,7 @@
2480 2499 }
2481 2500 }
2482 2501 if (datas.size() == 0) {
2483   - BaseResponse baseResponse = this.report(pid, userId, rid, "1", doctorId,beforeWeight);
  2502 + BaseResponse baseResponse = this.report(pid, userId, rid, "1", doctorId,beforeWeight,bregmatic1,bregmaticOther);
2484 2503 return baseResponse;
2485 2504 }
2486 2505 /*//同时出现高血压和肝硬化或肝功能不全则按照肝硬化或肝功能不全