From a9de9ee8220e458c5e7672675f296a6cb80b9c90 Mon Sep 17 00:00:00 2001 From: Ranyunqiao <2499115710@qq.com> Date: Fri, 26 Jun 2026 16:55:52 +0800 Subject: [PATCH] bug 628 804 806 818 --- ...orStationChineseMedicalAppServiceImpl.java | 4 +- .../impl/AdviceProcessAppServiceImpl.java | 12 +- .../V20260626_2__seed_tpr_dict_data.sql | 68 +++++++ ...20260626_3__fix_tpr_dict_data_complete.sql | 76 ++++++++ ...0260626__add_encounter_id_to_lab_apply.sql | 12 ++ .../DoctorStationLabApplyMapper.xml | 3 +- .../his/lab/domain/InspectionLabApply.java | 5 + .../inspection/inspectionApplication.vue | 6 +- .../diagnosis/chineseMedicineDialog.vue | 165 +--------------- .../home/components/diagnosis/diagnosis.vue | 177 ++---------------- .../tprsheet/components/addAttr.vue | 43 +++-- 11 files changed, 219 insertions(+), 352 deletions(-) create mode 100644 healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V20260626_2__seed_tpr_dict_data.sql create mode 100644 healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V20260626_3__fix_tpr_dict_data_complete.sql create mode 100644 healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V20260626__add_encounter_id_to_lab_apply.sql 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 7ff2c6c5b..d9c5e86f3 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 @@ -140,8 +140,8 @@ public class DoctorStationChineseMedicalAppServiceImpl implements IDoctorStation .setSourceEnum(ConditionDefinitionSource.TRADITIONAL_CHINESE_MEDICINE_SYNDROME_CATALOG.getValue()); QueryWrapper queryWrapper = HisQueryUtils.buildQueryWrapper(conditionDefinition, searchKey, new HashSet<>(Arrays.asList("name", "py_str", "wb_str")), null); - // 设置排序 - queryWrapper.orderByDesc("update_time"); + // 设置排序(与诊断目录页保持一致,按编码升序,确保取到原始标准编码记录) + queryWrapper.orderByAsc("condition_code"); // 诊断信息 Page conditionDefinitionMetadataPage = HisPageUtils .selectPage(conditionDefinitionMapper, queryWrapper, pageNo, pageSize, ConditionDefinitionMetadata.class); 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 869b2151b..25eaa9717 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 @@ -268,15 +268,9 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService { e.setSingleDose(doseStr + unitStr); } - // 总量:剂量 × 数量 + 单位(仅药品医嘱) - if (e.getDose() != null && e.getQuantity() != null) { - BigDecimal total = e.getDose().multiply(BigDecimal.valueOf(e.getQuantity())); - String totalStr = total.stripTrailingZeros().toPlainString(); - String unitStr = e.getUnitCode_dictText() != null ? e.getUnitCode_dictText() : ""; - e.setTotalAmount(totalStr + unitStr); - } else if (e.getQuantity() != null) { - String unitStr = e.getUnitCode_dictText() != null ? e.getUnitCode_dictText() : ""; - e.setTotalAmount(e.getQuantity() + unitStr); + // 总量:数量(总量就是数量,不需要乘以剂量,单位由前端显示) + if (e.getQuantity() != null) { + e.setTotalAmount(String.valueOf(e.getQuantity())); } // 频次/用法组合 diff --git a/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V20260626_2__seed_tpr_dict_data.sql b/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V20260626_2__seed_tpr_dict_data.sql new file mode 100644 index 000000000..5e45207bd --- /dev/null +++ b/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V20260626_2__seed_tpr_dict_data.sql @@ -0,0 +1,68 @@ +-- Bug #818: TPR变更体温单下拉框无数据 — 补充缺失的字典类型和字典数据 +-- 涉及的字典: temperature_select_type, breathe_unit, measurement_select_type, +-- urination_frequency_unit, stoolfrequency_unit + +-- ============================================================ +-- 1. 插入字典类型 (sys_dict_type) +-- ============================================================ +INSERT INTO sys_dict_type (dict_id, dict_name, dict_type, status, create_by, create_time, remark) +VALUES + (543, '体温测量类型', 'temperature_select_type', '0', 'admin', NOW(), 'TPR体温单-体温下拉选项'), + (544, '呼吸类型', 'breathe_unit', '0', 'admin', NOW(), 'TPR体温单-呼吸下拉选项'), + (545, '测量特殊状态', 'measurement_select_type', '0', 'admin', NOW(), 'TPR体温单-体重/腹围/身高特殊状态'), + (546, '小便次数符号', 'urination_frequency_unit', '0', 'admin', NOW(), 'TPR体温单-小便次数特殊符号'), + (547, '大便次数符号', 'stoolfrequency_unit', '0', 'admin', NOW(), 'TPR体温单-大便次数特殊符号') +ON CONFLICT DO NOTHING; + +-- ============================================================ +-- 2. 插入字典数据 (sys_dict_data) +-- ============================================================ + +-- temperature_select_type: 腋温/口温/额温/耳温/肛温 + 拒测/外出/请假 +-- Codes 1-5 = measurement types (do NOT replace temperature value) +-- Codes 6-8 = special statuses (replace temperature value with text) +INSERT INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time) +VALUES + (4142, 1, '腋温', '1', 'temperature_select_type', '', 'default', 'Y', '0', 'admin', NOW()), + (4143, 2, '口温', '2', 'temperature_select_type', '', 'default', 'N', '0', 'admin', NOW()), + (4144, 3, '额温', '3', 'temperature_select_type', '', 'default', 'N', '0', 'admin', NOW()), + (4145, 4, '耳温', '4', 'temperature_select_type', '', 'default', 'N', '0', 'admin', NOW()), + (4146, 5, '肛温', '5', 'temperature_select_type', '', 'default', 'N', '0', 'admin', NOW()), + (4147, 6, '拒测', '6', 'temperature_select_type', '', 'danger', 'N', '0', 'admin', NOW()), + (4148, 7, '外出', '7', 'temperature_select_type', '', 'warning', 'N', '0', 'admin', NOW()), + (4149, 8, '请假', '8', 'temperature_select_type', '', 'info', 'N', '0', 'admin', NOW()) +ON CONFLICT DO NOTHING; + +-- breathe_unit: 平稳/急促/浅慢/叹息样呼吸/潮式呼吸/抑制呼吸/@ +INSERT INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time) +VALUES + (4150, 1, '平稳', '1', 'breathe_unit', '', 'success', 'Y', '0', 'admin', NOW()), + (4151, 2, '急促', '2', 'breathe_unit', '', 'danger', 'N', '0', 'admin', NOW()), + (4152, 3, '浅慢', '3', 'breathe_unit', '', 'warning', 'N', '0', 'admin', NOW()), + (4153, 4, '叹息样呼吸', '4', 'breathe_unit', '', 'info', 'N', '0', 'admin', NOW()), + (4154, 5, '潮式呼吸', '5', 'breathe_unit', '', 'info', 'N', '0', 'admin', NOW()), + (4155, 6, '抑制呼吸', '6', 'breathe_unit', '', 'danger', 'N', '0', 'admin', NOW()), + (4156, 7, '@', '7', 'breathe_unit', '', 'default', 'N', '0', 'admin', NOW()) +ON CONFLICT DO NOTHING; + +-- measurement_select_type: 卧床/未测 +INSERT INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time) +VALUES + (4157, 1, '卧床', '1', 'measurement_select_type', '', 'warning', 'N', '0', 'admin', NOW()), + (4158, 2, '未测', '2', 'measurement_select_type', '', 'info', 'Y', '0', 'admin', NOW()) +ON CONFLICT DO NOTHING; + +-- urination_frequency_unit: ※/C +INSERT INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time) +VALUES + (4159, 1, '※', '1', 'urination_frequency_unit', '', 'default', 'N', '0', 'admin', NOW()), + (4160, 2, 'C', '2', 'urination_frequency_unit', '', 'default', 'N', '0', 'admin', NOW()) +ON CONFLICT DO NOTHING; + +-- stoolfrequency_unit: ※/☆/人工肛门 +INSERT INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time) +VALUES + (4161, 1, '※', '1', 'stoolfrequency_unit', '', 'default', 'N', '0', 'admin', NOW()), + (4162, 2, '☆', '2', 'stoolfrequency_unit', '', 'default', 'N', '0', 'admin', NOW()), + (4163, 3, '人工肛门', '3', 'stoolfrequency_unit', '', 'default', 'N', '0', 'admin', NOW()) +ON CONFLICT DO NOTHING; diff --git a/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V20260626_3__fix_tpr_dict_data_complete.sql b/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V20260626_3__fix_tpr_dict_data_complete.sql new file mode 100644 index 000000000..a6b085146 --- /dev/null +++ b/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V20260626_3__fix_tpr_dict_data_complete.sql @@ -0,0 +1,76 @@ +-- Bug #818: TPR变更体温单下拉框无数据 — 完整修复 +-- 原因: V20260626_2 使用的 dict_code 4142-4163 已被其他字典占用(rate_code/inpatient_diag_category/separate_decocting), +-- dict_id 543-546 也被占用,导致 ON CONFLICT DO NOTHING 跳过所有插入。 +-- 本迁移使用全新未占用的 dict_id(548-552) 和 dict_code(4237-4258)。 +-- 同时恢复被 V20260626_2 误覆盖的两行原始数据(dict_code 4142→rate_code, 4153→inpatient_diag_category)。 + +-- ============================================================ +-- 1. 恢复被误覆盖的两行原始 dict_type +-- ============================================================ +UPDATE sys_dict_data SET dict_type = 'rate_code' WHERE dict_code = 4142; +UPDATE sys_dict_data SET dict_type = 'inpatient_diag_category' WHERE dict_code = 4153; + +-- ============================================================ +-- 2. 插入字典类型 (sys_dict_type) — dict_id 548-552 +-- ============================================================ +INSERT INTO sys_dict_type (dict_id, dict_name, dict_type, status, create_by, create_time, remark) +VALUES + (548, '体温测量类型', 'temperature_select_type', '0', 'admin', NOW(), 'TPR体温单-体温下拉选项'), + (549, '呼吸类型', 'breathe_unit', '0', 'admin', NOW(), 'TPR体温单-呼吸下拉选项'), + (550, '测量特殊状态', 'measurement_select_type', '0', 'admin', NOW(), 'TPR体温单-体重/腹围/身高特殊状态'), + (551, '小便次数符号', 'urination_frequency_unit', '0', 'admin', NOW(), 'TPR体温单-小便次数特殊符号'), + (552, '大便次数符号', 'stoolfrequency_unit', '0', 'admin', NOW(), 'TPR体温单-大便次数特殊符号') +ON CONFLICT DO NOTHING; + +-- ============================================================ +-- 3. 插入字典数据 (sys_dict_data) — dict_code 4237-4258 +-- ============================================================ + +-- temperature_select_type: 腋温/口温/额温/耳温/肛温 + 拒测/外出/请假 +-- Codes 1-5 = measurement types (do NOT replace temperature value) +-- Codes 6-8 = special statuses (replace temperature value with text) +INSERT INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time) +VALUES + (4237, 1, '腋温', '1', 'temperature_select_type', '', 'default', 'Y', '0', 'admin', NOW()), + (4238, 2, '口温', '2', 'temperature_select_type', '', 'default', 'N', '0', 'admin', NOW()), + (4239, 3, '额温', '3', 'temperature_select_type', '', 'default', 'N', '0', 'admin', NOW()), + (4240, 4, '耳温', '4', 'temperature_select_type', '', 'default', 'N', '0', 'admin', NOW()), + (4241, 5, '肛温', '5', 'temperature_select_type', '', 'default', 'N', '0', 'admin', NOW()), + (4242, 6, '拒测', '6', 'temperature_select_type', '', 'danger', 'N', '0', 'admin', NOW()), + (4243, 7, '外出', '7', 'temperature_select_type', '', 'warning', 'N', '0', 'admin', NOW()), + (4244, 8, '请假', '8', 'temperature_select_type', '', 'info', 'N', '0', 'admin', NOW()) +ON CONFLICT DO NOTHING; + +-- breathe_unit: 平稳/急促/浅慢/叹息样呼吸/潮式呼吸/抑制呼吸/@ +INSERT INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time) +VALUES + (4245, 1, '平稳', '1', 'breathe_unit', '', 'success', 'Y', '0', 'admin', NOW()), + (4246, 2, '急促', '2', 'breathe_unit', '', 'danger', 'N', '0', 'admin', NOW()), + (4247, 3, '浅慢', '3', 'breathe_unit', '', 'warning', 'N', '0', 'admin', NOW()), + (4248, 4, '叹息样呼吸', '4', 'breathe_unit', '', 'info', 'N', '0', 'admin', NOW()), + (4249, 5, '潮式呼吸', '5', 'breathe_unit', '', 'info', 'N', '0', 'admin', NOW()), + (4250, 6, '抑制呼吸', '6', 'breathe_unit', '', 'danger', 'N', '0', 'admin', NOW()), + (4251, 7, '@', '7', 'breathe_unit', '', 'default', 'N', '0', 'admin', NOW()) +ON CONFLICT DO NOTHING; + +-- measurement_select_type: 卧床/未测 +INSERT INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time) +VALUES + (4252, 1, '卧床', '1', 'measurement_select_type', '', 'warning', 'N', '0', 'admin', NOW()), + (4253, 2, '未测', '2', 'measurement_select_type', '', 'info', 'Y', '0', 'admin', NOW()) +ON CONFLICT DO NOTHING; + +-- urination_frequency_unit: ※/C +INSERT INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time) +VALUES + (4254, 1, '※', '1', 'urination_frequency_unit', '', 'default', 'N', '0', 'admin', NOW()), + (4255, 2, 'C', '2', 'urination_frequency_unit', '', 'default', 'N', '0', 'admin', NOW()) +ON CONFLICT DO NOTHING; + +-- stoolfrequency_unit: ※/☆/人工肛门 +INSERT INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time) +VALUES + (4256, 1, '※', '1', 'stoolfrequency_unit', '', 'default', 'N', '0', 'admin', NOW()), + (4257, 2, '☆', '2', 'stoolfrequency_unit', '', 'default', 'N', '0', 'admin', NOW()), + (4258, 3, '人工肛门', '3', 'stoolfrequency_unit', '', 'default', 'N', '0', 'admin', NOW()) +ON CONFLICT DO NOTHING; diff --git a/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V20260626__add_encounter_id_to_lab_apply.sql b/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V20260626__add_encounter_id_to_lab_apply.sql new file mode 100644 index 000000000..42c90542d --- /dev/null +++ b/healthlink-his-server/healthlink-his-application/src/main/resources/db/migration/V20260626__add_encounter_id_to_lab_apply.sql @@ -0,0 +1,12 @@ +-- Bug #806: lab_apply 表增加 encounter_id 列,用于按就诊流水隔离检验申请单 +ALTER TABLE lab_apply ADD COLUMN IF NOT EXISTS encounter_id bigint; + +-- 对已有数据:尝试通过 visit_no 关联 adm_encounter.bus_no 回填 encounter_id +UPDATE lab_apply la +SET encounter_id = ae.id +FROM adm_encounter ae +WHERE la.visit_no IS NOT NULL + AND la.visit_no <> '' + AND la.visit_no = ae.bus_no + AND la.delete_flag = '0' + AND ae.delete_flag = '0'; diff --git a/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/doctorstation/DoctorStationLabApplyMapper.xml b/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/doctorstation/DoctorStationLabApplyMapper.xml index fb8d38545..d7040f210 100755 --- a/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/doctorstation/DoctorStationLabApplyMapper.xml +++ b/healthlink-his-server/healthlink-his-application/src/main/resources/mapper/doctorstation/DoctorStationLabApplyMapper.xml @@ -23,9 +23,8 @@ t1.apply_status AS applyStatus, t1.apply_remark AS applyRemark FROM lab_apply AS t1 - INNER JOIN adm_encounter AS t3 ON t1.patient_id::bigint = t3.patient_id WHERE t1.delete_flag = '0' - AND t3.id = #{encounterId} + AND t1.encounter_id = #{encounterId} ORDER BY t1.apply_time DESC diff --git a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/lab/domain/InspectionLabApply.java b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/lab/domain/InspectionLabApply.java index cd5d03479..141f87161 100755 --- a/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/lab/domain/InspectionLabApply.java +++ b/healthlink-his-server/healthlink-his-domain/src/main/java/com/healthlink/his/lab/domain/InspectionLabApply.java @@ -124,6 +124,11 @@ public class InspectionLabApply extends HisBaseEntity { * 备注 */ private String applyRemark; + /** + * 就诊ID(本次就诊流水,用于数据隔离) + */ + @JsonSerialize(using = ToStringSerializer.class) + private Long encounterId; /** * 操作员工号 */ diff --git a/healthlink-his-ui/src/views/doctorstation/components/inspection/inspectionApplication.vue b/healthlink-his-ui/src/views/doctorstation/components/inspection/inspectionApplication.vue index 96a7e016d..5694128ae 100755 --- a/healthlink-his-ui/src/views/doctorstation/components/inspection/inspectionApplication.vue +++ b/healthlink-his-ui/src/views/doctorstation/components/inspection/inspectionApplication.vue @@ -2001,16 +2001,16 @@ const formatAmount = (amount) => { // 单据状态标签文字 const getStatusLabel = (applyStatus, row) => { - // applyStatus: 0=待开立, 1=已开立(已签发) + // applyStatus: 0=待签发, 1=已签发 // 结合收费/执行标记推导更丰富的状态 if (applyStatus === 1) { // 已收费后根据执行标记判断 if (row.needExecute === true) { return '已执行' } - return '已开立' + return '已签发' } - return '待开立' + return '待签发' } // 单据状态标签颜色 diff --git a/healthlink-his-ui/src/views/inpatientDoctor/home/components/diagnosis/chineseMedicineDialog.vue b/healthlink-his-ui/src/views/inpatientDoctor/home/components/diagnosis/chineseMedicineDialog.vue index 0773bb63f..65afa150f 100755 --- a/healthlink-his-ui/src/views/inpatientDoctor/home/components/diagnosis/chineseMedicineDialog.vue +++ b/healthlink-his-ui/src/views/inpatientDoctor/home/components/diagnosis/chineseMedicineDialog.vue @@ -40,18 +40,20 @@ label="中医证候" prop="syndromeCode" > - + > + + @@ -416,12 +419,6 @@ const rowIndex = ref(); const diagnosis = ref(); const orgOrUser = ref(); const syndromeOptions = ref([]); -const cascaderRefs = ref({}); -const setCascaderRef = (el, index) => { - if (el) { - cascaderRefs.value[index] = el; - } -}; const form = ref({ diagnosisList: [], }); @@ -854,43 +851,11 @@ function loadSyndromeOptions(row) { } // 中医证候选中赋值 -function handleSyndromeSelect(val, row, rowIndex) { - console.log('handleSyndromeSelect called with:', val, 'rowIndex:', rowIndex); +function handleSyndromeSelect(val, row) { if (val) { - if (val === 'root-bagang' || val === 'root-weizhong' || val === 'root-other' || (typeof val === 'string' && val.startsWith('virtual-'))) { - row.tcmSyndromeCode = ''; - row.tcmSyndromeName = ''; - row.syndromeDefinitionId = ''; - return; - } const selected = (row.syndromeOptions || []).find((item) => item.value === val); row.tcmSyndromeName = selected ? selected.label : ''; row.syndromeDefinitionId = selected ? selected.id : ''; - - // Close the cascader dropdown programmatically - if (rowIndex !== undefined && cascaderRefs.value[rowIndex]) { - const refEl = cascaderRefs.value[rowIndex]; - console.log('Cascader Ref component instance:', refEl); - if (refEl) { - if (typeof refEl.togglePopperVisible === 'function') { - refEl.togglePopperVisible(false); - } - if (typeof refEl.toggleDropDownVisible === 'function') { - refEl.toggleDropDownVisible(false); - } - refEl.popperVisible = false; - if (typeof refEl.blur === 'function') { - refEl.blur(); - } - } - } - if (document.activeElement && typeof document.activeElement.blur === 'function') { - console.log('Blurring active element:', document.activeElement); - document.activeElement.blur(); - } - setTimeout(() => { - document.body.click(); - }, 50); } else { row.tcmSyndromeName = ''; row.syndromeDefinitionId = ''; @@ -1232,126 +1197,6 @@ function handleNodeClick(data) { } } -function getGroupedSyndromeOptions(options) { - if (!options || !options.length) return []; - - const seen = new Set(); - const uniqueOptions = []; - options.forEach(item => { - if (!seen.has(item.label)) { - seen.add(item.label); - uniqueOptions.push(item); - } - }); - - const nameToItems = {}; - uniqueOptions.forEach(item => { - const name = item.label; - if (!nameToItems[name]) { - nameToItems[name] = []; - } - nameToItems[name].push(item); - }); - - // Level 3 Children of 阴证 (寒证, 虚证) - const childrenOfYin = []; - ['寒证', '虚证'].forEach(name => { - if (nameToItems[name]) { - childrenOfYin.push(...nameToItems[name]); - } - }); - - // Level 3 Children of 阳证 (热证, 实证) - const childrenOfYang = []; - ['热证', '实证'].forEach(name => { - if (nameToItems[name]) { - childrenOfYang.push(...nameToItems[name]); - } - }); - - // Level 2 under 八纲总纲 (阴证, 阳证) - const level2OfBagang = []; - - if (nameToItems['阴证']) { - nameToItems['阴证'].forEach(item => { - level2OfBagang.push({ - value: item.value, - label: item.label, - id: item.id, - children: childrenOfYin.length ? childrenOfYin : undefined - }); - }); - } else if (childrenOfYin.length > 0) { - level2OfBagang.push({ - value: 'virtual-yin', - label: '阴证', - children: childrenOfYin - }); - } - - if (nameToItems['阳证']) { - nameToItems['阳证'].forEach(item => { - level2OfBagang.push({ - value: item.value, - label: item.label, - id: item.id, - children: childrenOfYang.length ? childrenOfYang : undefined - }); - }); - } else if (childrenOfYang.length > 0) { - level2OfBagang.push({ - value: 'virtual-yang', - label: '阳证', - children: childrenOfYang - }); - } - - // Level 2 under 危重急症 (闭证, 脱证) - const level2OfWeizhong = []; - ['闭证', '脱证'].forEach(name => { - if (nameToItems[name]) { - level2OfWeizhong.push(...nameToItems[name]); - } - }); - - // Level 2 under 其他证候 (all other syndromes) - const level2OfOther = []; - const specialNames = new Set(['阴证', '阳证', '寒证', '热证', '虚证', '实证', '闭证', '脱证']); - options.forEach(item => { - if (!specialNames.has(item.label)) { - level2OfOther.push(item); - } - }); - - const finalTree = []; - - if (level2OfBagang.length > 0) { - finalTree.push({ - value: 'root-bagang', - label: '八纲总纲', - children: level2OfBagang - }); - } - - if (level2OfWeizhong.length > 0) { - finalTree.push({ - value: 'root-weizhong', - label: '危重急症', - children: level2OfWeizhong - }); - } - - if (level2OfOther.length > 0) { - finalTree.push({ - value: 'root-other', - label: '其他证候', - children: level2OfOther - }); - } - - return finalTree; -} - defineExpose({ getList, getDetail, handleSaveDiagnosis }); diff --git a/healthlink-his-ui/src/views/inpatientNurse/tprsheet/components/addAttr.vue b/healthlink-his-ui/src/views/inpatientNurse/tprsheet/components/addAttr.vue index c5d76094b..0c3f98996 100755 --- a/healthlink-his-ui/src/views/inpatientNurse/tprsheet/components/addAttr.vue +++ b/healthlink-his-ui/src/views/inpatientNurse/tprsheet/components/addAttr.vue @@ -1137,18 +1137,28 @@ const onActionEdit = async (type) => { getTemRequset(); }; // 根据code获取文字 +// 体温(type=1): code 1-5=测量类型(腋温~肛温,不替换值), code 6-8=特殊状态(拒测/外出/请假) +// 呼吸(type=2): code 1-6=呼吸类型(平稳~抑制呼吸,不替换值), code 7=@ +// 血压(type=3): code 1-3=特殊状态(拒测/外出/请假) +// 体重/腹围/身高(type=4/5/6): code 1-2=特殊状态(卧床/未测) +// 小便(type=7): code 1-2=特殊符号(※/C) +// 大便(type=8): code 1-3=特殊符号(※/☆/人工肛门) const selectContent = (code, type) => { let title = ''; if (type == 1) { - if (code == 1) { + // 体温: code 1-5 为测量类型,不替换体温值 + if (code >= 1 && code <= 5) { + title = ''; + } else if (code == 6) { title = '拒测'; - } else if (code == 2) { + } else if (code == 7) { title = '外出'; - } else { + } else if (code == 8) { title = '请假'; } } else if (type == 2) { - if (code == 1) { + // 呼吸: code 1-6 为呼吸类型,不替换呼吸值; code 7=@ + if (code == 7) { title = '@'; } } else if (type == 3) { @@ -1183,25 +1193,30 @@ const selectContent = (code, type) => { return title; }; const temperChange = (row, type = 0) => { + // 只有特殊状态码才替换输入值,测量类型选择不替换 + const replaceValue = (field, content) => { + if (content) row[field] = content; + }; if (type == 1) { - row.temperature = selectContent(row.temperatureUnit, type); + replaceValue('temperature', selectContent(row.temperatureUnit, type)); } else if (type == 2) { - row.breathe = selectContent(row.breatheUnit, type); + replaceValue('breathe', selectContent(row.breatheUnit, type)); } else if (type == 3) { - row.systolicPressure = selectContent(row.pressureUnit, type); - row.diastolicPressure = selectContent(row.pressureUnit, type); - row.bloodPressure = selectContent(row.pressureUnit, type); + const content = selectContent(row.pressureUnit, type); + replaceValue('systolicPressure', content); + replaceValue('diastolicPressure', content); + replaceValue('bloodPressure', content); } else if (type == 4) { - row.weight = selectContent(row.weightUnit, type); + replaceValue('weight', selectContent(row.weightUnit, type)); } else if (type == 5) { - row.waistCircumference = selectContent(row.waistCircumferenceUnit, type); + replaceValue('waistCircumference', selectContent(row.waistCircumferenceUnit, type)); } else if (type == 6) { - row.height = selectContent(row.heightUnit, type); + replaceValue('height', selectContent(row.heightUnit, type)); } else if (type == 7) { - row.urinationFrequency = selectContent(row.urinationFrequencyUnit, type); + replaceValue('urinationFrequency', selectContent(row.urinationFrequencyUnit, type)); } else if (type == 8) { console.log('uuuuuu=========>', row.stoolFrequencyUnit); - row.stoolFrequency = selectContent(row.stoolFrequencyUnit, type); + replaceValue('stoolFrequency', selectContent(row.stoolFrequencyUnit, type)); } }; // 正则只能输入数字(包含小数)