Commit e5b003dab65de0356531a7a2caeac7a994edaab6
1 parent
6aedcb4c7e
Exists in
master
and in
6 other branches
根据疾病查询
Showing 4 changed files with 141 additions and 70 deletions
- platform-common/src/main/java/com/lyms/platform/common/enums/DiseaseTypeEnums.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PuerperaManageController.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/request/RiskPatientsQueryRequest.java
platform-common/src/main/java/com/lyms/platform/common/enums/DiseaseTypeEnums.java
View file @
e5b003d
1 | +package com.lyms.platform.common.enums; | |
2 | + | |
3 | +import java.util.ArrayList; | |
4 | +import java.util.HashMap; | |
5 | +import java.util.List; | |
6 | +import java.util.Map; | |
7 | + | |
8 | +/** | |
9 | + * @auther yangfei | |
10 | + * @createTime 2017年11月06日 16时37分 | |
11 | + * @discription | |
12 | + */ | |
13 | +public enum DiseaseTypeEnums { | |
14 | + YIGAN("yg","乙肝"), | |
15 | + BINGGAN("bg","丙肝"), | |
16 | + MEIDU("md","梅毒"); | |
17 | + | |
18 | + private DiseaseTypeEnums(String id, String name){ | |
19 | + this.name=name; | |
20 | + this.id =id; | |
21 | + | |
22 | + } | |
23 | + private String name; | |
24 | + private String id; | |
25 | + | |
26 | + public String getId() { | |
27 | + return id; | |
28 | + } | |
29 | + | |
30 | + public String getName() { | |
31 | + return name; | |
32 | + } | |
33 | + public static String getTitleById(String id){ | |
34 | + for(DiseaseTypeEnums enums:values()){ | |
35 | + if(id != null && id==enums.getId()){ | |
36 | + return enums.getName(); | |
37 | + } | |
38 | + } | |
39 | + return null; | |
40 | + } | |
41 | + | |
42 | + public static List<Map<String,String>> getDiseaseTypeList() | |
43 | + { | |
44 | + List<Map<String,String>> list = new ArrayList<>(); | |
45 | + for(DiseaseTypeEnums s : DiseaseTypeEnums.values()) { | |
46 | + Map<String,String> map = new HashMap<>(); | |
47 | + map.put("id", String.valueOf(s.getId())); | |
48 | + map.put("name", s.getName()); | |
49 | + list.add(map); | |
50 | + } | |
51 | + return list; | |
52 | + } | |
53 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PuerperaManageController.java
View file @
e5b003d
... | ... | @@ -4,6 +4,7 @@ |
4 | 4 | import com.lyms.platform.common.base.BaseController; |
5 | 5 | import com.lyms.platform.common.base.LoginContext; |
6 | 6 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
7 | +import com.lyms.platform.common.enums.DiseaseTypeEnums; | |
7 | 8 | import com.lyms.platform.common.enums.ServiceStatusEnums; |
8 | 9 | import com.lyms.platform.common.enums.ServiceTypeEnums; |
9 | 10 | import com.lyms.platform.common.result.BaseListResponse; |
... | ... | @@ -184,6 +185,10 @@ |
184 | 185 | //服务类型 |
185 | 186 | List serviceType = ServiceTypeEnums.getServiceTypeList(); |
186 | 187 | map.put("serviceType", serviceType); |
188 | + | |
189 | + //疾病类型 | |
190 | + List diseaseType = DiseaseTypeEnums.getDiseaseTypeList(); | |
191 | + map.put("diseaseType", diseaseType); | |
187 | 192 | |
188 | 193 | //服务状态 |
189 | 194 | List serviceStatus = ServiceStatusEnums.getServiceStatusList(); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
View file @
e5b003d
... | ... | @@ -2,6 +2,8 @@ |
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.dao.operator.MongoCondition; | |
6 | +import com.lyms.platform.common.dao.operator.MongoOper; | |
5 | 7 | import com.lyms.platform.common.enums.*; |
6 | 8 | import com.lyms.platform.common.result.BaseListResponse; |
7 | 9 | import com.lyms.platform.common.result.BaseObjectResponse; |
8 | 10 | |
... | ... | @@ -234,15 +236,11 @@ |
234 | 236 | patientsQuery.setType(type); |
235 | 237 | |
236 | 238 | //add lqy 高危孕产妇统计需求 |
237 | - if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(riskPatientsQueryRequest.getType())) | |
238 | - { | |
239 | - if ("2".equals(riskPatientsQueryRequest.getType())) | |
240 | - { | |
239 | + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(riskPatientsQueryRequest.getType())) { | |
240 | + if ("2".equals(riskPatientsQueryRequest.getType())) { | |
241 | 241 | //1孕妇 |
242 | 242 | patientsQuery.setType(1); |
243 | - } | |
244 | - else if ("3".equals(riskPatientsQueryRequest.getType())) | |
245 | - { | |
243 | + } else if ("3".equals(riskPatientsQueryRequest.getType())) { | |
246 | 244 | //3产妇 |
247 | 245 | patientsQuery.setType(3); |
248 | 246 | } |
249 | 247 | |
250 | 248 | |
251 | 249 | |
... | ... | @@ -253,15 +251,13 @@ |
253 | 251 | patientsQuery.sethScoreStart(riskPatientsQueryRequest.getStrtHScore()); |
254 | 252 | patientsQuery.sethScoreEnd(riskPatientsQueryRequest.getEndHScore()); |
255 | 253 | |
254 | + | |
256 | 255 | //高危统计中的自定义高危 |
257 | - if ("otherRiskId".equals(riskPatientsQueryRequest.getrFacotr())) | |
258 | - { | |
256 | + if ("otherRiskId".equals(riskPatientsQueryRequest.getrFacotr())) { | |
259 | 257 | patientsQuery.setoRiskFactor("true"); |
258 | + } else { | |
259 | + patientsQuery.setrFactorList(com.lyms.platform.common.utils.StringUtils.covertToList(riskPatientsQueryRequest.getrFacotr(), String.class)); | |
260 | 260 | } |
261 | - else | |
262 | - { | |
263 | - patientsQuery.setrFactorList(com.lyms.platform.common.utils.StringUtils.covertToList(riskPatientsQueryRequest.getrFacotr(),String.class)); | |
264 | - } | |
265 | 261 | |
266 | 262 | Date currentDate = DateUtil.formatDate(new Date()); |
267 | 263 | |
... | ... | @@ -433,6 +429,35 @@ |
433 | 429 | } |
434 | 430 | patientsQuery.setHospitalList(hospitalList); |
435 | 431 | |
432 | + //根据疾病进行查询 | |
433 | + if (StringUtils.isNotEmpty(riskPatientsQueryRequest.getDiseaseType())) { | |
434 | + MongoCondition criteria = new MongoCondition("hospitalId", hospitalList, MongoOper.IN); | |
435 | + //乙肝查询 | |
436 | + if (StringUtils.contains(riskPatientsQueryRequest.getDiseaseType(), DiseaseTypeEnums.YIGAN.getId())) { | |
437 | + criteria.andCondition(new MongoCondition("ygbmky", true, MongoOper.EXISTS) | |
438 | + .orCondition(new MongoCondition("ygbmkt", true, MongoOper.EXISTS)) | |
439 | + .orCondition(new MongoCondition("ygeky", true, MongoOper.EXISTS)) | |
440 | + .orCondition(new MongoCondition("ygekt", true, MongoOper.EXISTS)) | |
441 | + .orCondition(new MongoCondition("yghxkt", true, MongoOper.EXISTS)) | |
442 | + ); | |
443 | + } | |
444 | + //丙肝查询 | |
445 | + if (StringUtils.contains(riskPatientsQueryRequest.getDiseaseType(), DiseaseTypeEnums.BINGGAN.getId())) { | |
446 | + criteria.andCondition(new MongoCondition("bg", true, MongoOper.EXISTS)); | |
447 | + } | |
448 | + //梅毒查询 | |
449 | + if (StringUtils.contains(riskPatientsQueryRequest.getDiseaseType(), DiseaseTypeEnums.MEIDU.getId())) { | |
450 | + criteria.andCondition(new MongoCondition("syjg", true, MongoOper.EXISTS) | |
451 | + .orCondition(new MongoCondition("hivkt", true, MongoOper.EXISTS)) | |
452 | + ); | |
453 | + } | |
454 | + List<AntExChuModel> antExChuModels = antExService.queryAntExChu(criteria.toMongoQuery()); | |
455 | + List<String> pIds = new ArrayList<>(); | |
456 | + for(AntExChuModel antChu : antExChuModels){ | |
457 | + pIds.add(antChu.getParentId()); | |
458 | + } | |
459 | + patientsQuery.setpIds(pIds); | |
460 | + } | |
436 | 461 | |
437 | 462 | fmHospitalList.addAll(hospitalList); |
438 | 463 | |
439 | 464 | |
440 | 465 | |
... | ... | @@ -457,20 +482,15 @@ |
457 | 482 | } |
458 | 483 | fmHospitalList.retainAll(orgId); |
459 | 484 | } |
460 | - if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(riskPatientsQueryRequest.getFmHospital())) | |
461 | - { | |
485 | + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(riskPatientsQueryRequest.getFmHospital())) { | |
462 | 486 | patientsQuery.setFmHospital(riskPatientsQueryRequest.getFmHospital()); |
463 | - } | |
464 | - else | |
465 | - { | |
466 | - if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(riskPatientsQueryRequest.getFprovinceId())) | |
467 | - { | |
487 | + } else { | |
488 | + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(riskPatientsQueryRequest.getFprovinceId())) { | |
468 | 489 | patientsQuery.setFmHospitalList(fmHospitalList); |
469 | 490 | } |
470 | 491 | } |
471 | 492 | |
472 | 493 | |
473 | - | |
474 | 494 | } else { |
475 | 495 | |
476 | 496 | patientsQuery.setFmHospital(riskPatientsQueryRequest.getFmHospital()); |
477 | 497 | |
... | ... | @@ -505,15 +525,13 @@ |
505 | 525 | patientsQuery.setPostViewTimesStart(riskPatientsQueryRequest.getPostViewTimesStart()); |
506 | 526 | patientsQuery.setPostViewTimesEnd(riskPatientsQueryRequest.getPostViewTimesEnd()); |
507 | 527 | |
508 | - if (riskPatientsQueryRequest.getPostViewDaysStart() != null) | |
509 | - { | |
510 | - Date start = DateUtil.addDay(new Date(),-riskPatientsQueryRequest.getPostViewDaysStart()); | |
528 | + if (riskPatientsQueryRequest.getPostViewDaysStart() != null) { | |
529 | + Date start = DateUtil.addDay(new Date(), -riskPatientsQueryRequest.getPostViewDaysStart()); | |
511 | 530 | patientsQuery.setFmDateEnd(start); |
512 | 531 | } |
513 | 532 | |
514 | - if (riskPatientsQueryRequest.getPostViewDaysEnd() != null) | |
515 | - { | |
516 | - Date end = DateUtil.addDay(new Date(),-riskPatientsQueryRequest.getPostViewDaysEnd()-1); | |
533 | + if (riskPatientsQueryRequest.getPostViewDaysEnd() != null) { | |
534 | + Date end = DateUtil.addDay(new Date(), -riskPatientsQueryRequest.getPostViewDaysEnd() - 1); | |
517 | 535 | patientsQuery.setFmDateStart(end); |
518 | 536 | } |
519 | 537 | |
520 | 538 | |
521 | 539 | |
522 | 540 | |
523 | 541 | |
524 | 542 | |
... | ... | @@ -529,37 +547,31 @@ |
529 | 547 | } |
530 | 548 | |
531 | 549 | |
532 | - if (riskPatientsQueryRequest.getFmWeekStart() != null) | |
533 | - { | |
534 | - int start = org.apache.commons.lang.math.NumberUtils.toInt(riskPatientsQueryRequest.getFmWeekStart(), 0)*7; | |
550 | + if (riskPatientsQueryRequest.getFmWeekStart() != null) { | |
551 | + int start = org.apache.commons.lang.math.NumberUtils.toInt(riskPatientsQueryRequest.getFmWeekStart(), 0) * 7; | |
535 | 552 | patientsQuery.setFmWeekStart(start); |
536 | 553 | } |
537 | 554 | |
538 | - if (riskPatientsQueryRequest.getFmWeekEnd() != null) | |
539 | - { | |
540 | - int end = org.apache.commons.lang.math.NumberUtils.toInt(riskPatientsQueryRequest.getFmWeekEnd(), 0)+1; | |
541 | - end = end * 7 - 1; | |
555 | + if (riskPatientsQueryRequest.getFmWeekEnd() != null) { | |
556 | + int end = org.apache.commons.lang.math.NumberUtils.toInt(riskPatientsQueryRequest.getFmWeekEnd(), 0) + 1; | |
557 | + end = end * 7 - 1; | |
542 | 558 | patientsQuery.setFmWeekEnd(end); |
543 | 559 | } |
544 | 560 | |
545 | - if (riskPatientsQueryRequest.getFmStartAge() != null) | |
546 | - { | |
561 | + if (riskPatientsQueryRequest.getFmStartAge() != null) { | |
547 | 562 | patientsQuery.setFmAgeStart(riskPatientsQueryRequest.getFmStartAge()); |
548 | 563 | } |
549 | 564 | |
550 | - if (riskPatientsQueryRequest.getFmEndAge() != null) | |
551 | - { | |
565 | + if (riskPatientsQueryRequest.getFmEndAge() != null) { | |
552 | 566 | patientsQuery.setFmAgeEnd(riskPatientsQueryRequest.getFmEndAge()); |
553 | 567 | } |
554 | 568 | |
555 | 569 | //建档孕周 |
556 | - if (riskPatientsQueryRequest.getBuildWeekStart() != null) | |
557 | - { | |
558 | - patientsQuery.setBuildDaysStart(riskPatientsQueryRequest.getBuildWeekStart()*7); | |
570 | + if (riskPatientsQueryRequest.getBuildWeekStart() != null) { | |
571 | + patientsQuery.setBuildDaysStart(riskPatientsQueryRequest.getBuildWeekStart() * 7); | |
559 | 572 | } |
560 | 573 | |
561 | - if (riskPatientsQueryRequest.getBuildWeekEnd() != null) | |
562 | - { | |
574 | + if (riskPatientsQueryRequest.getBuildWeekEnd() != null) { | |
563 | 575 | patientsQuery.setBuildDaysEnd((riskPatientsQueryRequest.getBuildWeekEnd() + 1) * 7 - 1); |
564 | 576 | } |
565 | 577 | |
... | ... | @@ -747,7 +759,7 @@ |
747 | 759 | return response; |
748 | 760 | } |
749 | 761 | |
750 | - com.lyms.platform.beans.MessageListRequest smsList = new com.lyms.platform.beans.MessageListRequest(); | |
762 | + com.lyms.platform.beans.MessageListRequest smsList = new com.lyms.platform.beans.MessageListRequest(); | |
751 | 763 | List<com.lyms.platform.beans.MessageRequest> messages = new ArrayList<>(); |
752 | 764 | List<Patients> sendModels = new ArrayList<>(); |
753 | 765 | if (CollectionUtils.isNotEmpty(patientGuideSmsRequest.getIds())) { |
... | ... | @@ -766,7 +778,7 @@ |
766 | 778 | |
767 | 779 | com.lyms.platform.beans.MessageRequest mr = new com.lyms.platform.beans.MessageRequest(); |
768 | 780 | |
769 | - String content = patientGuideSmsRequest.getSmsContent(); | |
781 | + String content = patientGuideSmsRequest.getSmsContent(); | |
770 | 782 | |
771 | 783 | mr.setFirst("【" + messagePrefix + "】" + content); |
772 | 784 | mr.setObjType(ServiceObjEnums.YUNOBJ.getId()); |
... | ... | @@ -780,8 +792,7 @@ |
780 | 792 | mr.setPatientId(patient.getId()); |
781 | 793 | |
782 | 794 | String doctorName = ""; |
783 | - if (dbuser != null) | |
784 | - { | |
795 | + if (dbuser != null) { | |
785 | 796 | doctorName = dbuser.getName(); |
786 | 797 | } |
787 | 798 | |
788 | 799 | |
... | ... | @@ -801,14 +812,11 @@ |
801 | 812 | smsList.setTypeId(ProjectTypeEnums.YNXT.getId()); |
802 | 813 | smsList.setMessages(messages); |
803 | 814 | //调用发送接口 |
804 | - if ("4".equals(HIS_VERSION)) | |
805 | - { | |
815 | + if ("4".equals(HIS_VERSION)) { | |
806 | 816 | //秦皇岛 |
807 | 817 | //保存到同步表中 |
808 | 818 | syncDataService.savePostMsg(JsonUtil.obj2JsonString(smsList), messages.get(0).getHospitalId()); |
809 | - } | |
810 | - else | |
811 | - { | |
819 | + } else { | |
812 | 820 | //保存到短信中心 线上 |
813 | 821 | MessageCenterService.saveMsgCenter(smsList); |
814 | 822 | } |
... | ... | @@ -931,7 +939,7 @@ |
931 | 939 | cnames.put("lName", "登记人"); |
932 | 940 | cnames.put("serviceType", "服务类型"); |
933 | 941 | cnames.put("serviceStatus", "服务状态"); |
934 | - }else if(patientsQueryRequest.getQueryType() == 3){ | |
942 | + } else if (patientsQueryRequest.getQueryType() == 3) { | |
935 | 943 | listResponse = (BaseListResponse) queryHighRisk(patientsQueryRequest, null, 3, userId, null, Boolean.FALSE); |
936 | 944 | List list = listResponse.getData(); |
937 | 945 | for (Object obj : list) { |
938 | 946 | |
... | ... | @@ -984,14 +992,12 @@ |
984 | 992 | |
985 | 993 | PatientsQuery patientsQuery = new PatientsQuery(); |
986 | 994 | |
987 | - if (patientManagerRequest.getBuildWeekStart() != null) | |
988 | - { | |
989 | - patientsQuery.setBuildDaysStart(patientManagerRequest.getBuildWeekStart()*7); | |
995 | + if (patientManagerRequest.getBuildWeekStart() != null) { | |
996 | + patientsQuery.setBuildDaysStart(patientManagerRequest.getBuildWeekStart() * 7); | |
990 | 997 | } |
991 | 998 | |
992 | - if (patientManagerRequest.getBuildWeekEnd() != null) | |
993 | - { | |
994 | - patientsQuery.setBuildDaysEnd((patientManagerRequest.getBuildWeekEnd()+1) * 7 - 1); | |
999 | + if (patientManagerRequest.getBuildWeekEnd() != null) { | |
1000 | + patientsQuery.setBuildDaysEnd((patientManagerRequest.getBuildWeekEnd() + 1) * 7 - 1); | |
995 | 1001 | } |
996 | 1002 | |
997 | 1003 | patientsQuery.setYn(YnEnums.YES.getId()); |
998 | 1004 | |
999 | 1005 | |
1000 | 1006 | |
... | ... | @@ -1064,17 +1070,13 @@ |
1064 | 1070 | patientManagerQueryModel.setBuildWeek(dueWeek); |
1065 | 1071 | |
1066 | 1072 | String bookbuildingDoctor = ""; |
1067 | - if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(patients.getBookbuildingDoctor())) | |
1068 | - { | |
1073 | + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(patients.getBookbuildingDoctor())) { | |
1069 | 1074 | Users user = usersService.getUsers(Integer.valueOf(patients.getBookbuildingDoctor())); |
1070 | - if (user != null) | |
1071 | - { | |
1075 | + if (user != null) { | |
1072 | 1076 | bookbuildingDoctor = user.getName(); |
1077 | + } else { | |
1078 | + System.out.println(patients.getId() + ";no user bookbuildingDoctor" + patients.getBookbuildingDoctor()); | |
1073 | 1079 | } |
1074 | - else | |
1075 | - { | |
1076 | - System.out.println(patients.getId()+";no user bookbuildingDoctor"+patients.getBookbuildingDoctor()); | |
1077 | - } | |
1078 | 1080 | } |
1079 | 1081 | |
1080 | 1082 | |
1081 | 1083 | |
1082 | 1084 | |
... | ... | @@ -1115,15 +1117,15 @@ |
1115 | 1117 | } catch (Exception e) { |
1116 | 1118 | } |
1117 | 1119 | Patients p = mongoTemplate.findById(patientBaseResult.getId(), Patients.class); |
1118 | - if(p != null) { | |
1120 | + if (p != null) { | |
1119 | 1121 | AntExChuModel chuModel = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(p.getPid()).and("yn").ne("0")).with(new Sort(Sort.Direction.DESC, "created")), AntExChuModel.class); |
1120 | - if(chuModel != null) { | |
1122 | + if (chuModel != null) { | |
1121 | 1123 | patientBaseResult.setHeight(StringUtils.isNotEmpty(chuModel.getHeight()) ? chuModel.getHeight() : ""); |
1122 | 1124 | patientBaseResult.setWeight(StringUtils.isNotEmpty(chuModel.getWeight()) ? chuModel.getWeight() : ""); |
1123 | 1125 | } |
1124 | 1126 | } |
1125 | 1127 | PatientWeight pw = mongoTemplate.findOne(Query.query(Criteria.where("patientId").is(patientBaseResult.getId())), PatientWeight.class); |
1126 | - if(pw != null) { | |
1128 | + if (pw != null) { | |
1127 | 1129 | patientBaseResult.setPwId(pw.getId()); |
1128 | 1130 | } |
1129 | 1131 | return new BaseObjectResponse().setData(patientBaseResult).setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/RiskPatientsQueryRequest.java
View file @
e5b003d
... | ... | @@ -122,6 +122,9 @@ |
122 | 122 | //建档人 |
123 | 123 | private String buildUserId; |
124 | 124 | |
125 | + //疾病类型:"yg","乙肝" "bg","丙肝" "md","梅毒" | |
126 | + private String diseaseType; | |
127 | + | |
125 | 128 | //产检医生 |
126 | 129 | private String lastCheckDoctorId; |
127 | 130 | |
... | ... | @@ -143,6 +146,14 @@ |
143 | 146 | private Integer buildWeekEnd; |
144 | 147 | |
145 | 148 | private String notEnable; |
149 | + | |
150 | + public String getDiseaseType() { | |
151 | + return diseaseType; | |
152 | + } | |
153 | + | |
154 | + public void setDiseaseType(String diseaseType) { | |
155 | + this.diseaseType = diseaseType; | |
156 | + } | |
146 | 157 | |
147 | 158 | public String getNotEnable() { |
148 | 159 | return notEnable; |