From cc80209329a776bc8c3ba93608fb51c7f14b3a7d Mon Sep 17 00:00:00 2001 From: liuhongrui Date: Tue, 18 Mar 2025 14:59:03 +0800 Subject: [PATCH] =?UTF-8?q?=E7=97=85=E4=BA=BA=E4=BF=A1=E6=81=AF=E5=92=8C?= =?UTF-8?q?=E8=BE=93=E6=B6=B2=E8=AE=B0=E5=BD=95=E6=A0=BC=E5=BC=8F=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IOutpatientInfusionRecordService.java | 23 +- .../OutpatientInfusionRecordServiceImpl.java | 202 ++++++++++++++---- .../OutpatientInfusionRecordController.java | 2 +- .../OutpatientSkinTestRecordController.java | 6 +- .../dto/OutpatientInfusionRecordDto.java | 17 +- .../mapper/OutpatientManageMapper.java | 6 +- .../impl/PatientInformationServiceImpl.java | 12 ++ .../OutpatientRecordController.java | 2 +- .../PatientInformationController.java | 2 +- .../patientmanage/dto/PatientInfoInitDto.java | 4 + .../OutpatientManageMapper.xml | 19 +- .../impl/ServiceRequestServiceImpl.java | 5 +- 12 files changed, 229 insertions(+), 71 deletions(-) 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 index 2d2484a3..8ef35d22 100644 --- 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 @@ -1,16 +1,14 @@ 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.administration.domain.Practitioner; +import com.openhis.administration.domain.PractitionerRole; 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; /** * 门诊管理——输液实现类 @@ -27,7 +25,6 @@ public interface IOutpatientInfusionRecordService { */ OutpatientInfusionInitDto getOutpatientInfusionInit(); - /** * 获取门诊输液记录的患者列表 * @@ -39,14 +36,14 @@ public interface IOutpatientInfusionRecordService { IPage getOutpatientInfusionPatient( OutpatientInfusionSearchParam outpatientInfusionSearchParam, Integer pageNo, Integer pageSize); - /** * 查询单个患者门诊输液记录查询 * * @param outpatientInfusionPatientDto 患者输液信息 * @return 门诊输液记录列表 */ - List getPatientInfusionRecord(OutpatientInfusionPatientDto outpatientInfusionPatientDto); + List + getPatientInfusionRecord(OutpatientInfusionPatientDto outpatientInfusionPatientDto); /** * 执行单个患者门诊输液 @@ -55,7 +52,15 @@ public interface IOutpatientInfusionRecordService { * @param outpatientInfusionRecordDto 患者输液信息 * @return 修改成功/失败 */ - boolean editPatientInfusionRecord(OutpatientInfusionRecordDto outpatientInfusionRecordDto,Long exeCount); + boolean editPatientInfusionRecord(OutpatientInfusionRecordDto outpatientInfusionRecordDto, Long exeCount); + + /** + * 执行单个患者门诊输液 + * + * @param outpatientInfusionRecordDtoList 输液记录 + * @return 修改成功/失败 + */ + boolean batchEditPatientInfusionRecord(List outpatientInfusionRecordDtoList); /** * 执行输液后,修改执行结束时间 @@ -72,6 +77,6 @@ public interface IOutpatientInfusionRecordService { * @param endTime 结束时间 * @return 门诊输液记录列表 */ - List getPatientInfusionPerformRecord(String beginTime,String endTime); + List getPatientInfusionPerformRecord(String beginTime, String endTime); } 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 index edc8ed0a..d8e98b12 100644 --- 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 @@ -5,6 +5,7 @@ import java.time.LocalDateTime; import java.util.Arrays; import java.util.HashSet; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -12,9 +13,11 @@ import javax.annotation.Resource; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.core.common.utils.AgeCalculatorUtil; @@ -25,9 +28,11 @@ import com.openhis.administration.domain.Practitioner; import com.openhis.administration.domain.PractitionerRole; import com.openhis.administration.service.IPractitionerRoleService; import com.openhis.administration.service.IPractitionerService; +import com.openhis.common.constant.CommonConstants; import com.openhis.common.enums.AdministrativeGender; import com.openhis.common.enums.ClinicalStatus; import com.openhis.common.enums.EventStatus; +import com.openhis.common.enums.Whether; import com.openhis.common.utils.EnumUtils; import com.openhis.common.utils.HisQueryUtils; import com.openhis.web.outpatientmanage.appservice.IOutpatientInfusionRecordService; @@ -39,7 +44,6 @@ import com.openhis.web.outpatientmanage.mapper.OutpatientManageMapper; import com.openhis.workflow.domain.ServiceRequest; import com.openhis.workflow.mapper.ServiceRequestMapper; import com.openhis.workflow.service.IServiceRequestService; -import org.springframework.transaction.annotation.Transactional; /** * 门诊管理——输液实现类 @@ -85,9 +89,9 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR 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); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.ge(OutpatientInfusionRecordDto::getOccurrenceStartTime, beginTime); + queryWrapper.le(OutpatientInfusionRecordDto::getOccurrenceEndTime, endTime); // 从数据库获取输液记录列表 List infusionList = @@ -98,9 +102,14 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR 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())); + // 皮试标志 + e.setSkinTestFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getSkinTestFlag())); + // 只有皮试药品才显示皮试结果 + if (e.getSkinTestFlag() == Whether.YES.getValue()) { + // 皮试结果 + e.setMedicationStatusEnum_enumText( + EnumUtils.getInfoByValue(ClinicalStatus.class, e.getClinicalStatusEnum())); + } }); initDto.setInfusionList(infusionList); @@ -122,27 +131,36 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR LocalDateTime beginTime; LocalDateTime endTime; - if (outpatientInfusionSearchParam == null || outpatientInfusionSearchParam.getBeginTime() == null + String searchKey; + // 搜索key为空 + if (outpatientInfusionSearchParam == null) { + searchKey = null; + } else { + searchKey = outpatientInfusionSearchParam.getSearchKey(); + } + // 任意开始结束时间为空,默认查询当天日期记录 + if (outpatientInfusionSearchParam.getBeginTime() == null || outpatientInfusionSearchParam.getEndTime() == null) { beginTime = DateUtils.startDayOrEndDay(DateUtils.getDate(), true); endTime = DateUtils.startDayOrEndDay(DateUtils.getDate(), false); - } else { + } else {// 时间不空,删选时间 beginTime = DateUtils.startDayOrEndDay(outpatientInfusionSearchParam.getBeginTime(), true); endTime = DateUtils.startDayOrEndDay(outpatientInfusionSearchParam.getEndTime(), false); } // 构建查询条件 - QueryWrapper queryWrapper = - HisQueryUtils.buildQueryWrapper(null, outpatientInfusionSearchParam.getSearchKey(), - new HashSet<>(Arrays.asList("patient_bus_no", "encounter_bus_no", "patient_name")), null); + QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(null, searchKey, + new HashSet<>(Arrays.asList(CommonConstants.FieldName.PatientBusNo, + CommonConstants.FieldName.EncounterBusNo, CommonConstants.FieldName.PatientName)), + null); // based_on_id 是为空的 queryWrapper.eq("based_on_id", null); // 状态是未完成的 - queryWrapper.in("status_enum", EventStatus.IN_PROGRESS.getValue(), EventStatus.NOT_DONE.getValue()); + queryWrapper.in("service_status", EventStatus.IN_PROGRESS.getValue(), EventStatus.NOT_DONE.getValue()); // 添加时间段查询条件 if (beginTime != null && endTime != null) { - queryWrapper.ge("begin_time", beginTime); - queryWrapper.le("end_time", endTime); + queryWrapper.ge("create_time", beginTime); + queryWrapper.le("create_time", endTime); } IPage outpatientInfusionPatientDto = @@ -172,12 +190,13 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR return null; } // 创建查询包装器 - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("patient_id", outpatientInfusionPatientDto.getPatientId()); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(OutpatientInfusionRecordDto::getPatientId, outpatientInfusionPatientDto.getPatientId()); // based_on_id 是为空的 - queryWrapper.eq("based_on_id", null); + queryWrapper.eq(OutpatientInfusionRecordDto::getBasedOnId, null); // 状态是未完成的 - queryWrapper.in("status_enum", EventStatus.IN_PROGRESS.getValue(), EventStatus.NOT_DONE.getValue()); + queryWrapper.in(OutpatientInfusionRecordDto::getServiceStatus, EventStatus.IN_PROGRESS.getValue(), + EventStatus.NOT_DONE.getValue()); // 从数据库获取输液记录列表 List infusionList = outpatientManageMapper.getOutpatientInfusionRecord(queryWrapper); @@ -228,7 +247,7 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR .setPerformerTypeCode(practitionerRole.getRoleCode()) // 设置执行日期为当前时间 .setOccurrenceStartTime(DateUtils.getNowDate()) - // 默认30结束 + // 默认执行时间加30min结束 .setOccurrenceEndTime(DateUtils.addDateMinute(DateUtils.getNowDate(), 30)); boolean result = serviceRequestService.save(serviceRequest); @@ -239,12 +258,13 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR // 判断如果是执行该患者最后一次记录,更新原来的服请求状态 if ((BigDecimal.valueOf(exeCount + 1)).compareTo(outpatientInfusionRecordDto.getMedicationAntity()) == 0) { // 以id为主条件更新服务申请管理表 - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - updateWrapper.eq("id", outpatientInfusionRecordDto.getServiceId()) - .set("status_enum", EventStatus.COMPLETED.getValue()) - .set("performer_type_code", practitionerRole.getRoleCode()) - .set("performer_id", practitioner.getId()).set("occurrence_start_time", DateUtils.getNowDate()) - .set("occurrence_end_time", DateUtils.getNowDate()); + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.eq(ServiceRequest::getId, outpatientInfusionRecordDto.getServiceId()) + .set(ServiceRequest::getStatusEnum, EventStatus.COMPLETED.getValue()) + .set(ServiceRequest::getPerformerTypeCode, practitionerRole.getRoleCode()) + .set(ServiceRequest::getPerformerId, practitioner.getId()) + .set(ServiceRequest::getOccurrenceStartTime, DateUtils.getNowDate()) + .set(ServiceRequest::getOccurrenceEndTime, DateUtils.getNowDate()); int countUpdate = serviceRequestMapper.update(null, updateWrapper); if (countUpdate < 0) { return false; @@ -256,6 +276,108 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR return false; } + /** + * 执行患者门诊输液 + * + * @param outpatientInfusionRecordDtoList 输液记录 + * @return 修改成功/失败 + */ + @Override + public boolean batchEditPatientInfusionRecord(List outpatientInfusionRecordDtoList) { + + // 根据执行人ID,通过登录userId获取 + Practitioner practitioner = + practitionerService.getPractitionerByUserId(SecurityUtils.getLoginUser().getUserId()); + // 根具执行人ID,获取执行人身份类型 + PractitionerRole practitionerRole = practitionerRoleService.getPractitionerRoleById(practitioner.getId()); + if (practitioner == null || practitionerRole == null) { + return false; + } + + // 按 groupId 分组 + Map> groupedRecords = outpatientInfusionRecordDtoList.stream() + .collect(Collectors.groupingBy(OutpatientInfusionRecordDto::getGroupId)); + + // 遍历每个分组 + for (Map.Entry> entry : groupedRecords.entrySet()) { + // Long groupId = entry.getKey(); + List groupRecords = entry.getValue(); + + // 获取执行次数 + Long exeCount = serviceRequestService.countServiceRequestByBasedOnId(groupRecords.get(0).getBasedOnId()); + + // 批量处理每个分组中的记录 + for (OutpatientInfusionRecordDto record : groupRecords) { + boolean result = editSingleRecord(record, exeCount, practitioner, practitionerRole); + if (!result) { + return false; // 如果某个记录执行失败,返回 false + } + } + + // 更新分组中每个记录的状态 + for (OutpatientInfusionRecordDto record : groupRecords) { + + if (!updateRecordStatus(record.getServiceId(), practitioner, practitionerRole)) { + return false; // 如果更新状态失败,返回 false + } + } + } + + return true; // 所有分组都执行成功 + } + + /** + * 处理单个记录的执行逻辑 + * + * @param record 输液记录 + * @param practitioner 执行人 + * @param practitionerRole 执行人身份类型 + * @return 执行成功/失败 + */ + public boolean editSingleRecord(OutpatientInfusionRecordDto record, Long exeCount, Practitioner practitioner, + PractitionerRole practitionerRole) { + + String busNo = AssignSeqUtil.formatString(record.getBusNo(), exeCount, 3); + + if ((BigDecimal.valueOf(exeCount)).compareTo(record.getMedicationAntity()) < 0) { + ServiceRequest serviceRequest = new ServiceRequest(); + serviceRequest.setPrescriptionNo(record.getPrescriptionNo()).setBusNo(busNo) + .setBasedOnId(record.getServiceId()).setStatusEnum(EventStatus.COMPLETED.getValue()) + .setActivityId(record.getActivityId()).setPatientId(record.getPatientId()) + .setEncounterId(record.getEncounterId()).setPerformerId(practitioner.getId()) + .setPerformerTypeCode(practitionerRole.getRoleCode()).setOccurrenceStartTime(DateUtils.getNowDate()) + .setOccurrenceEndTime(DateUtils.addDateMinute(DateUtils.getNowDate(), 30)); + + boolean result = serviceRequestService.save(serviceRequest); + if (!result) { + return false; + } + } + + return true; + } + + /** + * 更新执行状态 + * + * @param serviceId 服务请求ID + * @param practitioner 执行人 + * @param practitionerRole 执行人身份类型 + * @return 修改成功/失败 + */ + public boolean updateRecordStatus(Long serviceId, Practitioner practitioner, PractitionerRole practitionerRole) { + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.eq(ServiceRequest::getId, serviceId) + .set(ServiceRequest::getStatusEnum, EventStatus.COMPLETED.getValue()) + .set(ServiceRequest::getPerformerTypeCode, practitionerRole.getRoleCode()) + .set(ServiceRequest::getPerformerId, practitioner.getId()) + .set(ServiceRequest::getOccurrenceStartTime, DateUtils.getNowDate()) + .set(ServiceRequest::getOccurrenceEndTime, DateUtils.getNowDate()); + + int countUpdate = serviceRequestMapper.update(null, updateWrapper); + return countUpdate > 0; + } + /** * 执行输液后,修改执行结束时间 * @@ -265,15 +387,14 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR @Override public boolean editPatientInfusionTime(OutpatientInfusionRecordDto outpatientInfusionRecordDto) { // 以id为主条件更新服务申请管理表 - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - updateWrapper.eq("id", outpatientInfusionRecordDto.getServiceId()).set("occurrence_end_time", + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.eq(ServiceRequest::getId, outpatientInfusionRecordDto.getServiceId()).set( + ServiceRequest::getOccurrenceEndTime, DateUtils.parseDate(outpatientInfusionRecordDto.getOccurrenceEndTime())); int countUpdate = serviceRequestMapper.update(null, updateWrapper); - if (countUpdate < 0) { - return false; - } else { - return true; - } + + return countUpdate < 0 ? false : true; + } /** @@ -281,7 +402,7 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR * * @param beginTime 开始时间 * @param endTime 结束时间 - * @return 门诊输液记录列表 + * @return 门诊输液执行记录查询 */ @Override public List getPatientInfusionPerformRecord(String beginTime, String endTime) { @@ -298,14 +419,15 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR } // 创建查询包装器 - QueryWrapper queryWrapper = new QueryWrapper<>(); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); // based_on_id 不为空 - queryWrapper.isNotNull("based_on_id"); + queryWrapper.isNotNull(OutpatientInfusionRecordDto::getBasedOnId); // 状态是已完成 - queryWrapper.eq("status_enum", EventStatus.COMPLETED.getValue()); + queryWrapper.eq(OutpatientInfusionRecordDto::getServiceStatus, EventStatus.COMPLETED.getValue()); // 时间筛选 - queryWrapper.ge("begin_time", beginDateTime); - queryWrapper.le("end_time", endDateTime); + queryWrapper.ge(OutpatientInfusionRecordDto::getCreateTime, beginDateTime); + queryWrapper.le(OutpatientInfusionRecordDto::getCreateTime, endDateTime); + // 从数据库获取输液记录列表 List infusionPerformList = outpatientManageMapper.getOutpatientInfusionRecord(queryWrapper); 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 index 7b239bfd..bbddaec6 100644 --- 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 @@ -25,7 +25,7 @@ import lombok.extern.slf4j.Slf4j; * @date 2025/3/12 */ @RestController -@RequestMapping("/outpatientmanage/infusion") +@RequestMapping("/outpatient-manage/infusion") @Slf4j @AllArgsConstructor public class OutpatientInfusionRecordController { 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 d85d12ad..41cead35 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/skintest") +@RequestMapping("/outpatient-manage/skin-test") @Slf4j @AllArgsConstructor public class OutpatientSkinTestRecordController { @@ -46,7 +46,7 @@ public class OutpatientSkinTestRecordController { * * @param outpatientSkinTestRecordDto 皮试记录信息 */ - @PutMapping("/outpatient-record-skintest") + @PutMapping("/outpatient-record-skin-test") public R editSkinTestRecord(@Validated @RequestBody OutpatientSkinTestRecordDto outpatientSkinTestRecordDto) { if (!OutpatientSkinTestRecordService.editSkinTestRecord(outpatientSkinTestRecordDto)) { @@ -60,7 +60,7 @@ public class OutpatientSkinTestRecordController { * * @param outpatientSkinTestRecordDto 皮试记录信息 */ - @PutMapping("/outpatient-record-signcheck") + @PutMapping("/outpatient-record-sign-check") public R nurseSignChkPs(@Validated @RequestBody OutpatientSkinTestRecordDto outpatientSkinTestRecordDto) { if (!OutpatientSkinTestRecordService.nurseSignChkPs(outpatientSkinTestRecordDto)) { 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 index 5fe66475..128494df 100644 --- 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 @@ -3,10 +3,12 @@ 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 com.sun.jna.platform.win32.OaIdl; import lombok.Data; import lombok.experimental.Accessors; import java.math.BigDecimal; +import java.util.Date; /** * 门诊输液记录Dto @@ -22,6 +24,9 @@ public class OutpatientInfusionRecordDto { @JsonSerialize(using = ToStringSerializer.class) private Long serviceId; + /** 服务申请状态 */ + private Integer serviceStatus; + /** 请求基于什么的ID */ @JsonSerialize(using = ToStringSerializer.class) private Long basedOnId; @@ -57,8 +62,7 @@ public class OutpatientInfusionRecordDto { private String genderEnum_enumText; /** 已执行数量 */ - @JsonSerialize(using = ToStringSerializer.class) - private Long executionCount; + private Integer executeNum; /** 分组id */ @JsonSerialize(using = ToStringSerializer.class) @@ -88,6 +92,9 @@ public class OutpatientInfusionRecordDto { /** 预计结束时间 */ private String occurrenceEndTime; + /** 药品ID */ + private Long medicationId; + /** 药品信息 */ private String medicationInformation; @@ -108,10 +115,14 @@ public class OutpatientInfusionRecordDto { private String medicationStatusEnum_enumText; /** 皮试标志(是/否) */ - private String flagText; + private Integer skinTestFlag; + private String skinTestFlag_enumText; /** 皮试结果 */ private Integer clinicalStatusEnum; private String clinicalStatusEnum_enumText; + /** 开单时间 */ + private Date createTime; + } 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 7f2cceeb..8776c3cd 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 @@ -4,6 +4,7 @@ import java.util.List; import org.apache.ibatis.annotations.Param; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Constants; @@ -59,8 +60,7 @@ public interface OutpatientManageMapper { * @param queryWrapper 查询条件 * @return 门诊输液记录列表 */ - List - getOutpatientInfusionRecord(@Param(Constants.WRAPPER) QueryWrapper queryWrapper); - + List getOutpatientInfusionRecord( + @Param(Constants.WRAPPER) LambdaQueryWrapper queryWrapper); } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/patientmanage/appservice/impl/PatientInformationServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/patientmanage/appservice/impl/PatientInformationServiceImpl.java index ab9d8ee7..bb0a23bd 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/patientmanage/appservice/impl/PatientInformationServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/patientmanage/appservice/impl/PatientInformationServiceImpl.java @@ -95,6 +95,18 @@ public class PatientInformationServiceImpl implements IPatientInformationService .collect(Collectors.toList()); initDto.setFamilyRelationshipType(statusEnumOptions6); + // 获取证件类型 + List statusEnumOptions7 = Stream.of(IdentityDocumentType.values()) + .map(status -> new PatientInfoInitDto.statusEnumOption(status.getValue(), status.getInfo())) + .collect(Collectors.toList()); + initDto.setIdentityDocumentType(statusEnumOptions7); + + // 获取是/否状态 + List statusEnumOptions8 = Stream.of(Whether.values()) + .map(status -> new PatientInfoInitDto.statusEnumOption(status.getValue(), status.getInfo())) + .collect(Collectors.toList()); + initDto.setWhetherStatus(statusEnumOptions8); + return initDto; } 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 1ac8ef93..144bd11e 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 @@ -20,7 +20,7 @@ import lombok.extern.slf4j.Slf4j; * @date 2025/2/28 */ @RestController -@RequestMapping("/patientmanage/records") +@RequestMapping("/patient-manage/records") @Slf4j @AllArgsConstructor public class OutpatientRecordController { diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/patientmanage/controller/PatientInformationController.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/patientmanage/controller/PatientInformationController.java index 4ef1b237..d8b2694b 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/patientmanage/controller/PatientInformationController.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/patientmanage/controller/PatientInformationController.java @@ -18,7 +18,7 @@ import lombok.extern.slf4j.Slf4j; * @date 2025/2/22 */ @RestController -@RequestMapping("/patientmanage/information") +@RequestMapping("/patient-manage/information") @Slf4j @AllArgsConstructor public class PatientInformationController { diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/patientmanage/dto/PatientInfoInitDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/patientmanage/dto/PatientInfoInitDto.java index cd65c7f1..c44b1a8e 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/patientmanage/dto/PatientInfoInitDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/patientmanage/dto/PatientInfoInitDto.java @@ -28,6 +28,10 @@ public class PatientInfoInitDto { private List bloodTypeRH; //获取家庭关系列表 private List familyRelationshipType; + //身份证件类型 + private List identityDocumentType; + //是/否 状态 + private List whetherStatus; /** * 状态 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 77890edd..9281bfe5 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 @@ -179,8 +179,9 @@ resultType="com.openhis.web.outpatientmanage.dto.OutpatientInfusionRecordDto"> SELECT T1.service_id, + T1.service_status, T1.bus_no, - T1.execution_count, + T1.execute_num, T1.based_on_id, T1.activity_id, T1.prescription_no, @@ -194,7 +195,7 @@ T1.medication_status_Enum, T1.group_id, T1.clinical_status_enum, - T1.flag_text, + T1.skin_test_flag, T1.speed, T1.method_code, T1.dose, @@ -209,25 +210,27 @@ SELECT sr.id AS service_id, --服务申请管理ID sr.bus_no, -- 服务请求编码 - (SELECT COUNT(*) FROM wor_service_request wsr WHERE wsr.based_on_id = sr.based_on_id) AS execution_count, sr.based_on_id, -- 请求基于什么的ID + sr.execute_num, -- 执行次数 sr.activity_id,--请求code,输液 sr.prescription_no, --处方号 sr.encounter_id , --就诊ID sr.tenant_id, + sr.status_enum AS service_status, --服务状态 e.bus_no AS encounter_busNo, --就诊ID(前台显示用) pt.name AS patient_name, --病人姓名 pt.bus_no AS patient_busNo, --病人ID(前台显示用) sr.patient_id, --病人ID - ad.name AS medication_information, --药品信息 + md.id AS medication_id, --药品ID + md.name AS medication_information, --药品信息 mr.antity AS medication_antity,--药品数量 mr.status_enum AS medication_status_Enum, --药品状态 mr.group_id, --注射药品组号 + CASE mr.skin_test_flag + WHEN 1 THEN 1 + ELSE 0 + END AS skin_test_flag ,--皮试标志 ai.clinical_status_enum, --皮试检查结果 - CASE mr.skin_test_flag--皮试标志 - WHEN 1 THEN '是' - ELSE '否' - END AS flag_text, mr.speed, --输液速度 mr.method_code,--用法 mr.dose || ' '|| mr.dose_unit_code AS dose,--单次剂量,剂量单位 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 6a782305..c40e3c9c 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,6 @@ package com.openhis.workflow.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -30,8 +31,8 @@ public class ServiceRequestServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("based_on_id", basedOnId); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(ServiceRequest::getBasedOnId, basedOnId); return serviceRequestMapper.selectCount(queryWrapper); } } \ No newline at end of file