From 2a1b396fe6ab3c0f59ac05d1097de5de2017c776 Mon Sep 17 00:00:00 2001 From: "Wang.Huan" Date: Tue, 18 Mar 2025 11:45:16 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E5=8C=BB=E5=98=B1=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E8=A1=A8=E5=8A=A0=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/doctorstation/dto/AdviceBaseDto.java | 6 +++++ .../DoctorStationAdviceAppMapper.xml | 8 ++++++ .../common/enums/ChargeItemContext.java | 27 ++++++------------- .../common/enums/ChargeItemStatus.java | 11 -------- .../domain/DeviceDefinition.java | 6 +++++ .../openhis/medication/domain/Medication.java | 3 +++ .../workflow/domain/ActivityDefinition.java | 8 ++++-- 7 files changed, 37 insertions(+), 32 deletions(-) diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceBaseDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceBaseDto.java index 626f8c73..32d22d83 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceBaseDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceBaseDto.java @@ -107,6 +107,12 @@ public class AdviceBaseDto { */ private String adviceTableName; + /** 所属科室 */ + private Long orgId; + + /** 所在位置 */ + private Long locationId; + /** * 医嘱库存集合 */ diff --git a/openhis-server/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml b/openhis-server/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml index 7d4f4699..c0b7504c 100644 --- a/openhis-server/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml +++ b/openhis-server/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml @@ -20,6 +20,8 @@ abi.volume, abi.method_code, abi.rate_code, + abi.org_id, + abi.location_id, abi.dose, abi.dose_unit_code, abi.supplier, @@ -42,6 +44,8 @@ T2.total_volume AS volume, T2.method_code AS method_code, T2.rate_code AS rate_code, + T2.org_id AS org_id, + T2.location_id AS location_id, CAST(T2.dose AS TEXT) AS dose, T2.dose_unit_code AS dose_unit_code, T3.NAME AS supplier, @@ -75,6 +79,8 @@ T1.SIZE AS volume, '' AS method_code, '' AS rate_code, + T1.org_id AS org_id, + T1.location_id AS location_id, '' AS dose, '' AS dose_unit_code, T2.NAME AS supplier, @@ -106,6 +112,8 @@ '' AS volume, '' AS method_code, '' AS rate_code, + T1.org_id AS org_id, + T1.location_id AS location_id, '' AS dose, '' AS dose_unit_code, '' AS supplier, diff --git a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/ChargeItemContext.java b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/ChargeItemContext.java index 327ba10e..21a38c0e 100644 --- a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/ChargeItemContext.java +++ b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/ChargeItemContext.java @@ -14,40 +14,29 @@ import lombok.Getter; */ @Getter @AllArgsConstructor -public enum ChargeItemContext { +public enum ChargeItemContext implements HisEnumInterface { /** * 采购 */ - PURCHASE(1, "采购"), + PURCHASE(1, "1", "采购"), /** * 药品 */ - MEDICATION(2, "药品"), + MEDICATION(2, "2", "药品"), /** * 耗材 */ - DEVICE(3, "耗材"), + DEVICE(3, "3", "耗材"), /** * 项目 */ - ACTIVITY(4, "项目"); + ACTIVITY(4, "4", "项目"); - private Integer value; - private String info; - - public static ChargeItemContext getByValue(Integer value) { - if (value == null) { - return null; - } - for (ChargeItemContext val : values()) { - if (val.getValue().equals(value)) { - return val; - } - } - return null; - } + private final Integer value; + private final String code; + private final String info; } diff --git a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/ChargeItemStatus.java b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/ChargeItemStatus.java index 466716b6..4d5b2d68 100644 --- a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/ChargeItemStatus.java +++ b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/ChargeItemStatus.java @@ -46,15 +46,4 @@ public enum ChargeItemStatus implements HisEnumInterface { private final String code; private final String info; - public static ChargeItemStatus getByValue(Integer value) { - if (value == null) { - return null; - } - for (ChargeItemStatus val : values()) { - if (val.getValue().equals(value)) { - return val; - } - } - return null; - } } diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/administration/domain/DeviceDefinition.java b/openhis-server/openhis-domain/src/main/java/com/openhis/administration/domain/DeviceDefinition.java index 9566a632..30b4c780 100644 --- a/openhis-server/openhis-domain/src/main/java/com/openhis/administration/domain/DeviceDefinition.java +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/administration/domain/DeviceDefinition.java @@ -59,6 +59,12 @@ public class DeviceDefinition extends HisBaseEntity { /** 最小使用单位 */ private String minUnitCode; + /** 所属科室 */ + private Long orgId; + + /** 所在位置 */ + private Long locationId; + /** 产品型号 */ private String modelNumber; diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/medication/domain/Medication.java b/openhis-server/openhis-domain/src/main/java/com/openhis/medication/domain/Medication.java index 1a1e2009..e8bd2969 100644 --- a/openhis-server/openhis-domain/src/main/java/com/openhis/medication/domain/Medication.java +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/medication/domain/Medication.java @@ -38,6 +38,9 @@ public class Medication extends HisBaseEntity { /** 所属科室 */ private Long orgId; + /** 所在位置 */ + private Long locationId; + /** 剂型 */ private String doseFormCode; diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/domain/ActivityDefinition.java b/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/domain/ActivityDefinition.java index 0ada4e88..4959ee74 100644 --- a/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/domain/ActivityDefinition.java +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/domain/ActivityDefinition.java @@ -4,8 +4,6 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.core.common.core.domain.HisBaseEntity; -import com.openhis.common.enums.ActivityDefCategory; -import com.openhis.common.enums.PublicationStatus; import lombok.Data; import lombok.EqualsAndHashCode; @@ -48,6 +46,12 @@ public class ActivityDefinition extends HisBaseEntity { /** 使用单位 */ private String permittedUnitCode; + /** 所属科室 */ + private Long orgId; + + /** 所在位置 */ + private Long locationId; + /** 医保标记 */ private Integer ybFlag; From 1276b80a016262474da6f0f2e7c46e8b4c4fe368 Mon Sep 17 00:00:00 2001 From: liuhongrui Date: Tue, 18 Mar 2025 14:58:12 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E8=AF=81=E4=BB=B6=E7=B1=BB=E5=9E=8B=20=20?= =?UTF-8?q?=E6=9E=9A=E4=B8=BE=E7=B1=BB=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/enums/IdentityDocumentType.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 openhis-server/openhis-common/src/main/java/com/openhis/common/enums/IdentityDocumentType.java diff --git a/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/IdentityDocumentType.java b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/IdentityDocumentType.java new file mode 100644 index 00000000..f9982958 --- /dev/null +++ b/openhis-server/openhis-common/src/main/java/com/openhis/common/enums/IdentityDocumentType.java @@ -0,0 +1,32 @@ +package com.openhis.common.enums; + +import com.baomidou.mybatisplus.annotation.EnumValue; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 身份证件类型 + * + * @author liuhr + * @date 2025/3/18 + */ + +@Getter +@AllArgsConstructor +public enum IdentityDocumentType implements HisEnumInterface { + + RESIDENT_ID_CARD(1, "residentIdCard", "居民身份证"), + HOUSEHOLD_REGISTER(2, "householdRegister", "居民户口簿"), + PASSPORT(3, "passport", "护照"), + OFFICER_CERTIFICATE(4, "officerCertificate", "军官证"), + DRIVING_LICENSE(5, "drivingLicense", "驾驶证"), + HONGKONG_MACAO_PASS(6, "hongkongMacaoPass", "港澳居民来往内地通行证"), + TAIWAN_PASS(7, "taiwanPass", "台湾居民来往内地通行证"), + OTHER(99, "other", "其他身份证件"); + + @EnumValue + private final Integer value; + private final String code; + private final String info; +} From cc80209329a776bc8c3ba93608fb51c7f14b3a7d Mon Sep 17 00:00:00 2001 From: liuhongrui Date: Tue, 18 Mar 2025 14:59:03 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E7=97=85=E4=BA=BA=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=92=8C=E8=BE=93=E6=B6=B2=E8=AE=B0=E5=BD=95=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E4=BF=AE=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 From 5f1c710296f6184269368432aeba846ed74d1633 Mon Sep 17 00:00:00 2001 From: duhe Date: Tue, 18 Mar 2025 16:02:40 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=A0=BC=E5=BC=8F=E7=BB=9F=E4=B8=80=20up=20by=20dh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../appservice/ISupplierManagementAppService.java | 2 +- .../appservice/impl/SupplierManagementAppServiceImpl.java | 2 +- .../controller/SupplierManagementController.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/ISupplierManagementAppService.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/ISupplierManagementAppService.java index 43e7b46d..1db520aa 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/ISupplierManagementAppService.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/ISupplierManagementAppService.java @@ -83,7 +83,7 @@ public interface ISupplierManagementAppService { * @param id 查询条件 * @return 厂商/产地查询结果 */ - R getSupplierDetail(@PathVariable("id") Long id); + R getSupplierDetail(Long id); /** * 厂商/产地停用 diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/SupplierManagementAppServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/SupplierManagementAppServiceImpl.java index 3e012d92..b1491a05 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/SupplierManagementAppServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/SupplierManagementAppServiceImpl.java @@ -144,7 +144,7 @@ public class SupplierManagementAppServiceImpl implements ISupplierManagementAppS * @return 厂商/产地查询结果 */ @Override - public R getSupplierDetail(@PathVariable("id") Long id) { + public R getSupplierDetail(Long id) { SupplierDto supplierDto = new SupplierDto(); // 根据ID查询【供应商信息】 Supplier supplier = supplierService.getById(id); diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/SupplierManagementController.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/SupplierManagementController.java index fd8d68e0..5e75103a 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/SupplierManagementController.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/SupplierManagementController.java @@ -88,8 +88,8 @@ public class SupplierManagementController { * @param id 查询条件 * @return 厂商/产地查询结果 */ - @GetMapping(value = "/get-supplier-detail/{id}") - public R getSupplierDetail(@PathVariable("id") Long id) { + @GetMapping(value = "/get-supplier-detail") + public R getSupplierDetail(@RequestParam Long id) { return supplierManagementAppService.getSupplierDetail(id); } From f4f7ca21fe8d8b06c7e8567539ed41a944963044 Mon Sep 17 00:00:00 2001 From: "Wang.Huan" Date: Tue, 18 Mar 2025 17:33:34 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/openhis/web/doctorstation/dto/AdviceInventoryDto.java | 4 ++++ .../mapper/doctorstation/DoctorStationAdviceAppMapper.xml | 1 + .../java/com/openhis/medication/domain/MedicationRequest.java | 3 +++ .../main/java/com/openhis/workflow/domain/DeviceRequest.java | 3 +++ 4 files changed, 11 insertions(+) diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceInventoryDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceInventoryDto.java index 50c8c9e2..7c6f5530 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceInventoryDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceInventoryDto.java @@ -42,6 +42,10 @@ public class AdviceInventoryDto { /** 产品批号 */ private String lotNumber; + /** 库位 */ + @JsonSerialize(using = ToStringSerializer.class) + private Long locationStoreId; + /** 库房id */ @JsonSerialize(using = ToStringSerializer.class) private Long locationId; diff --git a/openhis-server/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml b/openhis-server/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml index c0b7504c..7c378de7 100644 --- a/openhis-server/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml +++ b/openhis-server/openhis-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml @@ -139,6 +139,7 @@ T1.lot_number, T1.price, T1.location_id, + T1.location_store_id, T2.NAME AS location_name FROM wor_inventory_item AS T1 diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/medication/domain/MedicationRequest.java b/openhis-server/openhis-domain/src/main/java/com/openhis/medication/domain/MedicationRequest.java index 6160e0f2..c723ffad 100644 --- a/openhis-server/openhis-domain/src/main/java/com/openhis/medication/domain/MedicationRequest.java +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/medication/domain/MedicationRequest.java @@ -43,6 +43,9 @@ public class MedicationRequest extends HisBaseEntity { /** 请求数量 */ private Integer quantity; + /** 执行次数 */ + private Integer executeNum; + /** 请求单位编码 */ private String unitCode; diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/domain/DeviceRequest.java b/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/domain/DeviceRequest.java index 1d74c3f1..0a99a4a2 100644 --- a/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/domain/DeviceRequest.java +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/domain/DeviceRequest.java @@ -85,6 +85,9 @@ public class DeviceRequest extends HisBaseEntity { /** 就诊id */ private Long encounterId; + /** 患者ID */ + private Long patientId; + /** 用药频次 */ private String rateCode; From d8f16b1b517e3dde5cf46941e0efa6195d5dac8b Mon Sep 17 00:00:00 2001 From: duhe Date: Tue, 18 Mar 2025 18:10:32 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E6=8E=A5=E5=8F=A3url=E5=8F=98=E6=9B=B4?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E5=AF=B9=E5=BA=94=E4=BF=AE=E6=AD=A3=20?= =?UTF-8?q?=EF=BC=8C=E9=87=87=E8=B4=AD=E5=85=A5=E5=BA=93=E7=94=BB=E9=9D=A2?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=20up=20by=20dh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../supplier/components/supplier.js | 5 +- .../components/registrationfee.js | 4 +- .../basicservices/registrationfee/index.vue | 4 +- .../views/catalog/device/components/device.js | 14 +- .../components/diagnosisTreatment.js | 14 +- .../components/diagnosisTreatmentDialog.vue | 2 +- .../catalog/diagnosistreatment/index.vue | 1051 +++++++++-------- .../catalog/disease/components/disease.js | 14 +- .../catalog/medicine/components/medicine.js | 14 +- .../medicine/components/medicineDialog.vue | 11 - .../components/inventoryReceiptDialog.vue | 1017 ++++++++++++++++ .../components/purchaseinventory.js | 73 ++ .../purchaseinventory/index.vue | 683 +++++++++++ 13 files changed, 2335 insertions(+), 571 deletions(-) create mode 100644 openhis-ui-vue3/src/views/medicationmanagement/purchaseinventory/components/inventoryReceiptDialog.vue create mode 100644 openhis-ui-vue3/src/views/medicationmanagement/purchaseinventory/components/purchaseinventory.js create mode 100644 openhis-ui-vue3/src/views/medicationmanagement/purchaseinventory/index.vue diff --git a/openhis-ui-vue3/src/views/basicmanage/supplier/components/supplier.js b/openhis-ui-vue3/src/views/basicmanage/supplier/components/supplier.js index 2e645acb..3282d902 100644 --- a/openhis-ui-vue3/src/views/basicmanage/supplier/components/supplier.js +++ b/openhis-ui-vue3/src/views/basicmanage/supplier/components/supplier.js @@ -13,8 +13,9 @@ export function getSupplierList(query) { // 查询厂商详细 export function getSupplierOne(id) { return request({ - url: '/data-dictionary/supplier/get-supplier-detail/' + parseStrEmpty(id), - method: 'get' + url: '/data-dictionary/supplier/get-supplier-detail', + method: 'get', + params: {id} }) } diff --git a/openhis-ui-vue3/src/views/basicservices/registrationfee/components/registrationfee.js b/openhis-ui-vue3/src/views/basicservices/registrationfee/components/registrationfee.js index 3673a44c..801f8fbd 100644 --- a/openhis-ui-vue3/src/views/basicservices/registrationfee/components/registrationfee.js +++ b/openhis-ui-vue3/src/views/basicservices/registrationfee/components/registrationfee.js @@ -47,7 +47,7 @@ export function getInit() { // 查询部门树形数据 export function deptTreeSelect(queryParams) { return request({ - url: '/basedatamanage/organization/organization', + url: '/base-data-manage/organization/organization', method: 'get', param: queryParams }) @@ -56,7 +56,7 @@ export function deptTreeSelect(queryParams) { // 查询地点树形数据 export function locationTreeSelect(queryParams) { return request({ - url: '/basedatamanage/cabinet-location/cabinet-location', + url: '/base-data-manage/cabinet-location/cabinet-location', method: 'get', param: queryParams }) diff --git a/openhis-ui-vue3/src/views/basicservices/registrationfee/index.vue b/openhis-ui-vue3/src/views/basicservices/registrationfee/index.vue index 0a9fc2a3..752cb0f1 100644 --- a/openhis-ui-vue3/src/views/basicservices/registrationfee/index.vue +++ b/openhis-ui-vue3/src/views/basicservices/registrationfee/index.vue @@ -522,7 +522,7 @@ const data = reactive({ const { queryParams, form, rules } = toRefs(data); /** 挂号收费查询下拉树结构 */ -function getregistrationfeeTypeList() { +function getRegistrationfeeTypeList() { getInit().then((response) => { console.log(response, "response"); activeFlagOptions.value = response.data.activeFlagOptions; // 活动标记 @@ -842,7 +842,7 @@ const transformFormEditData = (form) => { }, }; }; -getregistrationfeeTypeList(); +getRegistrationfeeTypeList(); getDeptTree(); getLocationTree(); getList(); diff --git a/openhis-ui-vue3/src/views/catalog/device/components/device.js b/openhis-ui-vue3/src/views/catalog/device/components/device.js index 879ec8b3..061efdbc 100644 --- a/openhis-ui-vue3/src/views/catalog/device/components/device.js +++ b/openhis-ui-vue3/src/views/catalog/device/components/device.js @@ -5,7 +5,7 @@ import { parseStrEmpty } from "@/utils/openhis"; export function getDeviceList(query) { console.log(query,'aaaaa') return request({ - url: '/datadictionary/device/information-page', + url: '/data-dictionary/device/information-page', method: 'get', params: query }) @@ -14,7 +14,7 @@ export function getDeviceList(query) { // 查询器材目录详细 export function getDeviceOne(id) { return request({ - url: '/datadictionary/device/information-one/' + parseStrEmpty(id), + url: '/data-dictionary/device/information-one/' + parseStrEmpty(id), method: 'get' }) } @@ -22,7 +22,7 @@ export function getDeviceOne(id) { // 新增器材目录 export function addDevice(data) { return request({ - url: '/datadictionary/device/information', + url: '/data-dictionary/device/information', method: 'post', data: data }) @@ -31,7 +31,7 @@ export function addDevice(data) { // 修改器材目录 export function editDevice(data) { return request({ - url: '/datadictionary/device/information', + url: '/data-dictionary/device/information', method: 'put', data: data }) @@ -48,7 +48,7 @@ export function editDevice(data) { // 器材目录分类查询 export function getDiseaseTreatmentInit() { return request({ - url: '/datadictionary/device/init', + url: '/data-dictionary/device/init', method: 'get' }) } @@ -57,7 +57,7 @@ export function getDiseaseTreatmentInit() { export function stopDevice(ids) { console.log(ids) return request({ - url: '/datadictionary/device/information-stop', + url: '/data-dictionary/device/information-stop', method: 'put', data: ids }) @@ -67,7 +67,7 @@ export function stopDevice(ids) { export function startDevice(ids) { console.log(ids) return request({ - url: '/datadictionary/device/information-start', + url: '/data-dictionary/device/information-start', method: 'put', data: ids }) diff --git a/openhis-ui-vue3/src/views/catalog/diagnosistreatment/components/diagnosisTreatment.js b/openhis-ui-vue3/src/views/catalog/diagnosistreatment/components/diagnosisTreatment.js index d0c3b0e5..872ce52f 100644 --- a/openhis-ui-vue3/src/views/catalog/diagnosistreatment/components/diagnosisTreatment.js +++ b/openhis-ui-vue3/src/views/catalog/diagnosistreatment/components/diagnosisTreatment.js @@ -4,7 +4,7 @@ import { parseStrEmpty } from "@/utils/openhis"; // 查询诊疗目录列表 export function getDiagnosisTreatmentList(query) { return request({ - url: '/datadictionary/diagnosistreatment/information-page', + url: '/data-dictionary/diagnosistreatment/information-page', method: 'get', params: query }) @@ -13,7 +13,7 @@ export function getDiagnosisTreatmentList(query) { // 查询诊疗目录详细 export function getDiagnosisTreatmentOne(id) { return request({ - url: '/datadictionary/diagnosistreatment/information-one/' + parseStrEmpty(id), + url: '/data-dictionary/diagnosistreatment/information-one/' + parseStrEmpty(id), method: 'get' }) } @@ -21,7 +21,7 @@ export function getDiagnosisTreatmentOne(id) { // 新增诊疗目录 export function addDiagnosisTreatment(data) { return request({ - url: '/datadictionary/diagnosistreatment/information', + url: '/data-dictionary/diagnosistreatment/information', method: 'post', data: data }) @@ -30,7 +30,7 @@ export function addDiagnosisTreatment(data) { // 修改诊疗目录 export function editDiagnosisTreatment(data) { return request({ - url: '/datadictionary/diagnosistreatment/information', + url: '/data-dictionary/diagnosistreatment/information', method: 'put', data: data }) @@ -47,7 +47,7 @@ export function editDiagnosisTreatment(data) { // 诊疗目录分类查询 export function getDiseaseTreatmentInit() { return request({ - url: '/datadictionary/diagnosistreatment/init', + url: '/data-dictionary/diagnosistreatment/init', method: 'get' }) } @@ -56,7 +56,7 @@ export function getDiseaseTreatmentInit() { export function stopDiseaseTreatment(ids) { console.log(ids) return request({ - url: '/datadictionary/diagnosistreatment/information-stop', + url: '/data-dictionary/diagnosistreatment/information-stop', method: 'put', data: ids }) @@ -66,7 +66,7 @@ export function stopDiseaseTreatment(ids) { export function startDiseaseTreatment(ids) { console.log(ids) return request({ - url: '/datadictionary/diagnosistreatment/information-start', + url: '/data-dictionary/diagnosistreatment/information-start', method: 'put', data: ids }) diff --git a/openhis-ui-vue3/src/views/catalog/diagnosistreatment/components/diagnosisTreatmentDialog.vue b/openhis-ui-vue3/src/views/catalog/diagnosistreatment/components/diagnosisTreatmentDialog.vue index 7ac84f4a..2d758422 100644 --- a/openhis-ui-vue3/src/views/catalog/diagnosistreatment/components/diagnosisTreatmentDialog.vue +++ b/openhis-ui-vue3/src/views/catalog/diagnosistreatment/components/diagnosisTreatmentDialog.vue @@ -149,7 +149,7 @@ import { addDiagnosisTreatment, getDiseaseTreatmentInit, getDiagnosisTreatmentOne, -} from "./diagnosisTreatment"; +} from "./diagnosistreatment"; const router = useRouter(); const { proxy } = getCurrentInstance(); diff --git a/openhis-ui-vue3/src/views/catalog/diagnosistreatment/index.vue b/openhis-ui-vue3/src/views/catalog/diagnosistreatment/index.vue index d8c30f0d..f2175252 100644 --- a/openhis-ui-vue3/src/views/catalog/diagnosistreatment/index.vue +++ b/openhis-ui-vue3/src/views/catalog/diagnosistreatment/index.vue @@ -1,544 +1,545 @@ - - - + // proxy.$refs["diagnosisTreatmentRef"].edit(); + } + /** 打开查看弹窗 */ + function openViewDiagnosisTreatment(row) { + // viewData.value = row; + getDiagnosisTreatmentOne(row.id).then((response) => { + currentData.value = response.data; + currentData.value.ybFlag == 1 + ? (currentData.value.ybFlag = true) + : (currentData.value.ybFlag = false); + currentData.value.ybMatchFlag == 1 + ? (currentData.value.ybMatchFlag = true) + : (currentData.value.ybMatchFlag = false); + title.value = "查看"; + nextTick(() => { + proxy.$refs["diagnosisTreatmentRef"].edit(); + }); + getList(); + }); + // console.log(viewData.value, "currentData"); + // // 确保子组件已经接收到最新的 props + // nextTick(() => { + // proxy.$refs["diagnosisTreatmentViewRef"].edit(); + // }); + // proxy.$refs["diagnosisTreatmentRef"].edit(); + } + + getDiseaseTreatmentList(); + getList(); + + + \ No newline at end of file diff --git a/openhis-ui-vue3/src/views/catalog/disease/components/disease.js b/openhis-ui-vue3/src/views/catalog/disease/components/disease.js index f23551c2..07613c01 100644 --- a/openhis-ui-vue3/src/views/catalog/disease/components/disease.js +++ b/openhis-ui-vue3/src/views/catalog/disease/components/disease.js @@ -4,7 +4,7 @@ import { parseStrEmpty } from "@/utils/openhis"; // 查询病种目录列表 export function getDiseaseList(query) { return request({ - url: '/datadictionary/disease/information-page', + url: '/data-dictionary/disease/information-page', method: 'get', params: query }) @@ -13,7 +13,7 @@ export function getDiseaseList(query) { // 查询病种目录详细 export function getDiseaseOne(id) { return request({ - url: '/datadictionary/disease/information-one/' + parseStrEmpty(id), + url: '/data-dictionary/disease/information-one/' + parseStrEmpty(id), method: 'get' }) } @@ -21,7 +21,7 @@ export function getDiseaseOne(id) { // 新增病种目录 export function addDisease(data) { return request({ - url: '/datadictionary/disease/information', + url: '/data-dictionary/disease/information', method: 'post', data: data }) @@ -30,7 +30,7 @@ export function addDisease(data) { // 修改病种目录 export function editDisease(data) { return request({ - url: '/datadictionary/disease/information', + url: '/data-dictionary/disease/information', method: 'put', data: data }) @@ -47,7 +47,7 @@ export function editDisease(data) { // 病种目录分类查询 export function getDiseaseCategory() { return request({ - url: '/datadictionary/disease/information-init', + url: '/data-dictionary/disease/information-init', method: 'get' }) } @@ -55,7 +55,7 @@ export function getDiseaseCategory() { // 停用病种目录 export function stopDisease(ids) { return request({ - url: '/datadictionary/disease/information-stop', + url: '/data-dictionary/disease/information-stop', method: 'put', data: ids }) @@ -64,7 +64,7 @@ export function stopDisease(ids) { // 启用病种目录 export function startDisease(ids) { return request({ - url: '/datadictionary/disease/information-start', + url: '/data-dictionary/disease/information-start', method: 'put', data: ids }) diff --git a/openhis-ui-vue3/src/views/catalog/medicine/components/medicine.js b/openhis-ui-vue3/src/views/catalog/medicine/components/medicine.js index 577c107e..0ba4330f 100644 --- a/openhis-ui-vue3/src/views/catalog/medicine/components/medicine.js +++ b/openhis-ui-vue3/src/views/catalog/medicine/components/medicine.js @@ -4,7 +4,7 @@ import { parseStrEmpty } from "@/utils/openhis"; // 查询药品目录列表 export function getMedicationList(query) { return request({ - url: '/datadictionary/medication/information-page', + url: '/data-dictionary/medication/information-page', method: 'get', params: query }) @@ -13,7 +13,7 @@ export function getMedicationList(query) { // 查询药品目录详细 export function getMedicationOne(id) { return request({ - url: '/datadictionary/medication/information-one/' + parseStrEmpty(id), + url: '/data-dictionary/medication/information-one/' + parseStrEmpty(id), method: 'get' }) } @@ -21,7 +21,7 @@ export function getMedicationOne(id) { // 新增药品目录 export function addMedication(data) { return request({ - url: '/datadictionary/medication/information', + url: '/data-dictionary/medication/information', method: 'post', data: data }) @@ -30,7 +30,7 @@ export function addMedication(data) { // 修改药品目录 export function editMedication(data) { return request({ - url: '/datadictionary/medication/information', + url: '/data-dictionary/medication/information', method: 'put', data: data }) @@ -47,7 +47,7 @@ export function delUser(userId) { // 药品目录分类查询 export function getMedicationCategory() { return request({ - url: '/datadictionary/medication/information-init', + url: '/data-dictionary/medication/information-init', method: 'get' }) } @@ -57,7 +57,7 @@ export function getMedicationCategory() { export function stopMedication(ids) { console.log(ids) return request({ - url: '/datadictionary/medication/information-stop', + url: '/data-dictionary/medication/information-stop', method: 'put', data: ids }) @@ -67,7 +67,7 @@ export function stopMedication(ids) { export function startMedication(ids) { console.log(ids) return request({ - url: '/datadictionary/medication/information-start', + url: '/data-dictionary/medication/information-start', method: 'put', data: ids }) diff --git a/openhis-ui-vue3/src/views/catalog/medicine/components/medicineDialog.vue b/openhis-ui-vue3/src/views/catalog/medicine/components/medicineDialog.vue index a26dce4d..6234cc01 100644 --- a/openhis-ui-vue3/src/views/catalog/medicine/components/medicineDialog.vue +++ b/openhis-ui-vue3/src/views/catalog/medicine/components/medicineDialog.vue @@ -17,7 +17,6 @@ @@ -55,7 +54,6 @@ @@ -650,7 +648,6 @@ // getDiseaseCategory, // getDiseaseOne, // } from "./components/medicine"; -import pinyin from "pinyin"; // 需要安装 pinyin 库 const router = useRouter(); const { proxy } = getCurrentInstance(); @@ -700,14 +697,6 @@ const data = reactive({ }, }); -// 生成拼音码和五笔码 -const generateCodes = () => { - form.value.pyStr = pinyin(form.value.name, { - style: pinyin.STYLE_FIRST_LETTER, - }).join(""); // 生成拼音首字母 - console.log(form.value.pyStr, "form.pyStr", form.value.name); - // form.wbStr = wubi(form.name).join(''); // 如果有五笔库,可以生成五笔码 -}; const { queryParams, form, antibioticForm, rules } = toRefs(data); const props = defineProps({ diff --git a/openhis-ui-vue3/src/views/medicationmanagement/purchaseinventory/components/inventoryReceiptDialog.vue b/openhis-ui-vue3/src/views/medicationmanagement/purchaseinventory/components/inventoryReceiptDialog.vue new file mode 100644 index 00000000..bce286e0 --- /dev/null +++ b/openhis-ui-vue3/src/views/medicationmanagement/purchaseinventory/components/inventoryReceiptDialog.vue @@ -0,0 +1,1017 @@ + + + + \ No newline at end of file diff --git a/openhis-ui-vue3/src/views/medicationmanagement/purchaseinventory/components/purchaseinventory.js b/openhis-ui-vue3/src/views/medicationmanagement/purchaseinventory/components/purchaseinventory.js new file mode 100644 index 00000000..64c94c83 --- /dev/null +++ b/openhis-ui-vue3/src/views/medicationmanagement/purchaseinventory/components/purchaseinventory.js @@ -0,0 +1,73 @@ +import request from '@/utils/request' +import { parseStrEmpty } from "@/utils/openhis"; + +// 查询服务管理列表 +export function getPurchaseinventoryList(query) { + return request({ + url: '/inventory-manage/purchase/inventory-receipt-page', + method: 'get', + params: query + }) +} + +// 查询服务管理详细 +export function getPurchaseinventoryOne(id) { + return request({ + url: '/basic-service/healthcare/healthcare-service-detail/' + parseStrEmpty(id), + method: 'get' + }) +} + +// 新增服务管理 +export function addPurchaseinventory(data) { + return request({ + url: '/basic-service/healthcare/healthcare-service', + method: 'post', + data: data + }) +} + +// 修改服务管理 +export function editPurchaseinventory(data) { + return request({ + url: '/basic-service/healthcare/healthcare-service', + method: 'put', + data: data + }) +} + +// 查询厂商类型 +export function getInit() { + return request({ + url: '/basic-service/healthcare/init', + method: 'get' + }) +} + +// 查询部门树形数据 +export function deptTreeSelect(queryParams) { + return request({ + url: '/base-data-manage/organization/organization', + method: 'get', + param: queryParams + }) +} + +// 查询地点树形数据 +export function locationTreeSelect(queryParams) { + return request({ + url: '/base-data-manage/cabinet-location/cabinet-location', + method: 'get', + param: queryParams + }) +} + +// 删除收费挂号项目 +export function delPurchaseinventory(param) { + console.log(param,'aaaa') + return request({ + url: '/basic-service/healthcare/healthcare-service', + method: 'delete', + params: param + }) +} \ No newline at end of file diff --git a/openhis-ui-vue3/src/views/medicationmanagement/purchaseinventory/index.vue b/openhis-ui-vue3/src/views/medicationmanagement/purchaseinventory/index.vue new file mode 100644 index 00000000..9fb04066 --- /dev/null +++ b/openhis-ui-vue3/src/views/medicationmanagement/purchaseinventory/index.vue @@ -0,0 +1,683 @@ + + + + \ No newline at end of file From ba4ca7e889a5b19ef6993e2e2d7cbe8f78b30c85 Mon Sep 17 00:00:00 2001 From: anxin Date: Tue, 18 Mar 2025 19:15:31 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E8=8D=AF=E5=93=81=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/MedicationManageAppServiceImpl.java | 22 ++-- .../controller/DeviceManageController.java | 2 +- .../DiagnosisTreatmentController.java | 2 +- .../controller/DiseaseManageController.java | 2 +- .../MedicationManageController.java | 104 +----------------- .../dto/MedicationManageDto.java | 11 +- .../openhis/medication/domain/Medication.java | 12 ++ .../domain/MedicationDefinition.java | 30 +++++ 8 files changed, 59 insertions(+), 126 deletions(-) diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/MedicationManageAppServiceImpl.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/MedicationManageAppServiceImpl.java index e09b29d3..5d6a66a3 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/MedicationManageAppServiceImpl.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/appservice/impl/MedicationManageAppServiceImpl.java @@ -25,7 +25,9 @@ import com.core.common.utils.SecurityUtils; import com.core.common.utils.bean.BeanUtils; import com.core.common.utils.poi.ExcelUtil; import com.openhis.common.constant.PromptMsgConstant; -import com.openhis.common.enums.*; +import com.openhis.common.enums.AccountStatus; +import com.openhis.common.enums.ApplicableScope; +import com.openhis.common.enums.PublicationStatus; import com.openhis.common.utils.EnumUtils; import com.openhis.medication.domain.Medication; import com.openhis.medication.domain.MedicationDefinition; @@ -118,16 +120,6 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi e.setActiveFlag_enumText(EnumUtils.getInfoByValue(AccountStatus.class, e.getActiveFlag())); // 适用范围 e.setDomainEnum_enumText(EnumUtils.getInfoByValue(ApplicableScope.class, e.getDomainEnum())); - // 药品分类 - e.setCategoryCode_enumText(EnumUtils.getInfoByValue(ItemCategory.class, e.getCategoryCode())); - // 是否皮试 - e.setSkinTestFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getSkinTestFlag())); - // 是否为注射药物 - e.setInjectFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getInjectFlag())); - // 是否限制使用 - e.setRestrictedFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getRestrictedFlag())); - // 儿童用药标志 - e.setChildrenFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getChildrenFlag())); }); // 返回【药品录列表DTO】分页 @@ -135,9 +127,9 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi } /** - * 编辑供应商信息 + * 编辑药品目录信息 * - * @param medicationManageUpDto 供应商信息 + * @param medicationManageUpDto 药品目录信息 */ @Override public R editMedication(@Validated @RequestBody MedicationManageUpDto medicationManageUpDto) { @@ -222,9 +214,9 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi } /** - * 添加供应商信息 + * 添加药品目录信息 * - * @param medicationManageUpDto 供应商信息 + * @param medicationManageUpDto 药品目录信息 */ @Override public R addMedication(@Validated @RequestBody MedicationManageUpDto medicationManageUpDto) { diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DeviceManageController.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DeviceManageController.java index 0d609410..b803360a 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DeviceManageController.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DeviceManageController.java @@ -117,7 +117,7 @@ public class DeviceManageController { * @param id 器材ID * @return */ - @GetMapping("/information-one/{id}") + @GetMapping("/information-one") public R getDeviceOne(@PathVariable("id") Long id) { return deviceManageAppService.getDeviceOne(id); diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java index 8c196dae..7947c1b4 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiagnosisTreatmentController.java @@ -157,7 +157,7 @@ public class DiagnosisTreatmentController { * @param id 诊疗ID * @return */ - @GetMapping("/information-one/{id}") + @GetMapping("/information-one") public R getDiseaseTreatmentOne(@PathVariable("id") Long id) { DiagnosisTreatmentDto diagnosisTreatmentDto = new DiagnosisTreatmentDto(); // 根据ID查询【诊疗目录】 diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiseaseManageController.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiseaseManageController.java index b4030b69..1b3cb1e1 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiseaseManageController.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/DiseaseManageController.java @@ -101,7 +101,7 @@ public class DiseaseManageController { * @param id 疾病ID * @return */ - @GetMapping("/information-one/{id}") + @GetMapping("/information-one") public R getDiseaseOne(@PathVariable("id") Long id) { DiseaseManageDto diseaseManageDto = new DiseaseManageDto(); // 根据ID查询【病种目录】 diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/MedicationManageController.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/MedicationManageController.java index fb3b5471..d232cfac 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/MedicationManageController.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/controller/MedicationManageController.java @@ -28,10 +28,6 @@ import lombok.extern.slf4j.Slf4j; @AllArgsConstructor public class MedicationManageController { - // private final IMedicationDefinitionService iMedicationDefinitionService; - // private final IMedicationService iMedicationService; - // private final MedicationManageSearchMapper medicationManageSearchMapper; - @Autowired private IMedicationManageAppService medicationManageAppService; @@ -42,16 +38,7 @@ public class MedicationManageController { */ @GetMapping("/information-init") public R getMedicationInit() { - return medicationManageAppService.getMedicationInit(); - - // MedicationManageInitDto medicationManageInitDto = new MedicationManageInitDto(); - // // 获取状态 - // List statusEnumOptions = Stream.of(PublicationStatus.values()) - // .map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo())) - // .collect(Collectors.toList()); - // medicationManageInitDto.setStatusFlagOptions(statusEnumOptions); - // return R.ok(medicationManageInitDto); } /** @@ -72,25 +59,8 @@ public class MedicationManageController { @RequestParam(value = "categoryCode", defaultValue = "") String categoryCode, @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) { - return medicationManageAppService.getMedicationList(searchKey, ybMatchFlag, statusEnum, categoryCode, pageNo, pageSize, request); - - // // 分页设置 - // Integer offset = (pageNo - 1) * pageSize; - // // 获取租户ID - // Integer tenantId = SecurityUtils.getLoginUser().getTenantId(); - // // 查询药品目录列表 - // List medicationDetailList = medicationManageSearchMapper.getPage(searchKey, ybMatchFlag, - // statusEnum, categoryCode, tenantId, pageSize, offset); - // // 查询总记录数 - // long total = - // medicationManageSearchMapper.getPageCount(searchKey, ybMatchFlag, statusEnum, categoryCode, tenantId); - // // 创建Page对象并设置属性 - // Page medicationManageDtoPage = new Page<>(pageNo, pageSize, total); - // medicationManageDtoPage.setRecords(medicationDetailList); - // // 返回【药品录列表DTO】分页 - // return R.ok(medicationManageDtoPage); } /** @@ -99,39 +69,15 @@ public class MedicationManageController { * @param id 药品ID * @return */ - @GetMapping("/information-one/{id}") + @GetMapping("/information-one") public R getMedicationOne(@PathVariable("id") Long id) { - return medicationManageAppService.getMedicationOne(id); - - // // 获取租户ID - // Integer tenantId = SecurityUtils.getLoginUser().getTenantId(); - // // 查询药品目录列表 - // MedicationManageDto medicationManageDto = medicationManageSearchMapper.getOne(id, tenantId); - // // 返回【药品录列表DTO】列表 - // return R.ok(medicationManageDto); } // 药品目录编辑 @PutMapping("/information") public R editMedication(@RequestBody MedicationManageUpDto medicationManageUpDto) { - return medicationManageAppService.editMedication(medicationManageUpDto); - - // MedicationDefinition medicationDefinition = new MedicationDefinition(); - // Medication medication = new Medication(); - // BeanUtils.copyProperties(medicationManageUpDto, medication); // 子表信息 - // BeanUtils.copyProperties(medicationManageUpDto, medicationDefinition);// 主表信息 - // - // // 更新子表药品信息 - // if (iMedicationService.updateById(medication)) { - // // 更新主表药品信息 - // return iMedicationDefinitionService.updateById(medicationDefinition) - // ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"})) - // : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); - // } else { - // return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); - // } } /** @@ -142,19 +88,6 @@ public class MedicationManageController { */ @PutMapping("/information-stop") public R editMedicationStop(@RequestBody List ids) { - // List medicationList = new ArrayList<>(); - // // 取得更新值 - // for (Long detail : ids) { - // Medication medication = new Medication(); - // medication.setId(detail); - // medication.setStatusEnum(PublicationStatus.RETIRED); - // medicationList.add(medication); - // } - // // 更新药品信息 - // return iMedicationService.updateBatchById(medicationList) - // ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"})) - // : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); - return medicationManageAppService.editMedicationStop(ids); } @@ -166,20 +99,7 @@ public class MedicationManageController { */ @PutMapping("/information-start") public R editMedicationStart(@RequestBody List ids) { - return medicationManageAppService.editMedicationStart(ids); - // List medicationList = new ArrayList<>(); - // // 取得更新值 - // for (Long detail : ids) { - // Medication medication = new Medication(); - // medication.setId(detail); - // medication.setStatusEnum(PublicationStatus.ACTIVE); - // medicationList.add(medication); - // } - // // 更新药品信息 - // return iMedicationService.updateBatchById(medicationList) - // ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"})) - // : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); } /** @@ -190,20 +110,7 @@ public class MedicationManageController { */ @PostMapping("/information") public R addMedication(@Validated @RequestBody MedicationManageUpDto medicationManageUpDto) { - return medicationManageAppService.addMedication(medicationManageUpDto); - - // MedicationDetail medicationDetail = new MedicationDetail(); - // BeanUtils.copyProperties(medicationManageUpDto, medicationDetail); - // // 新增主表外来药品目录 - // if (iMedicationDefinitionService.addMedication(medicationDetail)) { - // // 新增子表外来药品目录 - // return iMedicationService.addMedication(medicationDetail) - // ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"})) - // : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null)); - // } else { - // return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null)); - // } } /** @@ -232,15 +139,6 @@ public class MedicationManageController { @RequestParam(value = "ybMatchFlag", defaultValue = "-1") Integer ybMatchFlag, @RequestParam(value = "statusEnum", defaultValue = "-1") Integer statusEnum, @RequestParam(value = "categoryCode", defaultValue = "") String categoryCode, HttpServletResponse response) { - return medicationManageAppService.exportMedication(searchKey, ybMatchFlag, statusEnum, categoryCode, response); - - // // 获取租户ID - // Integer tenantId = SecurityUtils.getLoginUser().getTenantId(); - // List list = - // medicationManageSearchMapper.getList(searchKey, ybMatchFlag, statusEnum, categoryCode, tenantId); - // ExcelUtil util = new ExcelUtil<>(MedicationManageDto.class); - // util.exportExcel(response, list, "药品目录"); - // return null; } } diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageDto.java index 6d495f7c..039f653c 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/datadictionary/dto/MedicationManageDto.java @@ -5,6 +5,7 @@ import java.util.Date; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import com.openhis.common.annotation.Dict; import com.openhis.common.enums.PublicationStatus; import lombok.Data; @@ -99,8 +100,8 @@ public class MedicationManageDto { private String wbStr; /** 药品分类 */ + @Dict(dictCode = "medicine_category") private Integer categoryCode; - private String categoryCode_enumText; /** 商品名称 */ private String merchandiseName; @@ -142,12 +143,12 @@ public class MedicationManageDto { private String pharmacologyCategoryCode; /** 是否皮试 */ + @Dict(dictCode = "sys_yes_no") private Integer skinTestFlag; - private String skinTestFlag_enumText; /** 是否为注射药物 */ + @Dict(dictCode = "sys_yes_no") private Integer injectFlag; - private String injectFlag_enumText; /** 生产厂家 */ private Long manufacturerId; @@ -156,15 +157,15 @@ public class MedicationManageDto { private Long supplyId; /** 是否限制使用 */ + @Dict(dictCode = "sys_yes_no") private Integer restrictedFlag; - private String restrictedFlag_enumText; /** 限制使用范围 */ private String restrictedScope; /** 儿童用药标志 */ + @Dict(dictCode = "sys_yes_no") private Integer childrenFlag; - private String childrenFlag_enumText; /** 产品特性 */ private Integer characteristic; diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/medication/domain/Medication.java b/openhis-server/openhis-domain/src/main/java/com/openhis/medication/domain/Medication.java index e8bd2969..df26fa0d 100644 --- a/openhis-server/openhis-domain/src/main/java/com/openhis/medication/domain/Medication.java +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/medication/domain/Medication.java @@ -80,4 +80,16 @@ public class Medication extends HisBaseEntity { /** 药品定义 */ private String definition; + /** 删除状态 */ + private String deleteFlag; + + /** 用量限定 */ + private BigDecimal usageLimit; + + /** DDD值 */ + private String dddCode; + + /** DDD单位 */ + private String dddUnitCode; + } \ No newline at end of file diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/medication/domain/MedicationDefinition.java b/openhis-server/openhis-domain/src/main/java/com/openhis/medication/domain/MedicationDefinition.java index 29a284c1..6db29b4c 100644 --- a/openhis-server/openhis-domain/src/main/java/com/openhis/medication/domain/MedicationDefinition.java +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/medication/domain/MedicationDefinition.java @@ -108,9 +108,18 @@ public class MedicationDefinition extends HisBaseEntity { /** 限制使用范围 */ private String restrictedScope; + /** 是否使用 */ + private Integer activeFlag; + /** 儿童用药标志 */ private Integer childrenFlag; + /** 产品特性 */ + private Integer characteristic; + + /** 删除状态 */ + private String deleteFlag; + /** 最小库存警戒数量(常规单位) */ private BigDecimal itemMinQuantity; @@ -123,4 +132,25 @@ public class MedicationDefinition extends HisBaseEntity { /** 默认住院单位 */ private String defInhospitalUnitCode; + /** 贯标国家编码 */ + private String nationalDrugCode; + + /** 拆分属性 */ + private String partAttribute; + + /** 抗生素分类 */ + private String antibioticCode; + + /** 权限限制 */ + private Integer restrictedEnum; + + /** 是否自制 */ + private Integer selfFlag; + + /** 是否抗生素 */ + private Integer antibioticFlag; + + /** 基药标识 */ + private Integer basicFlag; + } \ No newline at end of file From 134b228b80d59d195de47689de5701335d166475 Mon Sep 17 00:00:00 2001 From: "Wang.Huan" Date: Tue, 18 Mar 2025 20:02:28 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E5=8C=BB=E5=98=B1=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/doctorstation/dto/AdviceBaseDto.java | 2 +- .../web/doctorstation/dto/AdviceSaveDto.java | 84 +++++++++++++++++++ .../doctorstation/dto/AdviceSaveParam.java | 20 +++++ .../medication/domain/MedicationRequest.java | 3 - .../workflow/domain/DeviceRequest.java | 6 +- .../workflow/domain/ServiceRequest.java | 2 +- 6 files changed, 109 insertions(+), 8 deletions(-) create mode 100644 openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceSaveDto.java create mode 100644 openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceSaveParam.java diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceBaseDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceBaseDto.java index 32d22d83..4e3d9793 100644 --- a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceBaseDto.java +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceBaseDto.java @@ -17,7 +17,7 @@ import lombok.experimental.Accessors; public class AdviceBaseDto { /** 医嘱类型 */ - private String adviceType; // 1:药品 , 2: 耗材 , 3:检查检验 + private String adviceType; // 1:药品 , 2: 耗材 , 3:项目 /** 医嘱定义ID */ @JsonSerialize(using = ToStringSerializer.class) diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceSaveDto.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceSaveDto.java new file mode 100644 index 00000000..e102b8ec --- /dev/null +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceSaveDto.java @@ -0,0 +1,84 @@ +package com.openhis.web.doctorstation.dto; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import com.openhis.common.enums.EncounterClass; +import com.openhis.common.enums.RequestStatus; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 医嘱保存 dto + */ +@Data +@Accessors(chain = true) +public class AdviceSaveDto { + + /** 医嘱类型 */ + private String adviceType; // 1:药品 , 2: 耗材 , 3:项目 + + /** 执行次数 */ + private Integer executeNum; // 当医嘱类型为药品时,选填 + + /** 处方号 */ + private String prescriptionNo; + + /** 请求数量 */ + private Integer quantity; + + /** 请求单位编码 */ + private String unitCode; + + /** 产品批号 */ + private String lotNumber; + + /** + * 请求状态 + */ + private Integer statusEnum; + + /** 请求类型 */ + private Integer categoryEnum; + + /** 医嘱定义ID */ + @JsonSerialize(using = ToStringSerializer.class) + private Long adviceDefinitionId; + + /** 患者 */ + @JsonSerialize(using = ToStringSerializer.class) + private Long patientId; + + /** 开方医生 */ + @JsonSerialize(using = ToStringSerializer.class) + private Long practitionerId; + + /** 所属位置 */ + @JsonSerialize(using = ToStringSerializer.class) + private Long locationId; + + /** 所属科室 */ + @JsonSerialize(using = ToStringSerializer.class) + private Long orgId; + + /** 就诊id */ + @JsonSerialize(using = ToStringSerializer.class) + private Long encounterId; + + /** 组套id */ + @JsonSerialize(using = ToStringSerializer.class) + private Long packageId; // 该参数先预留出来 + + /** 活动(项目)定义id */ + @JsonSerialize(using = ToStringSerializer.class) + private Long activityId; // 该参数先预留出来 + + /** + * 设置默认值 + */ + public AdviceSaveDto() { + this.statusEnum = RequestStatus.DRAFT.getValue(); + this.categoryEnum = EncounterClass.AMB.getValue(); + } + +} diff --git a/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceSaveParam.java b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceSaveParam.java new file mode 100644 index 00000000..88cc562b --- /dev/null +++ b/openhis-server/openhis-application/src/main/java/com/openhis/web/doctorstation/dto/AdviceSaveParam.java @@ -0,0 +1,20 @@ +package com.openhis.web.doctorstation.dto; + +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.List; + +/** + * 医嘱保存参数类 + */ +@Data +@Accessors(chain = true) +public class AdviceSaveParam { + + /** + * 保存医嘱 dto + */ + private List adviceSaveList; + +} diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/medication/domain/MedicationRequest.java b/openhis-server/openhis-domain/src/main/java/com/openhis/medication/domain/MedicationRequest.java index c723ffad..a6728700 100644 --- a/openhis-server/openhis-domain/src/main/java/com/openhis/medication/domain/MedicationRequest.java +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/medication/domain/MedicationRequest.java @@ -52,9 +52,6 @@ public class MedicationRequest extends HisBaseEntity { /** 产品批号 */ private String lotNumber; - /** 请求合计(元) */ - private BigDecimal displayAmount; - /** 药品请求状态 */ private Integer statusEnum; diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/domain/DeviceRequest.java b/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/domain/DeviceRequest.java index 0a99a4a2..2e52c5eb 100644 --- a/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/domain/DeviceRequest.java +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/domain/DeviceRequest.java @@ -46,6 +46,9 @@ public class DeviceRequest extends HisBaseEntity { /** 请求意图 */ private String intentCode; + /** 请求类型 */ + private Integer categoryEnum; + /** 优先级 */ private Integer priorityEnum; @@ -67,9 +70,6 @@ public class DeviceRequest extends HisBaseEntity { /** 耗材定义id */ private Long deviceDefId; - /** 请求合计(元) */ - private BigDecimal displayAmount; - /** 器材规格 */ private String deviceSpecifications; diff --git a/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/domain/ServiceRequest.java b/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/domain/ServiceRequest.java index 22accef5..caed72bc 100644 --- a/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/domain/ServiceRequest.java +++ b/openhis-server/openhis-domain/src/main/java/com/openhis/workflow/domain/ServiceRequest.java @@ -49,7 +49,7 @@ public class ServiceRequest extends HisBaseEntity { /** 意图 */ private Integer intentEnum; - /** 服务分类 */ + /** 请求类型 */ private Integer categoryEnum; /** 优先权 */ From 1bf7841fdd632827505c74a6467e5e10c2c3e8bc Mon Sep 17 00:00:00 2001 From: liuhongrui Date: Tue, 18 Mar 2025 20:11:39 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E9=97=A8=E8=AF=8A=E8=BE=93=E6=B6=B2?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=20=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IOutpatientInfusionRecordService.java | 16 +- .../OutpatientInfusionRecordServiceImpl.java | 278 ++++++------------ .../OutpatientInfusionRecordController.java | 76 ++--- .../dto/OutpatientInfusionInitDto.java | 2 - .../dto/OutpatientInfusionRecordDto.java | 12 +- .../mapper/OutpatientManageMapper.java | 12 + .../OutpatientManageMapper.xml | 42 ++- .../common/constant/CommonConstants.java | 15 + 8 files changed, 194 insertions(+), 259 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 8ef35d22..5a80e0a1 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 @@ -3,8 +3,6 @@ package com.openhis.web.outpatientmanage.appservice; import java.util.List; import com.baomidou.mybatisplus.core.metadata.IPage; -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; @@ -45,15 +43,6 @@ public interface IOutpatientInfusionRecordService { List getPatientInfusionRecord(OutpatientInfusionPatientDto outpatientInfusionPatientDto); - /** - * 执行单个患者门诊输液 - * - * @param exeCount 执行记录数 - * @param outpatientInfusionRecordDto 患者输液信息 - * @return 修改成功/失败 - */ - boolean editPatientInfusionRecord(OutpatientInfusionRecordDto outpatientInfusionRecordDto, Long exeCount); - /** * 执行单个患者门诊输液 * @@ -71,12 +60,13 @@ public interface IOutpatientInfusionRecordService { boolean editPatientInfusionTime(OutpatientInfusionRecordDto outpatientInfusionRecordDto); /** - * 显示门诊输液执行记录查询 + * 门诊输液执行历史记录查询 * * @param beginTime 开始时间 * @param endTime 结束时间 + * @param historyFlag 查询的是否为执行履历 * @return 门诊输液记录列表 */ - List getPatientInfusionPerformRecord(String beginTime, String endTime); + List getPatientInfusionPerformRecord(String beginTime, String endTime,boolean historyFlag); } 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 d8e98b12..3c431f0b 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 @@ -1,11 +1,7 @@ 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.Map; +import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -80,39 +76,10 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR OutpatientInfusionInitDto initDto = new OutpatientInfusionInitDto(); // 获取皮试结果 - List statusEnumOptions2 = Stream.of(ClinicalStatus.values()) + List statusEnumOptions = 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); - // 创建查询包装器 - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.ge(OutpatientInfusionRecordDto::getOccurrenceStartTime, beginTime); - queryWrapper.le(OutpatientInfusionRecordDto::getOccurrenceEndTime, 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.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); + initDto.setClinicalStatus(statusEnumOptions); return initDto; } @@ -154,13 +121,14 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR CommonConstants.FieldName.EncounterBusNo, CommonConstants.FieldName.PatientName)), null); // based_on_id 是为空的 - queryWrapper.eq("based_on_id", null); + queryWrapper.eq(CommonConstants.FieldName.basedOnId, null); // 状态是未完成的 - queryWrapper.in("service_status", EventStatus.IN_PROGRESS.getValue(), EventStatus.NOT_DONE.getValue()); + queryWrapper.in(CommonConstants.FieldName.requestStatus, EventStatus.IN_PROGRESS.getValue(), + EventStatus.NOT_DONE.getValue()); // 添加时间段查询条件 if (beginTime != null && endTime != null) { - queryWrapper.ge("create_time", beginTime); - queryWrapper.le("create_time", endTime); + queryWrapper.ge(CommonConstants.FieldName.createTime, beginTime); + queryWrapper.le(CommonConstants.FieldName.createTime, endTime); } IPage outpatientInfusionPatientDto = @@ -177,10 +145,10 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR } /** - * 查询单个患者门诊输液记录查询 + * 查询单个患者门诊输液待执行记录 * * @param outpatientInfusionPatientDto 患者输液信息 - * @return 门诊输液记录列表 + * @return 患者待输液记录列表 */ @Override public List @@ -195,7 +163,7 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR // based_on_id 是为空的 queryWrapper.eq(OutpatientInfusionRecordDto::getBasedOnId, null); // 状态是未完成的 - queryWrapper.in(OutpatientInfusionRecordDto::getServiceStatus, EventStatus.IN_PROGRESS.getValue(), + queryWrapper.in(OutpatientInfusionRecordDto::getRequestStatus, EventStatus.IN_PROGRESS.getValue(), EventStatus.NOT_DONE.getValue()); // 从数据库获取输液记录列表 List infusionList = @@ -204,91 +172,18 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR return infusionList; } - /** - * 执行单个患者门诊输液 - * - * @param exeCount 执行记录数 - * @param outpatientInfusionRecordDto 患者输液信息 - * @return 门诊输液记录列表 - */ - @Override - public boolean editPatientInfusionRecord(OutpatientInfusionRecordDto outpatientInfusionRecordDto, Long exeCount) { - - // 根据执行人ID,通过登录userId获取 - Practitioner practitioner = - practitionerService.getPractitionerByUserId(SecurityUtils.getLoginUser().getUserId()); - // 以执行人ID,获取执行人的身份类别 - PractitionerRole practitionerRole = practitionerRoleService.getPractitionerRoleById(practitioner.getId()); - if (practitioner == null || practitionerRole == 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()) - // 设置执行人身份类别 - .setPerformerTypeCode(practitionerRole.getRoleCode()) - // 设置执行日期为当前时间 - .setOccurrenceStartTime(DateUtils.getNowDate()) - // 默认执行时间加30min结束 - .setOccurrenceEndTime(DateUtils.addDateMinute(DateUtils.getNowDate(), 30)); - - boolean result = serviceRequestService.save(serviceRequest); - if (!result) { - return false; - } - - // 判断如果是执行该患者最后一次记录,更新原来的服请求状态 - if ((BigDecimal.valueOf(exeCount + 1)).compareTo(outpatientInfusionRecordDto.getMedicationAntity()) == 0) { - // 以id为主条件更新服务申请管理表 - 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; - } - } - return true; - } - - return false; - } - /** * 执行患者门诊输液 * - * @param outpatientInfusionRecordDtoList 输液记录 - * @return 修改成功/失败 + * @param outpatientInfusionRecordDtoList 输液记录列表 + * @return 执行成功/失败 */ @Override public boolean batchEditPatientInfusionRecord(List outpatientInfusionRecordDtoList) { - // 根据执行人ID,通过登录userId获取 Practitioner practitioner = practitionerService.getPractitionerByUserId(SecurityUtils.getLoginUser().getUserId()); - // 根具执行人ID,获取执行人身份类型 + // 根据执行人ID,获取执行人身份类型 PractitionerRole practitionerRole = practitionerRoleService.getPractitionerRoleById(practitioner.getId()); if (practitioner == null || practitionerRole == null) { return false; @@ -300,60 +195,58 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR // 遍历每个分组 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) { + // 获取组内药品个数 + Long groupCount = outpatientManageMapper.countMedicationExecuteNum(groupRecords.get(0).getServiceId(), null, + groupRecords.get(0).getGroupId(), false); + // 检查组内药品是否全部选中 + if (groupCount != groupRecords.size()) { return false; } - } + // 构造批量插入的 ServiceRequest 列表 + List serviceRequests = new ArrayList<>(); + for (OutpatientInfusionRecordDto record : groupRecords) { + String prefixBusNo = record.getBusNo() + "." + record.getGroupId() + "." + record.getMedicationId(); + // 获取执行次数 + Long exeCount = + outpatientManageMapper.countMedicationExecuteNum(record.getServiceId(), prefixBusNo, null, true); + + if (exeCount < record.getExecuteNum()) { + ServiceRequest serviceRequest = new ServiceRequest(); + serviceRequest.setPrescriptionNo(record.getPrescriptionNo()) + .setBusNo(AssignSeqUtil.formatString(prefixBusNo, exeCount, 3)) + .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)); + + serviceRequests.add(serviceRequest); + } + } + // 使用 MyBatis-Plus 的 saveBatch 方法批量插入 + if (!serviceRequestService.saveBatch(serviceRequests)) { + return false; // 如果批量插入失败,返回 false + } + // 更新分组中每个记录的状态 + for (OutpatientInfusionRecordDto record : groupRecords) { + String prefixBusNo = record.getBusNo() + "." + record.getGroupId() + "." + record.getMedicationId(); + // 获取执行次数 + Long exeCount = + outpatientManageMapper.countMedicationExecuteNum(record.getServiceId(), prefixBusNo, null, true); + + // 执行完毕后,更新执行服务请求表的状态 + if (exeCount.equals(record.getExecuteNum())) { + if (!updateRecordStatus(record.getServiceId())) { + return false; // 如果更新状态失败,返回 false + } + } + } + } + // 所有分组都执行成功 return true; } @@ -361,18 +254,12 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR * 更新执行状态 * * @param serviceId 服务请求ID - * @param practitioner 执行人 - * @param practitionerRole 执行人身份类型 * @return 修改成功/失败 */ - public boolean updateRecordStatus(Long serviceId, Practitioner practitioner, PractitionerRole practitionerRole) { + public boolean updateRecordStatus(Long serviceId) { 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()); + updateWrapper.eq(ServiceRequest::getId, serviceId).set(ServiceRequest::getStatusEnum, + EventStatus.COMPLETED.getValue()); int countUpdate = serviceRequestMapper.update(null, updateWrapper); return countUpdate > 0; @@ -402,10 +289,11 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR * * @param beginTime 开始时间 * @param endTime 结束时间 + * @param historyFlag 查询的是否为执行履历 * @return 门诊输液执行记录查询 */ @Override - public List getPatientInfusionPerformRecord(String beginTime, String endTime) { + public List getPatientInfusionPerformRecord(String beginTime, String endTime,boolean historyFlag) { LocalDateTime beginDateTime; LocalDateTime endDateTime; @@ -420,10 +308,20 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR // 创建查询包装器 LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - // based_on_id 不为空 - queryWrapper.isNotNull(OutpatientInfusionRecordDto::getBasedOnId); - // 状态是已完成 - queryWrapper.eq(OutpatientInfusionRecordDto::getServiceStatus, EventStatus.COMPLETED.getValue()); + //执行历史查询的条件 + if(historyFlag){ + // based_on_id 不为空,此条件筛选出执行履历 + queryWrapper.isNotNull(OutpatientInfusionRecordDto::getBasedOnId); + // 状态是已完成 + queryWrapper.eq(OutpatientInfusionRecordDto::getRequestStatus, EventStatus.COMPLETED.getValue()); + + //门诊输液待执行记录查询 + }else{ + // based_on_id 为空,此条件筛选控制不显示执行履历 + queryWrapper.isNull(OutpatientInfusionRecordDto::getBasedOnId); + // 状态是进行中 + queryWrapper.eq(OutpatientInfusionRecordDto::getRequestStatus, EventStatus.IN_PROGRESS.getValue()); + } // 时间筛选 queryWrapper.ge(OutpatientInfusionRecordDto::getCreateTime, beginDateTime); queryWrapper.le(OutpatientInfusionRecordDto::getCreateTime, endDateTime); @@ -432,6 +330,22 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR List infusionPerformList = outpatientManageMapper.getOutpatientInfusionRecord(queryWrapper); + // 遍历列表并处理每个记录 + infusionPerformList.forEach(e -> { + // 性别 + e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum())); + // 药品状态 + e.setClinicalStatusEnum_enumText(EnumUtils.getInfoByValue(EventStatus.class, e.getMedicationStatusEnum())); + // 皮试标志 + e.setSkinTestFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getSkinTestFlag())); + // 只有皮试药品才显示皮试结果 + if (e.getSkinTestFlag() == Whether.YES.getValue()) { + // 皮试结果 + e.setMedicationStatusEnum_enumText( + EnumUtils.getInfoByValue(ClinicalStatus.class, e.getClinicalStatusEnum())); + } + }); + return infusionPerformList; } 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 bbddaec6..8b0968a0 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 @@ -12,8 +12,6 @@ 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; @@ -33,9 +31,6 @@ public class OutpatientInfusionRecordController { @Autowired IOutpatientInfusionRecordService outpatientInfusionRecordService; - @Autowired - IServiceRequestService serviceRequestService; - /** * 门诊输液记录初期数据 * @@ -48,24 +43,7 @@ public class OutpatientInfusionRecordController { } /** - * 查询门诊输液患者列表 - * - * @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 门诊输液记录列表 @@ -76,25 +54,6 @@ public class OutpatientInfusionRecordController { return R.ok(outpatientInfusionRecordService.getPatientInfusionRecord(outpatientInfusionPatientDto)); } - // /** - // * 执行单个患者门诊输液 - // * - // * @param outpatientInfusionRecordDto 患者输液信息 - // * @return 门诊输液记录列表 - // */ - // @PutMapping("/infusion-perform") - // public R - // editPatientInfusionRecord(@Validated @RequestBody OutpatientInfusionRecordDto outpatientInfusionRecordDto) { - // // 获取执行次数 - // Long exeCount = - // serviceRequestService.countServiceRequestByBasedOnId(outpatientInfusionRecordDto.getServiceId()); - // boolean res = outpatientInfusionRecordService.editPatientInfusionRecord(outpatientInfusionRecordDto, exeCount); - // if (!res) { - // return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); - // } - // return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"患者门诊输液执行"})); - // } - /** * 批量执行患者门诊输液 * @@ -104,14 +63,11 @@ public class OutpatientInfusionRecordController { @PutMapping("/infusion-perform/batch") public R batchEditPatientInfusionRecord( @Validated @RequestBody List outpatientInfusionRecordDtoList) { - // 获取执行次数 - for (OutpatientInfusionRecordDto dto : outpatientInfusionRecordDtoList) { - Long exeCount = serviceRequestService.countServiceRequestByBasedOnId(dto.getServiceId()); - boolean res = outpatientInfusionRecordService.editPatientInfusionRecord(dto, exeCount); - if (!res) { - return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); - } + + if (!outpatientInfusionRecordService.batchEditPatientInfusionRecord(outpatientInfusionRecordDtoList)) { + return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null)); } + return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"患者门诊输液执行"})); } @@ -131,17 +87,31 @@ public class OutpatientInfusionRecordController { } /** - * 显示门诊输液执行记录查询 + * 门诊输液待执行记录查询 * * @param beginTime 开始时间 * @param endTime 结束时间 - * @return 门诊输液记录列表 + * @return 门诊输液待执行记录列表 */ - @GetMapping(value = "/infusion-perform-Record") + @GetMapping(value = "/infusion-wait-perform-record") + public R getPatientInfusionRecords(@RequestParam(required = false) String beginTime, + @RequestParam(required = false) String endTime) { + + return R.ok(outpatientInfusionRecordService.getPatientInfusionPerformRecord(beginTime, endTime, false)); + } + + /** + * 门诊输液执行历史记录查询 + * + * @param beginTime 开始时间 + * @param endTime 结束时间 + * @return 门诊输液执行历史记录列表 + */ + @GetMapping(value = "/infusion-perform-record") public R getPatientInfusionPerformRecord(@RequestParam(required = false) String beginTime, @RequestParam(required = false) String endTime) { - return R.ok(outpatientInfusionRecordService.getPatientInfusionPerformRecord(beginTime,endTime)); + return R.ok(outpatientInfusionRecordService.getPatientInfusionPerformRecord(beginTime, endTime, true)); } } 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 index 9ce247eb..ade484c9 100644 --- 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 @@ -19,8 +19,6 @@ public class OutpatientInfusionInitDto { //皮试结果 private List clinicalStatus; - //当天位执行的输液记录 - private List infusionList; /** * 状态 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 128494df..d53f37a1 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 @@ -1,15 +1,15 @@ package com.openhis.web.outpatientmanage.dto; +import java.math.BigDecimal; +import java.util.Date; + 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 * @@ -25,7 +25,7 @@ public class OutpatientInfusionRecordDto { private Long serviceId; /** 服务申请状态 */ - private Integer serviceStatus; + private Integer requestStatus; /** 请求基于什么的ID */ @JsonSerialize(using = ToStringSerializer.class) @@ -61,7 +61,7 @@ public class OutpatientInfusionRecordDto { private Integer genderEnum; private String genderEnum_enumText; - /** 已执行数量 */ + /** 住院执行次数 */ private Integer executeNum; /** 分组id */ 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 8776c3cd..e5bd3d49 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 @@ -63,4 +63,16 @@ public interface OutpatientManageMapper { List getOutpatientInfusionRecord( @Param(Constants.WRAPPER) LambdaQueryWrapper queryWrapper); + /** + * 查询药品已执行数量/查询同组内药品数量 + * + * @param paramId baseOnId/服务请求ID + * @param prefixBusNo 服务请求编码 + * @param groupId 分组ID + * @param flag 控制查询条件 + * @return 查询个数 + */ + long countMedicationExecuteNum(@Param("paramId") Long paramId, @Param("prefixBusNo") String prefixBusNo, + @Param("groupId") Long groupId, @Param("flag") boolean flag); + } 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 9281bfe5..bff580d1 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,7 +179,7 @@ resultType="com.openhis.web.outpatientmanage.dto.OutpatientInfusionRecordDto"> SELECT T1.service_id, - T1.service_status, + T1.request_status, T1.bus_no, T1.execute_num, T1.based_on_id, @@ -216,7 +216,7 @@ sr.prescription_no, --处方号 sr.encounter_id , --就诊ID sr.tenant_id, - sr.status_enum AS service_status, --服务状态 + sr.status_enum AS request_status, --服务请求状态 e.bus_no AS encounter_busNo, --就诊ID(前台显示用) pt.name AS patient_name, --病人姓名 pt.bus_no AS patient_busNo, --病人ID(前台显示用) @@ -250,7 +250,7 @@ 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 - ad.bus_no = 'sy001' -- 皮试检查的编号,todo:编号未定,后期修改 + ad.bus_no = 'sy001' -- 输液检查的编号,todo:编号未定,后期修改 AND mr.infusion_flag = 1 AND md.infusion_flag = 1 @@ -261,4 +261,40 @@ ${ew.customSqlSegment} + + + \ No newline at end of file diff --git a/openhis-server/openhis-common/src/main/java/com/openhis/common/constant/CommonConstants.java b/openhis-server/openhis-common/src/main/java/com/openhis/common/constant/CommonConstants.java index 29afa93c..bd9005a0 100644 --- a/openhis-server/openhis-common/src/main/java/com/openhis/common/constant/CommonConstants.java +++ b/openhis-server/openhis-common/src/main/java/com/openhis/common/constant/CommonConstants.java @@ -112,6 +112,21 @@ public class CommonConstants { * 患者姓名 */ String PatientName = "patient_name"; + + /** + * 请求状态 + */ + String requestStatus = "request_status"; + + /** + * 创建时间 + */ + String createTime = "create_time"; + + /** + * 请求基于什么的ID + */ + String basedOnId = "based_on_id"; } /**