Commit 067ae6bf9e031c18cf79581d70fd4e76dfcd19e0

Authored by Administrator
1 parent aace7f7656

修改末次月经预产期修改

Showing 1 changed file with 13 additions and 15 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java View file @ 067ae6b
... ... @@ -635,13 +635,11 @@
635 635 }
636 636  
637 637  
638   - public void updateWeight(String beforeWeight,PatientWeight patientWeight,String bregmatic,String bregmaticOther)
639   - {
  638 + public void updateWeight(String beforeWeight, PatientWeight patientWeight, String bregmatic, String bregmaticOther) {
640 639 boolean isUpdate = false;
641 640 PatientWeight patientWeightBefore = new PatientWeight();
642 641  
643   - if (patientWeight != null && StringUtils.isNotEmpty(beforeWeight) && StringUtils.isNotEmpty(patientWeight.getBeforeHeight()))
644   - {
  642 + if (patientWeight != null && StringUtils.isNotEmpty(beforeWeight) && StringUtils.isNotEmpty(patientWeight.getBeforeHeight())) {
645 643 isUpdate = true;
646 644 patientWeightBefore.setBeforeWeight(beforeWeight);
647 645 String bmi = getBmi(beforeWeight, patientWeight.getBeforeHeight());
... ... @@ -650,8 +648,7 @@
650 648 patientWeight.setBmi(bmi);
651 649 }
652 650  
653   - if (StringUtils.isNotEmpty(bregmatic))
654   - {
  651 + if (StringUtils.isNotEmpty(bregmatic)) {
655 652 patientWeightBefore.setBregmatic(bregmatic);
656 653 patientWeightBefore.setBregmaticOther(bregmaticOther);
657 654  
658 655  
... ... @@ -659,15 +656,14 @@
659 656 patientWeight.setBregmaticOther(bregmaticOther);
660 657 }
661 658  
662   - if (isUpdate)
663   - {
  659 + if (isUpdate) {
664 660 patientWeightService2.update(Query.query(Criteria.where("_id").is(patientWeight.getId())), patientWeightBefore);
665 661 }
666 662 }
667 663  
668 664  
669 665 @Override
670   - public BaseResponse report(String id, Integer userId, String rid, String version, String doctorId,String beforeWeight,String bregmatic,String bregmaticOther) {
  666 + public BaseResponse report(String id, Integer userId, String rid, String version, String doctorId, String beforeWeight, String bregmatic, String bregmaticOther) {
671 667 String hospitalId = autoMatchFacade.getHospitalId(userId);
672 668 Organization org = organizationService.getOrganization(Integer.parseInt(hospitalId));
673 669  
... ... @@ -852,6 +848,8 @@
852 848 //同时修改初诊的末次月经
853 849 Patients patient = new Patients();
854 850 patient.setLastMenses(lastMenstrualData);
  851 + Date dueDate = DateUtil.addDay(DateUtil.addMonth(lastMenstrualData, 9), 7);
  852 + patient.setDueDate(dueDate);
855 853 for (Patients p : patients) {
856 854 patientsService.updatePatientOne(patient, p.getId());
857 855 }
858 856  
... ... @@ -2234,12 +2232,12 @@
2234 2232 }
2235 2233  
2236 2234 @Override
2237   - public BaseResponse getWeightsReport(String pid, Integer userId, String rid, String version, String doctorId,String beforeWeight,String bregmatic1,String bregmaticOther) {
  2235 + public BaseResponse getWeightsReport(String pid, Integer userId, String rid, String version, String doctorId, String beforeWeight, String bregmatic1, String bregmaticOther) {
2238 2236 Map<String, Map<Integer, Double>> series = new HashMap<>();
2239 2237 Map<String, Map<String, Object>> datas = new TreeMap<>();
2240 2238 PatientWeight patientWeight = mongoTemplate.findOne(Query.query(Criteria.where("_id").is(pid)), PatientWeight.class);
2241 2239  
2242   - updateWeight(beforeWeight,patientWeight, bregmatic1, bregmaticOther);
  2240 + updateWeight(beforeWeight, patientWeight, bregmatic1, bregmaticOther);
2243 2241  
2244 2242 //1.获取该孕妇是否有推荐的高危项
2245 2243 Patients patients = mongoTemplate.findOne(Query.query(Criteria.where("_id").is(patientWeight.getPatientId())), Patients.class);
... ... @@ -2374,7 +2372,7 @@
2374 2372 }
2375 2373 }
2376 2374 if (datas.size() == 0) {
2377   - BaseResponse baseResponse = this.report(pid, userId, rid, version, doctorId,beforeWeight, bregmatic, bregmaticOther);
  2375 + BaseResponse baseResponse = this.report(pid, userId, rid, version, doctorId, beforeWeight, bregmatic, bregmaticOther);
2378 2376 return baseResponse;
2379 2377 }
2380 2378 //同时出现高血压和肝硬化或肝功能不全则按照肝硬化或肝功能不全
2381 2379  
... ... @@ -2394,12 +2392,12 @@
2394 2392 * 秦皇岛高危报告
2395 2393 */
2396 2394 @Override
2397   - public BaseResponse qhdHighRiskReport(String pid, Integer userId, String rid, String version, String doctorId,String beforeWeight,String bregmatic1,String bregmaticOther) {
  2395 + public BaseResponse qhdHighRiskReport(String pid, Integer userId, String rid, String version, String doctorId, String beforeWeight, String bregmatic1, String bregmaticOther) {
2398 2396 Map<String, Map<Integer, Double>> series = new HashMap<>();
2399 2397 Map<String, Map<String, Object>> datas = new TreeMap<>();
2400 2398 PatientWeight patientWeight = mongoTemplate.findOne(Query.query(Criteria.where("_id").is(pid)), PatientWeight.class);
2401 2399  
2402   - updateWeight(beforeWeight,patientWeight, bregmatic1, bregmaticOther);
  2400 + updateWeight(beforeWeight, patientWeight, bregmatic1, bregmaticOther);
2403 2401  
2404 2402 //1.获取该孕妇是否有推荐的高危项
2405 2403 Patients patients = mongoTemplate.findOne(Query.query(Criteria.where("_id").is(patientWeight.getPatientId())), Patients.class);
... ... @@ -2499,7 +2497,7 @@
2499 2497 }
2500 2498 }
2501 2499 if (datas.size() == 0) {
2502   - BaseResponse baseResponse = this.report(pid, userId, rid, "1", doctorId,beforeWeight,bregmatic1,bregmaticOther);
  2500 + BaseResponse baseResponse = this.report(pid, userId, rid, "1", doctorId, beforeWeight, bregmatic1, bregmaticOther);
2503 2501 return baseResponse;
2504 2502 }
2505 2503 /*//同时出现高血压和肝硬化或肝功能不全则按照肝硬化或肝功能不全