From a36a61a843c4f905eca97d6f34a60c299ac46b93 Mon Sep 17 00:00:00 2001 From: liuhongrui Date: Sat, 15 Mar 2025 10:58:18 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=A8=E8=AF=8A=E8=BE=93=E6=B6=B2=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IOutpatientInfusionRecordService.java | 62 +++++ .../OutpatientInfusionRecordServiceImpl.java | 229 ++++++++++++++++++ .../OutpatientInfusionRecordController.java | 94 +++++++ .../dto/OutpatientInfusionInitDto.java | 41 ++++ .../dto/OutpatientInfusionPatientDto.java | 50 ++++ .../dto/OutpatientInfusionRecordDto.java | 112 +++++++++ .../dto/OutpatientInfusionSearchParam.java | 24 ++ .../mapper/OutpatientManageMapper.java | 29 ++- .../OutpatientManageMapper.xml | 130 +++++++++- .../service/IServiceRequestService.java | 9 + .../impl/ServiceRequestServiceImpl.java | 17 ++ 11 files changed, 789 insertions(+), 8 deletions(-) create mode 100644 openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/IOutpatientInfusionRecordService.java create mode 100644 openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/impl/OutpatientInfusionRecordServiceImpl.java create mode 100644 openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/controller/OutpatientInfusionRecordController.java create mode 100644 openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientInfusionInitDto.java create mode 100644 openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientInfusionPatientDto.java create mode 100644 openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientInfusionRecordDto.java create mode 100644 openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientInfusionSearchParam.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/IOutpatientInfusionRecordService.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/IOutpatientInfusionRecordService.java new file mode 100644 index 00000000..aadcb1f5 --- /dev/null +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/IOutpatientInfusionRecordService.java @@ -0,0 +1,62 @@ +package com.openhis.web.outpatientmanage.appservice; + +import java.time.LocalDateTime; +import java.util.List; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.openhis.web.outpatientmanage.dto.OutpatientInfusionInitDto; +import com.openhis.web.outpatientmanage.dto.OutpatientInfusionPatientDto; +import com.openhis.web.outpatientmanage.dto.OutpatientInfusionRecordDto; +import com.openhis.web.outpatientmanage.dto.OutpatientInfusionSearchParam; +import org.apache.ibatis.annotations.Param; + +/** + * 门诊管理——输液实现类 + * + * @author liuhr + * @date 2025/3/12 + */ +public interface IOutpatientInfusionRecordService { + + /** + * 获取门诊输液记录初期数据列表 + * + * @return 门诊输液记录初期数据列表 + */ + OutpatientInfusionInitDto getOutpatientInfusionInit(); + + + /** + * 获取门诊输液记录的患者列表 + * + * @param outpatientInfusionSearchParam 门诊输液记录的患者列表查询参数 + * @param pageNo 当前页 + * @param pageSize 每页多少条 + * @return 分页查询 + */ + IPage getOutpatientInfusionPatient( + OutpatientInfusionSearchParam outpatientInfusionSearchParam, Integer pageNo, Integer pageSize); + + + /** + * 查询单个患者门诊输液记录查询 + * + * @param outpatientInfusionPatientDto 患者输液信息 + * @return 门诊输液记录列表 + */ + List getPatientInfusionRecord(OutpatientInfusionPatientDto outpatientInfusionPatientDto); + + + + /** + * 执行单个患者门诊输液 + * + * @param exeCount 执行记录数 + * @param outpatientInfusionRecordDto 患者输液信息 + * @return 修改成功/失败 + */ + boolean editPatientInfusionRecord(OutpatientInfusionRecordDto outpatientInfusionRecordDto,Long exeCount); + +} diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/impl/OutpatientInfusionRecordServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/impl/OutpatientInfusionRecordServiceImpl.java new file mode 100644 index 00000000..e4e3d529 --- /dev/null +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/appservice/impl/OutpatientInfusionRecordServiceImpl.java @@ -0,0 +1,229 @@ +package com.openhis.web.outpatientmanage.appservice.impl; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import javax.annotation.Resource; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.core.common.utils.AgeCalculatorUtil; +import com.core.common.utils.AssignSeqUtil; +import com.core.common.utils.DateUtils; +import com.core.common.utils.SecurityUtils; +import com.openhis.administration.domain.Practitioner; +import com.openhis.administration.service.IPractitionerService; +import com.openhis.common.enums.AdministrativeGender; +import com.openhis.common.enums.ClinicalStatus; +import com.openhis.common.enums.EventStatus; +import com.openhis.common.utils.EnumUtils; +import com.openhis.common.utils.HisQueryUtils; +import com.openhis.web.outpatientmanage.appservice.IOutpatientInfusionRecordService; +import com.openhis.web.outpatientmanage.dto.OutpatientInfusionInitDto; +import com.openhis.web.outpatientmanage.dto.OutpatientInfusionPatientDto; +import com.openhis.web.outpatientmanage.dto.OutpatientInfusionRecordDto; +import com.openhis.web.outpatientmanage.dto.OutpatientInfusionSearchParam; +import com.openhis.web.outpatientmanage.mapper.OutpatientManageMapper; +import com.openhis.workflow.domain.ServiceRequest; +import com.openhis.workflow.service.IServiceRequestService; + +/** + * 门诊管理——输液实现类 + * + * @author liuhr + * @date 2025/3/12 + */ +@Service +public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionRecordService { + + @Resource + OutpatientManageMapper outpatientManageMapper; + + @Autowired + IServiceRequestService serviceRequestService; + + @Autowired + IPractitionerService practitionerService; + + @Override + /** + * 获取门诊输液记录初期数据列表 + * + * @return 门诊输液记录初期数据列表 + */ + public OutpatientInfusionInitDto getOutpatientInfusionInit() { + OutpatientInfusionInitDto initDto = new OutpatientInfusionInitDto(); + // 获取药品状态 + List statusEnumOptions = Stream.of(EventStatus.values()) + .map(status -> new OutpatientInfusionInitDto.statusEnumOption(status.getValue(), status.getInfo())) + .collect(Collectors.toList()); + initDto.setMedicationStatus(statusEnumOptions); + + // 获取皮试结果 + List statusEnumOptions2 = Stream.of(ClinicalStatus.values()) + .map(status -> new OutpatientInfusionInitDto.statusEnumOption(status.getValue(), status.getInfo())) + .collect(Collectors.toList()); + initDto.setClinicalStatus(statusEnumOptions2); + + // 获取当天日期 + LocalDateTime beginTime = DateUtils.startDayOrEndDay(DateUtils.getDate(), true); + LocalDateTime endTime = DateUtils.startDayOrEndDay(DateUtils.getDate(), false); + // 创建查询包装器 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.ge("occurrence_start_time", beginTime); + queryWrapper.le("occurrence_end_time", endTime); + + // 从数据库获取输液记录列表 + List infusionList = + outpatientManageMapper.getOutpatientInfusionRecord(queryWrapper); + // 遍历列表并处理每个记录 + infusionList.forEach(e -> { + // 性别 + e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum())); + // 药品状态 + e.setClinicalStatusEnum_enumText(EnumUtils.getInfoByValue(EventStatus.class, e.getMedicationStatusEnum())); + // 皮试结果 + e.setMedicationStatusEnum_enumText( + EnumUtils.getInfoByValue(ClinicalStatus.class, e.getClinicalStatusEnum())); + }); + + initDto.setInfusionList(infusionList); + + return initDto; + } + + /** + * 获取门诊输液记录的患者列表 + * + * @param outpatientInfusionSearchParam 门诊输液记录的患者列表查询参数 + * @param pageNo 当前页 + * @param pageSize 每页多少条 + * @return 分页查询 + */ + @Override + public IPage getOutpatientInfusionPatient( + OutpatientInfusionSearchParam outpatientInfusionSearchParam, Integer pageNo, Integer pageSize) { + + String searchKey; + LocalDateTime beginTime; + LocalDateTime endTime; + if (outpatientInfusionSearchParam == null) { + searchKey = null; + beginTime = DateUtils.startDayOrEndDay(DateUtils.getDate(), true); + endTime = DateUtils.startDayOrEndDay(DateUtils.getDate(), false); + } else { + searchKey = outpatientInfusionSearchParam.getSearchKey(); + beginTime = DateUtils.startDayOrEndDay(outpatientInfusionSearchParam.getBeginTime(), true); + endTime = DateUtils.startDayOrEndDay(outpatientInfusionSearchParam.getEndTime(), false); + } + + // 构建查询条件 + QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(null, searchKey, + new HashSet<>(Arrays.asList("patient_busNo", "encounter_busNo", "patient_name")), null); + // 添加时间段查询条件 + if (beginTime != null && endTime != null) { + queryWrapper.ge("begin_time", beginTime); + queryWrapper.le("end_time", endTime); + } + + IPage outpatientInfusionPatientDto = + outpatientManageMapper.getOutpatientInfusionPatient(new Page<>(pageNo, pageSize), queryWrapper); + + outpatientInfusionPatientDto.getRecords().forEach(e -> { + // 性别 + e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum())); + // 计算年龄 + e.setAgeString(AgeCalculatorUtil.getAge(e.getBirthDate())); + }); + + return outpatientInfusionPatientDto; + } + + /** + * 查询单个患者门诊输液记录查询 + * + * @param outpatientInfusionPatientDto 患者输液信息 + * @return 门诊输液记录列表 + */ + @Override + public List + getPatientInfusionRecord(OutpatientInfusionPatientDto outpatientInfusionPatientDto) { + + if (outpatientInfusionPatientDto == null && outpatientInfusionPatientDto.getPatientId() != null) { + return null; + } + // 创建查询包装器 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("patient_id", outpatientInfusionPatientDto.getPatientId()); + + // 从数据库获取输液记录列表 + List infusionList = + outpatientManageMapper.getOutpatientInfusionRecord(queryWrapper); + + return infusionList; + } + + /** + * 执行单个患者门诊输液 + * + * @param exeCount 执行记录数 + * @param outpatientInfusionRecordDto 患者输液信息 + * @return 门诊输液记录列表 + */ + @Override + public boolean editPatientInfusionRecord(OutpatientInfusionRecordDto outpatientInfusionRecordDto, Long exeCount) { + // 这里执行一次就insert 表 wor_service_request里一条数据,based_on_id一直,以mr.quantity来振分 + // 点击执行一次,生成一条执行记录,确认执行+1 ,直至所有药品打完, + + // 根据执行人ID,通过登录userId获取 + Practitioner practitioner = + practitionerService.getPractitionerByUserId(SecurityUtils.getLoginUser().getUserId()); + if (practitioner == null) { + return false; + } + String busNo = AssignSeqUtil.formatString(outpatientInfusionRecordDto.getBusNo(), exeCount, 3); + // 当输液未被全部执行时,可以修改继续执行,生成一条执行记录 + if ((BigDecimal.valueOf(exeCount)).compareTo(outpatientInfusionRecordDto.getMedicationAntity()) < 0) { + // 当 exeCount 小于 medicationAntity 时,执行这里的代码 + ServiceRequest serviceRequest = new ServiceRequest(); + serviceRequest.setPrescriptionNo(outpatientInfusionRecordDto.getPrescriptionNo()) + // 设置busNo,原来的服务请求编码为基础.执行次数 + .setBusNo(busNo) + // 基于service_request的id + .setBasedOnId(outpatientInfusionRecordDto.getServiceId()) + // 设置状态完成 + .setStatusEnum(EventStatus.COMPLETED.getValue()) + // 设置请求code 和原来一致 + .setActivityId(outpatientInfusionRecordDto.getActivityId()) + //患者id + .setPatientId(outpatientInfusionRecordDto.getPatientId()) + //就诊id + .setEncounterId(outpatientInfusionRecordDto.getEncounterId()) + // 执行人id,通过登录userId获取 + .setPerformerId(practitioner.getId()) + // 设置执行日期为当前时间 + .setOccurrenceStartTime(DateUtils.getNowDate()) + // 默认30结束 + .setOccurrenceEndTime(DateUtils.addDateMinute(DateUtils.getNowDate(), 30)); + boolean result = serviceRequestService.save(serviceRequest); + if (!result) { + return false; + } + + return true; + } + + return false; + + } + +} diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/controller/OutpatientInfusionRecordController.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/controller/OutpatientInfusionRecordController.java new file mode 100644 index 00000000..9579ceef --- /dev/null +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/controller/OutpatientInfusionRecordController.java @@ -0,0 +1,94 @@ +package com.openhis.web.outpatientmanage.controller; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import com.core.common.core.domain.R; +import com.core.common.utils.MessageUtils; +import com.openhis.common.constant.PromptMsgConstant; +import com.openhis.web.outpatientmanage.appservice.IOutpatientInfusionRecordService; +import com.openhis.web.outpatientmanage.dto.OutpatientInfusionPatientDto; +import com.openhis.web.outpatientmanage.dto.OutpatientInfusionRecordDto; +import com.openhis.web.outpatientmanage.dto.OutpatientInfusionSearchParam; +import com.openhis.workflow.service.IServiceRequestService; + +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; + +/** + * 门诊输液记录 + * + * @author liuhr + * @date 2025/3/12 + */ +@RestController +@RequestMapping("/outpatientmanage/infusion") +@Slf4j +@AllArgsConstructor +public class OutpatientInfusionRecordController { + + @Autowired + IOutpatientInfusionRecordService outpatientInfusionRecordService; + + @Autowired + IServiceRequestService serviceRequestService; + + /** + * 门诊输液记录初期数据 + * + * @return + */ + @GetMapping("/init") + public R getOutpatientInfusionInit() { + + return R.ok(outpatientInfusionRecordService.getOutpatientInfusionInit()); + } + + /** + * 查询门诊输液患者列表 + * + * @param outpatientInfusionSearchParam 查询参数 + * @param pageNo 当前页 + * @param pageSize 每页多少条 + * @return 就诊患者信息 + */ + @GetMapping(value = "/patients") + public R getOutpatientInfusionPatient(OutpatientInfusionSearchParam outpatientInfusionSearchParam, + @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { + + return R.ok(outpatientInfusionRecordService.getOutpatientInfusionPatient(outpatientInfusionSearchParam, pageNo, + pageSize)); + } + + /** + * 查询单个患者门诊输液记录查询 + * + * @param outpatientInfusionPatientDto 患者输液信息 + * @return 门诊输液记录列表 + */ + @GetMapping(value = "/patient-infusion") + public R getPatientInfusionRecord(OutpatientInfusionPatientDto outpatientInfusionPatientDto) { + + return R.ok(outpatientInfusionRecordService.getPatientInfusionRecord(outpatientInfusionPatientDto)); + } + + /** + * 执行单个患者门诊输液 + * + * @param outpatientInfusionRecordDto 患者输液信息 + * @return 门诊输液记录列表 + */ + @PutMapping("/outpatient-record-skintest") + public R + editPatientInfusionRecord(@Validated @RequestBody OutpatientInfusionRecordDto outpatientInfusionRecordDto) { + //获取执行次数 + Long exeCount = + serviceRequestService.countServiceRequestByBasedOnId(outpatientInfusionRecordDto.getServiceId()); + outpatientInfusionRecordService.editPatientInfusionRecord(outpatientInfusionRecordDto,exeCount); + + return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"患者门诊输液执行"})); + } + +} diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientInfusionInitDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientInfusionInitDto.java new file mode 100644 index 00000000..77faf729 --- /dev/null +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientInfusionInitDto.java @@ -0,0 +1,41 @@ +package com.openhis.web.outpatientmanage.dto; + +import com.openhis.common.enums.ClinicalStatus; +import com.openhis.web.datadictionary.dto.DiagnosisTreatmentInitDto; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.List; + +/** + * 门诊输液初期查询 + * + * @author liuhr + * @date 2025/3/12 + */ +@Data +@Accessors(chain = true) +public class OutpatientInfusionInitDto { + + //发药状态 + private List medicationStatus; + //皮试结果 + private List clinicalStatus; + //当天位执行的输液记录 + private List infusionList; + + /** + * 状态 + */ + @Data + public static class statusEnumOption { + private Integer value; + private String info; + + public statusEnumOption(Integer value, String info) { + this.value = value; + this.info = info; + } + } + +} diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientInfusionPatientDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientInfusionPatientDto.java new file mode 100644 index 00000000..6af8bed6 --- /dev/null +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientInfusionPatientDto.java @@ -0,0 +1,50 @@ +package com.openhis.web.outpatientmanage.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.Date; + +/** + * 门诊输液患者显示列表 + * + * @author liuhr + * @date 2025/3/13 + */ +@Data +@Accessors(chain = true) +public class OutpatientInfusionPatientDto { + + /** 服务申请管理表ID */ + @JsonSerialize(using = ToStringSerializer.class) + private Long serviceId; + + /** 处方号 */ + private String prescriptionNo; + + /** 就诊号 */ + private String encounterBusNo; + + /** 病人ID(前台显示用) */ + private String patientBusNo; + + /** 病人ID */ + @JsonSerialize(using = ToStringSerializer.class) + private Long patientId; + + /** 病人姓名 */ + private String patientName; + + /** 病人性别 */ + private Integer genderEnum; + private String genderEnum_enumText; + + /** 病人生日 */ + private Date birthDate; + + /** 病人年龄 */ + private String ageString; + +} diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientInfusionRecordDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientInfusionRecordDto.java new file mode 100644 index 00000000..a8d65e57 --- /dev/null +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientInfusionRecordDto.java @@ -0,0 +1,112 @@ +package com.openhis.web.outpatientmanage.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import com.openhis.common.annotation.Dict; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.math.BigDecimal; + +/** + * 门诊输液记录Dto + * + * @author liuhr + * @date 2025/3/12 + */ +@Data +@Accessors(chain = true) +public class OutpatientInfusionRecordDto { + + /** 服务申请管理表ID */ + @JsonSerialize(using = ToStringSerializer.class) + private Long serviceId; + + /** 请求基于什么的ID */ + @JsonSerialize(using = ToStringSerializer.class) + private Long basedOnId; + + /** 服务请求编码 */ + private String busNo; + + /** 请求code,输液 */ + @JsonSerialize(using = ToStringSerializer.class) + private Long activityId; + + /** 处方号 */ + private String prescriptionNo; + + /** 就诊ID(前台显示用) */ + private String encounterBusNo; + + /** 就诊ID */ + private Long encounterId; + + /** 病人ID(前台显示用) */ + private String patientBusNo; + + /** 病人ID */ + @JsonSerialize(using = ToStringSerializer.class) + private Long patientId; + + /** 病人姓名 */ + private String patientName; + + /** 病人性别 */ + private Integer genderEnum; + private String genderEnum_enumText; + + /** 已执行数量 */ + private Integer executionCount; + + /** 执行护士 */ + @Dict(dictCode = "id", dictTable = "adm_practitioner", dictText = "name") + @JsonSerialize(using = ToStringSerializer.class) + private Long performerId; + private String performerId_dictText; + + /** 开单医生 */ + @Dict(dictCode = "id", dictTable = "adm_practitioner", dictText = "name") + @JsonSerialize(using = ToStringSerializer.class) + private Long doctorId; + private String doctorId_dictText; + + /** 发放科室 */ + @Dict(dictCode = "id", dictTable = "adm_organization", dictText = "name") + @JsonSerialize(using = ToStringSerializer.class) + private Long orgId; + private String orgId_dictText; + + /** 预计执行时间 */ + private String occurrenceStartTime; + + /** 预计结束时间 */ + private String occurrenceEndTime; + + /** 药品信息 */ + private String medicationInformation; + + /** 药品数量 */ + private BigDecimal medicationAntity; + + /** 用药频次 */ + private String rateCode; + + /** 单次剂量带剂量单位 */ + private String dose; + + /** 输液速度 */ + private Integer speed; + + /** 药品状态 */ + private Integer medicationStatusEnum; + private String medicationStatusEnum_enumText; + + /** 皮试标志(是/否) */ + private String flagText; + + /** 皮试结果 */ + private Integer clinicalStatusEnum; + private String clinicalStatusEnum_enumText; + +} diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientInfusionSearchParam.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientInfusionSearchParam.java new file mode 100644 index 00000000..a0869482 --- /dev/null +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/dto/OutpatientInfusionSearchParam.java @@ -0,0 +1,24 @@ +package com.openhis.web.outpatientmanage.dto; + +import lombok.Data; + +/** + * 门诊输液记录查询体体条件类 + * + * @author liuhr + * @date 2025/3/12 + */ +@Data +public class OutpatientInfusionSearchParam { + + /** 病人ID/门诊号/病人姓名 */ + private String searchKey; + + /** 筛选开始时间 */ + private String beginTime; + + /** 筛选结束时间 */ + private String endTime; + +} + diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/mapper/OutpatientManageMapper.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/mapper/OutpatientManageMapper.java index c758c727..c81e7d8f 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/mapper/OutpatientManageMapper.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/outpatientmanage/mapper/OutpatientManageMapper.java @@ -2,11 +2,16 @@ package com.openhis.web.outpatientmanage.mapper; import java.util.List; -import com.openhis.web.outpatientmanage.dto.OutpatientSkinTestRecordDto; import org.apache.ibatis.annotations.Param; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.openhis.web.outpatientmanage.dto.OutpatientInfusionPatientDto; +import com.openhis.web.outpatientmanage.dto.OutpatientInfusionRecordDto; +import com.openhis.web.outpatientmanage.dto.OutpatientSkinTestRecordDto; import com.openhis.web.outpatientmanage.dto.OutpatientSkinTestRecordSearchParam; -import com.openhis.web.patientmanage.dto.OutpatientRecordDto; /** * 门诊管理 @@ -37,4 +42,24 @@ public interface OutpatientManageMapper { long countOutpatientSkinTestRecords( @Param("OutpatientSkinTestRecordSearchParam") OutpatientSkinTestRecordSearchParam outpatientSkinTestRecordSearchParam); + /** + * 门诊输液患者记录分页查询 + * + * @param page 分页参数 + * @param queryWrapper 查询条件 + * @return 门诊输液患者记录 + */ + IPage getOutpatientInfusionPatient( + @Param("page") Page page, + @Param(Constants.WRAPPER) QueryWrapper queryWrapper); + + /** + * 门诊输液记录查询 + * + * @param queryWrapper 查询条件 + * @return 门诊输液记录列表 + */ + List + getOutpatientInfusionRecord(@Param(Constants.WRAPPER) QueryWrapper queryWrapper); + } diff --git a/openhis-server/openhis-application/src/main/resources/mapper/outpatientmanage/OutpatientManageMapper.xml b/openhis-server/openhis-application/src/main/resources/mapper/outpatientmanage/OutpatientManageMapper.xml index c1ca8424..835bb7fb 100644 --- a/openhis-server/openhis-application/src/main/resources/mapper/outpatientmanage/OutpatientManageMapper.xml +++ b/openhis-server/openhis-application/src/main/resources/mapper/outpatientmanage/OutpatientManageMapper.xml @@ -34,13 +34,11 @@ LEFT JOIN med_medication m ON m.id = mr.medication_id LEFT JOIN med_medication_definition md ON md.id = m.medication_def_id LEFT JOIN cli_allergy_intolerance ai ON ai.request_id = sr.id - LEFT JOIN adm_encounter_participant ep ON ep.encounter_id = sr.encounter_id ad.bus_no = 'ps001' -- 皮试检查的编号,todo:编号未定,后期修改 AND mr.skin_test_flag = 1 AND md.skin_test_flag = 1 - AND sr.status_enum in (2,3,6) --服务状态有效 - AND ep.type_code = '1' --参与者身份类型是医生 + AND sr.status_enum in (2,3,6) --服务状态有效 @@ -90,13 +88,11 @@ LEFT JOIN med_medication m ON m.id = mr.medication_id LEFT JOIN med_medication_definition md ON md.id = m.medication_def_id LEFT JOIN cli_allergy_intolerance ai ON ai.request_id = sr.id - LEFT JOIN adm_encounter_participant ep ON ep.encounter_id = sr.encounter_id ad.bus_no = 'ps001' -- 皮试检查的编号,todo:编号未定,后期修改 AND mr.skin_test_flag = 1 AND md.skin_test_flag = 1 - AND sr.status_enum in (2,3,6) --服务状态有效 - AND ep.type_code = '1' --参与者身份类型是医生 + AND sr.status_enum in (2,3,6) --服务状态有效 @@ -133,4 +129,126 @@ + + + + + + \ No newline at end of file diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/service/IServiceRequestService.java b/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/service/IServiceRequestService.java index c0dabacd..2ed4a05d 100644 --- a/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/service/IServiceRequestService.java +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/service/IServiceRequestService.java @@ -12,4 +12,13 @@ import com.openhis.workflow.domain.ServiceRequest; */ public interface IServiceRequestService extends IService { + + /** + * 查询服务申请管理中basedOnId相同的个数 + * + * @param basedOnId 请求基于什么的ID + * @return basedOnId相同的个数 + */ + Long countServiceRequestByBasedOnId(Long basedOnId) ; + } \ No newline at end of file diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/service/impl/ServiceRequestServiceImpl.java b/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/service/impl/ServiceRequestServiceImpl.java index c8430b7f..6a782305 100644 --- a/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/service/impl/ServiceRequestServiceImpl.java +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/service/impl/ServiceRequestServiceImpl.java @@ -1,5 +1,7 @@ package com.openhis.workflow.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -17,4 +19,19 @@ import com.openhis.workflow.service.IServiceRequestService; public class ServiceRequestServiceImpl extends ServiceImpl implements IServiceRequestService { + @Autowired + private ServiceRequestMapper serviceRequestMapper; + + /** + * 查询服务申请管理中basedOnId相同的个数 + * + * @param basedOnId 请求基于什么的ID + * @return basedOnId相同的个数 + */ + @Override + public Long countServiceRequestByBasedOnId(Long basedOnId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("based_on_id", basedOnId); + return serviceRequestMapper.selectCount(queryWrapper); + } } \ No newline at end of file