Commit fb4c2d050c7e2f53a0325c87a576d78f99d30b97

Authored by jiangjiazhi
1 parent 8ea8aaaa5f

修改新电子病历

Showing 1 changed file with 37 additions and 4 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PostReviewFacade.java View file @ fb4c2d0
1 1 package com.lyms.platform.operate.web.facade;
2 2  
  3 +import com.lyms.platform.biz.service.ApplyOrderService;
3 4 import com.lyms.platform.biz.service.MatDeliverService;
4 5 import com.lyms.platform.biz.service.PatientsService;
5 6 import com.lyms.platform.biz.service.PostReviewService;
6 7  
7 8  
... ... @@ -25,18 +26,17 @@
25 26 import com.lyms.platform.pojo.MaternalDeliverModel;
26 27 import com.lyms.platform.pojo.Patients;
27 28 import com.lyms.platform.pojo.PostReviewModel;
  29 +import com.lyms.platform.pojo.ReferralApplyOrderModel;
28 30 import com.lyms.platform.query.MatDeliverQuery;
29 31 import com.lyms.platform.query.PostReviewQuery;
  32 +import com.lyms.platform.query.ReferralApplyOrderQuery;
30 33 import org.apache.commons.collections.CollectionUtils;
31 34 import org.apache.commons.lang.StringUtils;
32 35 import org.apache.commons.lang.math.NumberUtils;
33 36 import org.springframework.beans.factory.annotation.Autowired;
34 37 import org.springframework.stereotype.Component;
35 38  
36   -import java.util.ArrayList;
37   -import java.util.Collections;
38   -import java.util.HashMap;
39   -import java.util.List;
  39 +import java.util.*;
40 40  
41 41 /**
42 42 * 产后复查门面
... ... @@ -60,6 +60,8 @@
60 60 private OrganizationService organizationService;
61 61 @Autowired
62 62 private UsersService usersService;
  63 + @Autowired
  64 + private ApplyOrderService applyOrderService;
63 65  
64 66 /**
65 67 *
... ... @@ -104,6 +106,37 @@
104 106 }
105 107 postReviewModel.setPid(patients.getPid());
106 108 postReviewService.addPostReview(postReviewModel);
  109 +
  110 +
  111 + if (null != patients.getBuildType() && patients.getBuildType() == 3) {
  112 + ReferralApplyOrderQuery referralApplyOrderQuery = new ReferralApplyOrderQuery();
  113 + referralApplyOrderQuery.setParentId(patients.getId());
  114 + referralApplyOrderQuery.setHospitalId(hospital);
  115 + referralApplyOrderQuery.setStatus(1);
  116 + List<ReferralApplyOrderModel> orderModelList = applyOrderService.queryReferralApplyOrderWithQuery(referralApplyOrderQuery);
  117 + if (CollectionUtils.isNotEmpty(orderModelList)) {
  118 + String outHospitalId = orderModelList.get(0).getOutHospitalId();
  119 + ReferralApplyOrderQuery referralApplyOrderQuery1 = new ReferralApplyOrderQuery();
  120 + referralApplyOrderQuery1.setOutHospitalId(outHospitalId);
  121 + referralApplyOrderQuery1.setTransferredHospital(hospital);
  122 + referralApplyOrderQuery1.setPid(patients.getPid());
  123 +
  124 + ReferralApplyOrderModel model = new ReferralApplyOrderModel();
  125 + //设置接收时间
  126 + model.setReceived(DateUtil.parseYMD(postReviewRequest.getCheckTime()));
  127 + model.setRecDoctor(postReviewRequest.getProdDoctor());
  128 + model.setModified(new Date());
  129 + model.setStatus(2);
  130 + applyOrderService.updateByParentId(referralApplyOrderQuery1, model);
  131 +
  132 + ReferralApplyOrderQuery referralApplyOrderQuery2 = new ReferralApplyOrderQuery();
  133 + referralApplyOrderQuery2.setOutHospitalId(hospital);
  134 + referralApplyOrderQuery2.setTransferredHospital(outHospitalId);
  135 + referralApplyOrderQuery2.setPid(patients.getPid());
  136 + applyOrderService.updateByParentId(referralApplyOrderQuery2, model);
  137 + }
  138 + }
  139 +
107 140 } else {
108 141 Patients patients = patientsService.findOnePatientById(postReviewRequest.getParentId());
109 142 if(StringUtils.isNotEmpty(postReviewRequest.getDueDate())){