Commit 77842f748185ffcf0932f490e7bc0e2d68150f79
1 parent
e58089b93d
Exists in
master
and in
1 other branch
孕妇分娩后 变成产妇
Showing 6 changed files with 103 additions and 41 deletions
- 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/MatDeliverFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PostReviewFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/HighScoreResult.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/RiskPatientsResult.java
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
77842f7
... | ... | @@ -152,7 +152,7 @@ |
152 | 152 | antExChuModel.setYn(YnEnums.YES.getId()); |
153 | 153 | antenatalExaminationService.addOneAntEx(antExChuModel); |
154 | 154 | //修改患者风险等级 |
155 | - patients.setLastCheckEmployeeId(userId+""); | |
155 | + patients.setLastCheckEmployeeId(userId + ""); | |
156 | 156 | updatePatientRiskLevel(antExChuModel, patients); |
157 | 157 | } |
158 | 158 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
... | ... | @@ -226,7 +226,7 @@ |
226 | 226 | * |
227 | 227 | * @return |
228 | 228 | */ |
229 | - public HighScoreResult findLastRisk(String parentId) { | |
229 | + public HighScoreResult findLastRisk(String parentId,boolean needLevel) { | |
230 | 230 | List<AntenatalExaminationModel> list = antenatalExaminationService.findAllByParentId(parentId); |
231 | 231 | AntenatalExaminationModel model = null; |
232 | 232 | if (CollectionUtils.isNotEmpty(list)) { |
... | ... | @@ -237,7 +237,7 @@ |
237 | 237 | //复诊 |
238 | 238 | if (null != model && StringUtils.isNotEmpty(model.getRiskFactor()) && !"{}".equals(model.getRiskFactor())) { |
239 | 239 | List list1 = JsonUtil.toList(model.getRiskFactor(), List.class); |
240 | - highScoreResult = queryRisk(list1); | |
240 | + highScoreResult = queryRisk(list1,needLevel); | |
241 | 241 | } |
242 | 242 | if (null != model && !"{}".equals(model.getOtherRisk())) { |
243 | 243 | Map map = JsonUtil.str2Obj(model.getOtherRisk(), Map.class); |
... | ... | @@ -253,6 +253,14 @@ |
253 | 253 | BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(idObj.toString()); |
254 | 254 | highScoreResult.setScore(highScoreResult.getScore() + NumberUtils.toInt(basicConfig.getName(), 0)); |
255 | 255 | } |
256 | + if(needLevel){ | |
257 | + Object idObj1 = map.get("fyyse"); | |
258 | + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(idObj1.toString()); | |
259 | + Map<String, Object> map2 = new HashMap<>(); | |
260 | + map2.put("id", basicConfig.getId()); | |
261 | + map2.put("name", basicConfig.getName()); | |
262 | + highScoreResult.getLevel().add(map2); | |
263 | + } | |
256 | 264 | } |
257 | 265 | //初诊 |
258 | 266 | AntExChuQuery antExChuQuery = new AntExChuQuery(); |
... | ... | @@ -265,7 +273,7 @@ |
265 | 273 | } |
266 | 274 | if (null != antExChuModel && StringUtils.isNotEmpty(antExChuModel.getHighrisk()) && !"{}".equals(antExChuModel.getHighrisk())) { |
267 | 275 | List list2 = JsonUtil.toList(antExChuModel.getHighrisk(), List.class); |
268 | - highScoreResult = queryRisk(list2); | |
276 | + highScoreResult = queryRisk(list2,false); | |
269 | 277 | } |
270 | 278 | if (null != antExChuModel && !"{}".equals(antExChuModel.getOtherHighRisk())) { |
271 | 279 | Map map = JsonUtil.str2Obj(antExChuModel.getOtherHighRisk(), Map.class); |
... | ... | @@ -280,6 +288,14 @@ |
280 | 288 | BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(idObj.toString()); |
281 | 289 | highScoreResult.setScore(highScoreResult.getScore() + NumberUtils.toInt(basicConfig.getName(), 0)); |
282 | 290 | } |
291 | + if(needLevel){ | |
292 | + Object idObj1 = map.get("fyyse"); | |
293 | + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(idObj1.toString()); | |
294 | + Map<String, Object> map2 = new HashMap<>(); | |
295 | + map2.put("id", basicConfig.getId()); | |
296 | + map2.put("name", basicConfig.getName()); | |
297 | + highScoreResult.getLevel().add(map2); | |
298 | + } | |
283 | 299 | } |
284 | 300 | } catch (Exception e) { |
285 | 301 | } |
... | ... | @@ -307,7 +323,7 @@ |
307 | 323 | |
308 | 324 | antexListResult.convertToResult(null, list.get(0), null); |
309 | 325 | for (Patients patients : list) { |
310 | - HighScoreResult highScoreResult = findLastRisk(patients.getId()); | |
326 | + HighScoreResult highScoreResult = findLastRisk(patients.getId(),false); | |
311 | 327 | antexListResult.setRiskFactor(highScoreResult.getHighRisk()); |
312 | 328 | antexListResult.setRiskScore(highScoreResult.getScore() + ""); |
313 | 329 | List<StopPregModel> stopPregs = null; |
... | ... | @@ -540,7 +556,7 @@ |
540 | 556 | if (CollectionUtils.isNotEmpty(antExChulist)) { |
541 | 557 | antExChuModel = antExChulist.get(0); |
542 | 558 | }*/ |
543 | - HighScoreResult highScoreResult = findLastRisk(patients.getId()); | |
559 | + HighScoreResult highScoreResult = findLastRisk(patients.getId(),false); | |
544 | 560 | AntExQuery antExQuery = new AntExQuery(); |
545 | 561 | antExQuery.setYn(YnEnums.YES.getId()); |
546 | 562 | antExQuery.setPid(patients.getPid()); |
... | ... | @@ -620,7 +636,7 @@ |
620 | 636 | try { |
621 | 637 | if (StringUtils.isNotEmpty(examinationModel.getRiskFactor())) { |
622 | 638 | List list1 = JsonUtil.toList(examinationModel.getRiskFactor(), List.class); |
623 | - HighScoreResult highScoreResult = queryRisk(list1); | |
639 | + HighScoreResult highScoreResult = queryRisk(list1,false); | |
624 | 640 | antenatalExaminationResult.setRiskFactor(highScoreResult.getHighRisk()); |
625 | 641 | } |
626 | 642 | } catch (Exception e) { |
... | ... | @@ -628,7 +644,7 @@ |
628 | 644 | try { |
629 | 645 | if (StringUtils.isNotEmpty(examinationModel.getDiagnosis())) { |
630 | 646 | List list = JsonUtil.toList(examinationModel.getDiagnosis(), List.class); |
631 | - antenatalExaminationResult.setDiagnosis(queryRisk(list).getHighRisk()); | |
647 | + antenatalExaminationResult.setDiagnosis(queryRisk(list,false).getHighRisk()); | |
632 | 648 | } |
633 | 649 | } catch (Exception e) { |
634 | 650 | } |
635 | 651 | |
... | ... | @@ -662,14 +678,14 @@ |
662 | 678 | try { |
663 | 679 | if (StringUtils.isNotEmpty(antExChuModel.getDiagnosis())) { |
664 | 680 | List list = JsonUtil.toList(antExChuModel.getDiagnosis(), List.class); |
665 | - antexChuResult.setDiagnosis(queryRisk(list).getHighRisk()); | |
681 | + antexChuResult.setDiagnosis(queryRisk(list,false).getHighRisk()); | |
666 | 682 | } |
667 | 683 | } catch (Exception e) { |
668 | 684 | } |
669 | 685 | try { |
670 | 686 | if (StringUtils.isNotEmpty(antExChuModel.getHighrisk())) { |
671 | 687 | List list1 = JsonUtil.toList(antExChuModel.getHighrisk(), List.class); |
672 | - antexChuResult.setHighrisk(queryRisk(list1).getHighRisk()); | |
688 | + antexChuResult.setHighrisk(queryRisk(list1,false).getHighRisk()); | |
673 | 689 | } |
674 | 690 | } catch (Exception e) { |
675 | 691 | } |
676 | 692 | |
... | ... | @@ -688,11 +704,12 @@ |
688 | 704 | return new BaseObjectResponse().setData(object).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
689 | 705 | } |
690 | 706 | |
691 | - public HighScoreResult queryRisk(List<String> id) { | |
707 | + public HighScoreResult queryRisk(List<String> id,boolean n) { | |
692 | 708 | HighScoreResult highScoreResult = new HighScoreResult(); |
693 | 709 | BasicConfigQuery |
694 | 710 | basicConfigQuery = new BasicConfigQuery(); |
695 | 711 | List data = new ArrayList(); |
712 | + List dat1a = new ArrayList(); | |
696 | 713 | Integer score = null; |
697 | 714 | if (CollectionUtils.isNotEmpty(id)) { |
698 | 715 | score = 0; |
... | ... | @@ -707,6 +724,15 @@ |
707 | 724 | if (StringUtils.isNotEmpty(basicConfig.getCode())) { |
708 | 725 | score += NumberUtils.toInt(basicConfig.getCode(), 0); |
709 | 726 | } |
727 | + if(n){ | |
728 | + BasicConfig basicConfig1= basicConfigService.getOneBasicConfigById(basicConfig.getParentId()); | |
729 | + if(null!=basicConfig1){ | |
730 | + Map<String, Object> map1 = new HashMap<>(); | |
731 | + map1.put("id", basicConfig1.getId()); | |
732 | + map1.put("name", basicConfig1.getName()); | |
733 | + dat1a.add(dat1a); | |
734 | + } | |
735 | + } | |
710 | 736 | data.add(map); |
711 | 737 | } |
712 | 738 | } |
... | ... | @@ -714,6 +740,7 @@ |
714 | 740 | } |
715 | 741 | highScoreResult.setHighRisk(data); |
716 | 742 | highScoreResult.setScore(score); |
743 | + highScoreResult.setLevel(dat1a); | |
717 | 744 | return highScoreResult; |
718 | 745 | } |
719 | 746 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
View file @
77842f7
... | ... | @@ -291,7 +291,7 @@ |
291 | 291 | antExQuery.setParentId(patients.getId()); |
292 | 292 | antExQuery.setYn(YnEnums.YES.getId()); |
293 | 293 | List<AntenatalExaminationModel> examinationModel = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery()); |
294 | - HighScoreResult highScoreResult = antenatalExaminationFacade.findLastRisk(patients.getId()); | |
294 | + HighScoreResult highScoreResult = antenatalExaminationFacade.findLastRisk(patients.getId(),false); | |
295 | 295 | try { |
296 | 296 | String tTireNumber = ""; |
297 | 297 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
View file @
77842f7
... | ... | @@ -243,7 +243,7 @@ |
243 | 243 | patientBaseResult.convert(patients); |
244 | 244 | } |
245 | 245 | try { |
246 | - HighScoreResult highScoreResult = antenatalExaminationFacade.findLastRisk(patients.getId()); | |
246 | + HighScoreResult highScoreResult = antenatalExaminationFacade.findLastRisk(patients.getId(),false); | |
247 | 247 | patientBaseResult.setRiskFactor(highScoreResult.getHighRisk()); |
248 | 248 | patientBaseResult.setRiskScore(highScoreResult.getScore() + ""); |
249 | 249 | } catch (Exception e) { |
250 | 250 | |
... | ... | @@ -270,9 +270,9 @@ |
270 | 270 | if (StringUtils.isNotEmpty(patients.getBookbuildingDoctor())) { |
271 | 271 | if (NumberUtils.isNumber(patients.getBookbuildingDoctor())) { |
272 | 272 | Users users = usersService.getUsers(NumberUtils.toInt(patients.getBookbuildingDoctor())); |
273 | - if (null!=users) { | |
273 | + if (null != users) { | |
274 | 274 | chanResult.setlName(users.getName()); |
275 | - }else{ | |
275 | + } else { | |
276 | 276 | chanResult.setlName(patients.getBookbuildingDoctor()); |
277 | 277 | } |
278 | 278 | |
279 | 279 | |
... | ... | @@ -284,9 +284,9 @@ |
284 | 284 | if (StringUtils.isNotEmpty(patients.getLastCheckEmployeeId())) { |
285 | 285 | if (NumberUtils.isNumber(patients.getLastCheckEmployeeId())) { |
286 | 286 | Users users = usersService.getUsers(NumberUtils.toInt(patients.getLastCheckEmployeeId())); |
287 | - if(null!=users){ | |
287 | + if (null != users) { | |
288 | 288 | chanResult.setCheckDoctor(users.getName()); |
289 | - }else{ | |
289 | + } else { | |
290 | 290 | chanResult.setCheckDoctor(patients.getLastCheckEmployeeId()); |
291 | 291 | } |
292 | 292 | } else { |
293 | 293 | |
... | ... | @@ -330,9 +330,9 @@ |
330 | 330 | if (StringUtils.isNotEmpty(patients.getBookbuildingDoctor())) { |
331 | 331 | if (NumberUtils.isNumber(patients.getBookbuildingDoctor())) { |
332 | 332 | Users users = usersService.getUsers(NumberUtils.toInt(patients.getBookbuildingDoctor())); |
333 | - if(null!=users){ | |
333 | + if (null != users) { | |
334 | 334 | quanPatientsResult.setlName(users.getName()); |
335 | - }else{ | |
335 | + } else { | |
336 | 336 | quanPatientsResult.setlName(patients.getBookbuildingDoctor()); |
337 | 337 | } |
338 | 338 | |
339 | 339 | |
... | ... | @@ -343,9 +343,9 @@ |
343 | 343 | if (StringUtils.isNotEmpty(patients.getLastCheckEmployeeId())) { |
344 | 344 | if (NumberUtils.isNumber(patients.getLastCheckEmployeeId())) { |
345 | 345 | Users users = usersService.getUsers(NumberUtils.toInt(patients.getLastCheckEmployeeId())); |
346 | - if(null!=users){ | |
346 | + if (null != users) { | |
347 | 347 | quanPatientsResult.setCheckDoctor(users.getName()); |
348 | - }else{ | |
348 | + } else { | |
349 | 349 | quanPatientsResult.setCheckDoctor(patients.getLastCheckEmployeeId()); |
350 | 350 | } |
351 | 351 | } else { |
352 | 352 | |
... | ... | @@ -391,9 +391,9 @@ |
391 | 391 | if (StringUtils.isNotEmpty(patients.getBookbuildingDoctor())) { |
392 | 392 | if (NumberUtils.isNumber(patients.getBookbuildingDoctor())) { |
393 | 393 | Users users = usersService.getUsers(NumberUtils.toInt(patients.getBookbuildingDoctor())); |
394 | - if(null!=users){ | |
394 | + if (null != users) { | |
395 | 395 | riskPatientsResult.setlName(users.getName()); |
396 | - }else{ | |
396 | + } else { | |
397 | 397 | riskPatientsResult.setlName(patients.getBookbuildingDoctor()); |
398 | 398 | } |
399 | 399 | } else { |
400 | 400 | |
401 | 401 | |
... | ... | @@ -403,16 +403,16 @@ |
403 | 403 | if (StringUtils.isNotEmpty(patients.getLastCheckEmployeeId())) { |
404 | 404 | if (NumberUtils.isNumber(patients.getLastCheckEmployeeId())) { |
405 | 405 | Users users = usersService.getUsers(NumberUtils.toInt(patients.getLastCheckEmployeeId())); |
406 | - if(null!=users){ | |
406 | + if (null != users) { | |
407 | 407 | riskPatientsResult.setCheckDoctor(users.getName()); |
408 | - }else{ | |
408 | + } else { | |
409 | 409 | riskPatientsResult.setCheckDoctor(patients.getLastCheckEmployeeId()); |
410 | 410 | } |
411 | 411 | } else { |
412 | 412 | riskPatientsResult.setCheckDoctor(patients.getLastCheckEmployeeId()); |
413 | 413 | } |
414 | 414 | } |
415 | - HighScoreResult highScoreResult= antenatalExaminationFacade.findLastRisk(patients.getId()); | |
415 | + HighScoreResult highScoreResult = antenatalExaminationFacade.findLastRisk(patients.getId(),true); | |
416 | 416 | //复诊次数 |
417 | 417 | int i = antExService.queryAntenatalExaminationCount(antExQuery.convertToQuery()); |
418 | 418 | antExChuQuery.setParentId(patients.getId()); |
... | ... | @@ -431,16 +431,8 @@ |
431 | 431 | } |
432 | 432 | } |
433 | 433 | riskPatientsResult.setcTime(nextCheckTime); |
434 | - if(CollectionUtils.isNotEmpty(highScoreResult.getHighRisk())){ | |
435 | - List list = highScoreResult.getHighRisk(); | |
436 | - StringBuilder stringBuilder=new StringBuilder(); | |
437 | - for(int i1=0;i1<list.size();i1++){ | |
438 | - java.util.Map<String,String> map = (java.util.Map<String,String>)list.get(i1); | |
439 | - stringBuilder.append(map.get("name")).append(","); | |
440 | - } | |
441 | - riskPatientsResult.setrFactor(stringBuilder.toString()); | |
442 | - } | |
443 | - | |
434 | + riskPatientsResult.setrFactor(highScoreResult.gethighRiskStr()); | |
435 | + riskPatientsResult.setrLevel(highScoreResult.getLevelStr()); | |
444 | 436 | riskPatientsResult.sethScore(highScoreResult.getScore()); |
445 | 437 | data.add(riskPatientsResult); |
446 | 438 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PostReviewFacade.java
View file @
77842f7
... | ... | @@ -93,7 +93,7 @@ |
93 | 93 | dueDate= list.get(0).getDueDate(); |
94 | 94 | |
95 | 95 | } |
96 | - HighScoreResult highScoreResult = examinationFacade.findLastRisk(patientsList.getId()); | |
96 | + HighScoreResult highScoreResult = examinationFacade.findLastRisk(patientsList.getId(),false); | |
97 | 97 | postReviewListResult.convertToResult(postReviewModels, patientsList, dueDate); |
98 | 98 | postReviewListResult.setRiskFactor(highScoreResult.getHighRisk()); |
99 | 99 | postReviewListResult.setRiskScore(highScoreResult.getScore()+""); |
... | ... | @@ -120,7 +120,7 @@ |
120 | 120 | try { |
121 | 121 | if(StringUtils.isNotEmpty(postReviewModel.getDiagnosis())){ |
122 | 122 | List list = JsonUtil.toList(postReviewModel.getDiagnosis(), List.class); |
123 | - postReviewResult.setDiagnosis(examinationFacade.queryRisk(list).getHighRisk()); | |
123 | + postReviewResult.setDiagnosis(examinationFacade.queryRisk(list,false).getHighRisk()); | |
124 | 124 | } |
125 | 125 | } catch (Exception e) { |
126 | 126 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/HighScoreResult.java
View file @
77842f7
1 | 1 | package com.lyms.platform.operate.web.result; |
2 | 2 | |
3 | +import java.util.ArrayList; | |
3 | 4 | import java.util.List; |
4 | 5 | |
5 | 6 | /** |
6 | 7 | * Created by Administrator on 2016/8/2 0002. |
7 | 8 | */ |
8 | 9 | public class HighScoreResult { |
9 | - private List highRisk ; | |
10 | - private Integer score=0; | |
11 | 10 | |
11 | + //高危因素 | |
12 | + private List highRisk = new ArrayList(); | |
13 | + //风险等级颜色 | |
14 | + private List level; | |
15 | + //高危评分 | |
16 | + private Integer score = 0; | |
17 | + | |
12 | 18 | public List getHighRisk() { |
13 | 19 | return highRisk; |
14 | 20 | } |
15 | 21 | |
22 | + public List getLevel() { | |
23 | + return level; | |
24 | + } | |
25 | + | |
26 | + public void setLevel(List level) { | |
27 | + this.level = level; | |
28 | + } | |
29 | + | |
16 | 30 | public void setHighRisk(List highRisk) { |
17 | 31 | this.highRisk = highRisk; |
18 | 32 | } |
... | ... | @@ -23,6 +37,35 @@ |
23 | 37 | |
24 | 38 | public void setScore(Integer score) { |
25 | 39 | this.score = score; |
40 | + } | |
41 | + | |
42 | + public String getLevelStr() { | |
43 | + StringBuilder stringBuilder = new StringBuilder(); | |
44 | + if (null == level) { | |
45 | + return ""; | |
46 | + } | |
47 | + for (int i1 = 0; i1 < level.size(); i1++) { | |
48 | + java.util.Map<String, String> map = (java.util.Map<String, String>) level.get(i1); | |
49 | + String name = map.get("name"); | |
50 | + if (stringBuilder.indexOf(name) == -1) { | |
51 | + stringBuilder.append(map.get("name")).append(", "); | |
52 | + } | |
53 | + } | |
54 | + stringBuilder.setLength(stringBuilder.length() - 1); | |
55 | + return stringBuilder.toString(); | |
56 | + } | |
57 | + | |
58 | + public String gethighRiskStr() { | |
59 | + StringBuilder stringBuilder = new StringBuilder(); | |
60 | + if (null == highRisk) { | |
61 | + return ""; | |
62 | + } | |
63 | + for (int i1 = 0; i1 < highRisk.size(); i1++) { | |
64 | + java.util.Map<String, String> map = (java.util.Map<String, String>) highRisk.get(i1); | |
65 | + stringBuilder.append(map.get("name")).append(", "); | |
66 | + } | |
67 | + stringBuilder.setLength(stringBuilder.length() - 1); | |
68 | + return stringBuilder.toString(); | |
26 | 69 | } |
27 | 70 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/RiskPatientsResult.java
View file @
77842f7
... | ... | @@ -170,7 +170,7 @@ |
170 | 170 | setName(destModel.getUsername()); |
171 | 171 | setAge(destModel.getAge()); |
172 | 172 | setrLevel(destModel.getRiskLevelId()); |
173 | - setrFactor(destModel.getRiskFactorId() == null ? "" : JsonUtil.array2JsonString(destModel.getRiskFactorId())); | |
173 | +// setrFactor(destModel.getRiskFactorId() == null ? "" : JsonUtil.array2JsonString(destModel.getRiskFactorId())); | |
174 | 174 | sethScore(destModel.getRiskScore()); |
175 | 175 | setcTime(DateUtil.getyyyy_MM_dd(destModel.getNextCheckTime())); |
176 | 176 | setDueDate(DateUtil.getyyyy_MM_dd(destModel.getDueDate())); |