bug 573 588

This commit is contained in:
Ranyunqiao
2026-06-09 13:16:36 +08:00
parent 68b92dfe31
commit 2915915881
3 changed files with 58 additions and 73 deletions

View File

@@ -50,7 +50,6 @@
pt.patient_derived,
pt.education_level,
pt.company_address,
pt.country_code
FROM (
SELECT
(
@@ -105,7 +104,6 @@
p.patient_derived,
p.education_level,
p.company_address,
p.country_code
FROM adm_patient p
where p.delete_flag = '0'
) AS pt

View File

@@ -1,4 +1,4 @@
<template>
<template>
<div>
<el-row :gutter="24">
<el-col
@@ -873,90 +873,66 @@ function handleInfectiousDiseaseReport() {
// 疾病名称到报卡编码的映射(根据传染病报告卡弹窗中的疾病列表)
const diseaseNameToCode = {
// 甲类
'鼠疫': '0101',
'霍乱': '0102',
'鼠疫': '0101', '霍乱': '0102',
// 乙类
'传染性非典型肺炎': '0201',
'艾滋病': '0202',
'病毒性肝炎': '0203',
'脊髓灰质炎': '0204',
'人感染高致病性禽流感': '0205',
'麻疹': '0206',
'流行性出血热': '0207',
'狂犬病': '0208',
'流行性乙型脑炎': '0209',
'登革热': '0210',
'炭疽': '0211',
'细菌性和阿米巴性痢疾': '0212',
'肺结核': '0213',
'伤寒和副伤寒': '0214',
'流行性脑脊髓膜炎': '0215',
'百日咳': '0216',
'白喉': '0217',
'新生儿破伤风': '0218',
'猩红热': '0219',
'布鲁氏菌病': '0220',
'淋病': '0221',
'梅毒': '0222',
'钩端螺旋体病': '0223',
'血吸虫病': '0224',
'疟疾': '0225',
'新型冠状病毒肺炎': '0226',
'甲型H1N1流感': '0227',
'传染性非典型肺炎': '0201', '艾滋病': '0202', '病毒性肝炎': '0203',
'脊髓灰质炎': '0204', '人感染高致病性禽流感': '0205', '麻疹': '0206',
'流行性出血热': '0207', '狂犬病': '0208', '流行性乙型脑炎': '0209',
'登革热': '0210', '炭疽': '0211', '细菌性和阿米巴性痢疾': '0212',
'肺结核': '0213', '伤寒和副伤寒': '0214', '流行性脑脊髓膜炎': '0215',
'百日咳': '0216', '白喉': '0217', '新生儿破伤风': '0218',
'猩红热': '0219', '布鲁氏菌病': '0220', '淋病': '0221',
'梅毒': '0222', '钩端螺旋体病': '0223', '血吸虫病': '0224',
'疟疾': '0225', '新型冠状病毒肺炎': '0226', '甲型H1N1流感': '0227',
'人感染H7N9禽流感': '0228',
// 丙类
'流行性感冒': '0301',
'流行性腮腺炎': '0302',
'风疹': '0303',
'急性出血性结膜炎': '0304',
'麻风病': '0305',
'流行性和地方性斑疹伤寒': '0306',
'黑热病': '0307',
'包虫病': '0308',
'丝虫病': '0309',
'流行性感冒': '0301', '流行性腮腺炎': '0302', '风疹': '0303',
'急性出血性结膜炎': '0304', '麻风病': '0305',
'流行性和地方性斑疹伤寒': '0306', '黑热病': '0307',
'包虫病': '0308', '丝虫病': '0309',
'除霍乱/菌痢/伤寒副伤寒以外的感染性腹泻病': '0310',
'其它感染性腹泻病': '0310',
'手足口病': '0311',
'其它感染性腹泻病': '0310', '手足口病': '0311',
};
// 获取所有需要触发传染病报卡的诊断,跳过已有已提交报卡的诊断
// 判断依据1) 硬编码名称匹配2) 后端配置了 reportTypeCode报卡类型
const infectiousDiagnoses = form.value.diagnosisList
.map(d => {
// 跳过已有已提交报卡的诊断
if (d.hasInfectiousReport === 1) return null;
// 获取所有需要触发传染病报卡的诊断,跳过已有已提交报卡的诊断
const infectiousDiagnoses = [];
let diseaseCode = null;
for (const d of form.value.diagnosisList) {
// 跳过已有已提交报卡的诊断
if (d.hasInfectiousReport === 1) continue;
// 1. 尝试精确名称匹配
if (d.name && diseaseNameToCode[d.name]) {
diseaseCode = diseaseNameToCode[d.name];
}
// 2. 尝试部分名称匹配(如"古典生物型霍乱"包含"霍乱"
else if (d.name && d.reportTypeCode) {
const match = Object.entries(diseaseNameToCode).find(([name]) =>
name && d.name.includes(name)
);
if (match) {
diseaseCode = match[1];
}
}
// 3. 配置了 reportTypeCode 但无名称匹配,仍触发弹窗(不预选疾病)
else if (d.reportTypeCode) {
let diseaseCode = null;
// 1. 精确名称匹配硬编码映射表
if (d.name && diseaseNameToCode[d.name]) {
diseaseCode = diseaseNameToCode[d.name];
}
// 2. 部分名称匹配双向诊断名包含映射key或映射key包含诊断名
else if (d.name && d.reportTypeCode) {
const match = Object.entries(diseaseNameToCode).find(([name]) =>
name && (d.name.includes(name) || name.includes(d.name))
);
if (match) {
diseaseCode = match[1];
} else {
// 3. 诊断目录中配置了报卡类型(reportTypeCode)但无名称匹配,仍触发弹窗
diseaseCode = 'OTHER';
}
}
// 4. 仅有reportTypeCode但name为空
else if (d.reportTypeCode) {
diseaseCode = 'OTHER';
}
if (!diseaseCode) return null;
return { diagnosis: d, diseaseCode };
})
.filter(item => item !== null);
if (diseaseCode) {
infectiousDiagnoses.push({ diagnosis: d, diseaseCode });
}
}
if (infectiousDiagnoses.length === 0) return;
const allSelectedDiseases = infectiousDiagnoses.map(item => item.diseaseCode);
if (allSelectedDiseases.length === 0) {
return;
}
// 优先使用命中传染病映射的主诊断,否则使用第一条命中的传染病诊断
const mainInfectiousDiagnosis = infectiousDiagnoses.find(item => item.diagnosis.maindiseFlag === 1)?.diagnosis;
const firstInfectiousDiagnosis = infectiousDiagnoses[0].diagnosis;

View File

@@ -991,6 +991,10 @@ function clickRowDb({ row, column, event }) {
prescriptionList.value[index] = row;
}
expandOrder.value = [row.uniqueKey];
// VXE Table v4: clearRowExpand 后 expandRowKeys 不再自动响应,需手动调 API 展开
if (prescriptionRef.value?.setRowExpand) {
prescriptionRef.value.setRowExpand([row], true);
}
} else {
proxy.$modal.msgWarning('仅待保存或待签发医嘱允许编辑');
}
@@ -1691,6 +1695,7 @@ function handleSaveSign(row, index) {
const originalAdviceType = row.adviceType;
if (row.adviceType == 7) {
row.adviceType = 1;
row.prescriptionCategory = 3; // 出院带药标记,与 handleSaveBatch/handleSave 保持一致
}
row.conditionId = conditionId.value;
// 处理总量为小单位情况,需要把单价也保存成小单位的
@@ -1717,6 +1722,10 @@ function handleSaveSign(row, index) {
: 0;
row.skinTestFlag_enumText = row.skinTestFlag == 1 ? '是' : '否';
row.contentJson = JSON.stringify(row);
// Bug #589: contentJson 已序列化(含 adviceType=1恢复内存中的出院带药类型显示
if (originalAdviceType == 7) {
row.adviceType = 7;
}
if (row.requestId) {
row.dbOpType = '2';
savePrescription({ regAdviceSaveList: [row] }).then((res) => {
@@ -1882,6 +1891,8 @@ function setValue(row) {
...prevRow,
...baseRow,
uniqueKey: currentUniqueKey, // 确保 uniqueKey 不被覆盖
// Bug #589: 出院带药在 baseRow 中被药品的 adviceType=1 覆盖,此处恢复
adviceType: prevRow.dischargeFlag ? 7 : baseRow.adviceType,
// 🔧 修复执行科室逻辑:
// 1. 非诊疗类型(adviceType!=3)不需要执行科室设为undefined
// 2. 诊疗类型优先使用项目维护的所属科室(row.orgId)其次positionId