From 7b20de9c3d51c8e552f9d0600f66a37ad2233224 Mon Sep 17 00:00:00 2001 From: liuhongrui Date: Tue, 4 Mar 2025 18:00:21 +0800 Subject: [PATCH] up --- .../OutpatientRecordController.java | 53 ++++--------------- .../dto/OutpatientRecordDto.java | 2 + .../dto/OutpatientRecordSearchParam.java | 2 +- .../patientmanage/PatientManageMapper.xml | 10 ++-- .../common/enums/EncounterSubjectStatus.java | 2 +- 5 files changed, 20 insertions(+), 49 deletions(-) diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/patientmanage/controller/OutpatientRecordController.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/patientmanage/controller/OutpatientRecordController.java index a373a1eb..c30c9bd9 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/patientmanage/controller/OutpatientRecordController.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/patientmanage/controller/OutpatientRecordController.java @@ -1,7 +1,5 @@ package com.openhis.web.patientmanage.controller; -import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; @@ -14,9 +12,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.core.common.core.domain.R; import com.openhis.common.enums.AdministrativeGender; import com.openhis.common.enums.EncounterSubjectStatus; +import com.openhis.common.utils.EnumUtils; import com.openhis.web.patientmanage.dto.OutpatientRecordDto; import com.openhis.web.patientmanage.dto.OutpatientRecordSearchParam; -import com.openhis.web.patientmanage.dto.PatientListDto; import com.openhis.web.patientmanage.mapper.PatientManageMapper; import lombok.extern.slf4j.Slf4j; @@ -46,42 +44,6 @@ public class OutpatientRecordController { return R.ok(listDoctorNames); } - /** - * 获取性别列表 - */ - @GetMapping("/list-administrativegender") - public R getAdministrativeGender() { - // 获取性别 - List statusList = Arrays.asList(AdministrativeGender.values()); - List dtos = new ArrayList<>(); - // 取得更新值 - for (AdministrativeGender status : statusList) { - PatientListDto dto = new PatientListDto(); - dto.setValue(status.getValue()); - dto.setInfo(status.getInfo()); - dtos.add(dto); - } - return R.ok(dtos); - } - - /** - * 获取就诊状态列表 - */ - @GetMapping("/list-encountersubjectstatus") - public R getEncounterSubjectStatus() { - // 获取就诊状态 - List statusList = Arrays.asList(EncounterSubjectStatus.values()); - List dtos = new ArrayList<>(); - // 取得更新值 - for (EncounterSubjectStatus status : statusList) { - PatientListDto dto = new PatientListDto(); - dto.setValue(status.getValue()); - dto.setInfo(status.getInfo()); - dtos.add(dto); - } - return R.ok(dtos); - } - /** * 分页查询门诊记录,可选条件 * @@ -102,10 +64,17 @@ public class OutpatientRecordController { // 查询总记录数 long total = patientManageMapper.countOutpatientRecords(outpatientRecordSearchParam); // 创建Page对象并设置属性 - Page OutpatientRecordPage = new Page<>(pageNo, pageSize, total); - OutpatientRecordPage.setRecords(listOutpatientRecords); + Page outpatientRecordPage = new Page<>(pageNo, pageSize, total); + outpatientRecordPage.setRecords(listOutpatientRecords); + outpatientRecordPage.getRecords().forEach(e -> { + // 性别枚举类回显赋值 + e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum())); + // 就诊对象状态枚举类回显赋值 + e.setSubjectStatusEnum_enumText( + EnumUtils.getInfoByValue(EncounterSubjectStatus.class, e.getSubjectStatusEnum())); + }); - return R.ok(OutpatientRecordPage); + return R.ok(outpatientRecordPage); } } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/patientmanage/dto/OutpatientRecordDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/patientmanage/dto/OutpatientRecordDto.java index 4873ce60..3a85e954 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/patientmanage/dto/OutpatientRecordDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/patientmanage/dto/OutpatientRecordDto.java @@ -30,12 +30,14 @@ public class OutpatientRecordDto { /** 性别编码 */ private Integer genderEnum; + private String genderEnum_enumText; /** 就诊时间 */ private Date encounterTime; /** 就诊对象状态 */ private Integer subjectStatusEnum; + private String subjectStatusEnum_enumText; /** 机构名称/接诊医院 */ private String organizationName; diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/patientmanage/dto/OutpatientRecordSearchParam.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/patientmanage/dto/OutpatientRecordSearchParam.java index 4dda4a1e..4ff8c830 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/patientmanage/dto/OutpatientRecordSearchParam.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/patientmanage/dto/OutpatientRecordSearchParam.java @@ -25,7 +25,7 @@ public class OutpatientRecordSearchParam { private String doctorName; /** 筛选开始时间 */ - private Date startTime; + private Date beginTime; /** 筛选结束时间 */ private Date endTime; diff --git a/openhis-server/openhis-application/src/main/resources/mapper/patientmanage/PatientManageMapper.xml b/openhis-server/openhis-application/src/main/resources/mapper/patientmanage/PatientManageMapper.xml index 4e4d7089..59f9b2d5 100644 --- a/openhis-server/openhis-application/src/main/resources/mapper/patientmanage/PatientManageMapper.xml +++ b/openhis-server/openhis-application/src/main/resources/mapper/patientmanage/PatientManageMapper.xml @@ -106,13 +106,13 @@ pt.name, pt.id_card, c.description, - pt.bus_no, - e.bus_no, + pt.bus_no as patientBusNo, + e.bus_no as encounterBusNo, pt.gender_enum, - e.start_time, + e.start_time as encounterTime, e.subject_status_enum, - ogt.name, - p.name, + ogt.name as organizationName, + p.name as doctorName, pt.phone FROM adm_encounter e diff --git a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/EncounterSubjectStatus.java b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/EncounterSubjectStatus.java index b3a3507a..2dd33929 100644 --- a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/EncounterSubjectStatus.java +++ b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/EncounterSubjectStatus.java @@ -6,7 +6,7 @@ import lombok.Getter; @Getter @AllArgsConstructor -public enum EncounterSubjectStatus { +public enum EncounterSubjectStatus implements HisEnumInterface { PLANNED(1, "arrived", "已到达"), TRIAGED(2, "triaged", "已分诊"),