fix(doctorstation): 解决医嘱开具和报告查询中的问题

- 修复医嘱开具时诊断验证警告显示逻辑,支持可选的警告提示
- 修复中医医嘱库存检查条件判断逻辑
- 修复中医医嘱表单验证后数据处理逻辑,添加剂量单位字典值设置
- 优化报告查询处理,独立处理检查和检验报告查询,避免相互影响
- 修复LIS和PACS报告地址配置缺失时的处理逻辑,改为警告而非异常抛出
This commit is contained in:
2026-01-08 16:32:45 +08:00
parent 062c4a92b8
commit 58936c957d
4 changed files with 56 additions and 35 deletions

View File

@@ -959,12 +959,14 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
// LIS查看报告地址
String lisReportUrl = TenantOptionUtil.getOptionContent(TenantOptionDict.LIS_REPORT_URL);
if (StringUtils.isEmpty(lisReportUrl)) {
throw new ServiceException("租户配置项【LIS查看报告地址】未配置");
log.warn("租户配置项【LIS查看报告地址】未配置");
}
List<ProofAndTestResultDto> proofResult = doctorStationAdviceAppMapper.getProofAndTestResult(encounterId,
RequestStatus.DRAFT.getValue(), ActivityType.PROOF.getValue());
for (ProofAndTestResultDto proofAndTestResultDto : proofResult) {
proofAndTestResultDto.setRequestUrl(lisReportUrl.concat(proofAndTestResultDto.getBusNo()));
if (StringUtils.isNotEmpty(lisReportUrl)) {
proofAndTestResultDto.setRequestUrl(lisReportUrl.concat(proofAndTestResultDto.getBusNo()));
}
}
return R.ok(proofResult);
@@ -981,12 +983,14 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
// PACS查看报告地址
String pacsReportUrl = TenantOptionUtil.getOptionContent(TenantOptionDict.PACS_REPORT_URL);
if (StringUtils.isEmpty(pacsReportUrl)) {
throw new ServiceException("租户配置项【PACS查看报告地址】未配置");
log.warn("租户配置项【PACS查看报告地址】未配置");
}
List<ProofAndTestResultDto> testResult = doctorStationAdviceAppMapper.getProofAndTestResult(encounterId,
RequestStatus.DRAFT.getValue(), ActivityType.TEST.getValue());
for (ProofAndTestResultDto proofAndTestResultDto : testResult) {
proofAndTestResultDto.setRequestUrl(pacsReportUrl.concat(proofAndTestResultDto.getBusNo()));
if (StringUtils.isNotEmpty(pacsReportUrl)) {
proofAndTestResultDto.setRequestUrl(pacsReportUrl.concat(proofAndTestResultDto.getBusNo()));
}
}
return R.ok(testResult);
}

View File

@@ -1106,7 +1106,7 @@ onMounted(() => {
document.addEventListener('keydown', escKeyListener);
// 初始化时自动创建第一个西药处方
if (westernPrescriptions.value.length === 0) {
handleAddPrescription();
handleAddPrescription(null, false);
}
});
@@ -1531,7 +1531,7 @@ function getListInfo(addNewRow) {
});
getGroupMarkers(); // 更新标记
if (props.activeTab == 'prescription' && addNewRow) {
handleAddPrescription();
handleAddPrescription(null, false);
}
// 在所有异步操作完成后 resolve Promise
@@ -1595,14 +1595,16 @@ function handleSelectionChange(selection, row) {
}
// 新增医嘱
function handleAddPrescription(prescriptionId) {
function handleAddPrescription(prescriptionId, showWarning = true) {
// 如果传入了处方ID先切换到该处方
if (prescriptionId && prescriptionId !== currentPrescriptionId.value) {
switchToActivePrescription(prescriptionId);
}
if (diagnosisList.value.length == 0) {
proxy.$modal.msgWarning('请先保存诊断后再开立医嘱');
if (showWarning) {
proxy.$modal.msgWarning('请先保存诊断后再开立医嘱');
}
return;
}
if (isAdding.value) {
@@ -2291,7 +2293,7 @@ function handleSaveSign(row, index, prescriptionId) {
});
} else {
if (prescriptionList.value[0].adviceName) {
handleAddPrescription();
handleAddPrescription(null, false);
}
}
adviceQueryParams.value.adviceType = undefined;

View File

@@ -145,14 +145,20 @@ const fetchAll = async () => {
}
loadingCheck.value = true;
loadingInspection.value = true;
try {
await Promise.all([fetchCheckReport(), fetchInspectionReport()]);
} catch (e) {
proxy.$modal?.msgError?.(e.message || '查询报告失败');
} finally {
loadingCheck.value = false;
loadingInspection.value = false;
}
// 独立处理,互不影响
const runFetch = async (fn, loadingRef, name) => {
try {
await fn();
} catch (e) {
proxy.$modal?.msgError?.(`${name}查询失败: ${e.message || '未知错误'}`);
} finally {
loadingRef.value = false;
}
};
runFetch(fetchCheckReport, loadingCheck, '检查报告');
runFetch(fetchInspectionReport, loadingInspection, '检验报告');
};
const handleRefreshCheck = async () => {

View File

@@ -893,7 +893,7 @@ function selectAdviceBase(key, row, pIndex) {
).chargeItemDefinitionId;
// 库存列表 + 价格列表拼成批次号的下拉框
if (row.adviceType != 3) {
if (row.adviceType == 1 || row.adviceType == 2) {
if (row.inventoryList && row.inventoryList.length == 0) {
prescription.expandOrder = [];
proxy.$modal.msgWarning('该项目无库存');
@@ -1069,23 +1069,32 @@ function handleSaveSign(row, index, pIndex) {
const prescription = tcmPrescriptionList.value[pIndex];
const formRefName = 'formRef' + pIndex + '-' + index;
proxy.$refs[formRefName][0].validate((valid) => {
row.isEdit = false;
prescription.isAdding = false;
prescription.expandOrder = [];
row.contentJson = undefined;
row.patientId = props.patientInfo.patientId;
row.encounterId = props.patientInfo.encounterId;
row.accountId = prescription.accountId;
row.quantity = row.minUnitQuantity;
row.conditionId = prescription.conditionId;
row.unitPrice =
row.unitCodeList.find((item) => item.value == row.unitCode).type == 'unit'
? row.unitPrice
: new Decimal(row.unitPrice).div(row.partPercent).toFixed(2);
row.conditionDefinitionId = prescription.conditionDefinitionId;
row.encounterDiagnosisId = prescription.encounterDiagnosisId;
row.diagnosisName = prescription.diagnosisName;
row.contentJson = JSON.stringify(row);
if (valid) {
row.isEdit = false;
prescription.isAdding = false;
prescription.expandOrder = [];
row.contentJson = undefined;
row.patientId = props.patientInfo.patientId;
row.encounterId = props.patientInfo.encounterId;
row.accountId = prescription.accountId;
row.quantity = row.minUnitQuantity;
row.chineseHerbsDoseQuantity = prescription.chineseHerbsDoseQuantity;
row.unitPrice =
row.unitCodeList.find((item) => item.value == row.unitCode).type == 'unit'
? row.unitPrice
: new Decimal(row.unitPrice).div(row.partPercent).toFixed(2);
row.conditionDefinitionId = prescription.conditionDefinitionId;
row.encounterDiagnosisId = prescription.encounterDiagnosisId;
row.diagnosisName = prescription.diagnosisName;
// 寻找当前选中的单位字典值
const selectedUnit = row.unitCodeList.find((item) => item.value === row.minUnitCode);
if (selectedUnit) {
row.doseUnitCode_dictText = selectedUnit.label;
}
row.contentJson = JSON.stringify(row);
}
});
}