Commit 46764993b20a6e1c41e22f24b60fe2c52f2f611d
1 parent
d54241d1cd
Exists in
master
and in
6 other branches
查询号bug修改
Showing 5 changed files with 420 additions and 65 deletions
- platform-common/src/main/java/com/lyms/platform/common/result/BaseObjectResponse.java
- platform-dal/src/main/java/com/lyms/platform/query/AntExChuQuery.java
- platform-dal/src/main/java/com/lyms/platform/query/AntExQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntexDoctorStatistController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AntextDoctorPatient.java
platform-common/src/main/java/com/lyms/platform/common/result/BaseObjectResponse.java
View file @
4676499
1 | 1 | package com.lyms.platform.common.result; |
2 | 2 | |
3 | +import com.lyms.platform.common.base.PageInfo; | |
4 | + | |
3 | 5 | public class BaseObjectResponse extends BaseResponse { |
4 | 6 | |
5 | 7 | /** |
... | ... | @@ -8,6 +10,16 @@ |
8 | 10 | private static final long serialVersionUID = 1L; |
9 | 11 | |
10 | 12 | private Object data; |
13 | + | |
14 | + private PageInfo pageInfo; | |
15 | + | |
16 | + public PageInfo getPageInfo() { | |
17 | + return pageInfo; | |
18 | + } | |
19 | + | |
20 | + public void setPageInfo(PageInfo pageInfo) { | |
21 | + this.pageInfo = pageInfo; | |
22 | + } | |
11 | 23 | |
12 | 24 | public Object getData() { |
13 | 25 | return data; |
platform-dal/src/main/java/com/lyms/platform/query/AntExChuQuery.java
View file @
4676499
... | ... | @@ -33,7 +33,16 @@ |
33 | 33 | private String pid; |
34 | 34 | private Date checkTimeStart; |
35 | 35 | private Date checkTimeEnd; |
36 | + private String checkDoctor; | |
36 | 37 | |
38 | + public String getCheckDoctor() { | |
39 | + return checkDoctor; | |
40 | + } | |
41 | + | |
42 | + public void setCheckDoctor(String checkDoctor) { | |
43 | + this.checkDoctor = checkDoctor; | |
44 | + } | |
45 | + | |
37 | 46 | public List<String> getParentIds() { |
38 | 47 | return parentIds; |
39 | 48 | } |
... | ... | @@ -167,6 +176,9 @@ |
167 | 176 | |
168 | 177 | if (null != hospitalId) { |
169 | 178 | condition = condition.and("hospitalId", hospitalId, MongoOper.IS); |
179 | + } | |
180 | + if (null != checkDoctor) { | |
181 | + condition = condition.and("prodDoctor", checkDoctor, MongoOper.IS); | |
170 | 182 | } |
171 | 183 | if (null != pid) { |
172 | 184 | condition = condition.and("pid", pid, MongoOper.IS); |
platform-dal/src/main/java/com/lyms/platform/query/AntExQuery.java
View file @
4676499
... | ... | @@ -30,12 +30,21 @@ |
30 | 30 | private boolean neStart; |
31 | 31 | |
32 | 32 | private boolean neEnd; |
33 | + private String checkDoctor; | |
33 | 34 | |
34 | 35 | //大于修改时间 |
35 | 36 | private Date gteModified; |
36 | 37 | |
37 | 38 | private Date gteCreated; |
38 | 39 | |
40 | + public String getCheckDoctor() { | |
41 | + return checkDoctor; | |
42 | + } | |
43 | + | |
44 | + public void setCheckDoctor(String checkDoctor) { | |
45 | + this.checkDoctor = checkDoctor; | |
46 | + } | |
47 | + | |
39 | 48 | public List<String> getParentIds() { |
40 | 49 | return parentIds; |
41 | 50 | } |
... | ... | @@ -128,6 +137,9 @@ |
128 | 137 | } |
129 | 138 | if(null!=id){ |
130 | 139 | condition= condition.and("id",id, MongoOper.IS); |
140 | + } | |
141 | + if(null!=checkDoctor){ | |
142 | + condition= condition.and("checkDoctor",checkDoctor, MongoOper.IS); | |
131 | 143 | } |
132 | 144 | |
133 | 145 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntexDoctorStatistController.java
View file @
4676499
... | ... | @@ -2,12 +2,16 @@ |
2 | 2 | |
3 | 3 | import com.lyms.hospitalapi.pojo.ReportModel; |
4 | 4 | import com.lyms.platform.biz.service.AntenatalExaminationService; |
5 | +import com.lyms.platform.biz.service.BasicConfigService; | |
6 | +import com.lyms.platform.biz.service.CommonService; | |
5 | 7 | import com.lyms.platform.biz.service.YunBookbuildingService; |
6 | 8 | import com.lyms.platform.common.annotation.TokenRequired; |
7 | 9 | import com.lyms.platform.common.base.BaseController; |
8 | 10 | import com.lyms.platform.common.base.LoginContext; |
11 | +import com.lyms.platform.common.base.PageInfo; | |
9 | 12 | import com.lyms.platform.common.result.BaseObjectResponse; |
10 | 13 | import com.lyms.platform.common.utils.BeanUtils; |
14 | +import com.lyms.platform.common.utils.DateUtil; | |
11 | 15 | import com.lyms.platform.operate.web.facade.AutoMatchFacade; |
12 | 16 | import com.lyms.platform.operate.web.result.AntextDoctorPatient; |
13 | 17 | import com.lyms.platform.operate.web.result.AntextDoctorResult; |
... | ... | @@ -19,6 +23,7 @@ |
19 | 23 | import com.lyms.platform.query.AntExChuQuery; |
20 | 24 | import com.lyms.platform.query.AntExQuery; |
21 | 25 | import com.lyms.platform.query.PatientsQuery; |
26 | +import org.apache.commons.collections.CollectionUtils; | |
22 | 27 | import org.apache.commons.collections.map.HashedMap; |
23 | 28 | import org.apache.commons.lang.StringUtils; |
24 | 29 | import org.springframework.beans.factory.annotation.Autowired; |
25 | 30 | |
26 | 31 | |
27 | 32 | |
28 | 33 | |
29 | 34 | |
30 | 35 | |
31 | 36 | |
32 | 37 | |
33 | 38 | |
34 | 39 | |
35 | 40 | |
36 | 41 | |
37 | 42 | |
38 | 43 | |
39 | 44 | |
40 | 45 | |
... | ... | @@ -47,56 +52,202 @@ |
47 | 52 | private YunBookbuildingService yunBookbuildingService; |
48 | 53 | @Autowired |
49 | 54 | private UsersService usersService; |
55 | + @Autowired | |
56 | + private BasicConfigService basicConfigService; | |
57 | + @Autowired | |
58 | + private CommonService commonService; | |
50 | 59 | |
60 | + | |
51 | 61 | /** |
52 | - * 产检医生统计 | |
62 | + * 产检医生统计详情 | |
53 | 63 | * |
54 | - * @param startDate 建档开始时间 | |
55 | - * @param endDate 建档结束时间 | |
56 | - * @param childBirth 统计范围 1=孕妇 3=产妇 不传=全部 | |
64 | + * @param startDate 建档开始时间 | |
65 | + * @param endDate 建档结束时间 | |
66 | + * @param childBirth 统计范围 1=孕妇 3=产妇 不传=全部 | |
67 | + * @param number 产检次数 点的是产检人数的话就传1, 2次(含)以上就传2, 5次(含)以上就传5 | |
68 | + * @param doctorId 医生ID | |
69 | + * @param currentPage 当前页 | |
70 | + * @param pageSize 每页显示的数量 | |
57 | 71 | * @return |
58 | 72 | */ |
59 | - @RequestMapping(method = RequestMethod.GET,value = "/getDoctorStatic") | |
73 | + @RequestMapping(method = RequestMethod.GET, value = "/doctorStatInfo") | |
60 | 74 | @ResponseBody |
61 | 75 | @TokenRequired |
62 | - public BaseObjectResponse getDoctorStatic(Date startDate,Date endDate,Integer childBirth ,HttpServletRequest request){ | |
63 | - BaseObjectResponse rest = new BaseObjectResponse(); | |
64 | - | |
76 | + public BaseObjectResponse doctorInfo(Date startDate, Date endDate, Integer childBirth, Integer number, String doctorId, | |
77 | + Integer currentPage, Integer pageSize, HttpServletRequest request) { | |
65 | 78 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
79 | + if(pageSize==null){ | |
80 | + pageSize = 20; | |
81 | + } | |
82 | + if(currentPage==null){ | |
83 | + currentPage = 1; | |
84 | + } | |
85 | + if(number == null){ | |
86 | + number=1; | |
87 | + } | |
88 | + | |
89 | + //获取患者信息 | |
90 | + List<AntextDoctorPatient> antextDoctorPatient = getPatientList(loginState.getId(), startDate, endDate, childBirth ,doctorId,number); | |
91 | + //结果数据集合 | |
92 | + Map<String, AntextDoctorPatient> resultInfo = new HashMap<>(); | |
93 | + | |
94 | + List<String> patientIds = new ArrayList<>(); | |
95 | + | |
96 | + for (AntextDoctorPatient adp : antextDoctorPatient) { | |
97 | + if (resultInfo.containsKey(adp.getpId())) {//存在 | |
98 | + AntextDoctorPatient antextDoctorPatient1 = resultInfo.get(adp.getpId()); | |
99 | + antextDoctorPatient1.setCjNum(antextDoctorPatient1.getCjNum() + 1); | |
100 | + if (StringUtils.isNotEmpty(adp.getRiskFactors())) {//高危风险不为空 | |
101 | + antextDoctorPatient1.setRiskFactors(adp.getRiskFactors()); | |
102 | + } | |
103 | + if (CollectionUtils.isNotEmpty(adp.getRiskLevelId())) { | |
104 | + antextDoctorPatient1.setRiskLevelId(adp.getRiskLevelId()); | |
105 | + } | |
106 | + if (StringUtils.isNotEmpty(adp.getcDueWeek())) { | |
107 | + antextDoctorPatient1.setcDueWeek(adp.getcDueWeek()); | |
108 | + } | |
109 | + if (adp.getDueFmDate() != null) { | |
110 | + antextDoctorPatient1.setDueFmDate(adp.getDueFmDate()); | |
111 | + } | |
112 | + } else {//不存在 | |
113 | + patientIds.add(adp.getpId()); | |
114 | + adp.setCjNum(1); | |
115 | + resultInfo.put(adp.getpId(), adp); | |
116 | + } | |
117 | + } | |
118 | + if(CollectionUtils.isNotEmpty(patientIds)){ | |
119 | + getAllPatientList(patientIds, resultInfo); | |
120 | + } | |
121 | + | |
122 | + | |
123 | + List<AntextDoctorPatient> antextDoctorPatients = new ArrayList<>(); | |
124 | + | |
125 | + for (Map.Entry<String, AntextDoctorPatient> adp : resultInfo.entrySet()) { | |
126 | + AntextDoctorPatient antextDoctorPatient1 = adp.getValue(); | |
127 | + if(number==2){//2次及以上 | |
128 | + if(antextDoctorPatient1.getCjNum()>1){ | |
129 | + antextDoctorPatients.add(adp.getValue()); | |
130 | + } | |
131 | + }else if(number==5){//5次及以上 | |
132 | + if(antextDoctorPatient1.getCjNum()>4){ | |
133 | + antextDoctorPatients.add(adp.getValue()); | |
134 | + } | |
135 | + }else { | |
136 | + antextDoctorPatients.add(adp.getValue()); | |
137 | + } | |
138 | + } | |
139 | + | |
140 | + PageInfo pageInfo = new PageInfo(); | |
141 | + pageInfo.setLimit(pageSize); | |
142 | + pageInfo.setPage(currentPage); | |
143 | + pageInfo.setCount(resultInfo.size()); | |
144 | + | |
145 | + int startIndex = pageSize*(currentPage-1); | |
146 | + | |
147 | + List<AntextDoctorPatient> resultData = new ArrayList<>(); | |
148 | + | |
149 | + if(CollectionUtils.isNotEmpty(antextDoctorPatients)&&antextDoctorPatients.size()>startIndex){ | |
150 | + int size = startIndex+pageSize; | |
151 | + if(antextDoctorPatients.size()<size){ | |
152 | + size = antextDoctorPatients.size(); | |
153 | + } | |
154 | + for(int i = startIndex;i<size;i++){ | |
155 | + resultData.add(antextDoctorPatients.get(i)); | |
156 | + } | |
157 | + } | |
158 | + BaseObjectResponse result = new BaseObjectResponse(); | |
159 | + result.setData(resultData); | |
160 | + result.setPageInfo(pageInfo); | |
161 | + return result; | |
162 | + } | |
163 | + | |
164 | + //获取患者全部检测数据 | |
165 | + public void getAllPatientList(List<String> patientId, Map<String, AntextDoctorPatient> resultInfo) { | |
166 | + //根据patientId集合查询产检表、产检复查表,获取医生id、patientId列表 | |
167 | + AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
168 | + //患者集合 | |
169 | + antExChuQuery.setParentIds(patientId); | |
170 | + antExChuQuery.setYn(1); | |
171 | + //初诊集合列表 | |
172 | + List<AntExChuModel> antExChuModels = antExService.queryAntExChu(antExChuQuery); | |
173 | + AntExQuery antExQuery = new AntExQuery(); | |
174 | + antExQuery.setParentIds(patientId); | |
175 | + antExQuery.setYn(1); | |
176 | + //复诊集合列表 | |
177 | + List<AntenatalExaminationModel> antenatalExaminationModels = antExService.queryAntenatalExamination(antExQuery.convertToQuery()); | |
178 | + | |
179 | + List<AntextDoctorPatient> antextDoctorPatient = new ArrayList<>(); | |
180 | + //添加初诊结果 | |
181 | + for (AntExChuModel ac : antExChuModels) { | |
182 | + AntextDoctorPatient doctorPatient = resultInfo.get(ac.getParentId()); | |
183 | + doctorPatient.setAllCjNum(doctorPatient.getAllCjNum() + 1); | |
184 | + | |
185 | + if (ac.getCheckTime().after(doctorPatient.getCheckTime())) { | |
186 | + doctorPatient.setCheckTime(ac.getCheckTime()); | |
187 | + doctorPatient.setCheckDoctor(ac.getProdDoctor()); | |
188 | + } | |
189 | + } | |
190 | + //添加复诊结果 | |
191 | + for (AntenatalExaminationModel aec : antenatalExaminationModels) { | |
192 | + AntextDoctorPatient doctorPatient = resultInfo.get(aec.getParentId()); | |
193 | + doctorPatient.setAllCjNum(doctorPatient.getAllCjNum() + 1); | |
194 | + if (aec.getCheckDate().after(doctorPatient.getCheckTime())) { | |
195 | + doctorPatient.setCheckTime(aec.getCheckDate()); | |
196 | + doctorPatient.setCheckDoctor(aec.getCheckDoctor()); | |
197 | + } | |
198 | + } | |
199 | + } | |
200 | + | |
201 | + | |
202 | + public List<AntextDoctorPatient> getPatientList(Integer userId, Date startDate, Date endDate, Integer childBirth,String doctorId,Integer number) { | |
203 | + | |
66 | 204 | //根据当前登录人获取医院id |
67 | - String hospital = autoMatchFacade.getHospitalId(loginState.getId()); | |
205 | + String hospital = autoMatchFacade.getHospitalId(userId); | |
68 | 206 | PatientsQuery patientsQuery = new PatientsQuery(); |
69 | 207 | //医院id |
70 | 208 | patientsQuery.setHospitalId(hospital); |
71 | - if(startDate!=null){ | |
209 | + if (startDate != null) { | |
72 | 210 | //建档开始时间 |
73 | 211 | patientsQuery.setBookbuildingDateStart(startDate); |
74 | 212 | } |
75 | - if(endDate!=null){ | |
213 | + if (endDate != null) { | |
76 | 214 | //建档结束时间 |
77 | 215 | patientsQuery.setBookbuildingDateEnd(endDate); |
78 | 216 | } |
79 | 217 | //有效 |
80 | 218 | patientsQuery.setYn(1); |
81 | - if(childBirth!=null){ | |
219 | + if (childBirth != null) { | |
82 | 220 | patientsQuery.setType(childBirth); |
83 | 221 | } |
84 | 222 | //获取患者集合 |
85 | 223 | List<Patients> patientss = yunBookbuildingService.queryPregnantWithQuery(patientsQuery); |
224 | + | |
225 | + if(CollectionUtils.isEmpty(patientss)){ | |
226 | + return new ArrayList<>(); | |
227 | + } | |
86 | 228 | //患者id |
87 | 229 | List<String> pIds = new ArrayList<>(); |
88 | - for(Patients ps : patientss){ | |
230 | + Map<String, Patients> patientsMap = new HashMap<>(); | |
231 | + for (Patients ps : patientss) { | |
89 | 232 | pIds.add(ps.getId()); |
233 | + patientsMap.put(ps.getId(), ps); | |
90 | 234 | } |
235 | + | |
91 | 236 | //根据patientId集合查询产检表、产检复查表,获取医生id、patientId列表 |
92 | 237 | AntExChuQuery antExChuQuery = new AntExChuQuery(); |
93 | 238 | //患者集合 |
94 | 239 | antExChuQuery.setParentIds(pIds); |
240 | + if(StringUtils.isNotEmpty(doctorId)){ | |
241 | + antExChuQuery.setCheckDoctor(doctorId); | |
242 | + } | |
95 | 243 | antExChuQuery.setYn(1); |
96 | 244 | antExChuQuery.setHospitalId(hospital); |
97 | 245 | //初诊集合列表 |
98 | 246 | List<AntExChuModel> antExChuModels = antExService.queryAntExChu(antExChuQuery); |
99 | 247 | AntExQuery antExQuery = new AntExQuery(); |
248 | + if(StringUtils.isNotEmpty(doctorId)){ | |
249 | + antExQuery.setCheckDoctor(doctorId); | |
250 | + } | |
100 | 251 | antExQuery.setHospitalId(hospital); |
101 | 252 | antExQuery.setParentIds(pIds); |
102 | 253 | antExQuery.setYn(1); |
103 | 254 | |
104 | 255 | |
105 | 256 | |
106 | 257 | |
107 | 258 | |
... | ... | @@ -104,21 +255,79 @@ |
104 | 255 | List<AntenatalExaminationModel> antenatalExaminationModels = antExService.queryAntenatalExamination(antExQuery.convertToQuery()); |
105 | 256 | |
106 | 257 | List<AntextDoctorPatient> antextDoctorPatient = new ArrayList<>(); |
107 | - for(AntExChuModel ac : antExChuModels){ | |
258 | + //添加初诊结果 | |
259 | + for (AntExChuModel ac : antExChuModels) { | |
108 | 260 | AntextDoctorPatient adp = new AntextDoctorPatient(); |
109 | 261 | adp.setDoctorId(ac.getProdDoctor()); |
110 | - adp.setpId(ac.getPid()); | |
262 | + adp.setpId(ac.getParentId()); | |
263 | + Patients patients = patientsMap.get(ac.getParentId()); | |
264 | + if (patients.getType() == 1) {//孕妇 | |
265 | + //计算孕周 | |
266 | + adp.setcDueWeek(com.lyms.platform.common.utils.StringUtils.dueWeek(DateUtil.daysBetween(patients.getLastMenses(), new Date()))); | |
267 | + adp.setDueFmDate(patients.getDueDate()); | |
268 | + } else if (patients.getType() == 3) {//3-产妇 | |
269 | + adp.setcDueWeek("已分娩"); | |
270 | + adp.setDueFmDate(patients.getFmDate()); | |
271 | + } | |
272 | + adp.setCheckTime(ac.getCheckTime()); | |
273 | + adp.setpName(patients.getUsername()); | |
274 | + //高危因数 | |
275 | + adp.setRiskFactors(commonService.resloveFactor(patients.getRiskFactorId())); | |
276 | + //高危等级颜色 | |
277 | + adp.setRiskLevelId(commonService.findRiskLevel(patients.getRiskLevelId())); | |
111 | 278 | antextDoctorPatient.add(adp); |
112 | 279 | } |
113 | - for(AntenatalExaminationModel aec : antenatalExaminationModels){ | |
280 | + //添加复诊结果 | |
281 | + for (AntenatalExaminationModel aec : antenatalExaminationModels) { | |
114 | 282 | AntextDoctorPatient adp = new AntextDoctorPatient(); |
115 | 283 | adp.setDoctorId(aec.getCheckDoctor()); |
116 | - adp.setpId(aec.getPid()); | |
284 | + adp.setpId(aec.getParentId()); | |
285 | + adp.setCheckTime(aec.getCheckDate()); | |
117 | 286 | antextDoctorPatient.add(adp); |
118 | 287 | } |
119 | - Map<String,AntextDoctorResult> adr1 = new HashMap<>(); | |
288 | + if(number!=null){ | |
289 | + if(number == 2){ | |
290 | + for(AntextDoctorPatient ad :antextDoctorPatient){ | |
291 | + if(ad.getCjNum()<2){ | |
292 | + antextDoctorPatient.remove(ad); | |
293 | + } | |
294 | + } | |
295 | + }else if(number == 5){ | |
296 | + for(AntextDoctorPatient ad :antextDoctorPatient){ | |
297 | + if(ad.getCjNum()<5){ | |
298 | + antextDoctorPatient.remove(ad); | |
299 | + } | |
300 | + } | |
301 | + } | |
302 | + } | |
303 | + | |
304 | + | |
305 | + | |
306 | + return antextDoctorPatient; | |
307 | + } | |
308 | + | |
309 | + /** | |
310 | + * 产检医生统计 | |
311 | + * | |
312 | + * @param startDate 建档开始时间 | |
313 | + * @param endDate 建档结束时间 | |
314 | + * @param childBirth 统计范围 1=孕妇 3=产妇 不传=全部 | |
315 | + * @return | |
316 | + */ | |
317 | + @RequestMapping(method = RequestMethod.GET, value = "/getDoctorStatic") | |
318 | + @ResponseBody | |
319 | + @TokenRequired | |
320 | + public BaseObjectResponse getDoctorStatic(Date startDate, Date endDate, Integer childBirth, HttpServletRequest request) { | |
321 | + BaseObjectResponse rest = new BaseObjectResponse(); | |
322 | + | |
323 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
324 | + | |
325 | + //获取患者信息 | |
326 | + List<AntextDoctorPatient> antextDoctorPatient = getPatientList(loginState.getId(), startDate, endDate, childBirth,null,null); | |
327 | + | |
328 | + Map<String, AntextDoctorResult> adr1 = new HashMap<>(); | |
120 | 329 | //医生ID+患者ID 用与医生对于产检人数 + 总人数:患者ID |
121 | - Map<String,Integer> dpm = new HashMap<>(); | |
330 | + Map<String, Integer> dpm = new HashMap<>(); | |
122 | 331 | |
123 | 332 | //产检总人数 |
124 | 333 | int allCount = 0; |
125 | 334 | |
126 | 335 | |
127 | 336 | |
128 | 337 | |
129 | 338 | |
130 | 339 | |
131 | 340 | |
132 | 341 | |
133 | 342 | |
... | ... | @@ -129,40 +338,40 @@ |
129 | 338 | //产检五次及以上; |
130 | 339 | int allFive = 0; |
131 | 340 | |
132 | - for(AntextDoctorPatient adp : antextDoctorPatient){ | |
133 | - if(!dpm.containsKey(adp.getpId())){ | |
341 | + for (AntextDoctorPatient adp : antextDoctorPatient) { | |
342 | + if (!dpm.containsKey(adp.getpId())) { | |
134 | 343 | allCount++; |
135 | - dpm.put(adp.getpId(),1); | |
136 | - }else{ | |
137 | - Integer cjrc = dpm.get(adp.getpId()); | |
344 | + dpm.put(adp.getpId(), 1); | |
345 | + } else { | |
346 | + Integer cjrc = dpm.get(adp.getpId()); | |
138 | 347 | cjrc++; |
139 | - if(cjrc == 2){ | |
348 | + if (cjrc == 2) { | |
140 | 349 | allDoub++; |
141 | 350 | } |
142 | - if(cjrc == 5){ | |
351 | + if (cjrc == 5) { | |
143 | 352 | allFive++; |
144 | 353 | } |
145 | - dpm.put(adp.getpId(),cjrc); | |
354 | + dpm.put(adp.getpId(), cjrc); | |
146 | 355 | } |
147 | 356 | allCjrc++; |
148 | 357 | |
149 | - if(adr1.containsKey(adp.getDoctorId())){ | |
358 | + if (adr1.containsKey(adp.getDoctorId())) { | |
150 | 359 | AntextDoctorResult adr = adr1.get(adp.getDoctorId()); |
151 | - if(!dpm.containsKey(adp.getDoctorId()+adp.getpId())){//如果不存在,产检人数加1 | |
152 | - adr.setInspectPeople(adr.getInspectPeople()+1); | |
153 | - dpm.put(adp.getDoctorId()+adp.getpId(),1); | |
154 | - }else{//如果存在,则检测测试加一 | |
155 | - Integer num = dpm.get(adp.getDoctorId()+adp.getpId()); | |
360 | + if (!dpm.containsKey(adp.getDoctorId() + adp.getpId())) {//如果不存在,产检人数加1 | |
361 | + adr.setInspectPeople(adr.getInspectPeople() + 1); | |
362 | + dpm.put(adp.getDoctorId() + adp.getpId(), 1); | |
363 | + } else {//如果存在,则检测测试加一 | |
364 | + Integer num = dpm.get(adp.getDoctorId() + adp.getpId()); | |
156 | 365 | ++num; |
157 | - if(num == 2){ | |
158 | - adr.setTwice(adr.getTwice()+1); | |
159 | - }else if(num==5){ | |
160 | - adr.setFiveTimes(adr.getFiveTimes()+1); | |
366 | + if (num == 2) { | |
367 | + adr.setTwice(adr.getTwice() + 1); | |
368 | + } else if (num == 5) { | |
369 | + adr.setFiveTimes(adr.getFiveTimes() + 1); | |
161 | 370 | } |
162 | - dpm.put(adp.getDoctorId()+adp.getpId(),num); | |
371 | + dpm.put(adp.getDoctorId() + adp.getpId(), num); | |
163 | 372 | } |
164 | - adr.setInspectTime(adr.getInspectTime()+1); | |
165 | - }else{ | |
373 | + adr.setInspectTime(adr.getInspectTime() + 1); | |
374 | + } else { | |
166 | 375 | AntextDoctorResult adr = new AntextDoctorResult(); |
167 | 376 | adr.setDoctorId(adp.getDoctorId()); |
168 | 377 | adr.setInspectPeople(1); |
169 | 378 | |
170 | 379 | |
171 | 380 | |
172 | 381 | |
173 | 382 | |
174 | 383 | |
175 | 384 | |
176 | 385 | |
177 | 386 | |
... | ... | @@ -171,38 +380,38 @@ |
171 | 380 | adr.setFiveTimes(0); |
172 | 381 | adr.setTwiceProportion(""); |
173 | 382 | adr.setFiveTimeProportion(""); |
174 | - adr1.put(adp.getDoctorId(),adr); | |
175 | - dpm.put(adp.getDoctorId()+adp.getpId(),1); | |
383 | + adr1.put(adp.getDoctorId(), adr); | |
384 | + dpm.put(adp.getDoctorId() + adp.getpId(), 1); | |
176 | 385 | } |
177 | 386 | } |
178 | 387 | |
179 | - List<Map<String,Object>> gridList = new ArrayList<>(); | |
388 | + List<Map<String, Object>> gridList = new ArrayList<>(); | |
180 | 389 | //存总计 |
181 | 390 | gridList.add(new HashedMap()); |
182 | 391 | //表表图数据 |
183 | 392 | List<Object> doctorInfo = new ArrayList<>(); |
184 | 393 | |
185 | - for(Map.Entry<String,AntextDoctorResult> adr : adr1.entrySet()){ | |
394 | + for (Map.Entry<String, AntextDoctorResult> adr : adr1.entrySet()) { | |
186 | 395 | // System.out.println(adr.getValue().toString()); |
187 | 396 | AntextDoctorResult ar = adr.getValue(); |
188 | 397 | |
189 | - if(StringUtils.isNotEmpty(ar.getDoctorId())){ | |
190 | - Users users = usersService.getUsers(Integer.parseInt(ar.getDoctorId())); | |
191 | - if(users!=null){ | |
398 | + if (StringUtils.isNotEmpty(ar.getDoctorId())) { | |
399 | + Users users = usersService.getUsers(Integer.parseInt(ar.getDoctorId())); | |
400 | + if (users != null) { | |
192 | 401 | ar.setDoctorName(users.getName()); |
193 | - }else{ | |
402 | + } else { | |
194 | 403 | ar.setDoctorName("产检医生"); |
195 | 404 | } |
196 | - }else{ | |
405 | + } else { | |
197 | 406 | ar.setDoctorName("产检医生"); |
198 | 407 | } |
199 | - if(ar.getTwice()>0){ | |
408 | + if (ar.getTwice() > 0) { | |
200 | 409 | DecimalFormat df = new DecimalFormat("0.0");//格式化小数,不足的补0 |
201 | - ar.setTwiceProportion(df.format((float)ar.getTwice()/ar.getInspectPeople()*100)+"%"); | |
410 | + ar.setTwiceProportion(df.format((float) ar.getTwice() / ar.getInspectPeople() * 100) + "%"); | |
202 | 411 | } |
203 | - if(ar.getFiveTimes()>0){ | |
412 | + if (ar.getFiveTimes() > 0) { | |
204 | 413 | DecimalFormat df = new DecimalFormat("0.0");//格式化小数,不足的补0 |
205 | - ar.setFiveTimeProportion(df.format((float)ar.getFiveTimes()/ar.getInspectPeople()*100)+"%"); | |
414 | + ar.setFiveTimeProportion(df.format((float) ar.getFiveTimes() / ar.getInspectPeople() * 100) + "%"); | |
206 | 415 | } |
207 | 416 | gridList.add(BeanUtils.objectToObjectMap(ar)); |
208 | 417 | |
209 | 418 | |
210 | 419 | |
211 | 420 | |
212 | 421 | |
... | ... | @@ -224,26 +433,26 @@ |
224 | 433 | String allDoubBl = ""; |
225 | 434 | String allFiveBl = ""; |
226 | 435 | |
227 | - if(allDoub>0){ | |
436 | + if (allDoub > 0) { | |
228 | 437 | //两次比例 |
229 | - allDoubBl = df.format((float)allDoub/allCount*100)+"%"; | |
438 | + allDoubBl = df.format((float) allDoub / allCount * 100) + "%"; | |
230 | 439 | } |
231 | - if(allFive>0){ | |
440 | + if (allFive > 0) { | |
232 | 441 | //五次比例 |
233 | - allFiveBl = df.format((float)allFive/allCount*100)+"%"; | |
442 | + allFiveBl = df.format((float) allFive / allCount * 100) + "%"; | |
234 | 443 | } |
235 | 444 | |
236 | 445 | // System.out.println("总人数:"+allCount+",总人次:"+allCjrc+",总2次以上:"+allDoub+",总5次以上:"+allFive+",总两次比例:"+allDoubBl+",总五次比例:"+allFiveBl); |
237 | 446 | |
238 | 447 | //填充总计数据 |
239 | - Map<String,Object> allMap = gridList.get(0); | |
240 | - allMap.put("doctorName","总计"); | |
241 | - allMap.put("inspectTime",allCjrc); | |
242 | - allMap.put("inspectPeople",allCount); | |
243 | - allMap.put("twice",allDoub); | |
244 | - allMap.put("twiceProportion",allDoubBl); | |
245 | - allMap.put("fiveTimes",allFive); | |
246 | - allMap.put("fiveTimeProportion",allFiveBl); | |
448 | + Map<String, Object> allMap = gridList.get(0); | |
449 | + allMap.put("doctorName", "总计"); | |
450 | + allMap.put("inspectTime", allCjrc); | |
451 | + allMap.put("inspectPeople", allCount); | |
452 | + allMap.put("twice", allDoub); | |
453 | + allMap.put("twiceProportion", allDoubBl); | |
454 | + allMap.put("fiveTimes", allFive); | |
455 | + allMap.put("fiveTimeProportion", allFiveBl); | |
247 | 456 | |
248 | 457 | ReportModel reportModel = new ReportModel(); |
249 | 458 | reportModel.setDoctorInfo(doctorInfo); /** 医生数据详情 */ |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AntextDoctorPatient.java
View file @
4676499
1 | 1 | package com.lyms.platform.operate.web.result; |
2 | 2 | |
3 | +import java.util.Date; | |
4 | +import java.util.List; | |
5 | + | |
3 | 6 | /** |
4 | 7 | * @auther yangfei |
5 | 8 | * @createTime 2017年07月05日 16时58分 |
6 | 9 | |
... | ... | @@ -10,7 +13,97 @@ |
10 | 13 | private String doctorId; |
11 | 14 | //患者ID |
12 | 15 | private String pId; |
16 | + //患者姓名 | |
17 | + private String pName; | |
18 | + //本院产检次数 | |
19 | + private int cjNum; | |
20 | + //产检总次数 | |
21 | + private int allCjNum; | |
22 | + //高危风险 | |
23 | + private String riskFactors; | |
24 | + //风险等级颜色 | |
25 | + private List riskLevelId; | |
26 | + //孕周或已分娩 | |
27 | + private String cDueWeek; | |
28 | + //预产期或分娩日期 | |
29 | + private Date dueFmDate; | |
30 | + //产检时间 | |
31 | + private Date checkTime; | |
32 | + //产检医生 | |
33 | + private String checkDoctor; | |
13 | 34 | |
35 | + public Date getCheckTime() { | |
36 | + return checkTime; | |
37 | + } | |
38 | + | |
39 | + public void setCheckTime(Date checkTime) { | |
40 | + this.checkTime = checkTime; | |
41 | + } | |
42 | + | |
43 | + public String getCheckDoctor() { | |
44 | + return checkDoctor; | |
45 | + } | |
46 | + | |
47 | + public void setCheckDoctor(String checkDoctor) { | |
48 | + this.checkDoctor = checkDoctor; | |
49 | + } | |
50 | + | |
51 | + public int getCjNum() { | |
52 | + return cjNum; | |
53 | + } | |
54 | + | |
55 | + public int getAllCjNum() { | |
56 | + return allCjNum; | |
57 | + } | |
58 | + | |
59 | + public void setAllCjNum(int allCjNum) { | |
60 | + this.allCjNum = allCjNum; | |
61 | + } | |
62 | + | |
63 | + public void setCjNum(int cjNum) { | |
64 | + this.cjNum = cjNum; | |
65 | + } | |
66 | + | |
67 | + public String getpName() { | |
68 | + return pName; | |
69 | + } | |
70 | + | |
71 | + public void setpName(String pName) { | |
72 | + this.pName = pName; | |
73 | + } | |
74 | + | |
75 | + public String getcDueWeek() { | |
76 | + return cDueWeek; | |
77 | + } | |
78 | + | |
79 | + public void setcDueWeek(String cDueWeek) { | |
80 | + this.cDueWeek = cDueWeek; | |
81 | + } | |
82 | + | |
83 | + public Date getDueFmDate() { | |
84 | + return dueFmDate; | |
85 | + } | |
86 | + | |
87 | + public void setDueFmDate(Date dueFmDate) { | |
88 | + this.dueFmDate = dueFmDate; | |
89 | + } | |
90 | + | |
91 | + public String getRiskFactors() { | |
92 | + return riskFactors; | |
93 | + } | |
94 | + | |
95 | + public void setRiskFactors(String riskFactors) { | |
96 | + this.riskFactors = riskFactors; | |
97 | + } | |
98 | + | |
99 | + public List getRiskLevelId() { | |
100 | + return riskLevelId; | |
101 | + } | |
102 | + | |
103 | + public void setRiskLevelId(List riskLevelId) { | |
104 | + this.riskLevelId = riskLevelId; | |
105 | + } | |
106 | + | |
14 | 107 | public String getDoctorId() { |
15 | 108 | return doctorId; |
16 | 109 | } |
... | ... | @@ -25,6 +118,23 @@ |
25 | 118 | |
26 | 119 | public void setpId(String pId) { |
27 | 120 | this.pId = pId; |
121 | + } | |
122 | + | |
123 | + @Override | |
124 | + public String toString() { | |
125 | + return "AntextDoctorPatient{" + | |
126 | + "doctorId='" + doctorId + '\'' + | |
127 | + ", pId='" + pId + '\'' + | |
128 | + ", pName='" + pName + '\'' + | |
129 | + ", cjNum=" + cjNum + | |
130 | + ", allCjNum=" + allCjNum + | |
131 | + ", riskFactors='" + riskFactors + '\'' + | |
132 | + ", riskLevelId=" + riskLevelId + | |
133 | + ", cDueWeek='" + cDueWeek + '\'' + | |
134 | + ", dueFmDate=" + dueFmDate + | |
135 | + ", checkTime=" + checkTime + | |
136 | + ", checkDoctor='" + checkDoctor + '\'' + | |
137 | + '}'; | |
28 | 138 | } |
29 | 139 | } |