diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/chargemanage/appservice/impl/OutpatientPricingAppServiceImpl.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/chargemanage/appservice/impl/OutpatientPricingAppServiceImpl.java index 57c6f96d9..03f248219 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/chargemanage/appservice/impl/OutpatientPricingAppServiceImpl.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/chargemanage/appservice/impl/OutpatientPricingAppServiceImpl.java @@ -76,7 +76,7 @@ public class OutpatientPricingAppServiceImpl implements IOutpatientPricingAppSer String categoryCode = adviceBaseDto != null ? adviceBaseDto.getCategoryCode() : null; // 门诊划价:仅返回划价标记为“是”的项目 return iDoctorStationAdviceAppService.getAdviceBaseInfo(adviceBaseDto, searchKey, locationId, null, - organizationId, pageNo, pageSize, Whether.YES.getValue(), adviceTypes, null, categoryCode); + organizationId, pageNo, pageSize, Whether.YES.getValue(), adviceTypes, null, categoryCode, null); } } diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/doctorstation/appservice/IDoctorStationAdviceAppService.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/doctorstation/appservice/IDoctorStationAdviceAppService.java index 4b1f4704a..066e5ce30 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/doctorstation/appservice/IDoctorStationAdviceAppService.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/doctorstation/appservice/IDoctorStationAdviceAppService.java @@ -32,7 +32,8 @@ public interface IDoctorStationAdviceAppService { */ IPage getAdviceBaseInfo(AdviceBaseDto adviceBaseDto, String searchKey, Long locationId, List adviceDefinitionIdParamList, Long organizationId, Integer pageNo, Integer pageSize, - Integer pricingFlag, List adviceTypes, String orderPricing, String categoryCode); + Integer pricingFlag, List adviceTypes, String orderPricing, String categoryCode, + Integer dischargeFlag); /** * 查询医嘱绑定信息 diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java index b64a4dca0..ea944803c 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/doctorstation/appservice/impl/DoctorStationAdviceAppServiceImpl.java @@ -179,7 +179,8 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp @Override public IPage getAdviceBaseInfo(AdviceBaseDto adviceBaseDto, String searchKey, Long locationId, List adviceDefinitionIdParamList, Long organizationId, Integer pageNo, Integer pageSize, - Integer pricingFlag, List adviceTypes, String orderPricing, String categoryCode) { + Integer pricingFlag, List adviceTypes, String orderPricing, String categoryCode, + Integer dischargeFlag) { // 生成缓存键,处理可能的null值 String safeSearchKey = searchKey != null ? searchKey : ""; @@ -253,7 +254,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp new Page<>(pageNo, pageSize), PublicationStatus.ACTIVE.getValue(), organizationId, CommonConstants.TableName.MED_MEDICATION_DEFINITION, CommonConstants.TableName.ADM_DEVICE_DEFINITION, CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, pricingFlag, adviceDefinitionIdParamList, - adviceTypes, searchKey, categoryCode, + adviceTypes, searchKey, categoryCode, dischargeFlag, queryWrapper); List adviceBaseDtoList = adviceBaseInfo.getRecords(); @@ -680,15 +681,16 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp .filter(e -> e.getAdviceType() != null && e.getAdviceType() == ItemType.DEVICE.getValue()) .collect(Collectors.toList()); - // 诊疗分类:adviceType == 3 + // 诊疗分类:adviceType == 3 或 6(手术)或 8(文字医嘱) List activityList = adviceSaveList.stream() .filter(e -> e.getAdviceType() != null && (e.getAdviceType() == ItemType.ACTIVITY.getValue() - || e.getAdviceType() == ItemType.SURGERY.getValue())) // 手术(6)也走诊疗流程 + || e.getAdviceType() == ItemType.SURGERY.getValue() + || e.getAdviceType() == ItemType.TEXT.getValue())) // 手术(6)和文字医嘱(8)也走诊疗流程 .collect(Collectors.toList()); // 🔍 Debug日志日志: 记录分类结果 - log.info("BugFix#219: 医嘱分类完成 - 药品:{}, 耗材:{}, 诊疗:{}", + log.info("BugFix#219: 医嘱分类完成 - 药品:{}, 耗材:{}, 诊疗(含文字):{}", medicineList.size(), deviceList.size(), activityList.size()); // 🔍 Debug日志: 打印所有医嘱的adviceType for (AdviceSaveDto dto : adviceSaveList) { @@ -1340,6 +1342,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp null, null, null, + null, null); if (devicePage == null || devicePage.getRecords().isEmpty()) { @@ -1708,6 +1711,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp null, null, null, + null, null); if (devicePage != null && !devicePage.getRecords().isEmpty()) { AdviceBaseDto deviceBaseInfo = devicePage.getRecords().get(0); @@ -2037,14 +2041,19 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp // 会诊医嘱:category_enum设置为31 serviceRequest.setCategoryEnum(31); log.info("保存会诊医嘱,category_enum=31"); + } else if (adviceSaveDto.getAdviceType() != null && adviceSaveDto.getAdviceType() == ItemType.TEXT.getValue()) { + // 文字医嘱:category_enum设置为8 + serviceRequest.setCategoryEnum(ItemType.TEXT.getValue()); + log.info("保存文字医嘱,category_enum=8"); } else { // 普通诊疗医嘱 serviceRequest.setCategoryEnum(adviceSaveDto.getCategoryEnum()); } - // 🔧 BugFix#385: 检查类型(adviceType=2)不走定价体系,activityId设置为0L占位 + // 🔧 BugFix#385: 检查类型(adviceType=2)和文字医嘱(adviceType=8)不走定价体系,activityId设置为0L占位 // 与ExamApplyController保持一致,数据库有NOT NULL约束 - if (adviceSaveDto.getAdviceType() != null && adviceSaveDto.getAdviceType() == 2) { + if (adviceSaveDto.getAdviceType() != null + && (adviceSaveDto.getAdviceType() == 2 || adviceSaveDto.getAdviceType() == ItemType.TEXT.getValue())) { serviceRequest.setActivityId(0L); } else { serviceRequest.setActivityId(adviceSaveDto.getAdviceDefinitionId());// 诊疗定义id @@ -2069,10 +2078,16 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp // 备注 serviceRequest.setRemark(adviceSaveDto.getRemark()); + // 🔧 文字医嘱:设置频次和开始时间 + if (adviceSaveDto.getAdviceType() != null && adviceSaveDto.getAdviceType() == ItemType.TEXT.getValue()) { + serviceRequest.setRateCode(adviceSaveDto.getRateCode()); + serviceRequest.setOccurrenceStartTime(adviceSaveDto.getStartTime()); + } + iServiceRequestService.saveOrUpdate(serviceRequest); - // 保存时保存诊疗费用项 - if (is_save) { + // 保存时保存诊疗费用项(文字医嘱跳过计费) + if (is_save && !(adviceSaveDto.getAdviceType() != null && adviceSaveDto.getAdviceType() == ItemType.TEXT.getValue())) { chargeItem = new ChargeItem(); chargeItem.setId(adviceSaveDto.getChargeItemId()); // 费用项id chargeItem.setTenantId(tenantId); // 补全租户ID @@ -2169,9 +2184,12 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp // } // log.error(e.getMessage(), e); // } - // 🔧 BugFix#328: 签发时将收费项目状态从草稿改为待收费 - // 修复检验申请单生成的医嘱签发失败问题 + // 🔧 BugFix#328: 签发时将收费项目状态从草稿改为待收费(文字医嘱跳过) Long chargeItemId = adviceSaveDto.getChargeItemId(); + if (adviceSaveDto.getAdviceType() != null && adviceSaveDto.getAdviceType() == ItemType.TEXT.getValue()) { + // 文字医嘱无费用项,跳过计费状态更新 + continue; + } ChargeItem existingChargeItem = null; // 方式1:通过chargeItemId直接查询 diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/doctorstation/appservice/impl/DoctorStationChineseMedicalAppServiceImpl.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/doctorstation/appservice/impl/DoctorStationChineseMedicalAppServiceImpl.java index 442110b66..2f93fc86d 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/doctorstation/appservice/impl/DoctorStationChineseMedicalAppServiceImpl.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/doctorstation/appservice/impl/DoctorStationChineseMedicalAppServiceImpl.java @@ -369,7 +369,7 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation adviceBaseDto.setAdviceType(1); // 医嘱类型为药品 adviceBaseDto.setCategoryCode(MedCategoryCode.CHINESE_HERBAL_MEDICINE.getValue());// 中草药 return iDoctorStationAdviceAppService.getAdviceBaseInfo(adviceBaseDto, searchKey, locationId, - adviceDefinitionIdParamList, organizationId, pageNo, pageSize, pricingFlag, List.of(1, 2, 3), null, null); + adviceDefinitionIdParamList, organizationId, pageNo, pageSize, pricingFlag, List.of(1, 2, 3), null, null, null); } /** @@ -613,7 +613,7 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation // 对应的诊疗医嘱信息 AdviceBaseDto activityAdviceBaseDto = iDoctorStationAdviceAppService.getAdviceBaseInfo(adviceBaseDto, null, - null, null, organizationId, 1, 1, Whether.NO.getValue(), List.of(3), null, null).getRecords().get(0); + null, null, organizationId, 1, 1, Whether.NO.getValue(), List.of(3), null, null, null).getRecords().get(0); if (activityAdviceBaseDto != null) { // 费用定价 AdvicePriceDto advicePriceDto = activityAdviceBaseDto.getPriceList().get(0); diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/doctorstation/controller/DoctorStationAdviceController.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/doctorstation/controller/DoctorStationAdviceController.java index 21719b9c7..f707cb21f 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/doctorstation/controller/DoctorStationAdviceController.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/doctorstation/controller/DoctorStationAdviceController.java @@ -48,12 +48,13 @@ public class DoctorStationAdviceController { @RequestParam(value = "locationId", required = false) Long locationId, @RequestParam(value = "adviceDefinitionIdParamList", required = false) List adviceDefinitionIdParamList, @RequestParam(value = "organizationId", required = false) Long organizationId, - @RequestParam(value = "adviceTypes", defaultValue = "1,2,3") List adviceTypes, + @RequestParam(value = "adviceTypes", defaultValue = "1,2,3,8") List adviceTypes, @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, - @RequestParam(value = "categoryCode", required = false) String categoryCode) { + @RequestParam(value = "categoryCode", required = false) String categoryCode, + @RequestParam(value = "dischargeFlag", required = false) Integer dischargeFlag) { return R.ok(iDoctorStationAdviceAppService.getAdviceBaseInfo(adviceBaseDto, searchKey, locationId, - adviceDefinitionIdParamList, organizationId, pageNo, pageSize, null, adviceTypes, null, categoryCode)); + adviceDefinitionIdParamList, organizationId, pageNo, pageSize, null, adviceTypes, null, categoryCode, dischargeFlag)); } /** diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/doctorstation/mapper/DoctorStationAdviceAppMapper.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/doctorstation/mapper/DoctorStationAdviceAppMapper.java index fa7eb6a9f..d2d7423ae 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/doctorstation/mapper/DoctorStationAdviceAppMapper.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/doctorstation/mapper/DoctorStationAdviceAppMapper.java @@ -39,6 +39,7 @@ public interface DoctorStationAdviceAppMapper { @Param("adviceTypes") List adviceTypes, @Param("searchKey") String searchKey, @Param("categoryCode") String categoryCode, + @Param("dischargeFlag") Integer dischargeFlag, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); /** diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/doctorstation/utils/AdviceUtils.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/doctorstation/utils/AdviceUtils.java index 8b55de027..0332fc07f 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/doctorstation/utils/AdviceUtils.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/doctorstation/utils/AdviceUtils.java @@ -434,7 +434,7 @@ public class AdviceUtils { // 对应的子项诊疗医嘱信息 AdviceBaseDto activityAdviceBaseDto = iDoctorStationAdviceAppService.getAdviceBaseInfo(adviceBaseDto, null, null, null, organizationId, 1, - 1, Whether.NO.getValue(), List.of(1, 2, 3), null, null).getRecords().get(0); + 1, Whether.NO.getValue(), List.of(1, 2, 3), null, null, null).getRecords().get(0); if (activityAdviceBaseDto != null) { // 费用定价 AdvicePriceDto advicePriceDto = activityAdviceBaseDto.getPriceList().get(0); diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/appservice/impl/AdviceProcessAppServiceImpl.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/appservice/impl/AdviceProcessAppServiceImpl.java index 5cde3e46a..72eded6ac 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/appservice/impl/AdviceProcessAppServiceImpl.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/appservice/impl/AdviceProcessAppServiceImpl.java @@ -806,7 +806,7 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService { // 医嘱详细信息 Long orgId = SecurityUtils.getLoginUser().getOrgId(); List medicationInfos = doctorStationAdviceAppService.getAdviceBaseInfo(null, null, null, - medicationDefinitionIdList, orgId, 1, 500, Whether.NO.getValue(), List.of(1), null, null).getRecords(); + medicationDefinitionIdList, orgId, 1, 500, Whether.NO.getValue(), List.of(1), null, null, null).getRecords(); // 当前时间 Date curDate = new Date(); @@ -1094,7 +1094,7 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService { // 医嘱详细信息 Long orgId = SecurityUtils.getLoginUser().getOrgId(); List activityInfos = doctorStationAdviceAppService.getAdviceBaseInfo(null, null, null, - activityDefinitionIdList, orgId, 1, 500, Whether.NO.getValue(), List.of(3), null, null).getRecords(); + activityDefinitionIdList, orgId, 1, 500, Whether.NO.getValue(), List.of(3), null, null, null).getRecords(); // 当前时间 Date curDate = new Date(); @@ -1251,7 +1251,7 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService { // 耗材医嘱详细信息 List deviceInfos = doctorStationAdviceAppService .getAdviceBaseInfo(null, null, null, deviceIds, orgId, 1, 500, Whether.NO.getValue(), List.of(2), - null, null) + null, null, null) .getRecords(); DeviceRequest deviceRequest; diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/appservice/impl/EncounterAutoRollAppServiceImpl.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/appservice/impl/EncounterAutoRollAppServiceImpl.java index bcc556fa3..5c84c7807 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/appservice/impl/EncounterAutoRollAppServiceImpl.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/inhospitalnursestation/appservice/impl/EncounterAutoRollAppServiceImpl.java @@ -205,7 +205,7 @@ public class EncounterAutoRollAppServiceImpl implements IEncounterAutoRollAppSer .map(AutoRollNursingDto::getActivityDefinitionId).collect(Collectors.toList()); // 诊疗医嘱信息 List activityInfos = doctorStationAdviceAppService.getAdviceBaseInfo(null, null, null, - activityDefinitionIdList, 0L, 1, 500, Whether.NO.getValue(), List.of(3), orderPricing, null).getRecords(); + activityDefinitionIdList, 0L, 1, 500, Whether.NO.getValue(), List.of(3), orderPricing, null, null).getRecords(); // 计费 ChargeItem chargeItem; @@ -299,7 +299,7 @@ public class EncounterAutoRollAppServiceImpl implements IEncounterAutoRollAppSer .map(AutoRollBasicServiceDto::getActivityDefinitionId).collect(Collectors.toList()); // 诊疗医嘱信息 List activityInfos = doctorStationAdviceAppService.getAdviceBaseInfo(null, null, null, - activityDefinitionIdList, 0L, 1, 500, Whether.NO.getValue(), List.of(3), orderPricing, null).getRecords(); + activityDefinitionIdList, 0L, 1, 500, Whether.NO.getValue(), List.of(3), orderPricing, null, null).getRecords(); // 计费 ChargeItem chargeItem; for (AutoRollBasicServiceDto autoRollBasicServiceDto : autoRollBasicService) { diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/paymentmanage/appservice/impl/PaymentRecServiceImpl.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/paymentmanage/appservice/impl/PaymentRecServiceImpl.java index 033a01e64..17a522a8e 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/paymentmanage/appservice/impl/PaymentRecServiceImpl.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/paymentmanage/appservice/impl/PaymentRecServiceImpl.java @@ -2329,7 +2329,7 @@ public class PaymentRecServiceImpl implements IPaymentRecService { adviceBaseDto.setAdviceDefinitionId(activityDeviceDto.getDevActId()); // 对应的诊疗医嘱信息 AdviceBaseDto activityAdviceBaseDto = iDoctorStationAdviceAppService.getAdviceBaseInfo(adviceBaseDto, null, - null, null, organizationId, 1, 1, Whether.NO.getValue(), List.of(1, 2, 3), null, null).getRecords().get(0); + null, null, organizationId, 1, 1, Whether.NO.getValue(), List.of(1, 2, 3), null, null, null).getRecords().get(0); // 价格信息 if (activityAdviceBaseDto != null) { // 费用定价 diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/personalization/appservice/impl/OrdersGroupPackageAppServiceImpl.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/personalization/appservice/impl/OrdersGroupPackageAppServiceImpl.java index cc553ac2a..ff1fc50c8 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/personalization/appservice/impl/OrdersGroupPackageAppServiceImpl.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/personalization/appservice/impl/OrdersGroupPackageAppServiceImpl.java @@ -198,7 +198,7 @@ public class OrdersGroupPackageAppServiceImpl implements IOrdersGroupPackageAppS // 医嘱下拉详细信息 List personalRecords = iDoctorStationAdviceAppService.getAdviceBaseInfo(null, null, null, orderDefinitionIdParamList, - organizationId, 1, 100, Whether.NO.getValue(), List.of(1, 2, 3), null, null).getRecords(); + organizationId, 1, 100, Whether.NO.getValue(), List.of(1, 2, 3), null, null, null).getRecords(); // 创建AdviceBaseDto的映射,以adviceDefinitionId为key Map adviceMap = personalRecords.stream().collect(Collectors .toMap(AdviceBaseDto::getAdviceDefinitionId, advice -> advice, (existing, replacement) -> existing // 如果有重复key,保留第一个 @@ -249,7 +249,7 @@ public class OrdersGroupPackageAppServiceImpl implements IOrdersGroupPackageAppS // 医嘱下拉详细信息 List personalRecords = iDoctorStationAdviceAppService.getAdviceBaseInfo(null, null, null, orderDefinitionIdParamList, - organizationId, 1, 100, Whether.NO.getValue(), List.of(1, 2, 3), null, null).getRecords(); + organizationId, 1, 100, Whether.NO.getValue(), List.of(1, 2, 3), null, null, null).getRecords(); // 创建AdviceBaseDto的映射,以adviceDefinitionId为key Map adviceMap = personalRecords.stream().collect(Collectors .toMap(AdviceBaseDto::getAdviceDefinitionId, advice -> advice, (existing, replacement) -> existing // 如果有重复key,保留第一个 @@ -298,7 +298,7 @@ public class OrdersGroupPackageAppServiceImpl implements IOrdersGroupPackageAppS // 医嘱下拉详细信息 List personalRecords = iDoctorStationAdviceAppService.getAdviceBaseInfo(null, null, null, orderDefinitionIdParamList, - organizationId, 1, 100, Whether.NO.getValue(), List.of(1, 2, 3), null, null).getRecords(); + organizationId, 1, 100, Whether.NO.getValue(), List.of(1, 2, 3), null, null, null).getRecords(); // 创建AdviceBaseDto的映射,以adviceDefinitionId为key Map adviceMap = personalRecords.stream().collect(Collectors .toMap(AdviceBaseDto::getAdviceDefinitionId, advice -> advice, (existing, replacement) -> existing // 如果有重复key,保留第一个 diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/regdoctorstation/appservice/impl/AdviceManageAppServiceImpl.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/regdoctorstation/appservice/impl/AdviceManageAppServiceImpl.java index 60d98e840..980e97ba7 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/regdoctorstation/appservice/impl/AdviceManageAppServiceImpl.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/regdoctorstation/appservice/impl/AdviceManageAppServiceImpl.java @@ -192,16 +192,18 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService { // 药品 List medicineList = regAdviceSaveList.stream() .filter(e -> ItemType.MEDICINE.getValue().equals(e.getAdviceType())).collect(Collectors.toList()); - // 诊疗活动(包含护理adviceType=26、手术adviceType=6) + // 诊疗活动(包含护理adviceType=26、手术adviceType=6、文字医嘱adviceType=8) List activityList = regAdviceSaveList.stream() .filter(e -> ItemType.ACTIVITY.getValue().equals(e.getAdviceType()) || ItemType.SURGERY.getValue().equals(e.getAdviceType()) + || ItemType.TEXT.getValue().equals(e.getAdviceType()) || (e.getAdviceType() != null && e.getAdviceType() == 26)) .collect(Collectors.toList()); // 耗材 🔧 Bug #147 修复 List deviceList = regAdviceSaveList.stream() .filter(e -> ItemType.DEVICE.getValue().equals(e.getAdviceType())).collect(Collectors.toList()); + // 保存时,校验临时医嘱库存 if (AdviceOpType.SAVE_ADVICE.getCode().equals(adviceOpType)) { List medUpdateList @@ -214,7 +216,8 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService { List tempCheckList = regAdviceSaveList.stream() .filter(e -> TherapyTimeType.TEMPORARY.getValue().equals(e.getTherapyEnum()) && !DbOpType.DELETE.getCode().equals(e.getDbOpType()) - && !ItemType.ACTIVITY.getValue().equals(e.getAdviceType())) + && !ItemType.ACTIVITY.getValue().equals(e.getAdviceType()) + && !ItemType.TEXT.getValue().equals(e.getAdviceType())) // 文字医嘱跳过库存校验 .collect(Collectors.toList()); List needCheckList = new ArrayList<>(tempCheckList); // 校验库存 @@ -627,6 +630,7 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService { // 签发操作 boolean is_sign = AdviceOpType.SIGN_ADVICE.getCode().equals(adviceOpType); + // 收集已处理的requestId,用于批量更新状态 List processedRequestIds = new ArrayList<>(); @@ -708,7 +712,12 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService { tempServiceRequest.setUnitCode(regAdviceSaveDto.getUnitCode()); // 请求单位编码 tempServiceRequest.setCategoryEnum(regAdviceSaveDto.getCategoryEnum()); // 请求类型 tempServiceRequest.setTherapyEnum(regAdviceSaveDto.getTherapyEnum()); // 治疗类型,临时(需要前端传) - tempServiceRequest.setActivityId(regAdviceSaveDto.getAdviceDefinitionId());// 诊疗定义id + // 文字医嘱(type=8)不走定价体系,activityId设置为0L占位 + if (ItemType.TEXT.getValue().equals(regAdviceSaveDto.getAdviceType())) { + tempServiceRequest.setActivityId(0L); + } else { + tempServiceRequest.setActivityId(regAdviceSaveDto.getAdviceDefinitionId());// 诊疗定义id + } tempServiceRequest.setPatientId(regAdviceSaveDto.getPatientId()); // 患者 tempServiceRequest.setRequesterId(regAdviceSaveDto.getPractitionerId()); // 开方医生 tempServiceRequest.setEncounterId(regAdviceSaveDto.getEncounterId()); // 就诊id @@ -731,8 +740,8 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService { processedRequestIds.add(tempServiceRequest.getId()); } - // 保存时,保存诊疗费用项 - if (is_save) { + // 保存时,保存诊疗费用项(文字医嘱跳过计费) + if (is_save && !ItemType.TEXT.getValue().equals(regAdviceSaveDto.getAdviceType())) { chargeItem = new ChargeItem(); chargeItem.setId(regAdviceSaveDto.getChargeItemId()); // 费用项id chargeItem.setStatusEnum(ChargeItemStatus.DRAFT.getValue()); // 收费状态 @@ -1034,9 +1043,10 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService { .filter(e -> ItemType.MEDICINE.getValue().equals(e.getAdviceType())).collect(Collectors.toList()); List medicineRequestIds = medicineList.stream().map(AdviceBatchOpParam::getRequestId).collect(Collectors.toList()); - // 诊疗(包含护理adviceType=26) + // 诊疗(包含护理adviceType=26、文字医嘱adviceType=8) List activityList = paramList.stream() .filter(e -> ItemType.ACTIVITY.getValue().equals(e.getAdviceType()) + || ItemType.TEXT.getValue().equals(e.getAdviceType()) || (e.getAdviceType() != null && e.getAdviceType() == 26)) .collect(Collectors.toList()); List activityRequestIds @@ -1100,9 +1110,10 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService { .filter(e -> ItemType.MEDICINE.getValue().equals(e.getAdviceType())).collect(Collectors.toList()); List medicineRequestIds = medicineList.stream().map(AdviceBatchOpParam::getRequestId).collect(Collectors.toList()); - // 诊疗(包含护理adviceType=26) + // 诊疗(包含护理adviceType=26、文字医嘱adviceType=8) List activityList = paramList.stream() .filter(e -> ItemType.ACTIVITY.getValue().equals(e.getAdviceType()) + || ItemType.TEXT.getValue().equals(e.getAdviceType()) || (e.getAdviceType() != null && e.getAdviceType() == 26)) .collect(Collectors.toList()); List activityRequestIds @@ -1144,9 +1155,10 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService { .filter(e -> ItemType.MEDICINE.getValue().equals(e.getAdviceType())).collect(Collectors.toList()); List medicineRequestIds = medicineList.stream().map(AdviceBatchOpParam::getRequestId).collect(Collectors.toList()); - // 诊疗(包含护理adviceType=26) + // 诊疗(包含护理adviceType=26、文字医嘱adviceType=8) List activityList = paramList.stream() .filter(e -> ItemType.ACTIVITY.getValue().equals(e.getAdviceType()) + || ItemType.TEXT.getValue().equals(e.getAdviceType()) || (e.getAdviceType() != null && e.getAdviceType() == 26)) .collect(Collectors.toList()); List activityRequestIds diff --git a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/regdoctorstation/appservice/impl/SpecialAdviceAppServiceImpl.java b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/regdoctorstation/appservice/impl/SpecialAdviceAppServiceImpl.java index 560da1a29..7b75908b3 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/regdoctorstation/appservice/impl/SpecialAdviceAppServiceImpl.java +++ b/healthlink-his-server/healthlink-his-application/src/main/java/com/healthlink/his/web/regdoctorstation/appservice/impl/SpecialAdviceAppServiceImpl.java @@ -162,7 +162,7 @@ public class SpecialAdviceAppServiceImpl implements ISpecialAdviceAppService { adviceBaseDto.setAdviceDefinitionId(definitionId); // 医嘱定义id // 对应的诊疗医嘱信息 activityAdviceBaseDto = iDoctorStationAdviceAppService.getAdviceBaseInfo(adviceBaseDto, null, null, - null, null, 1, 1, null, List.of(3), null, null).getRecords().get(0); + null, null, 1, 1, null, List.of(3), null, null, null).getRecords().get(0); // 逻辑1---------------------直接新增 longServiceRequest.setStatusEnum(RequestStatus.DRAFT.getValue());// 请求状态 longServiceRequest.setOccurrenceStartTime(startTime); // 医嘱开始时间 @@ -209,7 +209,7 @@ public class SpecialAdviceAppServiceImpl implements ISpecialAdviceAppService { adviceBaseDto.setAdviceDefinitionId(definitionId); // 医嘱定义id // 对应的诊疗医嘱信息 activityAdviceBaseDto = iDoctorStationAdviceAppService - .getAdviceBaseInfo(adviceBaseDto, null, null, null, null, 1, 1, null, List.of(3), null, null) + .getAdviceBaseInfo(adviceBaseDto, null, null, null, null, 1, 1, null, List.of(3), null, null, null) .getRecords().get(0); longServiceRequest.setStatusEnum(RequestStatus.DRAFT.getValue());// 请求状态 @@ -349,7 +349,7 @@ public class SpecialAdviceAppServiceImpl implements ISpecialAdviceAppService { adviceBaseDto.setAdviceDefinitionId(transferOrganizationDefinitionId); // 医嘱定义id // 转科的医嘱信息 AdviceBaseDto activityAdviceBaseDto = iDoctorStationAdviceAppService - .getAdviceBaseInfo(adviceBaseDto, null, null, null, null, 1, 1, null, List.of(3), null, null) + .getAdviceBaseInfo(adviceBaseDto, null, null, null, null, 1, 1, null, List.of(3), null, null, null) .getRecords().get(0); // 保存转科医嘱请求 ServiceRequest serviceRequest = new ServiceRequest(); @@ -431,7 +431,7 @@ public class SpecialAdviceAppServiceImpl implements ISpecialAdviceAppService { // 出院的医嘱信息 List adviceList = iDoctorStationAdviceAppService.getAdviceBaseInfo(null, null, null, - List.of(transferOrganizationDefinitionId), null, 1, 1, null, List.of(3), null, null).getRecords(); + List.of(transferOrganizationDefinitionId), null, 1, 1, null, List.of(3), null, null, null).getRecords(); if (CollectionUtils.isEmpty(adviceList)) { return R.fail("未找到出院医嘱定义数据,请确认诊疗目录中已配置出院医嘱"); } diff --git a/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml b/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml index dba7e62b2..2fe602fd9 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml +++ b/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/doctorstation/DoctorStationAdviceAppMapper.xml @@ -128,6 +128,15 @@ AND (T5.instance_table = #{medicationTableName} OR T5.instance_table IS NULL) + + AND t1.category_code IN ('1', '2') + AND t1.inject_flag = 0 + AND t1.id NOT IN ( + SELECT DISTINCT medication_def_id FROM med_medication + WHERE delete_flag = '0' + AND (dose_form_code = '4' OR method_code IN ('4','401','402','403','404','405')) + ) + ) UNION ALL @@ -721,7 +730,7 @@ AND T1.refund_device_id IS NULL ORDER BY T1.status_enum) UNION ALL - (SELECT CASE WHEN T1.category_enum = 4 THEN 6 ELSE 3 END AS advice_type, + (SELECT CASE WHEN T1.category_enum = 4 THEN 6 WHEN T1.category_enum = 8 THEN 8 ELSE 3 END AS advice_type, T1.id AS request_id, T1.id || '-3' AS unique_key, '' AS prescription_no, diff --git a/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/regdoctorstation/AdviceManageAppMapper.xml b/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/regdoctorstation/AdviceManageAppMapper.xml index e526b053f..5c75ae1ac 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/regdoctorstation/AdviceManageAppMapper.xml +++ b/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/regdoctorstation/AdviceManageAppMapper.xml @@ -296,7 +296,7 @@ AND T1.refund_device_id IS NULL ORDER BY T1.status_enum) UNION ALL - (SELECT CASE WHEN T1.category_enum IN (4, 24) THEN 6 ELSE 3 END AS advice_type, + (SELECT CASE WHEN T1.category_enum IN (4, 24) THEN 6 WHEN T1.category_enum = 8 THEN 8 ELSE 3 END AS advice_type, T1.id AS request_id, T1.id || '-3' AS unique_key, T1.requester_id AS requester_id, @@ -306,7 +306,7 @@ null AS skin_test_flag, null AS inject_flag, null AS group_id, - COALESCE(T2.NAME, T1.content_json::jsonb->>'surgeryName') AS advice_name, + COALESCE(T2.NAME, T1.content_json::jsonb->>'surgeryName', T1.content_json::jsonb->>'adviceName') AS advice_name, '' AS volume, '' AS lot_number, T1.quantity AS quantity, diff --git a/healthlink-his-server/healthlink-his-common/src/main/java/com/healthlink/his/common/enums/ItemType.java b/healthlink-his-server/healthlink-his-common/src/main/java/com/healthlink/his/common/enums/ItemType.java index 1a5a57076..00bfceba3 100755 --- a/healthlink-his-server/healthlink-his-common/src/main/java/com/healthlink/his/common/enums/ItemType.java +++ b/healthlink-his-server/healthlink-his-common/src/main/java/com/healthlink/his/common/enums/ItemType.java @@ -35,7 +35,12 @@ public enum ItemType implements HisEnumInterface { /** * 手术(前端使用值6,避免与耗材冲突) */ - SURGERY(6, "6", "手术"); + SURGERY(6, "6", "手术"), + + /** + * 文字医嘱 + */ + TEXT(8, "8", "文字"); @EnumValue private Integer value; diff --git a/healthlink-his-ui/src/components/TableLayout/Table.vue b/healthlink-his-ui/src/components/TableLayout/Table.vue index b817c15c1..e8e906951 100755 --- a/healthlink-his-ui/src/components/TableLayout/Table.vue +++ b/healthlink-his-ui/src/components/TableLayout/Table.vue @@ -11,8 +11,8 @@ :height="computedTableHeight" :row-config="{ keyField: rowKey || 'id', isHover: true }" :highlight-current-row="highlightCurrentRow" - :show-overflow="true" - :show-header-overflow="title" + show-overflow="title" + show-header-overflow="title" :auto-resize="true" :scroll-x="{ enabled: true, gt: 20 }" :scroll-y="{ enabled: true, gt: 50 }" diff --git a/healthlink-his-ui/src/views/drug/inpatientMedicationDispensing/components/MedicationSummary.vue b/healthlink-his-ui/src/views/drug/inpatientMedicationDispensing/components/MedicationSummary.vue index 898b2c13d..61a285807 100755 --- a/healthlink-his-ui/src/views/drug/inpatientMedicationDispensing/components/MedicationSummary.vue +++ b/healthlink-his-ui/src/views/drug/inpatientMedicationDispensing/components/MedicationSummary.vue @@ -87,21 +87,21 @@ title="单据号" align="center" min-width="90" - show-overflow + show-overflow="title" /> - = - - - - - - - -
+ +
- + @@ -162,7 +174,6 @@ :disabled="!isCategoryLoaded" @change=" (value) => { - expandOrder = []; filterPrescriptionList[scope.rowIndex].adviceName = undefined; // 根据选中的医嘱类型,设置对应的 categoryCode const selectedItem = adviceTypeList.find(item => item.value === value); @@ -182,13 +193,17 @@ adviceQueryParams.value = { adviceType: newAdviceType, categoryCode: newCategoryCode, - searchKey: adviceQueryParams.value.searchKey || '', + searchKey: adviceQueryParams.value?.searchKey || '', }; // 直接调用子组件 refresh 方法,立即刷新列表(用 scope.rowIndex 找到当前行的子组件) const tableRef = Array.isArray(adviceTableRef.value) ? adviceTableRef.value[scope.rowIndex] : adviceTableRef.value; if (tableRef && tableRef.refresh) { tableRef.refresh(newAdviceType, newCategoryCode, ''); } + // 文字医嘱没有药品选择步骤,选类型后直接展开编辑行 + if (newAdviceType == 8) { + expandTextRow(scope.rowIndex); + } } " clearable @@ -341,7 +356,7 @@ - +