Commit 4aa5dd39f41096780ece0bdcdb56fa63f6ba27bd
1 parent
e6161f6a43
Exists in
master
and in
1 other branch
修改新电子病历
Showing 1 changed file with 29 additions and 19 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
4aa5dd3
... | ... | @@ -174,7 +174,7 @@ |
174 | 174 | antExChuQuery1.setParentId(excAddRequest.getParentId()); |
175 | 175 | List<AntExChuModel> data1 = antenatalExaminationService.queryAntExChu(antExChuQuery1); |
176 | 176 | //初诊只能建一次 |
177 | - if(CollectionUtils.isEmpty(data1)){ | |
177 | + if (CollectionUtils.isEmpty(data1)) { | |
178 | 178 | Patients patients = patientsService.findOnePatientById(excAddRequest.getParentId()); |
179 | 179 | PatientsQuery patientsQuery = new PatientsQuery(); |
180 | 180 | patientsQuery.setPid(patients.getPid()); |
... | ... | @@ -229,7 +229,7 @@ |
229 | 229 | applyOrderService.updateByParentId(referralApplyOrderQuery2, model); |
230 | 230 | } |
231 | 231 | } |
232 | - }else{ | |
232 | + } else { | |
233 | 233 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("您已经做过初诊"); |
234 | 234 | } |
235 | 235 | } |
... | ... | @@ -268,6 +268,11 @@ |
268 | 268 | patientsService.updatePatient(patients); |
269 | 269 | if (!list.isEmpty()) { |
270 | 270 | Patients patients1 = new Patients(); |
271 | + try { | |
272 | + List list2 = JsonUtil.toList(antExChuModel.getHighrisk(), List.class); | |
273 | + patients1.setRiskFactorId(list2); | |
274 | + } catch (Exception e) { | |
275 | + } | |
271 | 276 | patients1.setRiskLevelId(JsonUtil.array2JsonString(list)); |
272 | 277 | patients1.setModified(new Date()); |
273 | 278 | PatientsQuery patientsQuery = new PatientsQuery(); |
... | ... | @@ -307,6 +312,11 @@ |
307 | 312 | patientsService.updatePatient(patients); |
308 | 313 | if (!list.isEmpty()) { |
309 | 314 | Patients patients1 = new Patients(); |
315 | + try { | |
316 | + List list2 = JsonUtil.toList(antExChuModel.getRiskFactor(), List.class); | |
317 | + patients1.setRiskFactorId(list2); | |
318 | + } catch (Exception e) { | |
319 | + } | |
310 | 320 | patients1.setModified(new Date()); |
311 | 321 | patients1.setRiskLevelId(JsonUtil.array2JsonString(list)); |
312 | 322 | PatientsQuery patientsQuery = new PatientsQuery(); |
... | ... | @@ -596,7 +606,7 @@ |
596 | 606 | Date dueDate = new Date(); |
597 | 607 | if (CollectionUtils.isNotEmpty(listDate)) { |
598 | 608 | String pid = ""; |
599 | - int count = 0; | |
609 | + int count = 0; | |
600 | 610 | for (int i = 0; i < listDate.size(); i++) { |
601 | 611 | dueDate = listDate.get(i).getDate(); |
602 | 612 | Date end = new Date(listDate.get(i).getDate().getTime() + 86398000); |
603 | 613 | |
... | ... | @@ -612,9 +622,9 @@ |
612 | 622 | } |
613 | 623 | pid = list.get(0).getPid(); |
614 | 624 | patientsQuery1.setPid(pid); |
615 | - List<Patients> patientses = patientsService.queryPatient1(patientsQuery1,"created"); | |
625 | + List<Patients> patientses = patientsService.queryPatient1(patientsQuery1, "created"); | |
616 | 626 | if (CollectionUtils.isNotEmpty(patientses)) { |
617 | - count=count+patientses.size(); | |
627 | + count = count + patientses.size(); | |
618 | 628 | Iterator<Patients> iterator = patientses.iterator(); |
619 | 629 | while (iterator.hasNext()) { |
620 | 630 | Patients patients = iterator.next(); |
... | ... | @@ -634,7 +644,7 @@ |
634 | 644 | PostReviewQuery postReviewQuery = new PostReviewQuery(); |
635 | 645 | if (list.size() - 1 > i) { |
636 | 646 | postReviewQuery.setStart(dueDate); |
637 | - if(CollectionUtils.isNotEmpty(patientses)){ | |
647 | + if (CollectionUtils.isNotEmpty(patientses)) { | |
638 | 648 | //下次建档记录前都是产后复查,如果没有下个产程的数据就直接显示 |
639 | 649 | postReviewQuery.setEnd(patientses.get(0).getBookbuildingDate()); |
640 | 650 | } |
... | ... | @@ -649,7 +659,7 @@ |
649 | 659 | if (null != postReviewModel.getHospitalId()) { |
650 | 660 | organization = organizationService.getOrganization(Integer.valueOf(postReviewModel.getHospitalId())); |
651 | 661 | } |
652 | - listData.add(new AntData(postReviewModel, null != organization ? organization.getName() : "", patientses.get(patientses.size()-1).getFmDate())); | |
662 | + listData.add(new AntData(postReviewModel, null != organization ? organization.getName() : "", patientses.get(patientses.size() - 1).getFmDate())); | |
653 | 663 | } |
654 | 664 | } |
655 | 665 | sortList.add(listData); |
656 | 666 | |
... | ... | @@ -681,9 +691,9 @@ |
681 | 691 | postReviewQuery.setPid(pid); |
682 | 692 | Object obj = map.get(listDate.get(i).getId()); |
683 | 693 | if (obj instanceof MaternalDeliverModel) { |
684 | - listData.add(new AntData((MaternalDeliverModel) obj, patientses.get(0).getLastMenses(), null != organization ? organization.getName() : "")); | |
694 | + listData.add(new AntData((MaternalDeliverModel) obj, patientses.get(0).getLastMenses(), null != organization ? organization.getName() : "")); | |
685 | 695 | } else if (obj instanceof StopPregModel) { |
686 | - listData.add(new AntData(stopPregs.get(0), patientses.get(0).getLastMenses(), null != organization ? organization.getName() : "")); | |
696 | + listData.add(new AntData(stopPregs.get(0), patientses.get(0).getLastMenses(), null != organization ? organization.getName() : "")); | |
687 | 697 | } |
688 | 698 | |
689 | 699 | //产后复查记录 |
... | ... | @@ -693,7 +703,7 @@ |
693 | 703 | if (null != postReviewModel.getHospitalId()) { |
694 | 704 | organization = organizationService.getOrganization(Integer.valueOf(postReviewModel.getHospitalId())); |
695 | 705 | } |
696 | - listData.add(new AntData(postReviewModel, null != organization ? organization.getName() : "", patientses.get(patientses.size()-1).getFmDate())); | |
706 | + listData.add(new AntData(postReviewModel, null != organization ? organization.getName() : "", patientses.get(patientses.size() - 1).getFmDate())); | |
697 | 707 | } |
698 | 708 | } |
699 | 709 | } |
... | ... | @@ -703,7 +713,7 @@ |
703 | 713 | Collections.reverse(sortList); |
704 | 714 | } |
705 | 715 | } |
706 | - if(list.size()>count){ | |
716 | + if (list.size() > count) { | |
707 | 717 | //分娩记录剩下的建档 |
708 | 718 | PatientsQuery patientsQuery1 = new PatientsQuery(); |
709 | 719 | patientsQuery1.setYn(YnEnums.YES.getId()); |
710 | 720 | |
711 | 721 | |
712 | 722 | |
713 | 723 | |
714 | 724 | |
715 | 725 | |
... | ... | @@ -1047,29 +1057,29 @@ |
1047 | 1057 | * @param antExQueryRequest |
1048 | 1058 | * @return |
1049 | 1059 | */ |
1050 | - public BaseResponse delOneAntEx(AntExQueryRequest antExQueryRequest,Integer userId) { | |
1060 | + public BaseResponse delOneAntEx(AntExQueryRequest antExQueryRequest, Integer userId) { | |
1051 | 1061 | if ("1".equals(antExQueryRequest.getType())) { |
1052 | 1062 | AntenatalExaminationModel antEx = new AntenatalExaminationModel(); |
1053 | 1063 | antEx.setYn(YnEnums.NO.getId()); |
1054 | 1064 | antEx.setId(antExQueryRequest.getId()); |
1055 | 1065 | String hospital = autoMatchFacade.getHospitalId(userId); |
1056 | 1066 | |
1057 | - AntExQuery antExQuery=new AntExQuery(); | |
1067 | + AntExQuery antExQuery = new AntExQuery(); | |
1058 | 1068 | antExQuery.setId(antExQueryRequest.getId()); |
1059 | 1069 | antExQuery.setYn(YnEnums.YES.getId()); |
1060 | 1070 | antExQuery.setHospitalId(hospital); |
1061 | - List<AntenatalExaminationModel> list = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery()); | |
1071 | + List<AntenatalExaminationModel> list = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery()); | |
1062 | 1072 | //TODO 需要根据时间去查询是否是本院最后一条记录 |
1063 | - if(CollectionUtils.isNotEmpty(list)){ | |
1064 | - antExQuery.setStart(new Date(list.get(0).getCheckDate().getTime()+40000)); | |
1073 | + if (CollectionUtils.isNotEmpty(list)) { | |
1074 | + antExQuery.setStart(new Date(list.get(0).getCheckDate().getTime() + 40000)); | |
1065 | 1075 | } |
1066 | 1076 | antExQuery.setId(null); |
1067 | - list = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery()); | |
1077 | + list = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery()); | |
1068 | 1078 | |
1069 | 1079 | |
1070 | - if(CollectionUtils.isEmpty(list)){ | |
1080 | + if (CollectionUtils.isEmpty(list)) { | |
1071 | 1081 | antenatalExaminationService.updateOneAnt(antEx, antExQueryRequest.getId()); |
1072 | - }else{ | |
1082 | + } else { | |
1073 | 1083 | return new BaseResponse().setErrorcode(ErrorCodeConstants.BUSINESS_ERROR).setErrormsg("当前产检记录不是本院最新的产检记录,不能删除"); |
1074 | 1084 | } |
1075 | 1085 | } else { |