diff --git a/openhis-ui-vue3/src/views/doctorstation/index.vue b/openhis-ui-vue3/src/views/doctorstation/index.vue index 6fe3b570..2256b178 100644 --- a/openhis-ui-vue3/src/views/doctorstation/index.vue +++ b/openhis-ui-vue3/src/views/doctorstation/index.vue @@ -98,35 +98,36 @@ {{ userStore.name }} - - - 完诊 - - - 暂离 - - - 退费 - - - 处方单 - - - 办理住院 - - + + +初诊 +复诊 + + + + 完诊 + + + 暂离 + + + 退费 + + + 处方单 + + + 办理住院 + +
@@ -204,6 +205,7 @@ import { leaveEncounter, completeEncounter, getEnPrescriptionInfo, + getEmrHistoryList } from './components/api.js'; import prescriptionlist from './components/prescription/prescriptionlist.vue'; import RefundListDialog from './components/prescription/refundListDialog.vue'; @@ -260,6 +262,7 @@ const diagnosisRef = ref(); const waitCount = ref(0); const loading = ref(false); const { proxy } = getCurrentInstance(); +const visitType = ref(''); const disabled = computed(() => { return Object.keys(patientInfo.value).length === 0; }); @@ -282,7 +285,41 @@ function getPatientList() { }); }); } - +function setVisitType(type) { + visitType.value = type; +} +function checkPatientHistory(patient) { + // 如果患者没有身份证号,无法判断是否为初诊 + if (!patient.idCard) { + // 默认设置为初诊 + visitType.value = 'FIRST'; + return; + } + + // 查询患者历史就诊记录 + const params = { + patientId: patient.patientId, + idCard: patient.idCard + }; + + getEmrHistoryList(params).then(res => { + if (res.code === 200) { + // 如果有历史记录,则为复诊 + if (res.data && res.data.total > 0) { + visitType.value = 'FOLLOW_UP'; + } else { + // 如果没有历史记录,则为初诊 + visitType.value = 'FIRST'; + } + } else { + // 请求失败,默认设置为初诊 + visitType.value = 'FIRST'; + } + }).catch(() => { + // 异常情况,默认设置为初诊 + visitType.value = 'FIRST'; + }); +} function getWaitPatient() { queryParams.value.registerTimeSTime = formatDateStr(new Date(), 'YYYY-MM-DD') + ' 00:00:00'; queryParams.value.registerTimeETime = formatDateStr(new Date(), 'YYYY-MM-DD') + ' 23:59:59'; @@ -341,7 +378,7 @@ function handleOpen() { } function handleCardClick(item, index) { - currentEncounterId.value = ''; + currentEncounterId.value = ''; // if (item.active) { // patientList.value[index].active = false; // return; @@ -351,6 +388,10 @@ function handleCardClick(item, index) { patient.active = patient.encounterId === item.encounterId; }); patientInfo.value = item; + + // 检查患者历史记录以确定初诊/复诊 + checkPatientHistory(item); + activeTab.value = 'emr'; nextTick(() => { prescriptionRef.value.getListInfo(); diff --git a/说明.txt b/说明.txt index b487db09..cce79d2e 100644 --- a/说明.txt +++ b/说明.txt @@ -3,7 +3,7 @@ jdk17 (必须) node.js-v16.15 (推荐) -PostgreSQL-v16.2 (必须) +PostgreSQL-v16.2 (必须)1 redis (常用稳定版本即可) 需要修改数据库和redis的连接信息,详见: