fix(#572): 请修复 Bug #572:[一般] [门诊医生工作站-诊断] 传染病报告卡未自动同步并填充患者档案中的“现住址”与“职业”信息
根因: - 医生站 `PatientInfoDto` 中不包含患者地址和职业字段,传染病报卡弹窗的 `show()` 函数使用 `diagnosisData?.addressProv || ''`(诊断数据中的地址,始终为空)和硬编码 `occupation: ''`,完全未从患者档案获取数据。 - ### 修改内容(4 个文件) - 后端 (2 文件)** - | 文件 | 变更 | - |---|---| - | `openhis-application/.../dto/PatientDetailsDto.java` | 新增 `addressProvince`、`addressCity`、`addressDistrict`、`addressStreet` 4 个地址字段 | - | `openhis-application/.../mapper/doctorstation/DoctorStationPtDetailsAppMapper.xml` | SQL 查询增加 `p.address_province`、`p.address_city`、`p.address_district`、`p.address_street` | - 前端 (2 文件)** - | 文件 | 变更 | - |---|---| - | `src/views/doctorstation/components/api.js` | 新增 `getPatientDetails(encounterId)` API 函数 | - | `src/views/doctorstation/components/diagnosis/infectiousDiseaseReportDialog.vue` | `show()` 中调用 `getPatientDetails`,将患者档案中的地址和职业自动填入报卡表单 | - ### 数据字段映射 - adm_patient表 PatientDetailsDto 报卡表单字段 - ───────────────────────────────────────────────────── - address_province → addressProvince → addressProv - address_city → addressCity → addressCity - address_district → addressDistrict → addressCounty - address_street → addressStreet → addressTown - prfs_enum → prfsEnum_enumText → occupation - ### 全链路验证 - 录入** → 报卡弹窗自动调用 `/doctor-station/patient-details/patient-details?encounterId=X` ✓ - 保存** → 地址和职业字段已包括在 `saveInfectiousDiseaseReport` 提交数据中 ✓ - 查询/回显** → `showReport()` 正确读取已有报卡的地址和职业 ✓ - 编译** → 前端 `npm run lint` ✓,后端 `mvn compile` ✓ 修复: - 变更摘要
This commit is contained in:
@@ -63,6 +63,18 @@ public class PatientDetailsDto {
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/** 地址省 */
|
||||
private String addressProvince;
|
||||
|
||||
/** 地址市 */
|
||||
private String addressCity;
|
||||
|
||||
/** 地址区 */
|
||||
private String addressDistrict;
|
||||
|
||||
/** 地址街道 */
|
||||
private String addressStreet;
|
||||
|
||||
/**
|
||||
* 工作单位
|
||||
*/
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
p.birth_date,
|
||||
p.phone,
|
||||
p.address,
|
||||
p.address_province,
|
||||
p.address_city,
|
||||
p.address_district,
|
||||
p.address_street,
|
||||
p.work_company,
|
||||
p.nationality_code,
|
||||
p.marital_status_enum,
|
||||
|
||||
@@ -1232,3 +1232,14 @@ export function exportInfectiousCards(data) {
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取患者详情(含地址、职业信息)
|
||||
*/
|
||||
export function getPatientDetails(encounterId) {
|
||||
return request({
|
||||
url: '/doctor-station/patient-details/patient-details',
|
||||
method: 'get',
|
||||
params: { encounterId },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -972,7 +972,7 @@
|
||||
<script setup>
|
||||
import { ref, computed, getCurrentInstance, watch } from 'vue';
|
||||
import pcas from 'china-division/dist/pcas-code.json';
|
||||
import { saveInfectiousDiseaseReport, getNextCardNo } from '../api';
|
||||
import { saveInfectiousDiseaseReport, getNextCardNo, getPatientDetails } from '../api';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
import { useDict } from '@/utils/dict';
|
||||
|
||||
@@ -1840,11 +1840,31 @@ async function show(diagnosisData) {
|
||||
// 更新selectedDiseases数组
|
||||
updateSelectedDiseases();
|
||||
|
||||
// 设置地址选择组件初始值
|
||||
const provName = diagnosisData?.addressProv || '';
|
||||
const cityName = diagnosisData?.addressCity || '';
|
||||
const countyName = diagnosisData?.addressCounty || '';
|
||||
const townName = diagnosisData?.addressTown || '';
|
||||
// 获取患者详细信息(含现住址、职业),自动填充传染病报告卡
|
||||
const encounterId = patientInfo.encounterId;
|
||||
if (encounterId) {
|
||||
try {
|
||||
const res = await getPatientDetails(encounterId);
|
||||
if (res.code === 200 && res.data) {
|
||||
const detail = res.data;
|
||||
// 使用患者档案中的地址信息填充现住址
|
||||
if (detail.addressProvince) form.value.addressProv = detail.addressProvince;
|
||||
if (detail.addressCity) form.value.addressCity = detail.addressCity;
|
||||
if (detail.addressDistrict) form.value.addressCounty = detail.addressDistrict;
|
||||
if (detail.addressStreet) form.value.addressTown = detail.addressStreet;
|
||||
// 使用患者档案中的职业信息填充职业
|
||||
if (detail.prfsEnum_enumText) form.value.occupation = detail.prfsEnum_enumText;
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('获取患者详情失败:', err);
|
||||
}
|
||||
}
|
||||
|
||||
// 设置地址选择组件初始值(优先使用患者档案地址,回退到诊断数据)
|
||||
const provName = form.value.addressProv || diagnosisData?.addressProv || '';
|
||||
const cityName = form.value.addressCity || diagnosisData?.addressCity || '';
|
||||
const countyName = form.value.addressCounty || diagnosisData?.addressCounty || '';
|
||||
const townName = form.value.addressTown || diagnosisData?.addressTown || '';
|
||||
|
||||
initAddressByName(provName, cityName, countyName, townName);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user