Commit c86cf01c5e6a96597c3a7f4f0c7bf2f9fd298bc1
1 parent
edb6fddffc
Exists in
master
and in
6 other branches
追访
Showing 4 changed files with 61 additions and 37 deletions
- platform-common/src/main/java/com/lyms/platform/common/enums/PatientSerEnums.java
- platform-dal/src/main/java/com/lyms/platform/query/MatDeliverQuery.java
- platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
platform-common/src/main/java/com/lyms/platform/common/enums/PatientSerEnums.java
View file @
c86cf01
platform-dal/src/main/java/com/lyms/platform/query/MatDeliverQuery.java
View file @
c86cf01
... | ... | @@ -45,6 +45,7 @@ |
45 | 45 | private String deliveryModeQueryJson; |
46 | 46 | private String fmHospital; |
47 | 47 | private List<String> fmHospitalList; |
48 | + private String fsHospital; | |
48 | 49 | /** |
49 | 50 | * 预约联系结果(1-成功、2-失败) |
50 | 51 | */ |
... | ... | @@ -78,6 +79,14 @@ |
78 | 79 | */ |
79 | 80 | private String matFollowId; |
80 | 81 | |
82 | + public String getFsHospital() { | |
83 | + return fsHospital; | |
84 | + } | |
85 | + | |
86 | + public void setFsHospital(String fsHospital) { | |
87 | + this.fsHospital = fsHospital; | |
88 | + } | |
89 | + | |
81 | 90 | public Integer getHloseBloodType() { |
82 | 91 | return hloseBloodType; |
83 | 92 | } |
84 | 93 | |
... | ... | @@ -295,11 +304,19 @@ |
295 | 304 | condition = condition.and("matFollowId", matFollowId, MongoOper.IS); |
296 | 305 | } |
297 | 306 | if (CollectionUtils.isNotEmpty(fmHospitalList)) { |
298 | - condition = condition.and("fmHospital", fmHospitalList, MongoOper.IN); | |
307 | + if(fsHospital!=null){ | |
308 | + condition.orCondition(MongoCondition.newInstance("fmHospital", fmHospitalList, MongoOper.IN),MongoCondition.newInstance("fsHospital", fsHospital, MongoOper.IS)); | |
309 | + }else { | |
310 | + condition = condition.and("fmHospital", fmHospitalList, MongoOper.IN); | |
311 | + } | |
299 | 312 | } |
300 | 313 | |
301 | 314 | if (null != fmHospital) { |
302 | - condition = condition.and("fmHospital", fmHospital, MongoOper.IS); | |
315 | + if(fsHospital!=null){ | |
316 | + condition.orCondition(MongoCondition.newInstance("fmHospital", fmHospital, MongoOper.IS),MongoCondition.newInstance("fsHospital", fsHospital, MongoOper.IS)); | |
317 | + }else { | |
318 | + condition = condition.and("fmHospital", fmHospital, MongoOper.IS); | |
319 | + } | |
303 | 320 | } |
304 | 321 | if (null != deliveryModeQueryJson) { |
305 | 322 | condition = condition.and("deliveryMode", deliveryModeQueryJson, MongoOper.LIKE); |
platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
View file @
c86cf01
... | ... | @@ -563,7 +563,6 @@ |
563 | 563 | // 这个是分娩医院+建档医院的综合查询 |
564 | 564 | private List<String> fmHospitalQueryList; |
565 | 565 | private List<String> fmHospitalList; |
566 | - private List<String> fsHospitalList; | |
567 | 566 | // 分娩年龄 |
568 | 567 | private Integer fmAgeStart; |
569 | 568 | private Integer fmAgeEnd; |
... | ... | @@ -586,6 +585,7 @@ |
586 | 585 | |
587 | 586 | private String blNum; |
588 | 587 | |
588 | + | |
589 | 589 | public Date getIsNextCheckTime() { |
590 | 590 | return isNextCheckTime; |
591 | 591 | } |
592 | 592 | |
593 | 593 | |
... | ... | @@ -1383,11 +1383,10 @@ |
1383 | 1383 | MongoCondition c = MongoCondition.newInstance(); |
1384 | 1384 | MongoCondition con1 = MongoCondition.newInstance("hospitalId", fmHospitalQueryList, MongoOper.IN); |
1385 | 1385 | MongoCondition con2 = MongoCondition.newInstance("fmHospital", fmHospitalQueryList, MongoOper.IN); |
1386 | - MongoCondition con3 = MongoCondition.newInstance("fsHospital", fsHospitalList, MongoOper.IN); | |
1387 | 1386 | if (c1 != null) { |
1388 | - c1 = c1.andOperator(c.orCondition(new MongoCondition[]{con1, con2,con3}).getCriteria()); | |
1387 | + c1 = c1.andOperator(c.orCondition(new MongoCondition[]{con1, con2}).getCriteria()); | |
1389 | 1388 | } else { |
1390 | - c1 = c.orCondition(new MongoCondition[]{con1, con2,con3}).getCriteria(); | |
1389 | + c1 = c.orCondition(new MongoCondition[]{con1, con2}).getCriteria(); | |
1391 | 1390 | } |
1392 | 1391 | } |
1393 | 1392 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
View file @
c86cf01
... | ... | @@ -204,21 +204,31 @@ |
204 | 204 | return new BaseResponse().setErrormsg("您已分娩").setErrorcode(ErrorCodeConstants.DATA_EXIST); |
205 | 205 | } |
206 | 206 | Patients patients2 = patientsService.findOnePatientById(deliverAddRequest.getParentId()); |
207 | - if(CollectionUtils.isNotEmpty(patients2.getChildExtAddrs())){ | |
207 | + if (CollectionUtils.isNotEmpty(patients2.getChildExtAddrs())) { | |
208 | 208 | List<String> childExts = patients2.getChildExtAddrs(); |
209 | - String extId = childExts.get(childExts.size()-1); | |
209 | + String extId = childExts.get(childExts.size() - 1); | |
210 | 210 | PostVisitHospitalModelQuery postQuery = new PostVisitHospitalModelQuery(); |
211 | 211 | postQuery.setHosptialId(hospitalId); |
212 | 212 | postQuery.setAreaTiters(Arrays.asList(extId)); |
213 | 213 | List<PostVisitHospitalModel> postVisitHospitalModels = postVisitHospitalService.queryPostVisitHospitalModel(postQuery); |
214 | - if(CollectionUtils.isNotEmpty(postVisitHospitalModels)){ | |
215 | - PostVisitHospitalModel postVisitHospitalModel = postVisitHospitalModels.get(postVisitHospitalModels.size()-1); | |
214 | + if (CollectionUtils.isNotEmpty(postVisitHospitalModels)) { | |
215 | + PostVisitHospitalModel postVisitHospitalModel = postVisitHospitalModels.get(postVisitHospitalModels.size() - 1); | |
216 | 216 | String postHosptial = postVisitHospitalModel.getPostHosptial(); |
217 | 217 | maternalDeliverModel.setFsHospital(postHosptial); |
218 | 218 | } |
219 | + } else { | |
220 | + String streetId = patients2.getStreetPostRestId(); | |
221 | + PostVisitHospitalModelQuery postQuery = new PostVisitHospitalModelQuery(); | |
222 | + postQuery.setHosptialId(hospitalId); | |
223 | + postQuery.setAreaTiters(Arrays.asList(streetId)); | |
224 | + List<PostVisitHospitalModel> postVisitHospitalModels = postVisitHospitalService.queryPostVisitHospitalModel(postQuery); | |
225 | + if (CollectionUtils.isNotEmpty(postVisitHospitalModels)) { | |
226 | + PostVisitHospitalModel postVisitHospitalModel = postVisitHospitalModels.get(postVisitHospitalModels.size() - 1); | |
227 | + String postHosptial = postVisitHospitalModel.getPostHosptial(); | |
228 | + maternalDeliverModel.setFsHospital(postHosptial); | |
229 | + } | |
219 | 230 | } |
220 | 231 | |
221 | - | |
222 | 232 | matDeliverQuery.setDueDate(deliverAddRequest.getDueDate()); |
223 | 233 | matDeliverQuery.setParentId(null); |
224 | 234 | matDeliverQuery.setPid(patients2.getPid()); |
... | ... | @@ -315,8 +325,8 @@ |
315 | 325 | |
316 | 326 | maternalDeliverModel.setYn(YnEnums.YES.getId()); |
317 | 327 | //可能baby保存失败,所以导致babyId为null,这里为了处理打印出生医学证明 |
318 | - for(MaternalDeliverModel.Baby baby:maternalDeliverModel.getBaby()){ | |
319 | - if(StringUtils.isEmpty(baby.getId())){//如果是空则创建一个uuid,但是baby表还是没有数据,处理办法是医生手动去建档(泉渝说) | |
328 | + for (MaternalDeliverModel.Baby baby : maternalDeliverModel.getBaby()) { | |
329 | + if (StringUtils.isEmpty(baby.getId())) {//如果是空则创建一个uuid,但是baby表还是没有数据,处理办法是医生手动去建档(泉渝说) | |
320 | 330 | baby.setId(com.lyms.platform.common.utils.StringUtils.uuid()); |
321 | 331 | } |
322 | 332 | } |
... | ... | @@ -434,8 +444,7 @@ |
434 | 444 | addTrackDownInfo(userId, patients2); |
435 | 445 | |
436 | 446 | //出生证明打印前修改孕妇基本信息 |
437 | - if (deliverAddRequest.getPatient() != null) | |
438 | - { | |
447 | + if (deliverAddRequest.getPatient() != null) { | |
439 | 448 | Patients patient = bookbuildingFacade.getPatientsData(deliverAddRequest.getPatient()); |
440 | 449 | patient.setId(deliverAddRequest.getParentId()); |
441 | 450 | patientsService.updatePatient(patient); |
... | ... | @@ -557,7 +566,7 @@ |
557 | 566 | int day = DateUtil.getDays(patients.getLastMenses(), DateUtil.parseYMD(deliverAddRequest.getDueDate())); |
558 | 567 | babyModel.setDueWeek(day / 7); |
559 | 568 | int dueDay = day % 7; |
560 | - babyModel.setDueDay(dueDay == 0 ? null : dueDay); | |
569 | + babyModel.setDueDay(dueDay == 0 ? null : dueDay); | |
561 | 570 | } |
562 | 571 | } |
563 | 572 | // 产妇分娩建档 |
... | ... | @@ -605,7 +614,8 @@ |
605 | 614 | * @param list |
606 | 615 | * @return |
607 | 616 | */ |
608 | - private List updateBaby(MatDeliverAddRequest deliverAddRequest, List<MatDeliverAddRequest.Baby> list, Date lastMenses) { | |
617 | + private List updateBaby(MatDeliverAddRequest deliverAddRequest, List<MatDeliverAddRequest.Baby> list, Date | |
618 | + lastMenses) { | |
609 | 619 | List<MaternalDeliverModel.Baby> babyList = new ArrayList<>(); |
610 | 620 | for (MatDeliverAddRequest.Baby baby : list) { |
611 | 621 | MaternalDeliverModel.Baby babyModel = baby.convertToDataModel(); |
... | ... | @@ -622,8 +632,7 @@ |
622 | 632 | //修改分娩后自动建档了 的原因修改成这样 20180703 |
623 | 633 | if ((RenShenJieJuEnums.O.getId() + "").equals(baby.getPregnancyOut())) { |
624 | 634 | //判断是否已经建档 |
625 | - if (CollectionUtils.isNotEmpty(updateBaby) && updateBaby.get(0).getDataStatus() != null && updateBaby.get(0).getDataStatus() == 0) | |
626 | - { | |
635 | + if (CollectionUtils.isNotEmpty(updateBaby) && updateBaby.get(0).getDataStatus() != null && updateBaby.get(0).getDataStatus() == 0) { | |
627 | 636 | babyModel1.setYn(YnEnums.YES.getId()); |
628 | 637 | |
629 | 638 | if (CollectionUtils.isNotEmpty(updateBaby)) { |
... | ... | @@ -637,9 +646,7 @@ |
637 | 646 | } |
638 | 647 | } |
639 | 648 | } |
640 | - } | |
641 | - else | |
642 | - { | |
649 | + } else { | |
643 | 650 | babyModel1.setYn(YnEnums.NO.getId()); |
644 | 651 | if (CollectionUtils.isNotEmpty(updateBaby)) { |
645 | 652 | for (BabyModel babydel : updateBaby) { |
... | ... | @@ -748,7 +755,10 @@ |
748 | 755 | * @param parentId |
749 | 756 | * @param userName |
750 | 757 | */ |
751 | - private void handBaby(MatDeliverAddRequest deliverAddRequest, List<MaternalDeliverModel.Baby> babyList, MaternalDeliverModel maternalDeliverModel, List<MatDeliverAddRequest.Baby> list, List<String> babyIds, String parentId, String userName, Patients patients, String hospital) { | |
758 | + private void handBaby(MatDeliverAddRequest | |
759 | + deliverAddRequest, List<MaternalDeliverModel.Baby> babyList, MaternalDeliverModel | |
760 | + maternalDeliverModel, List<MatDeliverAddRequest.Baby> list, List<String> babyIds, String parentId, String | |
761 | + userName, Patients patients, String hospital) { | |
752 | 762 | |
753 | 763 | |
754 | 764 | List babyName = buildBabyName(list); |
... | ... | @@ -923,7 +933,7 @@ |
923 | 933 | |
924 | 934 | //聊城东昌府分娩界面通过住院号从his中查询到孕妇的身份号码,然后用身份证号码作为院内系统的查询条件查询孕妇信息 |
925 | 935 | if ("2100001305".equals(hospital) && StringUtils.isNotEmpty(deliverQueryRequest.getZhuYuanNo())) { |
926 | - //if ("1000000116".equals(hospital) && StringUtils.isNotEmpty(deliverQueryRequest.getZhuYuanNo())) { | |
936 | + //if ("1000000116".equals(hospital) && StringUtils.isNotEmpty(deliverQueryRequest.getZhuYuanNo())) { | |
927 | 937 | lcdcfHisModel = lcdcfHisService.getHisPatientByZyh(deliverQueryRequest.getZhuYuanNo()); |
928 | 938 | if (lcdcfHisModel != null && StringUtils.isNotEmpty(lcdcfHisModel.getIdCard())) { |
929 | 939 | deliverQueryRequest.setCardNo(lcdcfHisModel.getIdCard()); |
... | ... | @@ -1081,8 +1091,7 @@ |
1081 | 1091 | matDeliverListResult.setTireNumber1(tTireNumber); |
1082 | 1092 | |
1083 | 1093 | //聊城东昌府医院通过住院号查询分娩信息 然后回填到分娩界面 |
1084 | - if (lcdcfHisModel != null && StringUtils.isNotEmpty(deliverQueryRequest.getZhuYuanNo())) | |
1085 | - { | |
1094 | + if (lcdcfHisModel != null && StringUtils.isNotEmpty(deliverQueryRequest.getZhuYuanNo())) { | |
1086 | 1095 | matDeliverListResult.setDeliverData(lcdcfFmService.queryFmPatient(deliverQueryRequest.getZhuYuanNo())); |
1087 | 1096 | } |
1088 | 1097 | |
... | ... | @@ -1414,6 +1423,8 @@ |
1414 | 1423 | BaseListResponse listResponse = new BaseListResponse(); |
1415 | 1424 | |
1416 | 1425 | List<MatdeliverFollowListResult> matdeliverFollowListResults = new ArrayList<>(); |
1426 | + //根据用户id获取医院ID | |
1427 | + String hospitalId = autoMatchFacade.getHospitalId(matdeliverFollowRequest.getOperatorId()); | |
1417 | 1428 | |
1418 | 1429 | // 构造医院id集合 |
1419 | 1430 | List<String> hospitalList = new ArrayList<>(); |
... | ... | @@ -1421,8 +1432,7 @@ |
1421 | 1432 | if (StringUtils.isNotEmpty(matdeliverFollowRequest.getHospitalId())) { |
1422 | 1433 | hospitalList.add(matdeliverFollowRequest.getHospitalId()); |
1423 | 1434 | } else { |
1424 | - //根据用户id获取医院ID | |
1425 | - String hospitalId = autoMatchFacade.getHospitalId(matdeliverFollowRequest.getOperatorId()); | |
1435 | + | |
1426 | 1436 | //默认添加当前医院 |
1427 | 1437 | hospitalList.add(hospitalId); |
1428 | 1438 | |
... | ... | @@ -1531,6 +1541,7 @@ |
1531 | 1541 | } |
1532 | 1542 | |
1533 | 1543 | matDeliverQuery.setFmHospitalList(hospitalList); |
1544 | + matDeliverQuery.setFsHospital(hospitalId); | |
1534 | 1545 | matDeliverQuery.setContactResult(matdeliverFollowRequest.getContactResult()); |
1535 | 1546 | if (matdeliverFollowRequest.getContactReason() != null) { |
1536 | 1547 | matDeliverQuery.setContactResult(PostpartumFollowMakeEnums.ResultEnum.SB.getId()); |
1537 | 1548 | |
... | ... | @@ -1795,17 +1806,15 @@ |
1795 | 1806 | end = maternalDeliverModelList.size(); |
1796 | 1807 | } |
1797 | 1808 | List<MaternalDeliverModel> mlist = maternalDeliverModelList.subList(i, end); |
1798 | - Callable c = new MaterDeliverWorker( organizationService, usersService, | |
1799 | - babyService, basicConfigService,childbirthManagerRequest.getInitQuery(), | |
1800 | - mlist,patientsMap); | |
1809 | + Callable c = new MaterDeliverWorker(organizationService, usersService, | |
1810 | + babyService, basicConfigService, childbirthManagerRequest.getInitQuery(), | |
1811 | + mlist, patientsMap); | |
1801 | 1812 | Future f = commonThreadPool.submit(c); |
1802 | 1813 | futures.add(f); |
1803 | 1814 | } |
1804 | 1815 | |
1805 | - if (CollectionUtils.isNotEmpty(futures)) | |
1806 | - { | |
1807 | - for (Future f : futures) | |
1808 | - { | |
1816 | + if (CollectionUtils.isNotEmpty(futures)) { | |
1817 | + for (Future f : futures) { | |
1809 | 1818 | try { |
1810 | 1819 | childbirthManagerQueryModelList.addAll((List<ChildbirthManagerQueryModel>) f.get()); |
1811 | 1820 | } catch (Exception e) { |
... | ... | @@ -1813,7 +1822,6 @@ |
1813 | 1822 | } |
1814 | 1823 | } |
1815 | 1824 | } |
1816 | - | |
1817 | 1825 | |
1818 | 1826 | |
1819 | 1827 | // for (MaternalDeliverModel maternalDeliverModel : maternalDeliverModelList) { |