Commit 97defa2ce3290c70238dc17e4493fc77dcb7b216
1 parent
1ba87666cf
Exists in
master
and in
1 other branch
修改新电子病历
Showing 1 changed file with 67 additions and 20 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
97defa2
... | ... | @@ -429,15 +429,16 @@ |
429 | 429 | String pid=""; |
430 | 430 | for (int i = 0; i < listDate.size(); i++) { |
431 | 431 | dueDate = listDate.get(i).getDate(); |
432 | + Date end =new Date(listDate.get(i).getDate().getTime()+86398000); | |
432 | 433 | List listData = new ArrayList(); |
433 | 434 | Organization organization = null; |
434 | 435 | PatientsQuery patientsQuery1 = new PatientsQuery(); |
435 | - patientsQuery1.setBookbuildingDateEnd(new Date(listDate.get(i).getDate().getTime()+i*2200)); | |
436 | + patientsQuery1.setBookbuildingDateEnd(end); | |
436 | 437 | if (listDate.size() > i + 1) { |
437 | - patientsQuery1.setBookbuildingDateStart(listDate.get(i + 1).getDate()); | |
438 | - }else if(listDate.size()>1){ | |
438 | + patientsQuery1.setBookbuildingDateStart(new Date(listDate.get(i + 1).getDate().getTime()+86398000)); | |
439 | + }/*else if(listDate.size()==i){ | |
439 | 440 | patientsQuery1.setBookbuildingDateStart(new Date()); |
440 | - } | |
441 | + }*/ | |
441 | 442 | pid=list.get(0).getPid(); |
442 | 443 | patientsQuery1.setPid(pid); |
443 | 444 | List<Patients> patientses = patientsService.queryPatient1(patientsQuery1); |
... | ... | @@ -445,6 +446,7 @@ |
445 | 446 | Iterator<Patients> iterator=patientses.iterator(); |
446 | 447 | while(iterator.hasNext()){ |
447 | 448 | Patients patients= iterator.next(); |
449 | + //处理建档就分娩的情况 | |
448 | 450 | Date date = DateUtil.addWeek(patients.getLastMenses(),42); |
449 | 451 | Date currentDate = DateUtil.formatDate(patients.getBookbuildingDate()); |
450 | 452 | if (date.getTime() <= currentDate.getTime()) |
451 | 453 | |
452 | 454 | |
453 | 455 | |
... | ... | @@ -483,13 +485,24 @@ |
483 | 485 | } |
484 | 486 | |
485 | 487 | if(CollectionUtils.isNotEmpty(patientses)){ |
486 | - buildPatientList(dueDate,patientses,listData,null,false); | |
487 | 488 | |
489 | + List<SortIn> tmp =new ArrayList(); | |
490 | + for(Patients patients:patientses){ | |
491 | + tmp.add(new SortIn(patients)); | |
492 | + } | |
493 | + sortList(tmp); | |
494 | + Date min=null; | |
495 | + if(!tmp.isEmpty()){ | |
496 | + min=tmp.get(tmp.size()-1).getDate(); | |
497 | + } | |
498 | + //分娩前的数据 | |
499 | + buildPatientList(dueDate,patientses,listData,min,false); | |
500 | + | |
488 | 501 | PostReviewQuery postReviewQuery = new PostReviewQuery(); |
489 | - if (list.size() - 1 > i) { | |
490 | - postReviewQuery.setStart(dueDate); | |
502 | + postReviewQuery.setStart(dueDate); | |
503 | + if ( i>0) { | |
491 | 504 | //下次建档记录前都是产后复查,如果没有下个产程的数据就直接显示 |
492 | - postReviewQuery.setEnd(patientses.get(0).getBookbuildingDate()); | |
505 | + postReviewQuery.setEnd(listDate.get(i-1).getDate()); | |
493 | 506 | } |
494 | 507 | postReviewQuery.setPid(pid); |
495 | 508 | Object obj = map.get(listDate.get(i).getId()); |
... | ... | @@ -518,7 +531,7 @@ |
518 | 531 | PatientsQuery patientsQuery1=new PatientsQuery(); |
519 | 532 | patientsQuery1.setYn(YnEnums.YES.getId()); |
520 | 533 | patientsQuery1.setPid(pid); |
521 | - patientsQuery1.setBookbuildingDateStart(new Date(listDate.get(0).getDate().getTime()+1000)); | |
534 | + patientsQuery1.setBookbuildingDateStart(new Date(listDate.get(0).getDate().getTime())); | |
522 | 535 | patientsQuery1.setType(1); |
523 | 536 | List<Patients> patientsList = patientsService.queryPatient(patientsQuery1); |
524 | 537 | List list1=new ArrayList(); |
... | ... | @@ -531,7 +544,7 @@ |
531 | 544 | if(!tmp.isEmpty()){ |
532 | 545 | min=tmp.get(tmp.size()-1).getDate(); |
533 | 546 | } |
534 | - List l= buildPatientList(dueDate, patientsList, list1,min,false); | |
547 | + List l= buildPatientList(new Date(), patientsList, list1,min,false); | |
535 | 548 | if(!l.isEmpty()){ |
536 | 549 | sort(l); |
537 | 550 | sortList.add(l); |
... | ... | @@ -574,7 +587,7 @@ |
574 | 587 | |
575 | 588 | |
576 | 589 | |
577 | - private List buildPatientList(Date dueDate, List<Patients> patientses,List listData,Date min,boolean f) { | |
590 | + private List buildPatientList(Date end, List<Patients> patientses,List listData,Date min,boolean f) { | |
578 | 591 | if(CollectionUtils.isEmpty(patientses)){ |
579 | 592 | return listData; |
580 | 593 | } |
581 | 594 | |
582 | 595 | |
... | ... | @@ -590,19 +603,17 @@ |
590 | 603 | } |
591 | 604 | |
592 | 605 | |
593 | - if (null != dueDate) { | |
606 | + if (null != end) { | |
594 | 607 | //初诊记录 |
595 | 608 | AntExChuQuery antExChuQuery = new AntExChuQuery(); |
596 | 609 | antExChuQuery.setYn(YnEnums.YES.getId()); |
597 | 610 | if(!f){ |
598 | 611 | if(null==min){ |
599 | 612 | antExChuQuery.setStart(patientses.get(0).getBookbuildingDate()); |
600 | - antExChuQuery.setEnd(new Date(dueDate.getTime()+86398000)); | |
613 | + antExChuQuery.setEnd(new Date(end.getTime()+86398000)); | |
601 | 614 | }else{ |
602 | 615 | antExChuQuery.setStart(min); |
603 | - if(min.before(patientses.get(0).getBookbuildingDate())&&min.before(dueDate)){ | |
604 | - antExChuQuery.setEnd(new Date(patientses.get(0).getBookbuildingDate().getTime() + 86398000)); | |
605 | - } | |
616 | + antExChuQuery.setEnd(end); | |
606 | 617 | } |
607 | 618 | } |
608 | 619 | antExChuQuery.setPid(pid); |
609 | 620 | |
... | ... | @@ -624,12 +635,10 @@ |
624 | 635 | if(!f) { |
625 | 636 | if (null == min) { |
626 | 637 | antExQuery.setStart(patientses.get(0).getBookbuildingDate()); |
627 | - antExQuery.setEnd(new Date(dueDate.getTime() + 86398000)); | |
638 | + antExQuery.setEnd(new Date(end.getTime() + 86398000)); | |
628 | 639 | } else { |
629 | 640 | antExQuery.setStart(min); |
630 | - if (min.before(patientses.get(0).getBookbuildingDate())) { | |
631 | - antExQuery.setEnd(new Date(patientses.get(0).getBookbuildingDate().getTime() + 86398000)); | |
632 | - } | |
641 | + antExQuery.setEnd(end); | |
633 | 642 | } |
634 | 643 | } |
635 | 644 | |
636 | 645 | |
... | ... | @@ -973,10 +982,47 @@ |
973 | 982 | return new BaseResponse().setErrorcode(ErrorCodeConstants.DEPT_NOT_EXISTS).setErrormsg("该孕妇还未在本院建档不能进行产检"); |
974 | 983 | } |
975 | 984 | |
985 | + | |
986 | + MatDeliverQuery matDeliverQuery=new MatDeliverQuery(); | |
987 | + | |
988 | + matDeliverQuery.setPid(patients.getPid()); | |
989 | + matDeliverQuery.setYn(YnEnums.YES.getId()); | |
990 | + | |
991 | + List<MaternalDeliverModel> list1 = matDeliverService.query(matDeliverQuery); | |
992 | + | |
993 | + StopPregQuery stopPregQuery=new StopPregQuery(); | |
994 | + | |
995 | + stopPregQuery.setPid(patients.getPid()); | |
996 | + stopPregQuery.setYn(YnEnums.YES.getId()); | |
997 | + | |
998 | + List<StopPregModel> list2= stopPregnancyService.queryStopPreg(stopPregQuery); | |
999 | + | |
1000 | + | |
1001 | + List<SortIn> sortList = new ArrayList<>(); | |
1002 | + if(CollectionUtils.isNotEmpty(list1)){ | |
1003 | + for(MaternalDeliverModel model:list1){ | |
1004 | + sortList.add(new SortIn(model)); | |
1005 | + } | |
1006 | + | |
1007 | + } | |
1008 | + if(CollectionUtils.isNotEmpty(list2)) { | |
1009 | + for (StopPregModel model : list2) { | |
1010 | + sortList.add(new SortIn(model)); | |
1011 | + } | |
1012 | + } | |
1013 | + | |
1014 | + | |
1015 | + | |
976 | 1016 | AntexListResult antexListResult = new AntexListResult(); |
977 | 1017 | AntExChuQuery antExChuQuery = new AntExChuQuery(); |
978 | 1018 | antExChuQuery.setPid(patients.getPid()); |
979 | 1019 | antExChuQuery.setYn(YnEnums.YES.getId()); |
1020 | + Date max=null; | |
1021 | + if(!sortList.isEmpty()){ | |
1022 | + sortList(sortList); | |
1023 | + max = sortList.get(0).getDate(); | |
1024 | + } | |
1025 | + antExChuQuery.setStart(max); | |
980 | 1026 | //获取初诊记录 |
981 | 1027 | List<AntExChuModel> antExChulist = antenatalExaminationService.queryAntExChu(antExChuQuery); |
982 | 1028 | |
... | ... | @@ -984,6 +1030,7 @@ |
984 | 1030 | AntExQuery antExQuery = new AntExQuery(); |
985 | 1031 | antExQuery.setYn(YnEnums.YES.getId()); |
986 | 1032 | antExQuery.setPid(patients.getPid()); |
1033 | + antExQuery.setStart(max); | |
987 | 1034 | //查询产前检查记录 |
988 | 1035 | List<AntenatalExaminationModel> list = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery()); |
989 | 1036 |