Commit 58a53ab06f9173b6f71c71fdb08286abe32e029e
1 parent
f83cd42716
Exists in
master
and in
1 other branch
产前诊断申请保存
Showing 4 changed files with 398 additions and 12 deletions
- platform-dal/src/main/java/com/lyms/platform/pojo/DiagnosisModel.java
- platform-dal/src/main/java/com/lyms/platform/query/DiagnosisQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/DiagnosisFacaed.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/DiagnosisAddRequest.java
platform-dal/src/main/java/com/lyms/platform/pojo/DiagnosisModel.java
View file @
58a53ab
... | ... | @@ -21,7 +21,7 @@ |
21 | 21 | private String dueWeek;//孕周 |
22 | 22 | private Date yChanQi;//预产期 |
23 | 23 | private String phone;//联系方式 |
24 | - private String diaProject;//诊断项目(1,羊水穿刺;2,) | |
24 | + private String diaProject;//诊断项目(1,羊水穿刺;2,绒毛穿刺;3,脐带血检测) | |
25 | 25 | private Date birth;//出生日期 |
26 | 26 | private String weight;//体重 |
27 | 27 | private Date lastMenses;//末次月经 |
... | ... | @@ -37,7 +37,8 @@ |
37 | 37 | private String collectHospitalId;//申请医院 |
38 | 38 | private Date created;//创建时间 |
39 | 39 | private Date modified;//修改时间 |
40 | - private String status;//数据来源(1,申请过来的,2,自动流转过来) | |
40 | + private String status;//数据来源(1,申请过来的;2,自动流转过来) | |
41 | + private String diaStatus;//数据状态(0,未申请;1,已申请;2,已接收;3,已诊断) | |
41 | 42 | |
42 | 43 | public String getId() { |
43 | 44 | return id; |
... | ... | @@ -245,6 +246,14 @@ |
245 | 246 | |
246 | 247 | public void setStatus(String status) { |
247 | 248 | this.status = status; |
249 | + } | |
250 | + | |
251 | + public String getDiaStatus() { | |
252 | + return diaStatus; | |
253 | + } | |
254 | + | |
255 | + public void setDiaStatus(String diaStatus) { | |
256 | + this.diaStatus = diaStatus; | |
248 | 257 | } |
249 | 258 | } |
platform-dal/src/main/java/com/lyms/platform/query/DiagnosisQuery.java
View file @
58a53ab
... | ... | @@ -2,6 +2,8 @@ |
2 | 2 | |
3 | 3 | import com.lyms.platform.common.base.IConvertToNativeQuery; |
4 | 4 | import com.lyms.platform.common.dao.BaseQuery; |
5 | +import com.lyms.platform.common.dao.operator.MongoCondition; | |
6 | +import com.lyms.platform.common.dao.operator.MongoOper; | |
5 | 7 | import com.lyms.platform.common.dao.operator.MongoQuery; |
6 | 8 | |
7 | 9 | /** |
8 | 10 | |
9 | 11 | |
10 | 12 | |
11 | 13 | |
... | ... | @@ -13,12 +15,50 @@ |
13 | 15 | private String id; |
14 | 16 | private String parentId;//孕妇建档ID |
15 | 17 | private String queryNos;//查询号 |
18 | + private String diaStatus;//数据状态 | |
16 | 19 | |
17 | 20 | |
21 | + public String getId() { | |
22 | + return id; | |
23 | + } | |
18 | 24 | |
25 | + public void setId(String id) { | |
26 | + this.id = id; | |
27 | + } | |
19 | 28 | |
29 | + public String getParentId() { | |
30 | + return parentId; | |
31 | + } | |
32 | + | |
33 | + public void setParentId(String parentId) { | |
34 | + this.parentId = parentId; | |
35 | + } | |
36 | + | |
37 | + public String getQueryNos() { | |
38 | + return queryNos; | |
39 | + } | |
40 | + | |
41 | + public void setQueryNos(String queryNos) { | |
42 | + this.queryNos = queryNos; | |
43 | + } | |
44 | + | |
45 | + public String getDiaStatus() { | |
46 | + return diaStatus; | |
47 | + } | |
48 | + | |
49 | + public void setDiaStatus(String diaStatus) { | |
50 | + this.diaStatus = diaStatus; | |
51 | + } | |
52 | + | |
20 | 53 | public MongoQuery convertToQuery() { |
21 | - return null; | |
54 | + MongoCondition condition = MongoCondition.newInstance(); | |
55 | + if(null != id){ | |
56 | + condition = condition.and("id", id, MongoOper.IS); | |
57 | + } | |
58 | + if(null != diaStatus){ | |
59 | + condition = condition.and("diaStatus", diaStatus, MongoOper.IS); | |
60 | + } | |
61 | + return condition.toMongoQuery(); | |
22 | 62 | } |
23 | 63 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/DiagnosisFacaed.java
View file @
58a53ab
... | ... | @@ -2,22 +2,18 @@ |
2 | 2 | |
3 | 3 | import com.lyms.platform.biz.service.*; |
4 | 4 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
5 | +import com.lyms.platform.common.enums.OptActionEnums; | |
5 | 6 | import com.lyms.platform.common.enums.YnEnums; |
6 | 7 | import com.lyms.platform.common.result.BaseObjectResponse; |
7 | 8 | import com.lyms.platform.common.result.BaseResponse; |
8 | 9 | import com.lyms.platform.common.utils.DateUtil; |
9 | 10 | import com.lyms.platform.common.utils.JsonUtil; |
11 | +import com.lyms.platform.operate.web.request.DiagnosisAddRequest; | |
10 | 12 | import com.lyms.platform.operate.web.result.DiagnosisResult; |
11 | 13 | import com.lyms.platform.operate.web.result.HighScoreResult; |
12 | 14 | import com.lyms.platform.permission.model.PatientService; |
13 | -import com.lyms.platform.pojo.AntExChuModel; | |
14 | -import com.lyms.platform.pojo.Patients; | |
15 | -import com.lyms.platform.pojo.SieveApplyOrderModel; | |
16 | -import com.lyms.platform.pojo.SieveModel; | |
17 | -import com.lyms.platform.query.AntExChuQuery; | |
18 | -import com.lyms.platform.query.PatientsQuery; | |
19 | -import com.lyms.platform.query.SieveApplyOrderQuery; | |
20 | -import com.lyms.platform.query.SieveQuery; | |
15 | +import com.lyms.platform.pojo.*; | |
16 | +import com.lyms.platform.query.*; | |
21 | 17 | import org.apache.commons.collections.CollectionUtils; |
22 | 18 | import org.apache.commons.lang.StringUtils; |
23 | 19 | import org.springframework.beans.factory.annotation.Autowired; |
... | ... | @@ -49,6 +45,8 @@ |
49 | 45 | private SieveService sieveService; |
50 | 46 | @Autowired |
51 | 47 | private AntenatalExaminationService antenatalExaminationService; |
48 | + @Autowired | |
49 | + private OperateLogFacade operateLogFacade; | |
52 | 50 | |
53 | 51 | |
54 | 52 | /** |
... | ... | @@ -152,6 +150,40 @@ |
152 | 150 | return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(diagnosisResult); |
153 | 151 | } |
154 | 152 | |
153 | + | |
154 | + /** | |
155 | + * 修改或者新增产前诊断申请记录 | |
156 | + * @param dataresult | |
157 | + * @param userId | |
158 | + * @return | |
159 | + */ | |
160 | + public BaseResponse addOrUpdateDiagnosis(DiagnosisAddRequest dataresult,Integer userId){ | |
161 | + DiagnosisModel DiagnosisModel = dataresult.convertToDataModel(); | |
162 | + String hospital = autoMatchFacade.getHospitalId(userId); | |
163 | + if(StringUtils.isNotEmpty(DiagnosisModel.getId())){//更新数据 | |
164 | + DiagnosisQuery diagnosisQuery = new DiagnosisQuery(); | |
165 | + diagnosisQuery.setParentId(DiagnosisModel.getId()); | |
166 | + List<DiagnosisModel> list = diagnosisService.queryDiagnosis(diagnosisQuery); | |
167 | + //更新数据 | |
168 | + diagnosisService.updateDiagnosisById(DiagnosisModel,DiagnosisModel.getId()); | |
169 | + //添加记录 | |
170 | + operateLogFacade.addModifyOptLog(userId, Integer.parseInt(hospital), list.get(0), DiagnosisModel, OptActionEnums.UPDATE.getId(), "产前诊断申请修改完成"); | |
171 | + BaseObjectResponse objectResponse = new BaseObjectResponse(); | |
172 | + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
173 | + objectResponse.setData(DiagnosisModel.getId()); | |
174 | + objectResponse.setErrormsg("成功"); | |
175 | + return objectResponse; | |
176 | + }else{//新增数据 | |
177 | + DiagnosisModel.setDiaStatus("1");//已申请 | |
178 | + diagnosisService.addDiagnosis(DiagnosisModel);//插入数据 | |
179 | + BaseObjectResponse objectResponse = new BaseObjectResponse(); | |
180 | + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
181 | + objectResponse.setData(DiagnosisModel.getId()); | |
182 | + objectResponse.setErrormsg("成功"); | |
183 | + return objectResponse; | |
184 | + } | |
185 | + | |
186 | + } | |
155 | 187 | |
156 | 188 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/DiagnosisAddRequest.java
View file @
58a53ab
1 | 1 | package com.lyms.platform.operate.web.request; |
2 | 2 | |
3 | +import com.lyms.platform.common.base.IBasicRequestConvert; | |
4 | +import com.lyms.platform.common.utils.DateUtil; | |
5 | +import com.lyms.platform.pojo.DiagnosisModel; | |
6 | + | |
7 | +import java.util.Date; | |
8 | + | |
3 | 9 | /** |
4 | 10 | * 产前诊断申请请求 |
5 | 11 | * Created by Administrator on 2018/9/14. |
6 | 12 | */ |
7 | -public class DiagnosisAddRequest { | |
13 | +public class DiagnosisAddRequest implements IBasicRequestConvert<DiagnosisModel> { | |
8 | 14 | |
15 | + // 是否分页 | |
16 | + private String need; | |
17 | + // 当前页起始行数 | |
18 | + private Integer offset = 0; | |
19 | + // 页面行数 | |
20 | + private Integer limit = 15; | |
21 | + // 当前页 | |
22 | + private int page = 1; | |
23 | + //产前诊断主键ID | |
24 | + private String id; | |
25 | + //孕妇ID | |
26 | + private String parentId; | |
27 | + //孕妇姓名 | |
28 | + private String name; | |
29 | + //身份证号 | |
30 | + private String cardNo; | |
31 | + //联系方式 | |
32 | + private String phone; | |
33 | + //年龄 | |
34 | + private String age; | |
35 | + //孕周 | |
36 | + private String dueWeek; | |
37 | + //预产期 | |
38 | + private String yChanQi; | |
39 | + //诊断项目(1,羊水穿刺;2,绒毛穿刺;3,脐带血检测) | |
40 | + private String diaProject; | |
41 | + //出生日期 | |
42 | + private String birth; | |
43 | + //体重 | |
44 | + private String weight; | |
45 | + //末次月经 | |
46 | + private String lastMenses; | |
47 | + //月经周期开始天数 | |
48 | + private String mensStartDay; | |
49 | + //月经周期结束天数 | |
50 | + private String mensEndDay; | |
51 | + //月经停留开始天数 | |
52 | + private String mensStopStartDay; | |
53 | + //月经停留结束天数 | |
54 | + private String mensStopEndDay; | |
55 | + //标本号 | |
56 | + private String specimenNo; | |
57 | + //采集医生 | |
58 | + private String collectDocterId; | |
59 | + //采集时间 | |
60 | + private String collectDate; | |
61 | + //送检医生 | |
62 | + private String sendDocterId; | |
63 | + //送检日期 | |
64 | + private String sendDate; | |
65 | + //申请医院 | |
66 | + private String collectHospitalId; | |
67 | + //医院ID | |
68 | + private String hospitalId; | |
9 | 69 | |
70 | + public String getNeed() { | |
71 | + return need; | |
72 | + } | |
10 | 73 | |
74 | + public void setNeed(String need) { | |
75 | + this.need = need; | |
76 | + } | |
77 | + | |
78 | + public Integer getOffset() { | |
79 | + return offset; | |
80 | + } | |
81 | + | |
82 | + public void setOffset(Integer offset) { | |
83 | + this.offset = offset; | |
84 | + } | |
85 | + | |
86 | + public Integer getLimit() { | |
87 | + return limit; | |
88 | + } | |
89 | + | |
90 | + public void setLimit(Integer limit) { | |
91 | + this.limit = limit; | |
92 | + } | |
93 | + | |
94 | + public int getPage() { | |
95 | + return page; | |
96 | + } | |
97 | + | |
98 | + public void setPage(int page) { | |
99 | + this.page = page; | |
100 | + } | |
101 | + | |
102 | + public String getId() { | |
103 | + return id; | |
104 | + } | |
105 | + | |
106 | + public void setId(String id) { | |
107 | + this.id = id; | |
108 | + } | |
109 | + | |
110 | + public String getParentId() { | |
111 | + return parentId; | |
112 | + } | |
113 | + | |
114 | + public void setParentId(String parentId) { | |
115 | + this.parentId = parentId; | |
116 | + } | |
117 | + | |
118 | + public String getName() { | |
119 | + return name; | |
120 | + } | |
121 | + | |
122 | + public void setName(String name) { | |
123 | + this.name = name; | |
124 | + } | |
125 | + | |
126 | + public String getCardNo() { | |
127 | + return cardNo; | |
128 | + } | |
129 | + | |
130 | + public void setCardNo(String cardNo) { | |
131 | + this.cardNo = cardNo; | |
132 | + } | |
133 | + | |
134 | + public String getPhone() { | |
135 | + return phone; | |
136 | + } | |
137 | + | |
138 | + public void setPhone(String phone) { | |
139 | + this.phone = phone; | |
140 | + } | |
141 | + | |
142 | + public String getAge() { | |
143 | + return age; | |
144 | + } | |
145 | + | |
146 | + public void setAge(String age) { | |
147 | + this.age = age; | |
148 | + } | |
149 | + | |
150 | + public String getDueWeek() { | |
151 | + return dueWeek; | |
152 | + } | |
153 | + | |
154 | + public void setDueWeek(String dueWeek) { | |
155 | + this.dueWeek = dueWeek; | |
156 | + } | |
157 | + | |
158 | + public String getyChanQi() { | |
159 | + return yChanQi; | |
160 | + } | |
161 | + | |
162 | + public void setyChanQi(String yChanQi) { | |
163 | + this.yChanQi = yChanQi; | |
164 | + } | |
165 | + | |
166 | + public String getDiaProject() { | |
167 | + return diaProject; | |
168 | + } | |
169 | + | |
170 | + public void setDiaProject(String diaProject) { | |
171 | + this.diaProject = diaProject; | |
172 | + } | |
173 | + | |
174 | + public String getBirth() { | |
175 | + return birth; | |
176 | + } | |
177 | + | |
178 | + public void setBirth(String birth) { | |
179 | + this.birth = birth; | |
180 | + } | |
181 | + | |
182 | + public String getWeight() { | |
183 | + return weight; | |
184 | + } | |
185 | + | |
186 | + public void setWeight(String weight) { | |
187 | + this.weight = weight; | |
188 | + } | |
189 | + | |
190 | + public String getLastMenses() { | |
191 | + return lastMenses; | |
192 | + } | |
193 | + | |
194 | + public void setLastMenses(String lastMenses) { | |
195 | + this.lastMenses = lastMenses; | |
196 | + } | |
197 | + | |
198 | + public String getMensStartDay() { | |
199 | + return mensStartDay; | |
200 | + } | |
201 | + | |
202 | + public void setMensStartDay(String mensStartDay) { | |
203 | + this.mensStartDay = mensStartDay; | |
204 | + } | |
205 | + | |
206 | + public String getMensEndDay() { | |
207 | + return mensEndDay; | |
208 | + } | |
209 | + | |
210 | + public void setMensEndDay(String mensEndDay) { | |
211 | + this.mensEndDay = mensEndDay; | |
212 | + } | |
213 | + | |
214 | + public String getMensStopStartDay() { | |
215 | + return mensStopStartDay; | |
216 | + } | |
217 | + | |
218 | + public void setMensStopStartDay(String mensStopStartDay) { | |
219 | + this.mensStopStartDay = mensStopStartDay; | |
220 | + } | |
221 | + | |
222 | + public String getMensStopEndDay() { | |
223 | + return mensStopEndDay; | |
224 | + } | |
225 | + | |
226 | + public void setMensStopEndDay(String mensStopEndDay) { | |
227 | + this.mensStopEndDay = mensStopEndDay; | |
228 | + } | |
229 | + | |
230 | + public String getSpecimenNo() { | |
231 | + return specimenNo; | |
232 | + } | |
233 | + | |
234 | + public void setSpecimenNo(String specimenNo) { | |
235 | + this.specimenNo = specimenNo; | |
236 | + } | |
237 | + | |
238 | + public String getCollectDocterId() { | |
239 | + return collectDocterId; | |
240 | + } | |
241 | + | |
242 | + public void setCollectDocterId(String collectDocterId) { | |
243 | + this.collectDocterId = collectDocterId; | |
244 | + } | |
245 | + | |
246 | + public String getCollectDate() { | |
247 | + return collectDate; | |
248 | + } | |
249 | + | |
250 | + public void setCollectDate(String collectDate) { | |
251 | + this.collectDate = collectDate; | |
252 | + } | |
253 | + | |
254 | + public String getSendDocterId() { | |
255 | + return sendDocterId; | |
256 | + } | |
257 | + | |
258 | + public void setSendDocterId(String sendDocterId) { | |
259 | + this.sendDocterId = sendDocterId; | |
260 | + } | |
261 | + | |
262 | + public String getSendDate() { | |
263 | + return sendDate; | |
264 | + } | |
265 | + | |
266 | + public void setSendDate(String sendDate) { | |
267 | + this.sendDate = sendDate; | |
268 | + } | |
269 | + | |
270 | + public String getCollectHospitalId() { | |
271 | + return collectHospitalId; | |
272 | + } | |
273 | + | |
274 | + public void setCollectHospitalId(String collectHospitalId) { | |
275 | + this.collectHospitalId = collectHospitalId; | |
276 | + } | |
277 | + | |
278 | + public String getHospitalId() { | |
279 | + return hospitalId; | |
280 | + } | |
281 | + | |
282 | + public void setHospitalId(String hospitalId) { | |
283 | + this.hospitalId = hospitalId; | |
284 | + } | |
285 | + | |
286 | + @Override | |
287 | + public DiagnosisModel convertToDataModel(){ | |
288 | + DiagnosisModel diagnosisModel = new DiagnosisModel(); | |
289 | + diagnosisModel.setId(id); | |
290 | + diagnosisModel.setHospitalId(hospitalId); | |
291 | + diagnosisModel.setParentId(parentId); | |
292 | + diagnosisModel.setName(name); | |
293 | + diagnosisModel.setIdCard(cardNo); | |
294 | + diagnosisModel.setAge(age); | |
295 | + diagnosisModel.setDueWeek(dueWeek); | |
296 | + diagnosisModel.setyChanQi(DateUtil.parseYMD(yChanQi)); | |
297 | + diagnosisModel.setPhone(phone); | |
298 | + diagnosisModel.setDiaProject(diaProject); | |
299 | + diagnosisModel.setBirth(DateUtil.paseYMDH(birth)); | |
300 | + diagnosisModel.setWeight(weight); | |
301 | + diagnosisModel.setLastMenses(DateUtil.parseYMD(lastMenses)); | |
302 | + diagnosisModel.setMensStartDay(mensStartDay); | |
303 | + diagnosisModel.setMensEndDay(mensEndDay); | |
304 | + diagnosisModel.setMensStopStartDay(mensStopStartDay); | |
305 | + diagnosisModel.setMensStopEndDay(mensStopEndDay); | |
306 | + diagnosisModel.setSpecimenNo(specimenNo); | |
307 | + diagnosisModel.setCollectDocterId(collectDocterId); | |
308 | + diagnosisModel.setCollectDate(DateUtil.parseYMD(collectDate)); | |
309 | + diagnosisModel.setSendDocterId(sendDocterId); | |
310 | + diagnosisModel.setSendDate(DateUtil.parseYMD(sendDate)); | |
311 | + diagnosisModel.setCollectHospitalId(collectHospitalId); | |
312 | + diagnosisModel.setCreated(new Date()); | |
313 | + | |
314 | + return diagnosisModel; | |
315 | + } | |
11 | 316 | } |