Commit 4a49d74f301e717a062cb317bd0d4c8be7a61d92

Authored by liquanyu
1 parent b7e0e18ad0

update code

Showing 1 changed file with 35 additions and 24 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java View file @ 4a49d74
... ... @@ -560,33 +560,44 @@
560 560 else if (!StringUtils.isEmpty(bookbuildingQueryRequest.getVcCardNo())) {
561 561  
562 562 patientsQuery.setVcCardNo(bookbuildingQueryRequest.getVcCardNo());
  563 + patientsQuery.setHospitalId(autoMatchFacade.getHospitalId(userId));
  564 + //优先查询本院通过就诊卡
  565 + List<Patients> localPatients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery);
  566 + patientsQuery.setHospitalId(null);
  567 + if (CollectionUtils.isNotEmpty(localPatients))
  568 + {
  569 + patients = localPatients;
  570 + }
  571 + else
  572 + {
  573 + //区域模式
  574 + patientsQuery.setHospitalList(groupsFacade.findGroupHospital(userId, false));
563 575  
564   - //区域模式
565   - patientsQuery.setHospitalList(groupsFacade.findGroupHospital(userId, false));
566   -
567   - List<Patients> patientsVc = yunBookbuildingService.queryPregnantWithQuery(patientsQuery);
568   - if (CollectionUtils.isNotEmpty(patientsVc)) {
569   - if (patientsVc.get(0) == null || StringUtils.isEmpty(patientsVc.get(0).getCardNo())) {
570   - patients = patientsVc;
571   - } else {
572   - patientsQuery.setHospitalId(null);
573   - patientsQuery.setVcCardNo(null);
574   - patientsQuery.setCardNo(patientsVc.get(0).getCardNo());
575   - patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery, "bookbuildingDate", Sort.Direction.DESC);
  576 + List<Patients> patientsVc = yunBookbuildingService.queryPregnantWithQuery(patientsQuery);
  577 + if (CollectionUtils.isNotEmpty(patientsVc)) {
  578 + if (patientsVc.get(0) == null || StringUtils.isEmpty(patientsVc.get(0).getCardNo())) {
  579 + patients = patientsVc;
  580 + } else {
  581 + patientsQuery.setHospitalId(null);
  582 + patientsQuery.setVcCardNo(null);
  583 + patientsQuery.setCardNo(patientsVc.get(0).getCardNo());
  584 + patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery, "bookbuildingDate", Sort.Direction.DESC);
  585 + }
576 586 }
577   - }
578   - // 如果为空,初次建档,根据就诊卡号从HIS库取患者信息
579   - else {
580   - if ("2".equals(HIS_VERSION)) {
581   - typeMap.put("hisPatient", hisServiceV2.getPatientInfoList(bookbuildingQueryRequest.getVcCardNo()));
582   - } else if ("3".equals(HIS_VERSION)) {
583   - typeMap.put("hisPatient", qingLongXianHisService.getPatientInfoList(bookbuildingQueryRequest.getVcCardNo()));
584   - } else if ("5".equals(HIS_VERSION)) {
585   - typeMap.put("hisPatient", fnfyHisService.getPatientInfoList(bookbuildingQueryRequest.getVcCardNo()));
586   - } else if ("4".equals(HIS_VERSION)) {
587   - typeMap.put("hisPatient", qhdfyHisService.getPatientInfoList(bookbuildingQueryRequest.getVcCardNo()));
  587 + // 如果为空,初次建档,根据就诊卡号从HIS库取患者信息
  588 + else {
  589 + if ("2".equals(HIS_VERSION)) {
  590 + typeMap.put("hisPatient", hisServiceV2.getPatientInfoList(bookbuildingQueryRequest.getVcCardNo()));
  591 + } else if ("3".equals(HIS_VERSION)) {
  592 + typeMap.put("hisPatient", qingLongXianHisService.getPatientInfoList(bookbuildingQueryRequest.getVcCardNo()));
  593 + } else if ("5".equals(HIS_VERSION)) {
  594 + typeMap.put("hisPatient", fnfyHisService.getPatientInfoList(bookbuildingQueryRequest.getVcCardNo()));
  595 + } else if ("4".equals(HIS_VERSION)) {
  596 + typeMap.put("hisPatient", qhdfyHisService.getPatientInfoList(bookbuildingQueryRequest.getVcCardNo()));
  597 + }
588 598 }
589 599 }
  600 +
590 601 } else if (!StringUtils.isEmpty(bookbuildingQueryRequest.getId())) {
591 602 // id,HuJiaqi添加,为了建档管理里面的查看单条使用
592 603 patients.add(yunBookbuildingService.findOneById(bookbuildingQueryRequest.getId()));