From 388425084eb56558b1064c26e735fddbaabee9d9 Mon Sep 17 00:00:00 2001
From: suizihe <2958847195@qq.com>
Date: Thu, 23 Oct 2025 16:01:34 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B0=B1=E8=AF=8A=E5=92=8C?=
=?UTF-8?q?=E5=A4=8D=E8=AF=8A=E7=9A=84=E9=80=89=E5=AE=9A=E6=8C=89=E9=92=AE?=
=?UTF-8?q?=E5=92=8C=E5=88=A4=E6=96=AD=E9=80=BB=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/views/doctorstation/index.vue | 103 ++++++++++++------
说明.txt | 2 +-
2 files changed, 73 insertions(+), 32 deletions(-)
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
}}
-
-
- 完诊
-
-
- 暂离
-
-
- 退费
-
-
- 处方单
-
- {
- openDialog = true;
- }
- "
- >
- 办理住院
-
-
+
+
+初诊
+复诊
+
+
+
+ 完诊
+
+
+ 暂离
+
+
+ 退费
+
+
+ 处方单
+
+
+ 办理住院
+
+
@@ -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的连接信息,详见: