修复门诊医生站检验申请单的就诊卡号无法获取到对应的值的问题
This commit is contained in:
@@ -22,6 +22,7 @@ import com.openhis.web.doctorstation.dto.PrescriptionInfoBaseDto;
|
||||
import com.openhis.web.doctorstation.dto.PrescriptionInfoDetailDto;
|
||||
import com.openhis.web.doctorstation.dto.ReceptionStatisticsDto;
|
||||
import com.openhis.web.doctorstation.mapper.DoctorStationMainAppMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -32,6 +33,7 @@ import java.util.stream.Collectors;
|
||||
/**
|
||||
* 医生站-主页面 应用实现类
|
||||
*/
|
||||
//@Slf4j
|
||||
@Service
|
||||
public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppService {
|
||||
|
||||
@@ -95,6 +97,9 @@ public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppSer
|
||||
ParticipantType.REGISTRATION_DOCTOR.getCode(), ParticipantType.ADMITTER.getCode(), userId,
|
||||
currentUserOrganizationId, pricingFlag, EncounterStatus.PLANNED.getValue(),
|
||||
EncounterActivityStatus.ACTIVE.getValue(), queryWrapper);
|
||||
//日志输出就诊患者信息,patientInfo
|
||||
// log.debug("就诊患者信息: 总数={}, 记录数={}, 数据={}",
|
||||
// patientInfo.getTotal(), patientInfo.getRecords().size(), patientInfo.getRecords());
|
||||
patientInfo.getRecords().forEach(e -> {
|
||||
// 性别
|
||||
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||
|
||||
@@ -123,4 +123,8 @@ public class PatientInfoDto {
|
||||
* 病历号
|
||||
*/
|
||||
private String busNo;
|
||||
/**
|
||||
* 就诊卡号
|
||||
*/
|
||||
private String identifierNo;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,8 @@
|
||||
T10.reception_time,
|
||||
T10.practitioner_user_id,
|
||||
T10.jz_practitioner_user_id,
|
||||
T10.bus_no
|
||||
T10.bus_no,
|
||||
T10.identifier_no
|
||||
from
|
||||
(
|
||||
SELECT T1.tenant_id AS tenant_id,
|
||||
@@ -48,7 +49,8 @@
|
||||
T1.create_time AS register_time,
|
||||
T1.reception_time AS reception_time,
|
||||
T1.organization_id AS org_id,
|
||||
T8.bus_no AS bus_no
|
||||
T8.bus_no AS bus_no,
|
||||
T9.identifier_no AS identifier_no
|
||||
FROM adm_encounter AS T1
|
||||
LEFT JOIN adm_organization AS T2 ON T1.organization_id = T2.ID AND T2.delete_flag = '0'
|
||||
LEFT JOIN adm_healthcare_service AS T3 ON T1.service_type_id = T3.ID AND T3.delete_flag = '0'
|
||||
@@ -67,6 +69,20 @@
|
||||
LEFT JOIN adm_account AS T6 ON T1.ID = T6.encounter_id AND T6.delete_flag = '0' and T6.encounter_flag = '1'
|
||||
LEFT JOIN fin_contract AS T7 ON T6.contract_no = T7.bus_no AND T7.delete_flag = '0'
|
||||
LEFT JOIN adm_patient AS T8 ON T1.patient_id = T8.ID AND T8.delete_flag = '0'
|
||||
LEFT JOIN (
|
||||
SELECT patient_id,
|
||||
identifier_no
|
||||
FROM (
|
||||
SELECT patient_id,
|
||||
identifier_no,
|
||||
ROW_NUMBER() OVER (PARTITION BY patient_id ORDER BY create_time ASC) AS rn
|
||||
FROM adm_patient_identifier
|
||||
WHERE delete_flag = '0'
|
||||
AND identifier_no IS NOT NULL
|
||||
AND identifier_no != ''
|
||||
) t
|
||||
WHERE rn = 1
|
||||
) AS T9 ON T8.id = T9.patient_id
|
||||
WHERE
|
||||
T1.delete_flag = '0'
|
||||
<!-- 当前登录账号ID 和 当前登录账号所属的科室ID 用于控制数据权限 -->
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--检验信息-->
|
||||
<el-table
|
||||
ref="inspectionTableRef"
|
||||
:data="inspectionList"
|
||||
@@ -79,7 +79,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 下方:申请单和检验项目选择器 -->
|
||||
<!-- 下方:申请单和检验项目选择器 -->
|
||||
<div style="display: flex; gap: 20px">
|
||||
<!-- 左侧:申请单和检验信息 -->
|
||||
<div style="width: 55%">
|
||||
@@ -88,18 +88,18 @@
|
||||
<div class="application-form" style="padding: 20px; height: 700px; overflow-y: auto; border: 1px solid #e4e7ed; border-radius: 4px; margin: 10px;">
|
||||
<div style="margin-bottom: 20px">
|
||||
<label style="display: block; margin-bottom: 5px; font-weight: bold">申请单号</label>
|
||||
<el-input v-model="formData.applicationNo" disabled size="small" />
|
||||
<el-input v-model="formData.applicationNo" readonly size="small" />
|
||||
</div>
|
||||
|
||||
<!-- 患者信息行 -->
|
||||
<div style="display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 15px; margin-bottom: 20px">
|
||||
<div>
|
||||
<label style="display: block; margin-bottom: 5px; font-weight: bold">姓名</label>
|
||||
<el-input v-model="formData.patientName" disabled size="small" />
|
||||
<el-input v-model="formData.patientName" readonly size="small" />
|
||||
</div>
|
||||
<div>
|
||||
<label style="display: block; margin-bottom: 5px; font-weight: bold">就诊卡号</label>
|
||||
<el-input v-model="formData.cardNo" disabled size="small" />
|
||||
<el-input v-model="formData.identifierNo" readonly size="small" />
|
||||
</div>
|
||||
<div>
|
||||
<label style="display: block; margin-bottom: 5px; font-weight: bold">费用性质</label>
|
||||
@@ -115,6 +115,7 @@
|
||||
|
||||
<!-- 申请信息行 -->
|
||||
<div style="display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 15px; margin-bottom: 20px">
|
||||
<!--申请日期-->
|
||||
<div>
|
||||
<label style="display: block; margin-bottom: 5px; font-weight: bold">申请日期</label>
|
||||
<el-date-picker
|
||||
@@ -127,6 +128,7 @@
|
||||
style="width: 100%"
|
||||
/>
|
||||
</div>
|
||||
<!--申请科室-->
|
||||
<div>
|
||||
<label style="display: block; margin-bottom: 5px; font-weight: bold">申请科室</label>
|
||||
<el-select v-model="formData.departmentName" placeholder="请选择申请科室" size="small" style="width: 100%" disabled>
|
||||
@@ -135,9 +137,11 @@
|
||||
<el-option label="儿科" value="pediatrics" />
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<!--申请医生-->
|
||||
<div>
|
||||
<label style="display: block; margin-bottom: 5px; font-weight: bold">申请医生</label>
|
||||
<el-select v-model="formData.doctorName" placeholder="请选择申请医生" size="small" style="width: 100%" disabled>
|
||||
<el-select v-model="formData.doctorName" placeholder="请选择申请医生" size="small" style="width: 100%">
|
||||
<el-option label="张医生" value="doctor_zhang" />
|
||||
<el-option label="李医生" value="doctor_li" />
|
||||
<el-option label="王医生" value="doctor_wang" />
|
||||
@@ -164,7 +168,7 @@
|
||||
<div v-if="validationErrors.executeDepartment" class="error-message">请选择执行科室</div>
|
||||
</div>
|
||||
|
||||
<!-- 诊断相关字段 -->
|
||||
<!-- 诊断描述 -->
|
||||
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 20px">
|
||||
<div :class="{ 'form-item-error': validationErrors.diagnosisDesc }">
|
||||
<label style="display: block; margin-bottom: 5px; font-weight: bold">诊断描述 <span style="color: #f56c6c">*</span></label>
|
||||
@@ -248,7 +252,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="检验信息" name="inspectionInfo">
|
||||
<div style="padding: 20px; height: 700px; overflow-y: auto; border: 1px solid #e4e7ed; border-radius: 4px; margin: 10px;">
|
||||
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 20px">
|
||||
@@ -458,7 +461,7 @@ const formData = reactive({
|
||||
applicationId: null,
|
||||
applicationNo: '202511210001',
|
||||
patientName: '',
|
||||
cardNo: '',
|
||||
identifierNo: '',
|
||||
feeType: 'self',
|
||||
applicationDate: new Date(),
|
||||
departmentName: '',
|
||||
@@ -579,11 +582,11 @@ const getFilteredItems = (categoryKey) => {
|
||||
|
||||
// 初始化数据
|
||||
function initData() {
|
||||
console.log('检验组件初始化,patientInfo:', props.patientInfo)
|
||||
// console.log('检验组件初始化,patientInfo:', props.patientInfo)
|
||||
if (props.patientInfo) {
|
||||
queryParams.encounterId = props.patientInfo.encounterId
|
||||
formData.patientName = props.patientInfo.patientName || ''
|
||||
formData.cardNo = props.patientInfo.cardNo || ''
|
||||
formData.identifierNo = props.patientInfo.identifierNo || ''
|
||||
formData.departmentName = props.patientInfo.departmentName || ''
|
||||
formData.doctorName = props.patientInfo.doctorName || ''
|
||||
}
|
||||
@@ -597,26 +600,26 @@ function initData() {
|
||||
function getInspectionList() {
|
||||
// 如果没有encounterId,不调用接口
|
||||
if (!queryParams.encounterId) {
|
||||
console.warn('【检验】encounterId为空,不调用接口')
|
||||
// console.warn('【检验】encounterId为空,不调用接口')
|
||||
return
|
||||
}
|
||||
|
||||
loading.value = true
|
||||
|
||||
// 调用真实的API,只传递 encounterId 参数
|
||||
console.log('【检验】调用API,encounterId:', queryParams.encounterId)
|
||||
// console.log('【检验】调用API,encounterId:', queryParams.encounterId)
|
||||
getInspectionApplicationList({ encounterId: queryParams.encounterId }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
inspectionList.value = res.data || []
|
||||
total.value = res.data?.length || 0
|
||||
console.log('【检验】获取数据成功,数量:', inspectionList.value.length)
|
||||
// console.log('【检验】获取数据成功,数量:', inspectionList.value.length)
|
||||
} else {
|
||||
inspectionList.value = []
|
||||
total.value = 0
|
||||
ElMessage.error('获取检验申请单列表失败')
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.error('获取检验申请单列表异常:', error)
|
||||
// console.error('获取检验申请单列表异常:', error)
|
||||
inspectionList.value = []
|
||||
total.value = 0
|
||||
ElMessage.error('获取检验申请单列表异常')
|
||||
@@ -627,7 +630,7 @@ function getInspectionList() {
|
||||
|
||||
// 新增申请单
|
||||
function handleNewApplication() {
|
||||
console.log('点击新增按钮')
|
||||
// console.log('点击新增按钮')
|
||||
resetForm()
|
||||
// 生成申请单号
|
||||
formData.applicationNo = generateApplicationNo()
|
||||
@@ -737,7 +740,7 @@ function handleSave() {
|
||||
totalAmount: selectedInspectionItems.value.reduce((sum, item) => sum + item.price + (item.serviceFee || 0), 0)
|
||||
}
|
||||
|
||||
console.log('保存检验申请单数据:', saveData)
|
||||
// console.log('保存检验申请单数据:', saveData)
|
||||
|
||||
// 调用真实的API保存
|
||||
saveInspectionApplication(saveData).then((res) => {
|
||||
@@ -751,7 +754,7 @@ function handleSave() {
|
||||
ElMessage.error(res.message || '保存失败')
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.error('保存检验申请单异常:', error)
|
||||
// console.error('保存检验申请单异常:', error)
|
||||
ElMessage.error('保存异常')
|
||||
})
|
||||
}
|
||||
@@ -761,7 +764,7 @@ function handleFormSave() {
|
||||
formRef.value?.validate((valid) => {
|
||||
if (valid) {
|
||||
formData.inspectionItems = selectedInspectionItems.value.map(item => item.id)
|
||||
console.log('保存检验申请单表单数据:', formData)
|
||||
// console.log('保存检验申请单表单数据:', formData)
|
||||
ElMessage.success('保存成功')
|
||||
showForm.value = false
|
||||
getInspectionList()
|
||||
@@ -771,7 +774,7 @@ function handleFormSave() {
|
||||
|
||||
// 查看详情
|
||||
function handleView(row) {
|
||||
console.log('点击查看按钮,数据:', row)
|
||||
// console.log('点击查看按钮,数据:', row)
|
||||
// 加载表单数据
|
||||
Object.assign(formData, row)
|
||||
|
||||
@@ -811,7 +814,7 @@ function switchCategory(category) {
|
||||
// 处理搜索
|
||||
function handleSearch() {
|
||||
// 搜索逻辑已在getFilteredItems中实现,这里可以添加额外的搜索逻辑
|
||||
console.log('搜索关键词:', searchKeyword.value)
|
||||
// console.log('搜索关键词:', searchKeyword.value)
|
||||
}
|
||||
|
||||
// 处理项目项点击(排除勾选框点击)
|
||||
@@ -866,7 +869,7 @@ function handleSelectionChange(selection) {
|
||||
|
||||
// 打印申请单
|
||||
function handlePrint(row) {
|
||||
console.log('打印申请单:', row)
|
||||
// console.log('打印申请单:', row)
|
||||
|
||||
// 切换到申请单TAB
|
||||
leftActiveTab.value = 'application'
|
||||
@@ -949,7 +952,7 @@ function handleDelete(row) {
|
||||
confirmButtonClass: 'el-button--danger'
|
||||
}
|
||||
).then(() => {
|
||||
console.log('删除申请单:', row)
|
||||
// console.log('删除申请单:', row)
|
||||
// 调用真实的API删除
|
||||
deleteInspectionApplication(row.applicationId).then((res) => {
|
||||
if (res.code === 200) {
|
||||
@@ -960,7 +963,7 @@ function handleDelete(row) {
|
||||
ElMessage.error(res.message || '删除失败')
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.error('删除检验申请单异常:', error)
|
||||
// console.error('删除检验申请单异常:', error)
|
||||
ElMessage.error('删除异常')
|
||||
})
|
||||
}).catch(() => {
|
||||
@@ -987,10 +990,11 @@ watch(() => props.activeTab, (newVal) => {
|
||||
|
||||
// 监听patientInfo变化,确保encounterId及时更新
|
||||
watch(() => props.patientInfo, (newVal) => {
|
||||
console.log('【检验】patientInfo变化:', newVal)
|
||||
// console.log('【检验】patientInfo变化:', newVal)
|
||||
console.log('【检验】接收到的完整patientInfo:', JSON.stringify(newVal, null, 2))
|
||||
if (newVal && newVal.encounterId) {
|
||||
queryParams.encounterId = newVal.encounterId
|
||||
console.log('【检验】更新encounterId:', queryParams.encounterId)
|
||||
// console.log('【检验】更新encounterId:', queryParams.encounterId)
|
||||
}
|
||||
}, { deep: true, immediate: true })
|
||||
|
||||
|
||||
@@ -321,7 +321,10 @@ getPatientList();
|
||||
function getPatientList() {
|
||||
queryParams.value.statusEnum = 2;
|
||||
getList(queryParams.value).then((res) => {
|
||||
// console.log('API返回的完整数据:', res); // 添加这行来查看完整返回
|
||||
// console.log('API返回的数据记录:', res.data.records); // 查看具体数据记录
|
||||
patientList.value = res.data.records.map((item) => {
|
||||
// console.log('处理的单个患者数据:', item); // 查看处理的单个患者数据
|
||||
return {
|
||||
...item,
|
||||
active: currentEncounterId.value ? item.encounterId == currentEncounterId.value : false,
|
||||
@@ -431,7 +434,7 @@ function handleClick(tab) {
|
||||
// 查看本次就诊处方单(从医嘱Tab页获取已开立的处方单信息)
|
||||
function getEnPrescription(encounterId) {
|
||||
getEnPrescriptionInfo({ encounterId: encounterId }).then((res) => {
|
||||
console.log('处方单 res', res);
|
||||
// console.log('处方单 res', res);
|
||||
let dataArr = res.data.records || [];
|
||||
if (dataArr.length <= 0) {
|
||||
ElMessage({
|
||||
@@ -461,6 +464,7 @@ function handleCardClick(item, index) {
|
||||
patient.active = patient.encounterId === item.encounterId;
|
||||
});
|
||||
patientInfo.value = item;
|
||||
// console.log('patientInfo.value.cardNo:', patientInfo.value.cardNo)
|
||||
// 将患者信息保存到store中,供hospitalizationEmr组件使用
|
||||
updatePatientInfo(item);
|
||||
activeTab.value = 'hospitalizationEmr';
|
||||
|
||||
Reference in New Issue
Block a user