Commit 061637627b03d80743535ed74ed31eb6a57e9251
1 parent
bf494fd295
Exists in
master
and in
8 other branches
终止妊娠
Showing 5 changed files with 54 additions and 28 deletions
- platform-dal/src/main/java/com/lyms/platform/pojo/StopPregModel.java
- platform-dal/src/main/java/com/lyms/platform/query/StopPregQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/StopPregnancyFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/StopPregResult.java
platform-dal/src/main/java/com/lyms/platform/pojo/StopPregModel.java
View file @
0616376
... | ... | @@ -13,7 +13,7 @@ |
13 | 13 | public class StopPregModel extends BaseModel { |
14 | 14 | private String id; |
15 | 15 | //孕妇建档id |
16 | - private String pid; | |
16 | + private String patientId; | |
17 | 17 | |
18 | 18 | //终止原因 |
19 | 19 | private String stopReason; |
20 | 20 | |
... | ... | @@ -75,12 +75,12 @@ |
75 | 75 | this.id = id; |
76 | 76 | } |
77 | 77 | |
78 | - public String getPid() { | |
79 | - return pid; | |
78 | + public String getPatientId() { | |
79 | + return patientId; | |
80 | 80 | } |
81 | 81 | |
82 | - public void setPid(String pid) { | |
83 | - this.pid = pid; | |
82 | + public void setPatientId(String patientId) { | |
83 | + this.patientId = patientId; | |
84 | 84 | } |
85 | 85 | |
86 | 86 | public String getStopReason() { |
platform-dal/src/main/java/com/lyms/platform/query/StopPregQuery.java
View file @
0616376
... | ... | @@ -18,7 +18,7 @@ |
18 | 18 | public class StopPregQuery extends BaseQuery implements IConvertToNativeQuery { |
19 | 19 | private String id; |
20 | 20 | //孕妇建档id |
21 | - private String pid; | |
21 | + private String patientId; | |
22 | 22 | |
23 | 23 | //终止原因 |
24 | 24 | private List stopReason; |
... | ... | @@ -38,8 +38,8 @@ |
38 | 38 | public MongoQuery convertToQuery() { |
39 | 39 | MongoCondition condition = MongoCondition.newInstance(); |
40 | 40 | |
41 | - if (null != pid) { | |
42 | - condition = condition.and("pid", pid, MongoOper.IS); | |
41 | + if (null != patientId) { | |
42 | + condition = condition.and("patientId", patientId, MongoOper.IS); | |
43 | 43 | } |
44 | 44 | if (null != id) { |
45 | 45 | condition = condition.and("id", new ObjectId(id), MongoOper.IS); |
46 | 46 | |
... | ... | @@ -67,12 +67,12 @@ |
67 | 67 | this.id = id; |
68 | 68 | } |
69 | 69 | |
70 | - public String getPid() { | |
71 | - return pid; | |
70 | + public String getPatientId() { | |
71 | + return patientId; | |
72 | 72 | } |
73 | 73 | |
74 | - public void setPid(String pid) { | |
75 | - this.pid = pid; | |
74 | + public void setPatientId(String patientId) { | |
75 | + this.patientId = patientId; | |
76 | 76 | } |
77 | 77 | |
78 | 78 | public List getStopReason() { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
0616376
... | ... | @@ -380,14 +380,24 @@ |
380 | 380 | MaternalDeliverModel model = modelList.get(0); |
381 | 381 | dueDate = model.getDueDate(); |
382 | 382 | } else { |
383 | - //终止妊娠 | |
384 | - StopPregQuery query = new StopPregQuery(); | |
385 | - query.setYn(YnEnums.YES.getId()); | |
386 | - query.setPid(patients.getPid()); | |
387 | - stopPregs = stopPregnancyService.queryStopPreg(query); | |
388 | - if (CollectionUtils.isNotEmpty(stopPregs)) { | |
389 | - dueDate = DateUtil.getyyyy_MM_dd(stopPregs.get(0).getStopDate()); | |
383 | + PatientsQuery query1 = new PatientsQuery(); | |
384 | + query1.setCardNo(exListQueryRequest.getCardNo()); | |
385 | + query1.setYn(YnEnums.YES.getId()); | |
386 | + List<Patients> pats = patientsService.queryPatient(query1); | |
387 | + if (CollectionUtils.isNotEmpty(pats)) | |
388 | + { | |
389 | + | |
390 | + //终止妊娠 | |
391 | + StopPregQuery query = new StopPregQuery(); | |
392 | + query.setYn(YnEnums.YES.getId()); | |
393 | + query.setPatientId(patients.getId()); | |
394 | + stopPregs = stopPregnancyService.queryStopPreg(query); | |
395 | + if (CollectionUtils.isNotEmpty(stopPregs)) { | |
396 | + dueDate = DateUtil.getyyyy_MM_dd(stopPregs.get(0).getStopDate()); | |
397 | + } | |
390 | 398 | } |
399 | + | |
400 | + | |
391 | 401 | } |
392 | 402 | PostReviewQuery postReviewQuery = new PostReviewQuery(); |
393 | 403 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/StopPregnancyFacade.java
View file @
0616376
... | ... | @@ -91,6 +91,7 @@ |
91 | 91 | patientsQuery.setType(1); |
92 | 92 | patientsQuery.setPid(request.getPid()); |
93 | 93 | |
94 | + Patients pat = null; | |
94 | 95 | List<Patients> patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery); |
95 | 96 | if (CollectionUtils.isNotEmpty(patients)) |
96 | 97 | { |
... | ... | @@ -99,6 +100,13 @@ |
99 | 100 | { |
100 | 101 | if (patient != null) |
101 | 102 | { |
103 | + | |
104 | + String hid = patient.getHospitalId(); | |
105 | + if (StringUtils.isNotEmpty(hid) && hid.equals(request.getHospitalId())) | |
106 | + { | |
107 | + pat = patient; | |
108 | + } | |
109 | + | |
102 | 110 | patient.setModified(new Date()); |
103 | 111 | //终止妊娠状态 |
104 | 112 | patient.setDueStatus(1); |
... | ... | @@ -113,7 +121,7 @@ |
113 | 121 | { |
114 | 122 | patient.setServiceStatus(ServiceStatusEnums.ADD_OVERDUE.getId()); |
115 | 123 | } |
116 | - patient.setDueDate(new Date()); | |
124 | + patient.setFmDate(DateUtil.parseYMD(request.getStopDate())); | |
117 | 125 | patient.setType(3); |
118 | 126 | |
119 | 127 | //分娩状态 0未终止妊娠 1终止妊娠 |
120 | 128 | |
... | ... | @@ -129,7 +137,16 @@ |
129 | 137 | personService.updatePerson(pmodel, request.getPid()); |
130 | 138 | } |
131 | 139 | |
140 | + if (pat != null) | |
141 | + { | |
142 | + BaseResponse objectResponse = new BaseResponse(); | |
143 | + objectResponse.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
144 | + objectResponse.setErrormsg("数据异常"); | |
145 | + return objectResponse; | |
146 | + } | |
147 | + | |
132 | 148 | StopPregModel model = getStopPregModel(request); |
149 | + model.setPatientId(pat.getId()); | |
133 | 150 | model.setCreated(new Date()); |
134 | 151 | model.setModified(new Date()); |
135 | 152 | |
... | ... | @@ -143,7 +160,6 @@ |
143 | 160 | private StopPregModel getStopPregModel(StopPregRequest request) { |
144 | 161 | StopPregModel model = new StopPregModel(); |
145 | 162 | |
146 | - model.setPid(request.getPid()); | |
147 | 163 | model.setYn(YnEnums.YES.getId()); |
148 | 164 | model.setInPerson(request.getInPerson()); |
149 | 165 | model.setRemark(request.getRemark()); |
150 | 166 | |
... | ... | @@ -165,14 +181,14 @@ |
165 | 181 | Map map = new HashMap(); |
166 | 182 | StopPregQuery query = new StopPregQuery(); |
167 | 183 | query.setYn(YnEnums.YES.getId()); |
168 | - query.setPid(pid); | |
184 | + query.setPatientId(pid); | |
169 | 185 | StopPregResult result = null; |
170 | 186 | List<StopPregModel> stopPregs = stopPregnancyService.queryStopPreg(query); |
171 | 187 | if (CollectionUtils.isNotEmpty(stopPregs)) |
172 | 188 | { |
173 | 189 | StopPregModel model = stopPregs.get(0); |
174 | 190 | result = new StopPregResult(); |
175 | - result.setPid(model.getPid()); | |
191 | + result.setPatientId(model.getPatientId()); | |
176 | 192 | result.setRemark(model.getRemark()); |
177 | 193 | result.setId(model.getId()); |
178 | 194 | result.setStopDate(DateUtil.getyyyy_MM_dd(model.getStopDate())); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/StopPregResult.java
View file @
0616376
... | ... | @@ -9,7 +9,7 @@ |
9 | 9 | public class StopPregResult { |
10 | 10 | private String id; |
11 | 11 | //孕妇建档id |
12 | - private String pid; | |
12 | + private String patientId; | |
13 | 13 | |
14 | 14 | //终止原因 |
15 | 15 | private Map stopReason; |
16 | 16 | |
... | ... | @@ -31,12 +31,12 @@ |
31 | 31 | this.id = id; |
32 | 32 | } |
33 | 33 | |
34 | - public String getPid() { | |
35 | - return pid; | |
34 | + public String getPatientId() { | |
35 | + return patientId; | |
36 | 36 | } |
37 | 37 | |
38 | - public void setPid(String pid) { | |
39 | - this.pid = pid; | |
38 | + public void setPatientId(String patientId) { | |
39 | + this.patientId = patientId; | |
40 | 40 | } |
41 | 41 | |
42 | 42 | public Map getStopReason() { |