Commit cd27a3c4eefcad4255c981430ef2e46b318aaee3
1 parent
bfc44dbe2f
Exists in
master
and in
1 other branch
修改新电子病历
Showing 2 changed files with 34 additions and 12 deletions
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientsService.java
View file @
cd27a3c
| ... | ... | @@ -47,7 +47,7 @@ |
| 47 | 47 | iPatientDao.updatePatient(obj, obj.getId()); |
| 48 | 48 | } |
| 49 | 49 | public void findAndModify(PatientsQuery query,Patients obj){ |
| 50 | - iPatientDao.findAndModify(query.convertToQuery(),obj); | |
| 50 | + iPatientDao.findAndModify(query.convertToQuery(), obj); | |
| 51 | 51 | } |
| 52 | 52 | public List<Patients> queryPatient(PatientsQuery patientsQuery) { |
| 53 | 53 | MongoQuery query = patientsQuery.convertToQuery(); |
| ... | ... | @@ -58,6 +58,11 @@ |
| 58 | 58 | |
| 59 | 59 | return iPatientDao.queryPatient(query.addOrder(Sort.Direction.DESC, "id")); |
| 60 | 60 | } |
| 61 | + | |
| 62 | + public List<Patients> findLatelyCreated(MongoQuery mongoQuery){ | |
| 63 | + return iPatientDao.queryPatient(mongoQuery); | |
| 64 | + } | |
| 65 | + | |
| 61 | 66 | public List<Patients> queryPatient1(PatientsQuery patientsQuery) { |
| 62 | 67 | MongoQuery query = patientsQuery.convertToQuery(); |
| 63 | 68 | if (StringUtils.isNotEmpty(patientsQuery.getNeed())) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
cd27a3c
| ... | ... | @@ -246,7 +246,7 @@ |
| 246 | 246 | List<SortIn> listDate = new ArrayList<>(); |
| 247 | 247 | //分娩记录 |
| 248 | 248 | List<MaternalDeliverModel> modelList = matDeliverService.query(matDeliverQuery); |
| 249 | - if(CollectionUtils.isNotEmpty(modelList)){ | |
| 249 | + if (CollectionUtils.isNotEmpty(modelList)) { | |
| 250 | 250 | for (MaternalDeliverModel model : modelList) { |
| 251 | 251 | listDate.add(new SortIn(model)); |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | |
| ... | ... | @@ -257,17 +257,17 @@ |
| 257 | 257 | query.setYn(YnEnums.YES.getId()); |
| 258 | 258 | query.setPid(pid); |
| 259 | 259 | List<StopPregModel> stopPregs = stopPregnancyService.queryStopPreg(query); |
| 260 | - if(CollectionUtils.isNotEmpty(stopPregs)) { | |
| 260 | + if (CollectionUtils.isNotEmpty(stopPregs)) { | |
| 261 | 261 | for (StopPregModel stopPregModel : stopPregs) { |
| 262 | 262 | listDate.add(new SortIn(stopPregModel)); |
| 263 | 263 | } |
| 264 | 264 | } |
| 265 | - PatientsQuery patientsQuery=new PatientsQuery(); | |
| 265 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
| 266 | 266 | patientsQuery.setPid(pid); |
| 267 | 267 | patientsQuery.setType(3); |
| 268 | 268 | patientsQuery.setYn(YnEnums.YES.getId()); |
| 269 | 269 | List<Patients> patientses = patientsService.queryPatient(patientsQuery); |
| 270 | - if(CollectionUtils.isNotEmpty(patientses)) { | |
| 270 | + if (CollectionUtils.isNotEmpty(patientses)) { | |
| 271 | 271 | for (Patients patients : patientses) { |
| 272 | 272 | listDate.add(new SortIn(patients, 1)); |
| 273 | 273 | } |
| 274 | 274 | |
| ... | ... | @@ -275,12 +275,23 @@ |
| 275 | 275 | //排序集合 |
| 276 | 276 | sortList(listDate); |
| 277 | 277 | |
| 278 | + | |
| 279 | + PatientsQuery patientsQuery1 = new PatientsQuery(); | |
| 280 | + patientsQuery1.setPid(pid); | |
| 281 | + patientsQuery1.setType(1); | |
| 282 | + List<Patients> patientses1 = patientsService.findLatelyCreated(patientsQuery1.convertToQuery().addOrder(Sort.Direction.ASC, "created")); | |
| 283 | + | |
| 284 | + Date min = null; | |
| 285 | + if (CollectionUtils.isNotEmpty(patientses1)) { | |
| 286 | + min = patientses1.get(0).getBookbuildingDate(); | |
| 287 | + } | |
| 288 | + | |
| 278 | 289 | Date max = null; |
| 279 | 290 | if (!listDate.isEmpty()) { |
| 280 | 291 | max = listDate.get(0).getDate(); |
| 281 | 292 | } |
| 282 | 293 | |
| 283 | - HighScoreResult highScoreResult = getPatLastRiskByDate(pid, needLevel, max); | |
| 294 | + HighScoreResult highScoreResult = getPatLastRiskByDate(pid, needLevel,min, max); | |
| 284 | 295 | return highScoreResult; |
| 285 | 296 | } |
| 286 | 297 | |
| 287 | 298 | |
| ... | ... | @@ -292,12 +303,14 @@ |
| 292 | 303 | * @param date |
| 293 | 304 | * @return |
| 294 | 305 | */ |
| 295 | - public HighScoreResult getPatLastRiskByDate(String pid, boolean needLevel, Date date) { | |
| 306 | + public HighScoreResult getPatLastRiskByDate(String pid, boolean needLevel, Date min,Date date) { | |
| 296 | 307 | AntExQuery antExQuery = new AntExQuery(); |
| 297 | 308 | antExQuery.setPid(pid); |
| 298 | 309 | antExQuery.setYn(YnEnums.YES.getId()); |
| 299 | - if (date != null) { | |
| 300 | - antExQuery.setStart(date); | |
| 310 | + if (min != null) { | |
| 311 | + antExQuery.setStart(min); | |
| 312 | + }else if(null!=date){ | |
| 313 | + antExQuery.setEnd(date); | |
| 301 | 314 | } |
| 302 | 315 | List<AntenatalExaminationModel> list = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.DESC, "modified")); |
| 303 | 316 | HighScoreResult highScoreResult = new HighScoreResult(); |
| ... | ... | @@ -356,8 +369,10 @@ |
| 356 | 369 | //初诊 |
| 357 | 370 | AntExChuQuery antExChuQuery = new AntExChuQuery(); |
| 358 | 371 | antExChuQuery.setPid(pid); |
| 359 | - if (date != null) { | |
| 360 | - antExChuQuery.setStart(date); | |
| 372 | + if (min != null) { | |
| 373 | + antExChuQuery.setStart(min); | |
| 374 | + } else if (date != null) { | |
| 375 | + antExChuQuery.setEnd(date); | |
| 361 | 376 | } |
| 362 | 377 | antExChuQuery.setYn(YnEnums.YES.getId()); |
| 363 | 378 | List<AntExChuModel> list1 = antenatalExaminationService.queryAntExChu(antExChuQuery); |
| 364 | 379 | |
| ... | ... | @@ -727,11 +742,13 @@ |
| 727 | 742 | this.date = patients.getBookbuildingDate(); |
| 728 | 743 | this.type = 2; |
| 729 | 744 | } |
| 730 | - public SortIn(Patients patients,int i) { | |
| 745 | + | |
| 746 | + public SortIn(Patients patients, int i) { | |
| 731 | 747 | this.id = patients.getId(); |
| 732 | 748 | this.date = patients.getFmDate(); |
| 733 | 749 | this.type = 2; |
| 734 | 750 | } |
| 751 | + | |
| 735 | 752 | public SortIn(StopPregModel stopPregModel) { |
| 736 | 753 | this.id = stopPregModel.getId(); |
| 737 | 754 | this.date = stopPregModel.getStopDate(); |