diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/IDoctorStationAdviceAppService.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/IDoctorStationAdviceAppService.java index 641ad4db..f9f0b95e 100755 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/IDoctorStationAdviceAppService.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/IDoctorStationAdviceAppService.java @@ -147,6 +147,6 @@ public interface IDoctorStationAdviceAppService { */ IPage getSurgeryPage(Long organizationId, Integer pageNo, Integer pageSize, String searchKey); - IPage getExaminationPage(Long organizationId, Integer pageNo, Integer pageSize, String searchKey); + IPage getExaminationPage(Long organizationId, Integer pageNo, Integer pageSize, String searchKey, String categoryCode); } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java index 40bd312e..4a17e6d7 100755 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java @@ -2571,12 +2571,13 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp } @Override - public IPage getExaminationPage(Long organizationId, Integer pageNo, Integer pageSize, String searchKey) { + public IPage getExaminationPage(Long organizationId, Integer pageNo, Integer pageSize, String searchKey, String categoryCode) { IPage result = doctorStationAdviceAppMapper.getExaminationPage( new Page<>(pageNo, pageSize), PublicationStatus.ACTIVE.getValue(), organizationId, - searchKey); + searchKey, + categoryCode); return result; } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/controller/DoctorStationAdviceController.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/controller/DoctorStationAdviceController.java index 84b83334..2e64d725 100755 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/controller/DoctorStationAdviceController.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/controller/DoctorStationAdviceController.java @@ -226,8 +226,9 @@ public class DoctorStationAdviceController { @RequestParam(value = "organizationId", required = false) Long organizationId, @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(value = "pageSize", defaultValue = "500") Integer pageSize, - @RequestParam(value = "searchKey", defaultValue = "") String searchKey) { - return R.ok(iDoctorStationAdviceAppService.getExaminationPage(organizationId, pageNo, pageSize, searchKey)); + @RequestParam(value = "searchKey", defaultValue = "") String searchKey, + @RequestParam(value = "categoryCode", defaultValue = "23") String categoryCode) { + return R.ok(iDoctorStationAdviceAppService.getExaminationPage(organizationId, pageNo, pageSize, searchKey, categoryCode)); } } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/mapper/DoctorStationAdviceAppMapper.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/mapper/DoctorStationAdviceAppMapper.java index 67a16f4b..36b12109 100755 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/mapper/DoctorStationAdviceAppMapper.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/mapper/DoctorStationAdviceAppMapper.java @@ -203,6 +203,7 @@ public interface DoctorStationAdviceAppMapper { IPage getExaminationPage(@Param("page") Page page, @Param("statusEnum") Integer statusEnum, @Param("organizationId") Long organizationId, - @Param("searchKey") String searchKey); + @Param("searchKey") String searchKey, + @Param("categoryCode") String categoryCode); } diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/patientmanage/appservice/impl/PatientInformationServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/patientmanage/appservice/impl/PatientInformationServiceImpl.java index 54909bb8..abe838ee 100755 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/patientmanage/appservice/impl/PatientInformationServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/patientmanage/appservice/impl/PatientInformationServiceImpl.java @@ -133,47 +133,13 @@ public class PatientInformationServiceImpl implements IPatientInformationService @Override public IPage getPatientInfo(PatientBaseInfoDto patientBaseInfoDto, String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request) { - // 获取登录者信息 + // 构建基础查询条件 LoginUser loginUser = SecurityUtils.getLoginUser(); - Long userId = loginUser.getUserId(); - Integer tenantId = loginUser.getTenantId().intValue(); - - // 先构建基础查询条件 QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper( patientBaseInfoDto, searchKey, new HashSet<>(Arrays.asList(CommonConstants.FieldName.Name, CommonConstants.FieldName.BusNo, CommonConstants.FieldName.PyStr, CommonConstants.FieldName.WbStr)), request); - // 检查是否是精确ID查询(从门诊挂号页面跳转时使用) - boolean hasExactIdQuery = (patientBaseInfoDto.getId() != null); - - // 只有非精确ID查询时,才添加医生患者过滤条件 - if (!hasExactIdQuery) { - // 查询当前用户对应的医生信息 - LambdaQueryWrapper practitionerQuery = new LambdaQueryWrapper<>(); - practitionerQuery.eq(com.openhis.administration.domain.Practitioner::getUserId, userId); - // 使用list()避免TooManyResultsException异常,然后取第一个记录 - List practitionerList = practitionerService.list(practitionerQuery); - com.openhis.administration.domain.Practitioner practitioner = practitionerList != null && !practitionerList.isEmpty() ? practitionerList.get(0) : null; - - // 如果当前用户是医生,添加医生患者过滤条件 - if (practitioner != null) { - // 查询该医生作为接诊医生(ADMITTER, code="1")和挂号医生(REGISTRATION_DOCTOR, code="12")的所有就诊记录的患者ID - List doctorPatientIds = patientManageMapper.getPatientIdsByPractitionerId( - practitioner.getId(), - Arrays.asList(ParticipantType.ADMITTER.getCode(), ParticipantType.REGISTRATION_DOCTOR.getCode()), - tenantId); - - if (doctorPatientIds != null && !doctorPatientIds.isEmpty()) { - // 添加患者ID过滤条件 - 注意:这里使用列名而不是表别名 - queryWrapper.in("id", doctorPatientIds); - } else { - // 如果没有相关患者,返回空结果 - queryWrapper.eq("id", -1); // 设置一个不存在的ID - } - } - // 如果不是医生,查询所有患者 - } IPage patientInformationPage = patientManageMapper.getPatientPage(new Page<>(pageNo, pageSize), queryWrapper); diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml index c3067563..a53da429 100755 --- a/openhis-server-new/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml +++ b/openhis-server-new/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml @@ -895,7 +895,7 @@ ORDER BY t1.ID, t1.name ASC, t2.ID ASC - +