From 48dfed280813493118f39c6f2bc47e68826eb98a Mon Sep 17 00:00:00 2001 From: liuhongrui Date: Sat, 15 Mar 2025 14:48:21 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9A=AE=E8=AF=95=E8=AE=B0=E5=BD=95=E5=88=9D?= =?UTF-8?q?=E6=9C=9F=E6=A0=BC=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IOutpatientSkinTestRecordService.java | 13 ++--- .../OutpatientSkinTestRecordServiceImpl.java | 53 ++++++++----------- .../OutpatientSkinTestRecordController.java | 20 +++---- .../dto/OutpatientSkinTestInitDto.java | 36 +++++++++++++ 4 files changed, 72 insertions(+), 50 deletions(-) create mode 100644 openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientSkinTestInitDto.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/IOutpatientSkinTestRecordService.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/IOutpatientSkinTestRecordService.java index bd89bb87..8cd6b60b 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/IOutpatientSkinTestRecordService.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/IOutpatientSkinTestRecordService.java @@ -2,6 +2,8 @@ package com.openhis.web.outpatientmanage.appservice; import java.util.List; +import com.openhis.web.outpatientmanage.dto.OutpatientInfusionInitDto; +import com.openhis.web.outpatientmanage.dto.OutpatientSkinTestInitDto; import org.apache.ibatis.annotations.Param; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -17,15 +19,13 @@ import com.openhis.web.patientmanage.dto.PatientListDto; */ public interface IOutpatientSkinTestRecordService { - /** - * 获取皮试项目检查状态列表 - */ - List getSkinTestStatus(); /** - * 获取皮试结果列表 + * 获取门诊皮试记录初期数据列表 + * + * @return 获取门诊皮试记录初期数据列表 */ - List getSkinTestResult(); + OutpatientSkinTestInitDto getOutpatientSkinTestInit(); /** * 分页查询门诊皮试记录,可选条件 @@ -72,4 +72,5 @@ public interface IOutpatientSkinTestRecordService { */ boolean nurseSignChkPs(OutpatientSkinTestRecordDto outpatientSkinTestRecordDto); + } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/impl/OutpatientSkinTestRecordServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/impl/OutpatientSkinTestRecordServiceImpl.java index a8b995fa..e13b3f68 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/impl/OutpatientSkinTestRecordServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/impl/OutpatientSkinTestRecordServiceImpl.java @@ -4,9 +4,13 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; import javax.annotation.Resource; +import com.openhis.web.outpatientmanage.dto.OutpatientInfusionInitDto; +import com.openhis.web.outpatientmanage.dto.OutpatientSkinTestInitDto; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -74,40 +78,27 @@ public class OutpatientSkinTestRecordServiceImpl implements IOutpatientSkinTestR @Autowired IServiceRequestService serviceRequestService; - /** - * 获取皮试项目检查状态列表 - */ - @Override - public List getSkinTestStatus() { - // 获取皮试状态列表 - List statusList = Arrays.asList(VerificationStatus.values()); - List dtos = new ArrayList<>(); - // 取得更新值 - for (VerificationStatus status : statusList) { - PatientListDto dto = new PatientListDto(); - dto.setValue(status.getValue()); - dto.setInfo(status.getInfo()); - dtos.add(dto); - } - return dtos; - } /** - * 获取皮试项目检查状态列表 + * 获取门诊皮试记录初期数据列表 + * + * @return 获取门诊皮试记录初期数据列表 */ - @Override - public List getSkinTestResult() { - // 获取皮试状态列表 - List statusList = Arrays.asList(ClinicalStatus.values()); - List dtos = new ArrayList<>(); - // 取得更新值 - for (ClinicalStatus status : statusList) { - PatientListDto dto = new PatientListDto(); - dto.setValue(status.getValue()); - dto.setInfo(status.getInfo()); - dtos.add(dto); - } - return dtos; + @Override public OutpatientSkinTestInitDto getOutpatientSkinTestInit() { + OutpatientSkinTestInitDto initDto = new OutpatientSkinTestInitDto(); + //获取皮试状态 + List statusEnumOptions1 = Stream.of(VerificationStatus.values()) + .map(status -> new OutpatientInfusionInitDto.statusEnumOption(status.getValue(), status.getInfo())) + .collect(Collectors.toList()); + initDto.setVerificationStatus(statusEnumOptions1); + + // 获取皮试结果 + List statusEnumOptions2 = Stream.of(ClinicalStatus.values()) + .map(status -> new OutpatientInfusionInitDto.statusEnumOption(status.getValue(), status.getInfo())) + .collect(Collectors.toList()); + initDto.setClinicalStatus(statusEnumOptions2); + + return initDto; } /** diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/controller/OutpatientSkinTestRecordController.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/controller/OutpatientSkinTestRecordController.java index 27fdea6e..d85d12ad 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/controller/OutpatientSkinTestRecordController.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/controller/OutpatientSkinTestRecordController.java @@ -21,7 +21,7 @@ import lombok.extern.slf4j.Slf4j; * @date 2025/3/5 */ @RestController -@RequestMapping("/outpatientmanage") +@RequestMapping("/outpatientmanage/skintest") @Slf4j @AllArgsConstructor public class OutpatientSkinTestRecordController { @@ -29,22 +29,16 @@ public class OutpatientSkinTestRecordController { @Autowired private IOutpatientSkinTestRecordService OutpatientSkinTestRecordService; - /** - * 获取皮试项目检查状态列表 - */ - @GetMapping("/list-skinteststatus") - public R getSkinTestStatus() { - - return R.ok(OutpatientSkinTestRecordService.getSkinTestStatus()); - } /** - * 获取皮试结果列表 + * 门诊皮试记录初期数据 + * + * @return */ - @GetMapping("/list-skintestresult") - public R getSkinTestResult() { + @GetMapping("/init") + public R getOutpatientSkinTestInit() { - return R.ok(OutpatientSkinTestRecordService.getSkinTestResult()); + return R.ok(OutpatientSkinTestRecordService.getOutpatientSkinTestInit()); } /** diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientSkinTestInitDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientSkinTestInitDto.java new file mode 100644 index 00000000..b2e2e3ed --- /dev/null +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientSkinTestInitDto.java @@ -0,0 +1,36 @@ +package com.openhis.web.outpatientmanage.dto; + +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.List; + +/** + * 皮试初始化记录 + * + * @author liuhr + * @date 2025/3/15 + */ +@Data +@Accessors(chain = true) +public class OutpatientSkinTestInitDto { + //皮试检查项目状态 + private List VerificationStatus; + //皮试结果 + private List clinicalStatus; + + /** + * 状态 + */ + @Data + public static class statusEnumOption { + private Integer value; + private String info; + + public statusEnumOption(Integer value, String info) { + this.value = value; + this.info = info; + } + } + +}