Commit 5481483c393f082c65ffec2c4e28d7f40a973a63
1 parent
34d4ab5d43
Exists in
master
and in
1 other branch
修改新电子病历
Showing 2 changed files with 68 additions and 44 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
5481483
... | ... | @@ -647,48 +647,9 @@ |
647 | 647 | List<Patients> patientses = patientsService.queryPatient1(patientsQuery1, "created"); |
648 | 648 | if (CollectionUtils.isNotEmpty(patientses)) { |
649 | 649 | count = count + patientses.size(); |
650 | - Iterator<Patients> iterator = patientses.iterator(); | |
651 | - while (iterator.hasNext()) { | |
652 | - Patients patients = iterator.next(); | |
653 | - //处理建档就分娩的情况 | |
654 | - Date date = DateUtil.addWeek(patients.getLastMenses(), 42); | |
655 | - Date currentDate = DateUtil.formatDate(patients.getBookbuildingDate()); | |
656 | - if (date.getTime() <= currentDate.getTime()) { | |
657 | - //建档记录 | |
658 | - if (null != patients.getHospitalId()) { | |
659 | - organization = organizationService.getOrganization(Integer.valueOf(patients.getHospitalId())); | |
660 | - } | |
661 | - pid = patients.getPid(); | |
662 | - listData.add(new AntData(patients, null != organization ? organization.getName() : "")); | |
663 | - iterator.remove(); | |
664 | - | |
665 | - | |
666 | - PostReviewQuery postReviewQuery = new PostReviewQuery(); | |
667 | - if (list.size() - 1 > i) { | |
668 | - postReviewQuery.setStart(dueDate); | |
669 | - if (CollectionUtils.isNotEmpty(patientses)) { | |
670 | - //下次建档记录前都是产后复查,如果没有下个产程的数据就直接显示 | |
671 | - postReviewQuery.setEnd(patientses.get(0).getBookbuildingDate()); | |
672 | - } | |
673 | - } | |
674 | - postReviewQuery.setYn(YnEnums.YES.getId()); | |
675 | - postReviewQuery.setPid(pid); | |
676 | - | |
677 | - //产后复查记录 | |
678 | - List<PostReviewModel> reviewModels = postReviewService.findWithList(postReviewQuery); | |
679 | - if (CollectionUtils.isNotEmpty(reviewModels)) { | |
680 | - for (PostReviewModel postReviewModel : reviewModels) { | |
681 | - if (null != postReviewModel.getHospitalId()) { | |
682 | - organization = organizationService.getOrganization(Integer.valueOf(postReviewModel.getHospitalId())); | |
683 | - } | |
684 | - listData.add(new AntData(postReviewModel, null != organization ? organization.getName() : "", patientses.get(patientses.size() - 1).getFmDate())); | |
685 | - } | |
686 | - } | |
687 | - updateEditEnable(listData, sortList); | |
688 | - sortList.add(listData); | |
689 | - listData = new ArrayList(); | |
690 | - } | |
691 | - } | |
650 | + //TODO 处理自动分娩的情况 | |
651 | + updateAutoMatdel(patientses,list,i,dueDate,sortList); | |
652 | + listData = new ArrayList(); | |
692 | 653 | } |
693 | 654 | |
694 | 655 | if (CollectionUtils.isNotEmpty(patientses)) { |
... | ... | @@ -726,7 +687,9 @@ |
726 | 687 | if (null != postReviewModel.getHospitalId()) { |
727 | 688 | organization = organizationService.getOrganization(Integer.valueOf(postReviewModel.getHospitalId())); |
728 | 689 | } |
729 | - listData.add(new AntData(postReviewModel, null != organization ? organization.getName() : "", patientses.get(patientses.size() - 1).getFmDate())); | |
690 | + if(postReviewModel.getYn()==YnEnums.YES.getId()){ | |
691 | + listData.add(new AntData(postReviewModel, null != organization ? organization.getName() : "", patientses.get(patientses.size() - 1).getFmDate())); | |
692 | + } | |
730 | 693 | } |
731 | 694 | } |
732 | 695 | } |
733 | 696 | |
... | ... | @@ -772,11 +735,16 @@ |
772 | 735 | for (Patients patients : list) { |
773 | 736 | tmp.add(new SortIn(patients)); |
774 | 737 | } |
738 | + int size = list.size(); | |
775 | 739 | sortList(tmp); |
776 | 740 | Date min = null; |
777 | 741 | if (!tmp.isEmpty()) { |
778 | 742 | min = tmp.get(tmp.size() - 1).getDate(); |
779 | 743 | } |
744 | + updateAutoMatdel(list,list,0,dueDate,sortList); | |
745 | + if(size!=list.size()){ | |
746 | + list1 = new ArrayList(); | |
747 | + } | |
780 | 748 | List l = buildPatientList(dueDate, list, list1, min, true); |
781 | 749 | if (!l.isEmpty()) { |
782 | 750 | sort(l); |
... | ... | @@ -788,6 +756,58 @@ |
788 | 756 | antexListResult.setData(sortList); |
789 | 757 | return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(antexListResult); |
790 | 758 | } |
759 | + | |
760 | + /** | |
761 | + * 处理自动分娩的情况 | |
762 | + */ | |
763 | + private void updateAutoMatdel(List<Patients> patientses,List<Patients> list,int i,Date dueDate,List sortList){ | |
764 | + Iterator<Patients> iterator = patientses.iterator(); | |
765 | + Organization organization=null; | |
766 | + String pid=""; | |
767 | + List listData=new ArrayList(); | |
768 | + while (iterator.hasNext()) { | |
769 | + Patients patients = iterator.next(); | |
770 | + //处理建档就分娩的情况 | |
771 | + Date date = DateUtil.addWeek(patients.getLastMenses(), 42); | |
772 | + Date currentDate = DateUtil.formatDate(patients.getBookbuildingDate()); | |
773 | + if (date.getTime() <= currentDate.getTime()||patients.getBuildType()==2) { | |
774 | + //建档记录 | |
775 | + if (null != patients.getHospitalId()) { | |
776 | + organization = organizationService.getOrganization(Integer.valueOf(patients.getHospitalId())); | |
777 | + } | |
778 | + pid = patients.getPid(); | |
779 | + listData.add(new AntData(patients, null != organization ? organization.getName() : "")); | |
780 | + iterator.remove(); | |
781 | + | |
782 | + | |
783 | + PostReviewQuery postReviewQuery = new PostReviewQuery(); | |
784 | + if (list.size() - 1 > i) { | |
785 | + postReviewQuery.setStart(dueDate); | |
786 | + if (CollectionUtils.isNotEmpty(patientses)) { | |
787 | + //下次建档记录前都是产后复查,如果没有下个产程的数据就直接显示 | |
788 | + postReviewQuery.setEnd(patientses.get(0).getBookbuildingDate()); | |
789 | + } | |
790 | + } | |
791 | + postReviewQuery.setYn(YnEnums.YES.getId()); | |
792 | + postReviewQuery.setPid(pid); | |
793 | + | |
794 | + //产后复查记录 | |
795 | + List<PostReviewModel> reviewModels = postReviewService.findWithList(postReviewQuery); | |
796 | + if (CollectionUtils.isNotEmpty(reviewModels)) { | |
797 | + for (PostReviewModel postReviewModel : reviewModels) { | |
798 | + if (null != postReviewModel.getHospitalId()) { | |
799 | + organization = organizationService.getOrganization(Integer.valueOf(postReviewModel.getHospitalId())); | |
800 | + } | |
801 | + listData.add(new AntData(postReviewModel, null != organization ? organization.getName() : "", patientses.get(patientses.size() - 1).getFmDate())); | |
802 | + } | |
803 | + } | |
804 | + updateEditEnable(listData, sortList); | |
805 | + sortList.add(listData); | |
806 | + listData=new ArrayList(); | |
807 | + } | |
808 | + } | |
809 | + } | |
810 | + | |
791 | 811 | |
792 | 812 | /** |
793 | 813 | * |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
View file @
5481483
... | ... | @@ -340,7 +340,11 @@ |
340 | 340 | } |
341 | 341 | } |
342 | 342 | postReviewQuery.setHospitalId(hospital); |
343 | - chanResult.setcHTimes(postReviewService.count(postReviewQuery)); | |
343 | + | |
344 | + withList = postReviewService.findWithList(postReviewQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created")); | |
345 | + if(CollectionUtils.isNotEmpty(withList)){ | |
346 | + chanResult.setcHTimes(postReviewService.count(postReviewQuery)); | |
347 | + } | |
344 | 348 | if(StringUtils.isNotEmpty(withList.get(0).getProdDoctor())){ |
345 | 349 | Users users = usersService.getUsers(NumberUtils.toInt(withList.get(0).getProdDoctor())); |
346 | 350 | if(null!=users){ |