Commit 303b95d32e6237179fb894a4589338b0641648fd

Authored by liquanyu
1 parent eae2177550

预约住院分娩修改

Showing 6 changed files with 90 additions and 6 deletions

platform-dal/src/main/java/com/lyms/platform/pojo/PatientRegistrationModel.java View file @ 303b95d
... ... @@ -36,6 +36,15 @@
36 36  
37 37 //是否出院 1未出院 2出院
38 38 private Integer outType;
  39 + private Date dueDate;//孕产期
  40 +
  41 + public Date getDueDate() {
  42 + return dueDate;
  43 + }
  44 +
  45 + public void setDueDate(Date dueDate) {
  46 + this.dueDate = dueDate;
  47 + }
39 48  
40 49 public Integer getOutType() {
41 50 return outType;
platform-dal/src/main/java/com/lyms/platform/query/PatientRegistrationModelQuery.java View file @ 303b95d
... ... @@ -43,6 +43,11 @@
43 43 //是否出院 1未出院 2出院
44 44 private Integer outType;
45 45  
  46 + //预产期
  47 + private Date dueDateStart;
  48 + private Date dueDateEnd;
  49 +
  50 +
46 51 @Override
47 52 public MongoQuery convertToQuery() {
48 53 MongoCondition condition = MongoCondition.newInstance();
... ... @@ -92,6 +97,22 @@
92 97 c = Criteria.where("orderDate").lte(orderDateEnd);
93 98 }
94 99 }
  100 +
  101 + //预产期
  102 + if (null != dueDateStart) {
  103 + if (null != c) {
  104 + c = c.and("dueDate").gte(dueDateStart);
  105 + } else {
  106 + c = Criteria.where("dueDate").gte(dueDateStart);
  107 + }
  108 + }
  109 + if (null != dueDateEnd) {
  110 + if (null != c) {
  111 + c = c.lte(dueDateEnd);
  112 + } else {
  113 + c = Criteria.where("dueDate").lte(dueDateEnd);
  114 + }
  115 + }
95 116 // 登记时间
96 117 if (null != createDateStart) {
97 118 if (null != c) {
... ... @@ -125,6 +146,22 @@
125 146 }
126 147  
127 148 return condition.toMongoQuery();
  149 + }
  150 +
  151 + public Date getDueDateStart() {
  152 + return dueDateStart;
  153 + }
  154 +
  155 + public void setDueDateStart(Date dueDateStart) {
  156 + this.dueDateStart = dueDateStart;
  157 + }
  158 +
  159 + public Date getDueDateEnd() {
  160 + return dueDateEnd;
  161 + }
  162 +
  163 + public void setDueDateEnd(Date dueDateEnd) {
  164 + this.dueDateEnd = dueDateEnd;
128 165 }
129 166  
130 167 public Integer getOutType() {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java View file @ 303b95d
... ... @@ -398,9 +398,13 @@
398 398 }
399 399  
400 400 } else {
  401 +
  402 + Patients patients = patientsService.findOnePatientById(antExAddRequest.getParentId());
401 403 if (antExAddRequest.getRegistration() != null && StringUtils.isNotEmpty(antExAddRequest.getRegistration().getPid()))
402 404 {
403   - patientRegistrationFacade.add(antExAddRequest.getRegistration());
  405 + PatientRegistrationRequest registrationRequest = antExAddRequest.getRegistration();
  406 + registrationRequest.setDueDate(DateUtil.getYyyyMmDd(patients.getDueDate()));
  407 + patientRegistrationFacade.add(registrationRequest);
404 408 }
405 409  
406 410 model.setOperator(userId);
... ... @@ -419,7 +423,7 @@
419 423 }
420 424 }
421 425  
422   - Patients patients = patientsService.findOnePatientById(antExAddRequest.getParentId());
  426 +
423 427 model.setPid(patients.getPid());
424 428  
425 429 /**
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientRegistrationFacade.java View file @ 303b95d
... ... @@ -2,6 +2,7 @@
2 2  
3 3 import com.lyms.platform.beans.MsgRequest;
4 4 import com.lyms.platform.biz.service.PatientRegistrationService;
  5 +import com.lyms.platform.biz.service.PatientsService;
5 6 import com.lyms.platform.common.constants.ErrorCodeConstants;
6 7 import com.lyms.platform.common.enums.*;
7 8 import com.lyms.platform.common.result.BaseListResponse;
8 9  
... ... @@ -22,8 +23,10 @@
22 23 import com.lyms.platform.permission.service.UsersService;
23 24 import com.lyms.platform.pojo.AntenatalExaminationModel;
24 25 import com.lyms.platform.pojo.PatientRegistrationModel;
  26 +import com.lyms.platform.pojo.Patients;
25 27 import com.lyms.platform.pojo.PersonModel;
26 28 import com.lyms.platform.query.PatientRegistrationModelQuery;
  29 +import com.lyms.platform.query.PatientsQuery;
27 30 import org.springframework.beans.factory.annotation.Autowired;
28 31 import org.springframework.data.mongodb.core.MongoTemplate;
29 32 import org.springframework.data.mongodb.core.query.Criteria;
30 33  
... ... @@ -52,12 +55,9 @@
52 55 private AutoMatchFacade autoMatchFacade;
53 56  
54 57 @Autowired
55   - private OrganizationService organizationService;
  58 + private PatientsService patientsService;
56 59  
57 60 @Autowired
58   - private UsersService usersService;
59   -
60   - @Autowired
61 61 private MongoTemplate mongoTemplate;
62 62  
63 63 /**
... ... @@ -77,6 +77,7 @@
77 77 model.setType(request.getType());
78 78 model.setBedType(request.getBedType());
79 79 model.setOrderDate(DateUtil.parseYMD(request.getOrderDate()));
  80 + model.setDueDate(DateUtil.parseYMD(request.getDueDate()));
80 81 return model;
81 82  
82 83 }
... ... @@ -93,6 +94,18 @@
93 94 if (StringUtils.isNotEmpty(request.getPid()))
94 95 {
95 96 PersonModel personModels = mongoTemplate.findOne(Query.query(Criteria.where("id").is(request.getPid())), PersonModel.class);
  97 +
  98 + PatientsQuery patientsQuery = new PatientsQuery();
  99 + patientsQuery.setYn(YnEnums.YES.getId());
  100 + patientsQuery.setPid(request.getPid());
  101 + patientsQuery.setType(1);
  102 + List<Patients> patients = patientsService.queryPatient(patientsQuery);
  103 + if (CollectionUtils.isNotEmpty(patients))
  104 + {
  105 + Patients pat = patients.get(0);
  106 + model.setDueDate(pat.getDueDate());
  107 + }
  108 +
96 109 model.setName(personModels.getName());
97 110 model.setCardno(personModels.getCardNo());
98 111 model.setPhone(personModels.getPhone());
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/PatientRegistrationRequest.java View file @ 303b95d
... ... @@ -35,6 +35,16 @@
35 35 //预约时间
36 36 private String orderDate;
37 37  
  38 + private String dueDate;//孕产期
  39 +
  40 + public String getDueDate() {
  41 + return dueDate;
  42 + }
  43 +
  44 + public void setDueDate(String dueDate) {
  45 + this.dueDate = dueDate;
  46 + }
  47 +
38 48 public String getPid() {
39 49 return pid;
40 50 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/PatientRegistrationResult.java View file @ 303b95d
... ... @@ -22,6 +22,8 @@
22 22 private String bedType;
23 23 //预约时间
24 24 private String orderDate;
  25 + //孕产期
  26 + private String dueDate;
25 27 //是否出院 1未出院 2出院
26 28 private Integer outType;
27 29 @Override
28 30  
... ... @@ -34,8 +36,17 @@
34 36 setType(destModel.getType() == null ? "" : ("1".equals(destModel.getType()) ? "是" : "否" ));
35 37 setBedType(destModel.getBedType() == null ? "" : (destModel.getBedType() == 1 ? "LDRP(家庭化产房)" : (destModel.getBedType() == 2 ? "普通房间(产前)+单人分娩产房+单间(产后)" : "普通房间(产前+产后)")));
36 38 setOrderDate(DateUtil.getYyyyMmDd(destModel.getOrderDate()));
  39 + setDueDate(DateUtil.getYyyyMmDd(destModel.getDueDate()));
37 40 setOutType(destModel.getOutType());
38 41 return this;
  42 + }
  43 +
  44 + public String getDueDate() {
  45 + return dueDate;
  46 + }
  47 +
  48 + public void setDueDate(String dueDate) {
  49 + this.dueDate = dueDate;
39 50 }
40 51  
41 52 public Integer getOutType() {