Commit 3a8430c21c7a7407ddb20ae0bf128b37ee4132d7

Authored by gengxiaokai
1 parent b5f854bc1a

产前诊断条件查询

Showing 1 changed file with 39 additions and 12 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/DiagnosisFacaed.java View file @ 3a8430c
... ... @@ -463,10 +463,49 @@
463 463 */
464 464 public DiagnosisManagerResult queryDiagnosisLab(DiagnosisAddRequest dataresult,Integer userId){
465 465 List<Map<String,String>> mList = new ArrayList<Map<String,String>>();
  466 + List<String> pList = new ArrayList<String>();
466 467 DiagnosisManagerResult diagnosisManagerResult = new DiagnosisManagerResult();
467 468 String hospital = autoMatchFacade.getHospitalId(userId);
468 469 dataresult.setHospitalId(hospital);
469 470 DiagnosisQuery diagnosisQuery = new DiagnosisQuery();
  471 + if(null != dataresult.getQueryNo()){
  472 + PatientsQuery patientsQuery = new PatientsQuery();
  473 + patientsQuery.setQueryNo(dataresult.getQueryNo());
  474 + patientsQuery.setHospitalId(hospital);
  475 + List<Patients> list = patientsService.queryPatient(patientsQuery);
  476 + if(list != null && list.size() > 0){
  477 + for(Patients patient : list){
  478 + pList.add(patient.getId());
  479 + }
  480 + }else{
  481 + return diagnosisManagerResult;
  482 + }
  483 + }
  484 + if(pList != null && pList.size() > 0){
  485 + diagnosisQuery.setParentIdList(pList);
  486 + }
  487 + if(null != dataresult.getDiaResult()){
  488 + diagnosisQuery.setDiaResult(dataresult.getDiaResult());
  489 + }
  490 + if (null != dataresult.getApplyWeekStart()){
  491 + diagnosisQuery.setApplyWeeksStart(7 * Integer.valueOf(dataresult.getApplyWeekStart()));
  492 + }
  493 + if (null != dataresult.getApplyWeekEnd()){
  494 + diagnosisQuery.setApplyWeeksEnd(7 * Integer.valueOf(dataresult.getApplyWeekEnd()) + 6);
  495 + }
  496 + if (null != dataresult.getNowWeeksStart()) {
  497 + diagnosisQuery.setLastMensesEnd(DateUtil.addDay(DateUtil.parseYMD(DateUtil.getyyyy_MM_dd(new Date())), -(dataresult.getNowWeeksStart() * 7)));
  498 + }
  499 + if (null != dataresult.getNowWeeksEnd()) {
  500 + diagnosisQuery.setLastMensesStart(DateUtil.addDay(DateUtil.parseYMD(DateUtil.getyyyy_MM_dd(new Date())), -(dataresult.getNowWeeksEnd() * 7) - 6));
  501 + }
  502 + if(null != dataresult.getDiaStatus()){
  503 + diagnosisQuery.setDiaStatus(dataresult.getDiaStatus());
  504 + }
  505 + if(null != dataresult.getRsResult()){
  506 + diagnosisQuery.setRsResult(dataresult.getRsResult());
  507 + }
  508 +
470 509 if(StringUtils.isNotEmpty(dataresult.getApplyDate())){
471 510 String[] dates = dataresult.getApplyDate().split(" - ");
472 511 diagnosisQuery.setApplyDateStart(DateUtil.parseYMD(dates[0]));
473 512  
... ... @@ -475,24 +514,12 @@
475 514 diagnosisQuery.setApplyDateEnd(DateUtil.parseYMDHMS(dates[1] + " 23:59:59"));
476 515 }
477 516 }
478   - if(null != dataresult.getCollectHospitalId()){
479   - diagnosisQuery.setCollectHospitalId(dataresult.getCollectHospitalId());
480   - }
481   - if(null != dataresult.getSpecimenNo()){
482   - diagnosisQuery.setSpecimenNo(dataresult.getSpecimenNo());
483   - }
484   - if(null != dataresult.getDiaStatus()){
485   - diagnosisQuery.setDiaStatus(dataresult.getDiaStatus());
486   - }
487 517 if(null != dataresult.getResultDate()){
488 518 String[] dates = dataresult.getResultDate().split(" - ");
489 519 diagnosisQuery.setResultDateStart(DateUtil.parseYMD(dates[0]));
490 520 if (dates.length == 2) {
491 521 diagnosisQuery.setResultDateEnd(DateUtil.parseYMDHMS(dates[1] + " 23:59:59"));
492 522 }
493   - }
494   - if(null != dataresult.getQueryNo()){
495   - diagnosisQuery.setQueryNo(dataresult.getQueryNo());
496 523 }
497 524 //只查询状态为已申请和已接收的
498 525 List<String> listString = new ArrayList<String>();