Commit 7ccca9b626585c1f1e5b728a65bd23208e79cde7
1 parent
3779d17a4c
Exists in
master
and in
8 other branches
修改新电子病历
Showing 2 changed files with 63 additions and 34 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
7ccca9b
| ... | ... | @@ -438,37 +438,33 @@ |
| 438 | 438 | }else if(listDate.size()>1){ |
| 439 | 439 | patientsQuery1.setBookbuildingDateStart(new Date()); |
| 440 | 440 | } |
| 441 | - /* else{ | |
| 442 | - Date end = patientsQuery1.getBookbuildingDateEnd(); | |
| 443 | - patientsQuery1.setBookbuildingDateEnd(new Date()); | |
| 444 | - patientsQuery1.setBookbuildingDateStart(end); | |
| 445 | - }*/ | |
| 446 | 441 | pid=list.get(0).getPid(); |
| 447 | 442 | patientsQuery1.setPid(pid); |
| 448 | 443 | List<Patients> patientses = patientsService.queryPatient1(patientsQuery1); |
| 449 | - Iterator<Patients> iterator=patientses.iterator(); | |
| 450 | - while(iterator.hasNext()){ | |
| 451 | - Patients patients= iterator.next(); | |
| 452 | - Date date = DateUtil.addWeek(patients.getLastMenses(),42); | |
| 453 | - Date currentDate = DateUtil.formatDate(patients.getBookbuildingDate()); | |
| 454 | - if (date.getTime() <= currentDate.getTime()) | |
| 455 | - { | |
| 444 | + if(CollectionUtils.isNotEmpty(patientses)){ | |
| 445 | + Iterator<Patients> iterator=patientses.iterator(); | |
| 446 | + while(iterator.hasNext()){ | |
| 447 | + Patients patients= iterator.next(); | |
| 448 | + Date date = DateUtil.addWeek(patients.getLastMenses(),42); | |
| 449 | + Date currentDate = DateUtil.formatDate(patients.getBookbuildingDate()); | |
| 450 | + if (date.getTime() <= currentDate.getTime()) | |
| 451 | + { | |
| 456 | 452 | //建档记录 |
| 457 | - if (null != patients.getHospitalId()) { | |
| 458 | - organization = organizationService.getOrganization(Integer.valueOf(patients.getHospitalId())); | |
| 459 | - } | |
| 460 | - pid = patients.getPid(); | |
| 461 | - listData.add(new AntData(patients, null != organization ? organization.getName() : "")); | |
| 462 | - iterator.remove(); | |
| 453 | + if (null != patients.getHospitalId()) { | |
| 454 | + organization = organizationService.getOrganization(Integer.valueOf(patients.getHospitalId())); | |
| 455 | + } | |
| 456 | + pid = patients.getPid(); | |
| 457 | + listData.add(new AntData(patients, null != organization ? organization.getName() : "")); | |
| 458 | + iterator.remove(); | |
| 463 | 459 | |
| 464 | 460 | |
| 465 | - PostReviewQuery postReviewQuery = new PostReviewQuery(); | |
| 466 | - if (list.size() - 1 > i) { | |
| 467 | - postReviewQuery.setStart(dueDate); | |
| 468 | - //下次建档记录前都是产后复查,如果没有下个产程的数据就直接显示 | |
| 469 | - postReviewQuery.setEnd(patientses.get(0).getBookbuildingDate()); | |
| 470 | - } | |
| 471 | - postReviewQuery.setPid(pid); | |
| 461 | + PostReviewQuery postReviewQuery = new PostReviewQuery(); | |
| 462 | + if (list.size() - 1 > i) { | |
| 463 | + postReviewQuery.setStart(dueDate); | |
| 464 | + //下次建档记录前都是产后复查,如果没有下个产程的数据就直接显示 | |
| 465 | + postReviewQuery.setEnd(patientses.get(0).getBookbuildingDate()); | |
| 466 | + } | |
| 467 | + postReviewQuery.setPid(pid); | |
| 472 | 468 | // Object obj = map.get(listDate.get(i).getId()); |
| 473 | 469 | /* if (obj instanceof MaternalDeliverModel) { |
| 474 | 470 | listData.add(new AntData((MaternalDeliverModel) obj, patientses.get(0).getLastMenses(), null != organization ? organization.getName() : "")); |
| 475 | 471 | |
| 476 | 472 | |
| 477 | 473 | |
| 478 | 474 | |
| ... | ... | @@ -476,20 +472,22 @@ |
| 476 | 472 | listData.add(new AntData(stopPregs.get(0), patientses.get(0).getLastMenses(), null != organization ? organization.getName() : "")); |
| 477 | 473 | }*/ |
| 478 | 474 | |
| 479 | - //产后复查记录 | |
| 480 | - List<PostReviewModel> reviewModels = postReviewService.findWithList(postReviewQuery); | |
| 481 | - if (CollectionUtils.isNotEmpty(reviewModels)) { | |
| 482 | - for (PostReviewModel postReviewModel : reviewModels) { | |
| 483 | - if (null != postReviewModel.getHospitalId()) { | |
| 484 | - organization = organizationService.getOrganization(Integer.valueOf(postReviewModel.getHospitalId())); | |
| 475 | + //产后复查记录 | |
| 476 | + List<PostReviewModel> reviewModels = postReviewService.findWithList(postReviewQuery); | |
| 477 | + if (CollectionUtils.isNotEmpty(reviewModels)) { | |
| 478 | + for (PostReviewModel postReviewModel : reviewModels) { | |
| 479 | + if (null != postReviewModel.getHospitalId()) { | |
| 480 | + organization = organizationService.getOrganization(Integer.valueOf(postReviewModel.getHospitalId())); | |
| 481 | + } | |
| 482 | + listData.add(new AntData(postReviewModel, null != organization ? organization.getName() : "", patientses.get(0).getFmDate())); | |
| 485 | 483 | } |
| 486 | - listData.add(new AntData(postReviewModel, null != organization ? organization.getName() : "", patientses.get(0).getFmDate())); | |
| 487 | 484 | } |
| 485 | + sortList.add(listData); | |
| 486 | + listData=new ArrayList(); | |
| 488 | 487 | } |
| 489 | - sortList.add(listData); | |
| 490 | - listData=new ArrayList(); | |
| 491 | 488 | } |
| 492 | 489 | } |
| 490 | + | |
| 493 | 491 | if(CollectionUtils.isNotEmpty(patientses)){ |
| 494 | 492 | buildPatientList(dueDate,patientses,listData); |
| 495 | 493 | |
| ... | ... | @@ -521,6 +519,18 @@ |
| 521 | 519 | if(!listData.isEmpty()){ |
| 522 | 520 | sortList.add(listData); |
| 523 | 521 | } |
| 522 | + Collections.sort(listData, new Comparator<AntData>() { | |
| 523 | + @Override | |
| 524 | + public int compare(AntData o1, AntData o2) { | |
| 525 | + if (o1.getCreated().after(o2.getCreated())) { | |
| 526 | + return -1; | |
| 527 | + } | |
| 528 | + if (o1.getCreated().before(o2.getCreated())) { | |
| 529 | + return 1; | |
| 530 | + } | |
| 531 | + return 0; | |
| 532 | + } | |
| 533 | + }); | |
| 524 | 534 | } |
| 525 | 535 | PatientsQuery patientsQuery1=new PatientsQuery(); |
| 526 | 536 | patientsQuery1.setYn(YnEnums.YES.getId()); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AntData.java
View file @
7ccca9b
| ... | ... | @@ -3,6 +3,7 @@ |
| 3 | 3 | import com.lyms.platform.common.utils.DateUtil; |
| 4 | 4 | import com.lyms.platform.common.utils.StringUtils; |
| 5 | 5 | import com.lyms.platform.pojo.*; |
| 6 | +import org.codehaus.jackson.annotate.JsonIgnore; | |
| 6 | 7 | |
| 7 | 8 | import java.util.Date; |
| 8 | 9 | |
| 9 | 10 | |
| ... | ... | @@ -18,7 +19,17 @@ |
| 18 | 19 | |
| 19 | 20 | private String hospitalName; |
| 20 | 21 | private String hospitalId; |
| 22 | + @JsonIgnore | |
| 23 | + private Date created; | |
| 21 | 24 | |
| 25 | + public Date getCreated() { | |
| 26 | + return created; | |
| 27 | + } | |
| 28 | + | |
| 29 | + public void setCreated(Date created) { | |
| 30 | + this.created = created; | |
| 31 | + } | |
| 32 | + | |
| 22 | 33 | public String getHospitalId() { |
| 23 | 34 | return hospitalId; |
| 24 | 35 | } |
| ... | ... | @@ -65,6 +76,7 @@ |
| 65 | 76 | this.dueWeek = StringUtils.dueWeek(days); |
| 66 | 77 | if(null!=model.getCheckDate()){ |
| 67 | 78 | this.checkTime = DateUtil.getyyyy_MM_dd(model.getCheckDate()); |
| 79 | + this.created=model.getCheckDate(); | |
| 68 | 80 | } |
| 69 | 81 | this.title="复诊"; |
| 70 | 82 | this.type="3"; |
| ... | ... | @@ -78,6 +90,7 @@ |
| 78 | 90 | this.dueWeek = StringUtils.dueWeek(days); |
| 79 | 91 | if(null!=model.getCheckTime()){ |
| 80 | 92 | this.checkTime = DateUtil.getyyyy_MM_dd(model.getCheckTime()); |
| 93 | + this.created=model.getCheckTime(); | |
| 81 | 94 | } |
| 82 | 95 | |
| 83 | 96 | this.title="初诊"; |
| ... | ... | @@ -91,6 +104,7 @@ |
| 91 | 104 | int days = DateUtil.daysBetween(model.getLastMenses(), model.getBookbuildingDate()); |
| 92 | 105 | this.dueWeek = StringUtils.dueWeek(days); |
| 93 | 106 | this.checkTime = DateUtil.getyyyy_MM_dd(model.getBookbuildingDate()); |
| 107 | + this.created=model.getBookbuildingDate(); | |
| 94 | 108 | this.title="孕妇建档"; |
| 95 | 109 | this.type="1"; |
| 96 | 110 | this.hospitalName=hospitalName; |
| ... | ... | @@ -101,6 +115,9 @@ |
| 101 | 115 | this.id = model.getId(); |
| 102 | 116 | int days = DateUtil.daysBetween(lastMenses,DateUtil.parseYMD(model.getDueDate())); |
| 103 | 117 | this.dueWeek = StringUtils.dueWeek(days); |
| 118 | + if(null!=model.getDueDate()){ | |
| 119 | + this.created = DateUtil.parseYMD(model.getDueDate()); | |
| 120 | + } | |
| 104 | 121 | this.checkTime =model.getDueDate(); |
| 105 | 122 | this.title="孕妇分娩"; |
| 106 | 123 | this.type="4"; |
| ... | ... | @@ -114,6 +131,7 @@ |
| 114 | 131 | this.dueWeek= "产后"+days+"天"; |
| 115 | 132 | this.dueDate=DateUtil.getyyyy_MM_dd(dueDate); |
| 116 | 133 | this.checkTime=DateUtil.getyyyy_MM_dd(postReviewModel.getCheckTime()); |
| 134 | + this.created=postReviewModel.getCheckTime(); | |
| 117 | 135 | this.title="产后复查"; |
| 118 | 136 | this.type="5"; |
| 119 | 137 | this.hospitalName=hospitalName; |
| ... | ... | @@ -125,6 +143,7 @@ |
| 125 | 143 | int days= DateUtil.daysBetween(lastMenses,postReviewModel.getStopDate()); |
| 126 | 144 | this.dueWeek=StringUtils.dueWeek(days); |
| 127 | 145 | this.checkTime=DateUtil.getyyyy_MM_dd(postReviewModel.getStopDate()); |
| 146 | + this.created=postReviewModel.getStopDate(); | |
| 128 | 147 | this.title="终止妊娠"; |
| 129 | 148 | this.type="6"; |
| 130 | 149 | this.hospitalName=hospitalName; |