From fb8321a8ef0d5b9877bc55d9fbdd4e94d9af7f85 Mon Sep 17 00:00:00 2001 From: "Wang.Huan" Date: Wed, 5 Mar 2025 14:14:41 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=A8=E8=AF=8A=E6=8C=82=E5=8F=B7-=E5=85=83?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OutpatientRegistrationController.java | 22 +++++++- .../IOutpatientRegistrationService.java | 21 +++++++ .../IOutpatientRegistrationServiceImpl.java | 56 +++++++++++++++++++ .../dto/OutpatientRegistrationAddParam.java | 22 ++++++++ .../dto/PatientMetadata.java | 28 ++++++++++ 5 files changed, 147 insertions(+), 2 deletions(-) create mode 100644 openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientservice/controller/appservice/IOutpatientRegistrationService.java create mode 100644 openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientservice/controller/appservice/impl/IOutpatientRegistrationServiceImpl.java create mode 100644 openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientservice/dto/OutpatientRegistrationAddParam.java create mode 100644 openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientservice/dto/PatientMetadata.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientservice/controller/OutpatientRegistrationController.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientservice/controller/OutpatientRegistrationController.java index 33a1bfad..43e63b9c 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientservice/controller/OutpatientRegistrationController.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientservice/controller/OutpatientRegistrationController.java @@ -4,14 +4,14 @@ package com.openhis.web.outpatientservice.controller; import com.core.common.core.domain.R; -import com.openhis.common.enums.AccountStatus; import com.openhis.common.enums.PriorityLevel; -import com.openhis.web.basicservice.dto.HealthcareServiceInitDto; +import com.openhis.web.outpatientservice.controller.appservice.IOutpatientRegistrationService; import com.openhis.web.outpatientservice.dto.OutpatientRegistrationInitDto; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.util.List; @@ -27,6 +27,8 @@ import java.util.stream.Stream; @AllArgsConstructor public class OutpatientRegistrationController { + private final IOutpatientRegistrationService iOutpatientRegistrationService; + /** * 门诊挂号基础数据初始化 */ @@ -41,4 +43,20 @@ public class OutpatientRegistrationController { return R.ok(outpatientRegistrationInitDto); } + /** + * 门诊挂号 - 查询患者信息 + * + * @param searchKey 模糊查询关键字 + * @param pageNo 当前页 + * @param pageSize 每页多少条 + * @return 患者信息 + */ + @GetMapping(value = "/patient-metadata") + public R getPatientMetadata(@RequestParam(value = "searchKey", defaultValue = "") String searchKey, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { + return R.ok(iOutpatientRegistrationService.getPatientMetadataBySearchKey(searchKey, pageNo, pageSize)); + } + + } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientservice/controller/appservice/IOutpatientRegistrationService.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientservice/controller/appservice/IOutpatientRegistrationService.java new file mode 100644 index 00000000..a6c23d4e --- /dev/null +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientservice/controller/appservice/IOutpatientRegistrationService.java @@ -0,0 +1,21 @@ +package com.openhis.web.outpatientservice.controller.appservice; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.openhis.web.outpatientservice.dto.PatientMetadata; + +/** + * 门诊挂号 Service + */ +public interface IOutpatientRegistrationService { + + /** + * 门诊挂号 - 查询患者信息 + * + * @param searchKey 模糊查询关键字 + * @param pageNo 当前页 + * @param pageSize 每页多少条 + * @return 患者信息 + */ + Page getPatientMetadataBySearchKey(String searchKey, Integer pageNo, Integer pageSize); + +} diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientservice/controller/appservice/impl/IOutpatientRegistrationServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientservice/controller/appservice/impl/IOutpatientRegistrationServiceImpl.java new file mode 100644 index 00000000..ef0d144c --- /dev/null +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientservice/controller/appservice/impl/IOutpatientRegistrationServiceImpl.java @@ -0,0 +1,56 @@ +package com.openhis.web.outpatientservice.controller.appservice.impl; + + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.openhis.administration.domain.Patient; +import com.openhis.administration.mapper.PatientMapper; +import com.openhis.common.enums.AdministrativeGender; +import com.openhis.common.utils.EnumUtils; +import com.openhis.common.utils.HisPageUtils; +import com.openhis.common.utils.HisQueryUtils; +import com.openhis.web.outpatientservice.controller.appservice.IOutpatientRegistrationService; +import com.openhis.web.outpatientservice.dto.PatientMetadata; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Arrays; +import java.util.HashSet; + +/** + * 门诊挂号 实现类 + */ +@Service +public class IOutpatientRegistrationServiceImpl implements IOutpatientRegistrationService { + + @Resource + PatientMapper patientMapper; + + /** + * 门诊挂号 - 查询患者信息 + * + * @param searchKey 模糊查询关键字 + * @param pageNo 当前页 + * @param pageSize 每页多少条 + * @return 患者信息 + */ + @Override + public Page getPatientMetadataBySearchKey(String searchKey, Integer pageNo, Integer pageSize) { + // 构建查询条件 + QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(null, + searchKey, new HashSet<>(Arrays.asList("name", "py_str", "wb_str")), null + ); + // 设置排序 + queryWrapper.orderByDesc("update_time"); + // 患者信息 + Page patientMetadataPage = HisPageUtils.selectPage(patientMapper, + queryWrapper, pageNo, pageSize, PatientMetadata.class); + + patientMetadataPage.getRecords().forEach(e -> { + // 性别枚举 + e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum())); + }); + return patientMetadataPage; + } + +} diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientservice/dto/OutpatientRegistrationAddParam.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientservice/dto/OutpatientRegistrationAddParam.java new file mode 100644 index 00000000..75560da2 --- /dev/null +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientservice/dto/OutpatientRegistrationAddParam.java @@ -0,0 +1,22 @@ +package com.openhis.web.outpatientservice.dto; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 门诊挂号 新增数据 + */ +@Data +@Accessors(chain = true) +public class OutpatientRegistrationAddParam { + + // 就诊管理-表单数据 + + // 就诊诊断管理-表单数据 + + // 就诊位置管理-表单数据 + + // 就诊参数者管理-表单数据 + + +} diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientservice/dto/PatientMetadata.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientservice/dto/PatientMetadata.java new file mode 100644 index 00000000..1d42779c --- /dev/null +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientservice/dto/PatientMetadata.java @@ -0,0 +1,28 @@ +package com.openhis.web.outpatientservice.dto; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 患者信息 元数据 + */ +@Data +@Accessors(chain = true) +public class PatientMetadata { + /** + * ID + */ + private Long id; + + /** + * 患者姓名 + */ + private String name; + + /** + * 性别编码 + */ + private Integer genderEnum; + private String genderEnum_enumText; + +}