Commit 21e7a35a203f22c6e45574c21ea56aa7cbfee7b9
1 parent
3570c3e45d
Exists in
master
and in
6 other branches
高危检查列表
Showing 7 changed files with 128 additions and 89 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/CommonService.java
- platform-common/src/main/java/com/lyms/platform/common/utils/StringUtils.java
- platform-dal/src/main/java/com/lyms/platform/query/AntExRecordQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.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/result/AntExManagerResult.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/AntExRecordWorker.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/CommonService.java
View file @
21e7a35
... | ... | @@ -82,6 +82,23 @@ |
82 | 82 | return filter(level); |
83 | 83 | } |
84 | 84 | |
85 | + public List findRiskLevelByRisk(List<String> riskIds) { | |
86 | + List level = new ArrayList(); | |
87 | + if (CollectionUtils.isNotEmpty(riskIds)) { | |
88 | + try { | |
89 | + for (String str : riskIds) { | |
90 | + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(str); | |
91 | + if (null != basicConfig) { | |
92 | + level.add(basicConfig.getParentId()); | |
93 | + } | |
94 | + } | |
95 | + } catch (Exception e) { | |
96 | + ExceptionUtils.catchException(e, "findRiskLevelByRisk error."); | |
97 | + } | |
98 | + } | |
99 | + return findRiskLevel(level); | |
100 | + } | |
101 | + | |
85 | 102 | |
86 | 103 | /** |
87 | 104 | * 高危id转成列表 |
platform-common/src/main/java/com/lyms/platform/common/utils/StringUtils.java
View file @
21e7a35
... | ... | @@ -281,16 +281,16 @@ |
281 | 281 | } |
282 | 282 | |
283 | 283 | |
284 | - public static String replaceName(String name, String repalceStr) { | |
284 | + public static String replaceName(String name, String repalceStr,String doctor) { | |
285 | 285 | if (StringUtils.isNotEmpty(repalceStr)) { |
286 | - return repalceStr.replace("{{姓名}}", name); | |
286 | + return repalceStr.replace("{{姓名}}", name).replace("{{医生名称}}",doctor); | |
287 | 287 | } |
288 | 288 | return repalceStr; |
289 | 289 | } |
290 | 290 | |
291 | - public static String replaceNameRisk(String name, String risk,String repalceStr) { | |
291 | + public static String replaceNameRisk(String name, String risk,String repalceStr,String doctor) { | |
292 | 292 | if (StringUtils.isNotEmpty(repalceStr)) { |
293 | - return repalceStr.replace("{{姓名}}", name).replace("{{高危因素}}", risk); | |
293 | + return repalceStr.replace("{{姓名}}", name).replace("{{高危因素}}", risk).replace("{{医生名称}}",doctor); | |
294 | 294 | } |
295 | 295 | return repalceStr; |
296 | 296 | } |
platform-dal/src/main/java/com/lyms/platform/query/AntExRecordQuery.java
View file @
21e7a35
... | ... | @@ -18,6 +18,8 @@ |
18 | 18 | public class AntExRecordQuery extends BaseQuery implements IConvertToNativeQuery { |
19 | 19 | private String parentId; |
20 | 20 | private String id; |
21 | + private List<String> ids; | |
22 | + | |
21 | 23 | private String fId; |
22 | 24 | private String name; |
23 | 25 | private String cardNo; |
... | ... | @@ -63,6 +65,14 @@ |
63 | 65 | private Integer type; |
64 | 66 | private String neqId; |
65 | 67 | |
68 | + public List<String> getIds() { | |
69 | + return ids; | |
70 | + } | |
71 | + | |
72 | + public void setIds(List<String> ids) { | |
73 | + this.ids = ids; | |
74 | + } | |
75 | + | |
66 | 76 | public String getNeqId() { |
67 | 77 | return neqId; |
68 | 78 | } |
... | ... | @@ -464,6 +474,10 @@ |
464 | 474 | } |
465 | 475 | if (null != id) { |
466 | 476 | condition = condition.and("id", id, MongoOper.IS); |
477 | + } | |
478 | + | |
479 | + if (null != ids && ids.size() > 0) { | |
480 | + condition = condition.and("id", ids, MongoOper.IN); | |
467 | 481 | } |
468 | 482 | |
469 | 483 | if (StringUtils.isNotEmpty(name)) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.java
View file @
21e7a35
... | ... | @@ -28,6 +28,7 @@ |
28 | 28 | import org.apache.commons.lang.math.NumberUtils; |
29 | 29 | import org.springframework.beans.factory.annotation.Autowired; |
30 | 30 | import org.springframework.beans.factory.annotation.Qualifier; |
31 | +import org.springframework.data.domain.Sort; | |
31 | 32 | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; |
32 | 33 | import org.springframework.stereotype.Component; |
33 | 34 | |
34 | 35 | |
35 | 36 | |
36 | 37 | |
... | ... | @@ -242,67 +243,16 @@ |
242 | 243 | } |
243 | 244 | |
244 | 245 | String hospital = autoMatchFacade.getHospitalId(userId); |
245 | - List<AntExManagerResult> data = new ArrayList<>(); | |
246 | 246 | List<AntExRecordModel> antExRecordModelList = recordService.queryAntExRecords(antExRecordQuery); |
247 | - if (CollectionUtils.isNotEmpty(antExRecordModelList)) { | |
248 | - /*AntExManagerResult antExManagerResult = new AntExManagerResult(); | |
249 | - antExManagerResult.convertToResult(e); | |
250 | - if (isRegion) { | |
251 | - //产检医院 | |
252 | - if (StringUtils.isNotEmpty(e.getHospitalId())) { | |
253 | - Organization org = organizationService.getOrganization(Integer.valueOf(e.getHospitalId())); | |
254 | - if (null != org) { | |
255 | - antExManagerResult.setCheckHospital(org.getName()); | |
256 | - } else { | |
257 | - antExManagerResult.setCheckHospital(e.getHospitalId()); | |
258 | - } | |
259 | - } | |
260 | - antExManagerResult.setAddr(CommonsHelper.getResidence(e.getProvinceRegisterId(), e.getCityRegisterId(), e.getAreaRegisterId(), e.getStreetRegisterId(), e.getAddressRegister(), basicConfigService)); | |
261 | - } | |
247 | + List<AntExManagerResult> data = getAntExRecords(antExRecordModelList, hospital, isRegion, antExManagerQueryRequest.getShowDetail()); | |
248 | + return new BaseListResponse().setData(data).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setPageInfo(antExRecordQuery.getPageInfo()); | |
249 | + } | |
262 | 250 | |
263 | - //登记人 | |
264 | - if (org.apache.commons.lang.StringUtils.isNotEmpty(e.getBuildDoctor())) { | |
265 | - if (NumberUtils.isNumber(e.getBuildDoctor())) { | |
266 | - Users users = usersService.getUsers(NumberUtils.toInt(e.getBuildDoctor())); | |
267 | - if (null != users) { | |
268 | - antExManagerResult.setlName(users.getName()); | |
269 | - } else { | |
270 | - antExManagerResult.setlName(e.getBuildDoctor()); | |
271 | - } | |
272 | - } else { | |
273 | - antExManagerResult.setlName(e.getBuildDoctor()); | |
274 | - } | |
275 | - } | |
276 | - //产检医生 | |
277 | - if (org.apache.commons.lang.StringUtils.isNotEmpty(e.getCheckDoctor())) { | |
278 | - if (NumberUtils.isNumber(e.getCheckDoctor())) { | |
279 | - Users users = usersService.getUsers(NumberUtils.toInt(e.getCheckDoctor())); | |
280 | - if (null != users) { | |
281 | - antExManagerResult.setCheckDoctor(users.getName()); | |
282 | - } else { | |
283 | - antExManagerResult.setCheckDoctor(e.getCheckDoctor()); | |
284 | - } | |
285 | - } else { | |
286 | - antExManagerResult.setCheckDoctor(e.getCheckDoctor()); | |
287 | - } | |
288 | - } | |
289 | 251 | |
290 | - AntExRecordQuery antExRecordQuery1 = new AntExRecordQuery(); | |
291 | - antExRecordQuery1.setCheckTimeEnd(e.getCheckTime()); | |
292 | - antExRecordQuery1.setPid(e.getPid()); | |
293 | - antExRecordQuery1.setHospitalId(hospital); | |
294 | - | |
295 | - //本院低次 | |
296 | - int dichi = recordService.count(antExRecordQuery1); | |
297 | - antExRecordQuery1.setHospitalId(null); | |
298 | - | |
299 | - antExManagerResult.settTimes(recordService.count(antExRecordQuery1)); | |
300 | - antExManagerResult.setChTimes(dichi); | |
301 | - //高危因素 | |
302 | - antExManagerResult.setrLevel(commonService.findRiskLevel(e.gethLevel())); | |
303 | - antExManagerResult.setRiskFactor(commonService.resloveFactor(e.gethRisk()));*/ | |
304 | - | |
305 | - | |
252 | + private List<AntExManagerResult> getAntExRecords( List<AntExRecordModel> antExRecordModelList,String hospital,boolean isRegion,Integer isShowDetail) | |
253 | + { | |
254 | + List<AntExManagerResult> data = new ArrayList<>(); | |
255 | + if (CollectionUtils.isNotEmpty(antExRecordModelList)) { | |
306 | 256 | int batchSize = 4; |
307 | 257 | int end = 0; |
308 | 258 | List<Future> listFuture = new ArrayList<>(); |
309 | 259 | |
310 | 260 | |
... | ... | @@ -323,15 +273,16 @@ |
323 | 273 | } |
324 | 274 | Organization og = organizationService.getOrganization(Integer.valueOf(hospital)); |
325 | 275 | |
326 | - if(og!=null&&"2".equals(og.getCityId())&&antExManagerQueryRequest.getShowDetail()==1){//需要隐藏姓名、地址 | |
276 | + if(og!=null&&"2".equals(og.getCityId())&&isShowDetail==1){//需要隐藏姓名、地址 | |
327 | 277 | for (AntExManagerResult result:data){ |
328 | 278 | result.setName(StringUtils.encryName(result.getName())); |
329 | 279 | result.setAddr(StringUtils.encryAddr(result.getAddr())); |
330 | 280 | } |
331 | 281 | } |
332 | - return new BaseListResponse().setData(data).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setPageInfo(antExRecordQuery.getPageInfo()); | |
282 | + return data; | |
333 | 283 | } |
334 | 284 | |
285 | + | |
335 | 286 | /** |
336 | 287 | * 产检统计 |
337 | 288 | * |
... | ... | @@ -644,7 +595,7 @@ |
644 | 595 | Map<String,List<AntExRecordModel>> map = new HashMap<>(); |
645 | 596 | |
646 | 597 | antExRecordQuery.setHospitalId(hospitalId); |
647 | - List<AntExRecordModel> antExRecordModelList = recordService.queryAntExRecords(antExRecordQuery); | |
598 | + List<AntExRecordModel> antExRecordModelList = recordService.queryAntExRecords(antExRecordQuery, Sort.Direction.DESC,"created"); | |
648 | 599 | if (CollectionUtils.isNotEmpty(antExRecordModelList)) |
649 | 600 | { |
650 | 601 | for (AntExRecordModel recordModel : antExRecordModelList) |
651 | 602 | |
... | ... | @@ -659,8 +610,10 @@ |
659 | 610 | } |
660 | 611 | } |
661 | 612 | |
662 | - List<AntExRecordModel> riskList = new ArrayList<>(); | |
613 | + List<String> riskListIds = new ArrayList<>(); | |
663 | 614 | |
615 | + Map<String,List<String>> incriskMap = new HashMap<>(); | |
616 | + | |
664 | 617 | AntExRecordQuery beforeRecordQuery = new AntExRecordQuery(); |
665 | 618 | |
666 | 619 | if (map.size() > 0) |
667 | 620 | |
... | ... | @@ -686,10 +639,11 @@ |
686 | 639 | AntExRecordModel twoRecord = beforeAntRecords.get(0); |
687 | 640 | List currentRiskList = oneRecord.gethRisk(); |
688 | 641 | List beforeRiskList = twoRecord.gethRisk(); |
642 | + | |
689 | 643 | if (CollectionUtils.isNotEmpty(beforeRiskList) && beforeRiskList.contains("d42eec03-aa86-45b8-a4e0-78a0ff365fb6")) |
690 | 644 | { |
691 | - oneRecord.setIncrhRisk(currentRiskList); | |
692 | - riskList.add(oneRecord); | |
645 | + riskListIds.add(oneRecord.getId()); | |
646 | + incriskMap.put(oneRecord.getId(), currentRiskList); | |
693 | 647 | } |
694 | 648 | else if (CollectionUtils.isNotEmpty(beforeRiskList) ) |
695 | 649 | { |
696 | 650 | |
... | ... | @@ -703,15 +657,15 @@ |
703 | 657 | } |
704 | 658 | if (CollectionUtils.isNotEmpty(incrHrisk)) |
705 | 659 | { |
706 | - oneRecord.setIncrhRisk(incrHrisk); | |
707 | - riskList.add(oneRecord); | |
660 | + riskListIds.add(oneRecord.getId()); | |
661 | + incriskMap.put(oneRecord.getId(), incrHrisk); | |
708 | 662 | } |
709 | 663 | } |
710 | 664 | } |
711 | 665 | else |
712 | 666 | { |
713 | - oneRecord.setIncrhRisk(oneRecord.gethRisk()); | |
714 | - riskList.add(oneRecord); | |
667 | + riskListIds.add(oneRecord.getId()); | |
668 | + incriskMap.put(oneRecord.getId(), oneRecord.gethRisk()); | |
715 | 669 | } |
716 | 670 | } |
717 | 671 | } |
718 | 672 | |
719 | 673 | |
720 | 674 | |
... | ... | @@ -731,23 +685,23 @@ |
731 | 685 | List beforeRiskList = twoRecord.gethRisk(); |
732 | 686 | if (CollectionUtils.isNotEmpty(beforeRiskList) && beforeRiskList.contains("d42eec03-aa86-45b8-a4e0-78a0ff365fb6")) |
733 | 687 | { |
734 | - oneRecord.setIncrhRisk(currentRiskList); | |
735 | - riskList.add(oneRecord); | |
688 | + riskListIds.add(oneRecord.getId()); | |
689 | + incriskMap.put(oneRecord.getId(), currentRiskList); | |
736 | 690 | } |
737 | 691 | else if (CollectionUtils.isNotEmpty(beforeRiskList) ) |
738 | 692 | { |
739 | - List incrHrisk = new ArrayList(); | |
693 | + List<String> incrHrisk = new ArrayList(); | |
740 | 694 | for (Object riskId : currentRiskList) |
741 | 695 | { |
742 | 696 | if (!beforeRiskList.contains(riskId)) |
743 | 697 | { |
744 | - incrHrisk.add(riskId); | |
698 | + incrHrisk.add(String.valueOf(riskId)); | |
745 | 699 | } |
746 | 700 | } |
747 | 701 | if (CollectionUtils.isNotEmpty(incrHrisk)) |
748 | 702 | { |
749 | - oneRecord.setIncrhRisk(incrHrisk); | |
750 | - riskList.add(oneRecord); | |
703 | + riskListIds.add(oneRecord.getId()); | |
704 | + incriskMap.put(oneRecord.getId(), incrHrisk); | |
751 | 705 | } |
752 | 706 | } |
753 | 707 | } |
... | ... | @@ -755,7 +709,23 @@ |
755 | 709 | } |
756 | 710 | } |
757 | 711 | |
758 | - return null; | |
712 | + AntExRecordQuery pageAntExRecordsQuery = new AntExRecordQuery(); | |
713 | + pageAntExRecordsQuery.setNeed("true"); | |
714 | + pageAntExRecordsQuery.setPage(antExManagerQueryRequest.getPage()); | |
715 | + pageAntExRecordsQuery.setLimit(antExManagerQueryRequest.getLimit()); | |
716 | + pageAntExRecordsQuery.setIds(riskListIds); | |
717 | + List<AntExRecordModel> pageAntExRecords = recordService.queryAntExRecords(pageAntExRecordsQuery); | |
718 | + if (CollectionUtils.isNotEmpty(pageAntExRecords)) | |
719 | + { | |
720 | + for (AntExRecordModel model : pageAntExRecords) | |
721 | + { | |
722 | + model.setIncrhRisk(incriskMap.get(model.getId())); | |
723 | + } | |
724 | + } | |
725 | + | |
726 | + List<AntExManagerResult> data = getAntExRecords(pageAntExRecords, hospitalId, false, antExManagerQueryRequest.getShowDetail()); | |
727 | + | |
728 | + return new BaseListResponse().setData(data).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setPageInfo(pageAntExRecordsQuery.getPageInfo()); | |
759 | 729 | } |
760 | 730 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
21e7a35
... | ... | @@ -730,13 +730,26 @@ |
730 | 730 | |
731 | 731 | List<MsgRequest> messages = new ArrayList<>(); |
732 | 732 | MsgRequest mr = new MsgRequest(); |
733 | + | |
734 | + String doctorName = ""; | |
735 | + try { | |
736 | + Users users = usersService.getUsers(Integer.parseInt(patient.getLastCheckEmployeeId())); | |
737 | + if (users != null && users.getYn() == YnEnums.YES.getId()) { | |
738 | + doctorName = users.getName(); | |
739 | + mr.setKeyword1(doctorName); | |
740 | + } | |
741 | + } catch (Exception e) { | |
742 | + System.out.print(e + patient.getLastCheckEmployeeId()); | |
743 | + } | |
744 | + | |
745 | + | |
733 | 746 | String content = ""; |
734 | 747 | if (isHightRisk) { |
735 | 748 | //风险名称 |
736 | 749 | String riskNmae = queryRiskNameStr(patient.getRiskFactorId()); |
737 | - content = com.lyms.platform.common.utils.StringUtils.replaceNameRisk(patient.getUsername(), riskNmae, templateModel.getContent()); | |
750 | + content = com.lyms.platform.common.utils.StringUtils.replaceNameRisk(patient.getUsername(), riskNmae, templateModel.getContent(),doctorName); | |
738 | 751 | } else { |
739 | - content = com.lyms.platform.common.utils.StringUtils.replaceName(patient.getUsername(), templateModel.getContent()); | |
752 | + content = com.lyms.platform.common.utils.StringUtils.replaceName(patient.getUsername(), templateModel.getContent(),doctorName); | |
740 | 753 | } |
741 | 754 | |
742 | 755 | mr.setFirst("【" + messagePrefix + "】" + content); |
... | ... | @@ -752,14 +765,7 @@ |
752 | 765 | mr.setPatientId(patient.getId()); |
753 | 766 | mr.setSmsStatus(SmsStatusEnums.WFS.getId()); |
754 | 767 | mr.setServiceType((templateModel.getTemplateType() == null || templateModel.getTemplateType() == 0) ? 1 : 3); //判断发送类型 |
755 | - try { | |
756 | - Users users = usersService.getUsers(Integer.parseInt(patient.getLastCheckEmployeeId())); | |
757 | - if (users != null && users.getYn() == YnEnums.YES.getId()) { | |
758 | - mr.setKeyword1(users.getName()); | |
759 | - } | |
760 | - } catch (Exception e) { | |
761 | - System.out.print(e + patient.getLastCheckEmployeeId()); | |
762 | - } | |
768 | + | |
763 | 769 | |
764 | 770 | mr.setKeyword2(DateUtil.getymd()); |
765 | 771 | mr.setRemark(""); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AntExManagerResult.java
View file @
21e7a35
... | ... | @@ -29,8 +29,16 @@ |
29 | 29 | private String cDueWeek; |
30 | 30 | //风险等级 |
31 | 31 | private List<Map> rLevel; |
32 | + | |
33 | + //新增风险等级 | |
34 | + private List<Map> incrRLevel; | |
35 | + | |
32 | 36 | //高危因素 |
33 | 37 | private String riskFactor; |
38 | + | |
39 | + //新增高危因素 | |
40 | + private String incrRiskFactor; | |
41 | + | |
34 | 42 | //高危评分 |
35 | 43 | private String riskScore; |
36 | 44 | //本院产检次数 |
... | ... | @@ -55,6 +63,22 @@ |
55 | 63 | private String addr; |
56 | 64 | //产次 |
57 | 65 | private int cTimes=1; |
66 | + | |
67 | + public List<Map> getIncrRLevel() { | |
68 | + return incrRLevel; | |
69 | + } | |
70 | + | |
71 | + public void setIncrRLevel(List<Map> incrRLevel) { | |
72 | + this.incrRLevel = incrRLevel; | |
73 | + } | |
74 | + | |
75 | + public String getIncrRiskFactor() { | |
76 | + return incrRiskFactor; | |
77 | + } | |
78 | + | |
79 | + public void setIncrRiskFactor(String incrRiskFactor) { | |
80 | + this.incrRiskFactor = incrRiskFactor; | |
81 | + } | |
58 | 82 | |
59 | 83 | public String getScreenResult() { |
60 | 84 | return screenResult; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/AntExRecordWorker.java
View file @
21e7a35
... | ... | @@ -199,6 +199,14 @@ |
199 | 199 | //筛查结果 |
200 | 200 | List<String> screen = e.getScreenResult(); |
201 | 201 | |
202 | + | |
203 | + //新增高危因素 | |
204 | + String incrRisk = commonService.resloveFactor(e.getIncrhRisk()); | |
205 | + antExManagerResult.setIncrRiskFactor(incrRisk); | |
206 | + | |
207 | + //高危因素 | |
208 | + antExManagerResult.setIncrRLevel(commonService.findRiskLevelByRisk(e.getIncrhRisk())); | |
209 | + | |
202 | 210 | String screenStr = basicConfigService.getScreenResult(screen); |
203 | 211 | antExManagerResult.setScreenResult(screenStr); |
204 | 212 | antExManagerResult.setRiskFactor(ri); |