bug 587 588 589 591
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -32,7 +32,8 @@ public interface IDoctorStationAdviceAppService {
|
||||
*/
|
||||
IPage<AdviceBaseDto> getAdviceBaseInfo(AdviceBaseDto adviceBaseDto, String searchKey, Long locationId,
|
||||
List<Long> adviceDefinitionIdParamList, Long organizationId, Integer pageNo, Integer pageSize,
|
||||
Integer pricingFlag, List<Integer> adviceTypes, String orderPricing, String categoryCode);
|
||||
Integer pricingFlag, List<Integer> adviceTypes, String orderPricing, String categoryCode,
|
||||
Integer dischargeFlag);
|
||||
|
||||
/**
|
||||
* 查询医嘱绑定信息
|
||||
|
||||
@@ -179,7 +179,8 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
|
||||
@Override
|
||||
public IPage<AdviceBaseDto> getAdviceBaseInfo(AdviceBaseDto adviceBaseDto, String searchKey, Long locationId,
|
||||
List<Long> adviceDefinitionIdParamList, Long organizationId, Integer pageNo, Integer pageSize,
|
||||
Integer pricingFlag, List<Integer> adviceTypes, String orderPricing, String categoryCode) {
|
||||
Integer pricingFlag, List<Integer> 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<AdviceBaseDto> 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<AdviceSaveDto> 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直接查询
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -48,12 +48,13 @@ public class DoctorStationAdviceController {
|
||||
@RequestParam(value = "locationId", required = false) Long locationId,
|
||||
@RequestParam(value = "adviceDefinitionIdParamList", required = false) List<Long> adviceDefinitionIdParamList,
|
||||
@RequestParam(value = "organizationId", required = false) Long organizationId,
|
||||
@RequestParam(value = "adviceTypes", defaultValue = "1,2,3") List<Integer> adviceTypes,
|
||||
@RequestParam(value = "adviceTypes", defaultValue = "1,2,3,8") List<Integer> 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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -39,6 +39,7 @@ public interface DoctorStationAdviceAppMapper {
|
||||
@Param("adviceTypes") List<Integer> adviceTypes,
|
||||
@Param("searchKey") String searchKey,
|
||||
@Param("categoryCode") String categoryCode,
|
||||
@Param("dischargeFlag") Integer dischargeFlag,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<AdviceBaseDto> queryWrapper);
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -806,7 +806,7 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
|
||||
// 医嘱详细信息
|
||||
Long orgId = SecurityUtils.getLoginUser().getOrgId();
|
||||
List<AdviceBaseDto> 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<AdviceBaseDto> 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<AdviceBaseDto> deviceInfos = doctorStationAdviceAppService
|
||||
.getAdviceBaseInfo(null, null, null, deviceIds, orgId, 1, 500, Whether.NO.getValue(), List.of(2),
|
||||
null, null)
|
||||
null, null, null)
|
||||
.getRecords();
|
||||
|
||||
DeviceRequest deviceRequest;
|
||||
|
||||
@@ -205,7 +205,7 @@ public class EncounterAutoRollAppServiceImpl implements IEncounterAutoRollAppSer
|
||||
.map(AutoRollNursingDto::getActivityDefinitionId).collect(Collectors.toList());
|
||||
// 诊疗医嘱信息
|
||||
List<AdviceBaseDto> 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<AdviceBaseDto> 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) {
|
||||
|
||||
@@ -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) {
|
||||
// 费用定价
|
||||
|
||||
@@ -198,7 +198,7 @@ public class OrdersGroupPackageAppServiceImpl implements IOrdersGroupPackageAppS
|
||||
// 医嘱下拉详细信息
|
||||
List<AdviceBaseDto> 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<Long, AdviceBaseDto> adviceMap = personalRecords.stream().collect(Collectors
|
||||
.toMap(AdviceBaseDto::getAdviceDefinitionId, advice -> advice, (existing, replacement) -> existing // 如果有重复key,保留第一个
|
||||
@@ -249,7 +249,7 @@ public class OrdersGroupPackageAppServiceImpl implements IOrdersGroupPackageAppS
|
||||
// 医嘱下拉详细信息
|
||||
List<AdviceBaseDto> 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<Long, AdviceBaseDto> adviceMap = personalRecords.stream().collect(Collectors
|
||||
.toMap(AdviceBaseDto::getAdviceDefinitionId, advice -> advice, (existing, replacement) -> existing // 如果有重复key,保留第一个
|
||||
@@ -298,7 +298,7 @@ public class OrdersGroupPackageAppServiceImpl implements IOrdersGroupPackageAppS
|
||||
// 医嘱下拉详细信息
|
||||
List<AdviceBaseDto> 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<Long, AdviceBaseDto> adviceMap = personalRecords.stream().collect(Collectors
|
||||
.toMap(AdviceBaseDto::getAdviceDefinitionId, advice -> advice, (existing, replacement) -> existing // 如果有重复key,保留第一个
|
||||
|
||||
@@ -192,16 +192,18 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
// 药品
|
||||
List<RegAdviceSaveDto> 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<RegAdviceSaveDto> 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<RegAdviceSaveDto> deviceList = regAdviceSaveList.stream()
|
||||
.filter(e -> ItemType.DEVICE.getValue().equals(e.getAdviceType())).collect(Collectors.toList());
|
||||
|
||||
|
||||
// 保存时,校验临时医嘱库存
|
||||
if (AdviceOpType.SAVE_ADVICE.getCode().equals(adviceOpType)) {
|
||||
List<RegAdviceSaveDto> medUpdateList
|
||||
@@ -214,7 +216,8 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
List<RegAdviceSaveDto> 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<AdviceSaveDto> needCheckList = new ArrayList<>(tempCheckList);
|
||||
// 校验库存
|
||||
@@ -627,6 +630,7 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
// 签发操作
|
||||
boolean is_sign = AdviceOpType.SIGN_ADVICE.getCode().equals(adviceOpType);
|
||||
|
||||
|
||||
// 收集已处理的requestId,用于批量更新状态
|
||||
List<Long> 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<Long> medicineRequestIds
|
||||
= medicineList.stream().map(AdviceBatchOpParam::getRequestId).collect(Collectors.toList());
|
||||
// 诊疗(包含护理adviceType=26)
|
||||
// 诊疗(包含护理adviceType=26、文字医嘱adviceType=8)
|
||||
List<AdviceBatchOpParam> 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<Long> activityRequestIds
|
||||
@@ -1100,9 +1110,10 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
.filter(e -> ItemType.MEDICINE.getValue().equals(e.getAdviceType())).collect(Collectors.toList());
|
||||
List<Long> medicineRequestIds
|
||||
= medicineList.stream().map(AdviceBatchOpParam::getRequestId).collect(Collectors.toList());
|
||||
// 诊疗(包含护理adviceType=26)
|
||||
// 诊疗(包含护理adviceType=26、文字医嘱adviceType=8)
|
||||
List<AdviceBatchOpParam> 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<Long> activityRequestIds
|
||||
@@ -1144,9 +1155,10 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
|
||||
.filter(e -> ItemType.MEDICINE.getValue().equals(e.getAdviceType())).collect(Collectors.toList());
|
||||
List<Long> medicineRequestIds
|
||||
= medicineList.stream().map(AdviceBatchOpParam::getRequestId).collect(Collectors.toList());
|
||||
// 诊疗(包含护理adviceType=26)
|
||||
// 诊疗(包含护理adviceType=26、文字医嘱adviceType=8)
|
||||
List<AdviceBatchOpParam> 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<Long> activityRequestIds
|
||||
|
||||
@@ -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<AdviceBaseDto> 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("未找到出院医嘱定义数据,请确认诊疗目录中已配置出院医嘱");
|
||||
}
|
||||
|
||||
@@ -128,6 +128,15 @@
|
||||
<if test="medicationTableName != null">
|
||||
AND (T5.instance_table = #{medicationTableName} OR T5.instance_table IS NULL)
|
||||
</if>
|
||||
<if test="dischargeFlag != null and dischargeFlag == 1">
|
||||
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'))
|
||||
)
|
||||
</if>
|
||||
)
|
||||
<if test="adviceTypes.contains(2) or adviceTypes.contains(3)">UNION ALL</if>
|
||||
</if>
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -35,7 +35,12 @@ public enum ItemType implements HisEnumInterface {
|
||||
/**
|
||||
* 手术(前端使用值6,避免与耗材冲突)
|
||||
*/
|
||||
SURGERY(6, "6", "手术");
|
||||
SURGERY(6, "6", "手术"),
|
||||
|
||||
/**
|
||||
* 文字医嘱
|
||||
*/
|
||||
TEXT(8, "8", "文字");
|
||||
|
||||
@EnumValue
|
||||
private Integer value;
|
||||
|
||||
Reference in New Issue
Block a user