Commit 54151130f3ee466780f2ec44f3c0a650f2286dea
1 parent
5f6b95c5fa
Exists in
master
and in
8 other branches
产妇增加字段
Showing 3 changed files with 204 additions and 33 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PuerperaManageController.java
View file @
5415113
... | ... | @@ -84,7 +84,7 @@ |
84 | 84 | @RequestMapping(value = "/hPuer", method = RequestMethod.GET) |
85 | 85 | @ResponseBody |
86 | 86 | public BaseResponse queryHighRiskPuerpera(@Valid RiskPatientsQueryRequest patientsQueryRequest) { |
87 | - return patientFacade.queryHighRisk(patientsQueryRequest,Boolean.TRUE); | |
87 | + return patientFacade.queryHighRisk(patientsQueryRequest, Boolean.TRUE,1); | |
88 | 88 | } |
89 | 89 | /** |
90 | 90 | *全部孕妇管理 |
... | ... | @@ -95,7 +95,15 @@ |
95 | 95 | @RequestMapping(value = "/aPuer", method = RequestMethod.GET) |
96 | 96 | @ResponseBody |
97 | 97 | public BaseResponse queryAllPuerpera(@Valid RiskPatientsQueryRequest patientsQueryRequest) { |
98 | - return patientFacade.queryHighRisk(patientsQueryRequest,null); | |
98 | + return patientFacade.queryHighRisk(patientsQueryRequest,null,1); | |
99 | + } | |
100 | + | |
101 | + /** | |
102 | + * | |
103 | + * @return | |
104 | + */ | |
105 | + public BaseResponse queryAllPatients(@Valid RiskPatientsQueryRequest patientsQueryRequest){ | |
106 | + return patientFacade.queryHighRisk(patientsQueryRequest,null,3); | |
99 | 107 | } |
100 | 108 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
View file @
5415113
... | ... | @@ -13,6 +13,7 @@ |
13 | 13 | import com.lyms.platform.operate.web.request.PuerperaMatcherCommunityRequest; |
14 | 14 | import com.lyms.platform.operate.web.request.RiskPatientsQueryRequest; |
15 | 15 | import com.lyms.platform.operate.web.result.PuerperaResult; |
16 | +import com.lyms.platform.operate.web.result.QuanChanResult; | |
16 | 17 | import com.lyms.platform.operate.web.result.QuanPatientsResult; |
17 | 18 | import com.lyms.platform.operate.web.result.RiskPatientsResult; |
18 | 19 | import com.lyms.platform.operate.web.utils.CommonsHelper; |
19 | 20 | |
20 | 21 | |
... | ... | @@ -186,14 +187,16 @@ |
186 | 187 | * 查询高危孕妇 |
187 | 188 | * |
188 | 189 | * @param riskPatientsQueryRequest |
190 | + * @param isHighRisk 控制是否是高危 | |
191 | + * @param type 控制类型 1孕妇 3产妇 | |
189 | 192 | * @return |
190 | 193 | */ |
191 | - public BaseResponse queryHighRisk(RiskPatientsQueryRequest riskPatientsQueryRequest,Boolean isHighRisk) { | |
194 | + public BaseResponse queryHighRisk(RiskPatientsQueryRequest riskPatientsQueryRequest, Boolean isHighRisk, int type) { | |
192 | 195 | PatientsQuery patientsQuery = new PatientsQuery(); |
193 | 196 | patientsQuery.setPhone(riskPatientsQueryRequest.getPhone()); |
194 | 197 | patientsQuery.setCardNo(riskPatientsQueryRequest.getCardNo()); |
195 | 198 | //设置为孕妇 |
196 | - patientsQuery.setType(1); | |
199 | + patientsQuery.setType(type); | |
197 | 200 | patientsQuery.setName(riskPatientsQueryRequest.getName()); |
198 | 201 | patientsQuery.sethScore(riskPatientsQueryRequest.gethScore()); |
199 | 202 | patientsQuery.setrFactor(riskPatientsQueryRequest.getrFactor()); |
200 | 203 | |
201 | 204 | |
... | ... | @@ -206,39 +209,79 @@ |
206 | 209 | List<Patients> patientses = patientsService.queryPatient(patientsQuery); |
207 | 210 | List data = new ArrayList<>(); |
208 | 211 | if (CollectionUtils.isNotEmpty(patientses)) { |
209 | - AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
210 | - AntExQuery antExQuery = new AntExQuery(); | |
211 | 212 | //如果是查高危孕妇 |
212 | - if(null!=isHighRisk&&Boolean.TRUE.equals(isHighRisk)){ | |
213 | - for (Patients patients : patientses) { | |
214 | - RiskPatientsResult riskPatientsResult = new RiskPatientsResult(); | |
215 | - riskPatientsResult.convertToResult(patients); | |
216 | - //复诊次数 | |
217 | - int i = antExService.queryAntenatalExaminationCount(antExQuery.convertToQuery()); | |
218 | - antExChuQuery.setParentId(patients.getId()); | |
219 | - antExChuQuery.setYn(YnEnums.YES.getId()); | |
220 | - //初诊次数 | |
221 | - int b = antExService.queryAntExChuCount(antExChuQuery.convertToQuery()); | |
222 | - riskPatientsResult.setcTimes(i + b); | |
223 | - data.add(riskPatientsResult); | |
224 | - } | |
225 | - }else{ | |
226 | - //处理全部产妇的情况 | |
227 | - for (Patients patients : patientses) { | |
228 | - QuanPatientsResult quanPatientsResult = new QuanPatientsResult(); | |
229 | - quanPatientsResult.convertToResult(patients); | |
230 | - //复诊次数 | |
231 | - int i = antExService.queryAntenatalExaminationCount(antExQuery.convertToQuery()); | |
232 | - antExChuQuery.setParentId(patients.getId()); | |
233 | - antExChuQuery.setYn(YnEnums.YES.getId()); | |
234 | - //初诊次数 | |
235 | - int b = antExService.queryAntExChuCount(antExChuQuery.convertToQuery()); | |
236 | - quanPatientsResult.setcTimes(i + b); | |
237 | - data.add(quanPatientsResult); | |
238 | - } | |
213 | + if (null != isHighRisk && Boolean.TRUE.equals(isHighRisk)) { | |
214 | + data = convertToHighRisk(patientses); | |
215 | + } else if (type == 1) { | |
216 | + //处理全部孕妇的情况 | |
217 | + data = convertToQuanPatient(patientses); | |
218 | + //处理全部产妇 | |
219 | + } else if (type == 3) { | |
220 | + data=convertToQuanCPatient(patientses); | |
239 | 221 | } |
240 | 222 | } |
241 | 223 | return new BaseObjectResponse().setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS).setData(data); |
224 | + } | |
225 | + | |
226 | + /** | |
227 | + * 转成全部产妇的返回数据 | |
228 | + * | |
229 | + * @param patientses 符合条件的产妇 | |
230 | + * @return | |
231 | + */ | |
232 | + private List convertToQuanCPatient(List<Patients> patientses){ | |
233 | + List data = new ArrayList<>(); | |
234 | + for (Patients patients : patientses) { | |
235 | + QuanChanResult chanResult =new QuanChanResult(); | |
236 | + chanResult.convertToResult(patients); | |
237 | + data.add(chanResult); | |
238 | + } | |
239 | + return data; | |
240 | + } | |
241 | + | |
242 | + | |
243 | + private List convertToQuanPatient(List<Patients> patientses) { | |
244 | + AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
245 | + AntExQuery antExQuery = new AntExQuery(); | |
246 | + List data = new ArrayList<>(); | |
247 | + for (Patients patients : patientses) { | |
248 | + QuanPatientsResult quanPatientsResult = new QuanPatientsResult(); | |
249 | + quanPatientsResult.convertToResult(patients); | |
250 | + //复诊次数 | |
251 | + int i = antExService.queryAntenatalExaminationCount(antExQuery.convertToQuery()); | |
252 | + antExChuQuery.setParentId(patients.getId()); | |
253 | + antExChuQuery.setYn(YnEnums.YES.getId()); | |
254 | + //初诊次数 | |
255 | + int b = antExService.queryAntExChuCount(antExChuQuery.convertToQuery()); | |
256 | + quanPatientsResult.setcTimes(i + b); | |
257 | + data.add(quanPatientsResult); | |
258 | + } | |
259 | + return data; | |
260 | + } | |
261 | + | |
262 | + /** | |
263 | + * 转换成高危产妇的返回对象 | |
264 | + * | |
265 | + * @param patientses | |
266 | + * @return | |
267 | + */ | |
268 | + private List convertToHighRisk(List<Patients> patientses) { | |
269 | + AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
270 | + AntExQuery antExQuery = new AntExQuery(); | |
271 | + List data = new ArrayList<>(); | |
272 | + for (Patients patients : patientses) { | |
273 | + RiskPatientsResult riskPatientsResult = new RiskPatientsResult(); | |
274 | + riskPatientsResult.convertToResult(patients); | |
275 | + //复诊次数 | |
276 | + int i = antExService.queryAntenatalExaminationCount(antExQuery.convertToQuery()); | |
277 | + antExChuQuery.setParentId(patients.getId()); | |
278 | + antExChuQuery.setYn(YnEnums.YES.getId()); | |
279 | + //初诊次数 | |
280 | + int b = antExService.queryAntExChuCount(antExChuQuery.convertToQuery()); | |
281 | + riskPatientsResult.setcTimes(i + b); | |
282 | + data.add(riskPatientsResult); | |
283 | + } | |
284 | + return data; | |
242 | 285 | } |
243 | 286 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/QuanChanResult.java
View file @
5415113
1 | +package com.lyms.platform.operate.web.result; | |
2 | + | |
3 | +import com.lyms.platform.common.base.IBasicResultConvert; | |
4 | +import com.lyms.platform.common.utils.DateUtil; | |
5 | +import com.lyms.platform.pojo.Patients; | |
6 | + | |
7 | +import java.util.Date; | |
8 | + | |
9 | +/** | |
10 | + * Created by Administrator on 2016/6/23 0023. | |
11 | + */ | |
12 | +public class QuanChanResult implements IBasicResultConvert<QuanChanResult, Patients> { | |
13 | + private String id; | |
14 | + //名称 | |
15 | + private String name; | |
16 | + //年龄 | |
17 | + private Integer age; | |
18 | + //分娩日期 | |
19 | + private String dueWeek; | |
20 | + //产后时间 | |
21 | + private String cTime; | |
22 | + //产检次数 | |
23 | + private int cTimes; | |
24 | + | |
25 | + //产检医生 | |
26 | + private String checkDoctor; | |
27 | + //登记人 | |
28 | + private String lName; | |
29 | + | |
30 | + //联系方式 | |
31 | + private String phone; | |
32 | + | |
33 | + public Integer getAge() { | |
34 | + return age; | |
35 | + } | |
36 | + | |
37 | + public void setAge(Integer age) { | |
38 | + this.age = age; | |
39 | + } | |
40 | + | |
41 | + public String getCheckDoctor() { | |
42 | + return checkDoctor; | |
43 | + } | |
44 | + | |
45 | + public void setCheckDoctor(String checkDoctor) { | |
46 | + this.checkDoctor = checkDoctor; | |
47 | + } | |
48 | + | |
49 | + public String getcTime() { | |
50 | + return cTime; | |
51 | + } | |
52 | + | |
53 | + public void setcTime(String cTime) { | |
54 | + this.cTime = cTime; | |
55 | + } | |
56 | + | |
57 | + public int getcTimes() { | |
58 | + return cTimes; | |
59 | + } | |
60 | + | |
61 | + public void setcTimes(int cTimes) { | |
62 | + this.cTimes = cTimes; | |
63 | + } | |
64 | + | |
65 | + | |
66 | + public String getDueWeek() { | |
67 | + return dueWeek; | |
68 | + } | |
69 | + | |
70 | + public void setDueWeek(String dueWeek) { | |
71 | + this.dueWeek = dueWeek; | |
72 | + } | |
73 | + | |
74 | + public String getId() { | |
75 | + return id; | |
76 | + } | |
77 | + | |
78 | + public void setId(String id) { | |
79 | + this.id = id; | |
80 | + } | |
81 | + | |
82 | + public String getlName() { | |
83 | + return lName; | |
84 | + } | |
85 | + | |
86 | + public void setlName(String lName) { | |
87 | + this.lName = lName; | |
88 | + } | |
89 | + | |
90 | + public String getName() { | |
91 | + return name; | |
92 | + } | |
93 | + | |
94 | + public void setName(String name) { | |
95 | + this.name = name; | |
96 | + } | |
97 | + | |
98 | + public String getPhone() { | |
99 | + return phone; | |
100 | + } | |
101 | + | |
102 | + public void setPhone(String phone) { | |
103 | + this.phone = phone; | |
104 | + } | |
105 | + | |
106 | + @Override | |
107 | + public QuanChanResult convertToResult(Patients destModel) { | |
108 | + setId(destModel.getId()); | |
109 | + setAge(destModel.getAge()); | |
110 | + setCheckDoctor(destModel.getLastReportDoctorName()); | |
111 | + setName(destModel.getUsername()); | |
112 | + setPhone(destModel.getPhone()); | |
113 | + if (null != destModel.getFmDate()) { | |
114 | + setDueWeek(DateUtil.getyyyy_MM_dd(destModel.getFmDate())); | |
115 | + setcTime(DateUtil.daysBetween(destModel.getFmDate(),new Date())+"天"); | |
116 | + } | |
117 | + setcTimes(33); | |
118 | + return this; | |
119 | + } | |
120 | +} |