Commit 8229b12121e90a54074c27097165d42078ab61dd
1 parent
4f08873d33
Exists in
master
and in
6 other branches
update
Showing 4 changed files with 80 additions and 15 deletions
- platform-dal/src/main/java/com/lyms/platform/pojo/Patients.java
- platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.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/service/impl/RareBloodGroupServiceImpl.java
platform-dal/src/main/java/com/lyms/platform/pojo/Patients.java
View file @
8229b12
| ... | ... | @@ -324,6 +324,17 @@ |
| 324 | 324 | |
| 325 | 325 | private String trackHospitalId; |
| 326 | 326 | |
| 327 | + //稀有血型 1 是稀有血型,空不是 | |
| 328 | + private String rareType; | |
| 329 | + | |
| 330 | + public String getRareType() { | |
| 331 | + return rareType; | |
| 332 | + } | |
| 333 | + | |
| 334 | + public void setRareType(String rareType) { | |
| 335 | + this.rareType = rareType; | |
| 336 | + } | |
| 337 | + | |
| 327 | 338 | public String getTrackHospitalId() { |
| 328 | 339 | return trackHospitalId; |
| 329 | 340 | } |
platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
View file @
8229b12
| ... | ... | @@ -33,6 +33,8 @@ |
| 33 | 33 | |
| 34 | 34 | |
| 35 | 35 | private String liveType; |
| 36 | + | |
| 37 | + private String rareType; | |
| 36 | 38 | /** |
| 37 | 39 | * 关键字 |
| 38 | 40 | */ |
| ... | ... | @@ -524,7 +526,9 @@ |
| 524 | 526 | if (null != liveType) { |
| 525 | 527 | condition = condition.and("pliveTypeId", liveType, MongoOper.IS); |
| 526 | 528 | } |
| 527 | - | |
| 529 | + if (null != rareType) { | |
| 530 | + condition = condition.and("rareType", rareType, MongoOper.IS); | |
| 531 | + } | |
| 528 | 532 | if (null != sendCareMan) { |
| 529 | 533 | condition = condition.and("sendCareMan", sendCareMan, MongoOper.IS); |
| 530 | 534 | } |
| ... | ... | @@ -698,6 +702,7 @@ |
| 698 | 702 | condition = condition.and("pid", pIds, MongoOper.IN); |
| 699 | 703 | } |
| 700 | 704 | |
| 705 | + | |
| 701 | 706 | if (null != blNum) { |
| 702 | 707 | condition = condition.and("blNum", blNum, MongoOper.IS); |
| 703 | 708 | } |
| ... | ... | @@ -1204,6 +1209,14 @@ |
| 1204 | 1209 | |
| 1205 | 1210 | public void setExistRiskLevel(boolean existRiskLevel) { |
| 1206 | 1211 | this.existRiskLevel = existRiskLevel; |
| 1212 | + } | |
| 1213 | + | |
| 1214 | + public String getRareType() { | |
| 1215 | + return rareType; | |
| 1216 | + } | |
| 1217 | + | |
| 1218 | + public void setRareType(String rareType) { | |
| 1219 | + this.rareType = rareType; | |
| 1207 | 1220 | } |
| 1208 | 1221 | |
| 1209 | 1222 | public String getLiveType() { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
View file @
8229b12
| ... | ... | @@ -5,6 +5,7 @@ |
| 5 | 5 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 6 | 6 | import com.lyms.platform.common.dao.operator.MongoCondition; |
| 7 | 7 | import com.lyms.platform.common.dao.operator.MongoOper; |
| 8 | +import com.lyms.platform.common.dao.operator.MongoQuery; | |
| 8 | 9 | import com.lyms.platform.common.enums.*; |
| 9 | 10 | import com.lyms.platform.common.result.BaseListResponse; |
| 10 | 11 | import com.lyms.platform.common.result.BaseObjectResponse; |
| ... | ... | @@ -707,7 +708,7 @@ |
| 707 | 708 | return new BaseListResponse().setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS).setData(data).setPageInfo(patientsQuery.getPageInfo()); |
| 708 | 709 | } |
| 709 | 710 | |
| 710 | - /** | |
| 711 | + /** | |
| 711 | 712 | * 查询双胎全部孕妇管理 |
| 712 | 713 | * |
| 713 | 714 | * @param riskPatientsQueryRequest |
| ... | ... | @@ -723,6 +724,35 @@ |
| 723 | 724 | //查询符合条件的孕妇 |
| 724 | 725 | StopWatch stopWatch = new StopWatch("queryPatient1 -" + hospital); |
| 725 | 726 | stopWatch.start(); |
| 727 | + | |
| 728 | + | |
| 729 | + Query yn = null; | |
| 730 | + //双绒双羊、单绒单羊、单绒双羊 | |
| 731 | + if ("1".equals(riskPatientsQueryRequest.getTwinsType())) { | |
| 732 | + Criteria criteria2 = Criteria.where("name").is("双胎妊娠(双绒双羊)"); | |
| 733 | + yn = Query.query(Criteria.where("yn").is(1).orOperator(criteria2)); | |
| 734 | + | |
| 735 | + } else if ("2".equals(riskPatientsQueryRequest.getTwinsType())) { | |
| 736 | + Criteria criteria2 = Criteria.where("name").is("双胎妊娠(单绒双羊)"); | |
| 737 | + yn = Query.query(Criteria.where("yn").is(1).orOperator(criteria2)); | |
| 738 | + | |
| 739 | + } else if ("3".equals(riskPatientsQueryRequest.getTwinsType())) { | |
| 740 | + Criteria criteria3 = Criteria.where("name").is("双胎妊娠(单绒单羊)"); | |
| 741 | + yn = Query.query(Criteria.where("yn").is(1).orOperator(criteria3)); | |
| 742 | + } else { | |
| 743 | + Criteria criteria1 = Criteria.where("name").is("双胎妊娠(双绒双羊)"); | |
| 744 | + Criteria criteria2 = Criteria.where("name").is("双胎妊娠(单绒双羊)"); | |
| 745 | + Criteria criteria3 = Criteria.where("name").is("双胎妊娠(单绒单羊)"); | |
| 746 | + yn = Query.query(Criteria.where("yn").is(1).orOperator(criteria1, criteria2, criteria3)); | |
| 747 | + } | |
| 748 | + List<BasicConfig> models = mongoTemplate.find(yn, BasicConfig.class); | |
| 749 | + List<String> rFactorList = new ArrayList<>(); | |
| 750 | + if (models != null && models.size() > 0) { | |
| 751 | + for (int i = 0; i < models.size(); i++) { | |
| 752 | + rFactorList.add(models.get(i).getId()); | |
| 753 | + } | |
| 754 | + } | |
| 755 | + patientsQuery.setrFactorList(rFactorList); | |
| 726 | 756 | List<Patients> patientses = patientsService.queryPatientBySort(patientsQuery, riskPatientsQueryRequest.getSort(), riskPatientsQueryRequest.getOrder()); |
| 727 | 757 | stopWatch.stop(); |
| 728 | 758 | |
| 729 | 759 | |
| 730 | 760 | |
| ... | ... | @@ -731,13 +761,14 @@ |
| 731 | 761 | if (CollectionUtils.isNotEmpty(patientses)) { |
| 732 | 762 | if (type == 1) { |
| 733 | 763 | //处理全部孕妇的情况 |
| 734 | - data = convertToTwinsPatient(riskPatientsQueryRequest,patientses, userId, hospital); | |
| 764 | + data = convertToTwinsPatient(riskPatientsQueryRequest, patientses, userId, hospital); | |
| 735 | 765 | } |
| 736 | 766 | } |
| 737 | - patientsQuery.mysqlBuild(data.size()); | |
| 767 | +// patientsQuery.mysqlBuild(data.size()); | |
| 738 | 768 | return new BaseListResponse().setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS).setData(data).setPageInfo(patientsQuery.getPageInfo()); |
| 739 | 769 | } |
| 740 | - /** | |
| 770 | + | |
| 771 | + /** | |
| 741 | 772 | * 稀有血型专病门诊管理list |
| 742 | 773 | * |
| 743 | 774 | * @param riskPatientsQueryRequest |
| ... | ... | @@ -748,7 +779,7 @@ |
| 748 | 779 | public BaseResponse queryRareList(RiskPatientsQueryRequest riskPatientsQueryRequest, Boolean isHighRisk, Integer type, Integer userId, String needPage, boolean isRegion) { |
| 749 | 780 | //组合请求 |
| 750 | 781 | PatientsQuery patientsQuery = complayRequest(riskPatientsQueryRequest, isHighRisk, type, userId, needPage, isRegion); |
| 751 | - | |
| 782 | + patientsQuery.setRareType("1"); | |
| 752 | 783 | String hospital = autoMatchFacade.getHospitalId(userId); |
| 753 | 784 | //查询符合条件的孕妇 |
| 754 | 785 | StopWatch stopWatch = new StopWatch("queryPatient1 -" + hospital); |
| 755 | 786 | |
| ... | ... | @@ -761,11 +792,16 @@ |
| 761 | 792 | if (CollectionUtils.isNotEmpty(patientses)) { |
| 762 | 793 | if (type == 1) { |
| 763 | 794 | //处理全部孕妇的情况 |
| 764 | - data = convertToRareList(riskPatientsQueryRequest,patientses, userId, hospital); | |
| 795 | + data = convertToRareList(riskPatientsQueryRequest, patientses, userId, hospital); | |
| 765 | 796 | |
| 766 | 797 | } |
| 767 | 798 | } |
| 768 | - patientsQuery.mysqlBuild(data.size()); | |
| 799 | +// patientsQuery.mysqlBuild(data.size()); | |
| 800 | + MongoQuery query = patientsQuery.convertToQuery(); | |
| 801 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(patientsQuery.getNeed())) { | |
| 802 | + patientsQuery.mysqlBuild(data.size()); | |
| 803 | + query.start(patientsQuery.getOffset()).end(patientsQuery.getLimit()); | |
| 804 | + } | |
| 769 | 805 | return new BaseListResponse().setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS).setData(data).setPageInfo(patientsQuery.getPageInfo()); |
| 770 | 806 | } |
| 771 | 807 | |
| ... | ... | @@ -867,7 +903,8 @@ |
| 867 | 903 | } |
| 868 | 904 | return data; |
| 869 | 905 | } |
| 870 | - private List convertToTwinsPatient(RiskPatientsQueryRequest riskPatientsQueryRequest,List<Patients> patientses, Integer userId, String hospital) { | |
| 906 | + | |
| 907 | + private List convertToTwinsPatient(RiskPatientsQueryRequest riskPatientsQueryRequest, List<Patients> patientses, Integer userId, String hospital) { | |
| 871 | 908 | List data = new ArrayList<>(); |
| 872 | 909 | int batchSize = 4; |
| 873 | 910 | int end = 0; |
| ... | ... | @@ -877,7 +914,7 @@ |
| 877 | 914 | if (end > patientses.size()) { |
| 878 | 915 | end = patientses.size(); |
| 879 | 916 | } |
| 880 | - listFuture.add(commonThreadPool.submit(new TwinsPatientWorker(riskPatientsQueryRequest,patientses.subList(i, end), usersService, hospital, antExService, basicConfigService, patientsService, organizationService))); | |
| 917 | + listFuture.add(commonThreadPool.submit(new TwinsPatientWorker(riskPatientsQueryRequest, patientses.subList(i, end), usersService, hospital, antExService, basicConfigService, patientsService, organizationService))); | |
| 881 | 918 | } |
| 882 | 919 | for (Future f : listFuture) { |
| 883 | 920 | try { |
| ... | ... | @@ -888,7 +925,8 @@ |
| 888 | 925 | } |
| 889 | 926 | return data; |
| 890 | 927 | } |
| 891 | - private List convertToRareList(RiskPatientsQueryRequest riskPatientsQueryRequest,List<Patients> patientses, Integer userId, String hospital) { | |
| 928 | + | |
| 929 | + private List convertToRareList(RiskPatientsQueryRequest riskPatientsQueryRequest, List<Patients> patientses, Integer userId, String hospital) { | |
| 892 | 930 | List data = new ArrayList<>(); |
| 893 | 931 | int batchSize = 4; |
| 894 | 932 | int end = 0; |
| ... | ... | @@ -898,7 +936,7 @@ |
| 898 | 936 | if (end > patientses.size()) { |
| 899 | 937 | end = patientses.size(); |
| 900 | 938 | } |
| 901 | - listFuture.add(commonThreadPool.submit(new RareListWorker(riskPatientsQueryRequest, patientses.subList(i, end), usersService,rareBloodGroupService,mongoTemplate, hospital, antExService, basicConfigService, patientsService, organizationService))); | |
| 939 | + listFuture.add(commonThreadPool.submit(new RareListWorker(riskPatientsQueryRequest, patientses.subList(i, end), usersService, rareBloodGroupService, mongoTemplate, hospital, antExService, basicConfigService, patientsService, organizationService))); | |
| 902 | 940 | } |
| 903 | 941 | for (Future f : listFuture) { |
| 904 | 942 | try { |
| 905 | 943 | |
| 906 | 944 | |
| ... | ... | @@ -1987,11 +2025,11 @@ |
| 1987 | 2025 | if (sieveApplyOrderModels != null && sieveApplyOrderModels.size() > 0) { |
| 1988 | 2026 | SieveApplyOrderModel sieveApplyOrderModel = sieveApplyOrderModels.get(0); |
| 1989 | 2027 | //本次妊娠情况 |
| 1990 | - if (org.apache.commons.lang.StringUtils.isNotEmpty(sieveApplyOrderModel.getImprenation()) && "1".equals(sieveApplyOrderModel.getImprenation())) { | |
| 2028 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(sieveApplyOrderModel.getImprenation()) && "1".equals(sieveApplyOrderModel.getImprenation())) { | |
| 1991 | 2029 | pregnancy = "0"; |
| 1992 | - } else if (org.apache.commons.lang.StringUtils.isNotEmpty(sieveApplyOrderModel.getOvulationInduction()) && "1".equals(sieveApplyOrderModel.getOvulationInduction())) { | |
| 2030 | + } else if (org.apache.commons.lang.StringUtils.isNotEmpty(sieveApplyOrderModel.getOvulationInduction()) && "1".equals(sieveApplyOrderModel.getOvulationInduction())) { | |
| 1993 | 2031 | pregnancy = "1"; |
| 1994 | - } else if (org.apache.commons.lang.StringUtils.isNotEmpty(sieveApplyOrderModel.getIui()) && "1".equals(sieveApplyOrderModel.getIui())) { | |
| 2032 | + } else if (org.apache.commons.lang.StringUtils.isNotEmpty(sieveApplyOrderModel.getIui()) && "1".equals(sieveApplyOrderModel.getIui())) { | |
| 1995 | 2033 | pregnancy = "2"; |
| 1996 | 2034 | } |
| 1997 | 2035 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/RareBloodGroupServiceImpl.java
View file @
8229b12
| ... | ... | @@ -78,6 +78,9 @@ |
| 78 | 78 | rareBloodGroupModel.setYn(YnEnums.YES.getId()); |
| 79 | 79 | rareBloodGroupModel.setCreated(new Date()); |
| 80 | 80 | Patients p = mongoTemplate.findById(rareBloodGroupModel.getParentId(), Patients.class); |
| 81 | + //冗余到lyms_patient表,关联关系 | |
| 82 | + mongoTemplate.updateFirst(new Query(Criteria.where("id").is(p.getId())), Update.update("rareType", "1"), Patients.class); | |
| 83 | + | |
| 81 | 84 | rareBloodGroupModel.setWeek(DateUtil.getWeekDesc(p.getLastMenses(), new Date()));//录入孕周 |
| 82 | 85 | rareBloodGroupDao.addRare(rareBloodGroupModel); |
| 83 | 86 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |