Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
@@ -28,7 +28,19 @@ public enum YbDiagType {
|
||||
/**
|
||||
* 中医主证诊断
|
||||
*/
|
||||
TCM_MAIN_SYNDROME_DIAGNOSIS(3, "中医主证诊断");
|
||||
TCM_MAIN_SYNDROME_DIAGNOSIS(3, "中医主证诊断"),
|
||||
/**
|
||||
* 初诊诊断
|
||||
*/
|
||||
INITIAL_DIAGNOSIS(4, "初诊诊断"),
|
||||
/**
|
||||
* 修正诊断
|
||||
*/
|
||||
REVISED_DIAGNOSIS(5, "修正诊断"),
|
||||
/**
|
||||
* 补充诊断
|
||||
*/
|
||||
SUPPLEMENTARY_DIAGNOSIS(6, "补充诊断");
|
||||
|
||||
private Integer value;
|
||||
private String description;
|
||||
@@ -38,7 +50,7 @@ public enum YbDiagType {
|
||||
return null;
|
||||
}
|
||||
for (YbDiagType val : values()) {
|
||||
if (val.getValue().equals(value)) {
|
||||
if (val.getValue().toString().equals(value)) {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
|
||||
109
openhis-ui-vue3/src/utils/medicalConstants.js
Normal file
109
openhis-ui-vue3/src/utils/medicalConstants.js
Normal file
@@ -0,0 +1,109 @@
|
||||
/**
|
||||
* 医疗常量配置
|
||||
* 从字典动态获取常量值,避免硬编码
|
||||
*
|
||||
* 使用方式:
|
||||
* import { DIAG_TYPE } from '@/utils/medicalConstants';
|
||||
* medTypeCode: DIAG_TYPE.WESTERN_MEDICINE
|
||||
*/
|
||||
|
||||
import { getDicts } from '@/api/system/dict/data';
|
||||
|
||||
// 诊断类型字典缓存
|
||||
let diagTypeCache = null;
|
||||
|
||||
/**
|
||||
* 获取诊断类型字典(异步初始化)
|
||||
*/
|
||||
async function initDiagType() {
|
||||
if (!diagTypeCache) {
|
||||
try {
|
||||
const res = await getDicts('diag_type');
|
||||
diagTypeCache = res.data || [];
|
||||
} catch (error) {
|
||||
console.error('获取诊断类型字典失败:', error);
|
||||
diagTypeCache = [];
|
||||
}
|
||||
}
|
||||
return diagTypeCache;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据标签获取诊断类型的值
|
||||
* @param {string} label - 诊断类型标签,如 '西医诊断'
|
||||
* @returns {string|null} - 诊断类型的值,如 '1'
|
||||
*/
|
||||
export async function getDiagTypeValue(label) {
|
||||
const dictList = await initDiagType();
|
||||
const item = dictList.find(d => d.dictLabel === label);
|
||||
return item ? item.dictValue : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据值获取诊断类型的标签
|
||||
* @param {string} value - 诊断类型的值,如 '1'
|
||||
* @returns {string|null} - 诊断类型的标签,如 '西医诊断'
|
||||
*/
|
||||
export async function getDiagTypeLabel(value) {
|
||||
const dictList = await initDiagType();
|
||||
const item = dictList.find(d => d.dictValue === value);
|
||||
return item ? item.dictLabel : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取完整的诊断类型字典列表
|
||||
* @returns {Array} - 诊断类型字典列表
|
||||
*/
|
||||
export async function getDiagTypeList() {
|
||||
return await initDiagType();
|
||||
}
|
||||
|
||||
/**
|
||||
* 诊断类型常量(同步使用,需要先初始化字典)
|
||||
* 注意:这些值在字典加载后才有效
|
||||
*/
|
||||
export const DIAG_TYPE = {
|
||||
/** 西医诊断 */
|
||||
WESTERN_MEDICINE: '1',
|
||||
/** 中医主病诊断 */
|
||||
TCM_MAIN_DISEASE: '2',
|
||||
/** 中医主证诊断 */
|
||||
TCM_MAIN_SYNDROME: '3',
|
||||
/** 初诊诊断 */
|
||||
INITIAL: '4',
|
||||
/** 修正诊断 */
|
||||
REVISED: '5',
|
||||
/** 补充诊断 */
|
||||
SUPPLEMENTARY: '6',
|
||||
};
|
||||
|
||||
/**
|
||||
* 诊断类型常量的说明信息
|
||||
*/
|
||||
export const DIAG_TYPE_DESCRIPTIONS = {
|
||||
'1': '西医诊断',
|
||||
'2': '中医主病诊断',
|
||||
'3': '中医主证诊断',
|
||||
'4': '初诊诊断',
|
||||
'5': '修正诊断',
|
||||
'6': '补充诊断',
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取诊断类型的说明
|
||||
* @param {string} value - 诊断类型的值
|
||||
* @returns {string} - 说明信息
|
||||
*/
|
||||
export function getDiagTypeDescription(value) {
|
||||
return DIAG_TYPE_DESCRIPTIONS[value] || '未知类型';
|
||||
}
|
||||
|
||||
// 默认导出
|
||||
export default {
|
||||
DIAG_TYPE,
|
||||
DIAG_TYPE_DESCRIPTIONS,
|
||||
getDiagTypeValue,
|
||||
getDiagTypeLabel,
|
||||
getDiagTypeList,
|
||||
getDiagTypeDescription,
|
||||
};
|
||||
@@ -94,6 +94,7 @@ import {
|
||||
updateTcmDiagnosis,
|
||||
getTcmDiagnosis,
|
||||
} from '@/views/doctorstation/components/api';
|
||||
import { DIAG_TYPE } from '@/utils/medicalConstants';
|
||||
|
||||
const props = defineProps({
|
||||
openAddDiagnosisDialog: {
|
||||
@@ -120,6 +121,11 @@ const selectedDisease = ref(false);
|
||||
const { proxy } = getCurrentInstance();
|
||||
const emit = defineEmits(['close']);
|
||||
|
||||
|
||||
|
||||
// 获取诊断类型字典
|
||||
const { diag_type } = proxy.useDict('diag_type');
|
||||
|
||||
function handleOpen() {
|
||||
// 获取诊断列表
|
||||
getTcmCondition().then((res) => {
|
||||
@@ -227,7 +233,7 @@ function handleClickRow(row) {
|
||||
ybNo: row.ybNo,
|
||||
syndromeGroupNo: timestamp.value,
|
||||
verificationStatusEnum: 4,
|
||||
medTypeCode: undefined, // 不设默认值
|
||||
medTypeCode: DIAG_TYPE.TCM_MAIN_DISEASE, // 诊断类型:中医主病诊断 (值:2)
|
||||
isExisting: false // 标记为新增
|
||||
});
|
||||
tcmDiagonsisList.value.push({
|
||||
@@ -255,6 +261,7 @@ function clickSyndromeRow(row) {
|
||||
definitionId: row.id,
|
||||
ybNo: row.ybNo,
|
||||
syndromeGroupNo: timestamp.value,
|
||||
medTypeCode: DIAG_TYPE.TCM_MAIN_SYNDROME, // 诊断类型:中医主证诊断 (值:3)
|
||||
isExisting: false // 标记为新增
|
||||
});
|
||||
tcmDiagonsisList.value[tcmDiagonsisList.value.length - 1].syndromeName = row.name;
|
||||
@@ -381,7 +388,6 @@ function close() {
|
||||
gap: 20px;
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
|
||||
.disease-section,
|
||||
.syndrome-section,
|
||||
.diagnosis-section {
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
<el-form-item :prop="`diagnosisList.${scope.$index}.medTypeCode`" :rules="rules.medTypeCode">
|
||||
<el-select v-model="scope.row.medTypeCode" placeholder=" " style="width: 150px">
|
||||
<el-option
|
||||
v-for="item in med_type"
|
||||
v-for="item in diag_type"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
@@ -264,6 +264,7 @@ import {
|
||||
isFoodDiseasesNew,
|
||||
saveDiagnosis,
|
||||
} from '../api';
|
||||
import { DIAG_TYPE } from '@/utils/medicalConstants';
|
||||
import diagnosisdialog from '../diagnosis/diagnosisdialog.vue';
|
||||
import AddDiagnosisDialog from './addDiagnosisDialog.vue';
|
||||
import diagnosislist from '../diagnosis/diagnosislist.vue';
|
||||
@@ -293,7 +294,7 @@ const props = defineProps({
|
||||
const emits = defineEmits(['diagnosisSave']);
|
||||
const { proxy } = getCurrentInstance();
|
||||
const userStore = useUserStore();
|
||||
const { med_type } = proxy.useDict('med_type');
|
||||
const { diag_type } = proxy.useDict('diag_type');
|
||||
const { diagnosis_classification } = proxy.useDict('diagnosis_classification');
|
||||
const { long_term_flag } = proxy.useDict('long_term_flag');
|
||||
|
||||
@@ -340,13 +341,15 @@ async function getList() {
|
||||
});
|
||||
emits('diagnosisSave', false);
|
||||
}
|
||||
maxNo = form.value.diagnosisList.length;
|
||||
// 获取现有诊断的排序号集合,用于判断是否重复
|
||||
const existingDiagSrtNoSet = new Set(form.value.diagnosisList.map(item => item.diagSrtNo));
|
||||
|
||||
const tcmRes = await getTcmDiagnosis({ encounterId: props.patientInfo.encounterId });
|
||||
if (tcmRes.code == 200) {
|
||||
if (tcmRes.data.illness.length > 0) {
|
||||
tcmRes.data.illness.forEach((item, index) => {
|
||||
if (item.diagSrtNo <= maxNo) {
|
||||
// 如果该排序号的诊断已存在,则跳过(避免重复添加)
|
||||
if (existingDiagSrtNoSet.has(item.diagSrtNo)) {
|
||||
return;
|
||||
}
|
||||
form.value.diagnosisList.push({
|
||||
@@ -363,7 +366,8 @@ async function getList() {
|
||||
symptomDefinitionId : tcmRes.data.symptom[index].definitionId,
|
||||
symptomYbNo: tcmRes.data.symptom[index].ybNo,
|
||||
});
|
||||
maxNo = item.diagSrtNo;
|
||||
// 添加后更新集合
|
||||
existingDiagSrtNoSet.add(item.diagSrtNo);
|
||||
});
|
||||
}
|
||||
emits('diagnosisSave', false);
|
||||
@@ -402,7 +406,7 @@ function handleImport() {
|
||||
form.value.diagnosisList.push({
|
||||
...item,
|
||||
...{
|
||||
medTypeCode: '140104',
|
||||
medTypeCode: DIAG_TYPE.WESTERN_MEDICINE, // 诊断类型:西医诊断 (值:1)
|
||||
verificationStatusEnum: 4,
|
||||
definitionId: item.id,
|
||||
diagSrtNo: maxSortNo + index + 1,
|
||||
@@ -508,7 +512,7 @@ function handleAddDiagnosis() {
|
||||
showPopover: false,
|
||||
name: undefined,
|
||||
verificationStatusEnum: 4,
|
||||
medTypeCode: '11',
|
||||
medTypeCode: DIAG_TYPE.WESTERN_MEDICINE, // 诊断类型:西医诊断 (值:1)
|
||||
diagSrtNo: maxSortNo + 1,
|
||||
iptDiseTypeCode: 2,
|
||||
diagnosisDesc: '',
|
||||
@@ -770,7 +774,7 @@ form.value.diagnosisList.push({
|
||||
ybNo: data.ybNo,
|
||||
name: data.name,
|
||||
verificationStatusEnum: 4,
|
||||
medTypeCode: '11',
|
||||
medTypeCode: DIAG_TYPE.WESTERN_MEDICINE, // 诊断类型:西医诊断 (值:1)
|
||||
diagSrtNo: maxSortNo + 1,
|
||||
definitionId: data.definitionId,
|
||||
classification: '西医', // 默认为西医
|
||||
|
||||
Reference in New Issue
Block a user