弃检项目隐藏
This commit is contained in:
parent
38400a3924
commit
704827fd97
@ -1014,7 +1014,7 @@
|
||||
<div style="text-align: center;margin-top: 5px;">
|
||||
<span style="font-size: 20px;font-weight: bold;">一般检查</span>
|
||||
</div>
|
||||
<div class="report-content">
|
||||
<div class="report-content" id="general-exam-content">
|
||||
|
||||
<table class="exam-table">
|
||||
<thead>
|
||||
@ -1059,7 +1059,7 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="report-summary">
|
||||
<div class="report-summary" id="general-exam-summary">
|
||||
<h4>一般检查小结:</h4>
|
||||
<p>--</p>
|
||||
</div>
|
||||
@ -1081,14 +1081,14 @@
|
||||
<div class="USPrinttitleDiv" style="text-align: center;margin-top: 5px;">
|
||||
<span style="font-size: 20px;font-weight: bold;">超声检查报告</span>
|
||||
</div>
|
||||
<div class="report-content">
|
||||
<div class="report-content" id="ultrasound-exam-content">
|
||||
<!-- 屏幕查看时显示PDF -->
|
||||
<div class="screen-only">
|
||||
<iframe src=""></iframe>
|
||||
</div>
|
||||
|
||||
<!-- 打印时显示渲染的PDF -->
|
||||
<div class="print-only pdf-container" data-pdf-url="">
|
||||
<div class="print-only pdf-container" data-pdf-url="" id="ultrasound-exam-pdf-container">
|
||||
<div class="pdf-loading">正在准备PDF预览...</div>
|
||||
<!-- 添加图片容器,用于存放渲染后的图片 -->
|
||||
<div class="pdf-image-container" style="display:none;"></div>
|
||||
@ -1122,7 +1122,7 @@
|
||||
<div style="text-align: center;margin-top: 5px;">
|
||||
<span style="font-size: 20px;font-weight: bold;">尿常规检查报告</span>
|
||||
</div>
|
||||
<div class="report-content">
|
||||
<div class="report-content" id="urine-exam-content">
|
||||
<!-- 屏幕查看时显示PDF -->
|
||||
<div class="screen-only">
|
||||
<iframe src=""></iframe>
|
||||
@ -1135,7 +1135,7 @@
|
||||
<div class="pdf-image-container" style="display:none;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="report-summary">
|
||||
<div class="report-summary" id="urine-summary">
|
||||
<h4>尿常规小结:</h4>
|
||||
<p id="urine-summary" style="white-space: pre-line">--</p>
|
||||
</div>
|
||||
@ -1157,7 +1157,7 @@
|
||||
<div style="text-align: center;margin-top: 5px;">
|
||||
<span style="font-size: 20px;font-weight: bold;">生化检查报告</span>
|
||||
</div>
|
||||
<div class="report-content">
|
||||
<div class="report-content" id="biochemistry-exam-content">
|
||||
|
||||
<!-- 屏幕查看时显示PDF -->
|
||||
<div class="screen-only">
|
||||
@ -1165,13 +1165,13 @@
|
||||
</div>
|
||||
|
||||
<!-- 打印时显示渲染的PDF -->
|
||||
<div class="print-only pdf-container" data-pdf-url="">
|
||||
<div class="print-only pdf-container" data-pdf-url="" id="biochemistry-exam-pdf-container">
|
||||
<div class="pdf-loading">正在准备PDF预览...</div>
|
||||
<!-- 添加图片容器 -->
|
||||
<div class="pdf-image-container" style="display:none;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="report-summary">
|
||||
<div class="report-summary" id="biochemistry-summary">
|
||||
<h4>生化小结:</h4>
|
||||
<p id="biochemistry-summary" style="white-space: pre-line">--</p>
|
||||
</div>
|
||||
@ -1193,7 +1193,7 @@
|
||||
<div style="text-align: center;margin-top: 5px;">
|
||||
<span style="font-size: 20px;font-weight: bold;">血常规检查报告</span>
|
||||
</div>
|
||||
<div class="report-content">
|
||||
<div class="report-content" id="blood-exam-content" >
|
||||
|
||||
<!-- 屏幕查看时显示PDF -->
|
||||
<div class="screen-only">
|
||||
@ -1201,13 +1201,13 @@
|
||||
</div>
|
||||
|
||||
<!-- 打印时显示渲染的PDF -->
|
||||
<div class="print-only pdf-container" data-pdf-url="">
|
||||
<div class="print-only pdf-container" data-pdf-url="" id="blood-exam-pdf-container">
|
||||
<div class="pdf-loading">正在准备PDF预览...</div>
|
||||
<!-- 添加图片容器 -->
|
||||
<div class="pdf-image-container" style="display:none;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="report-summary">
|
||||
<div class="report-summary" id="blood-summary">
|
||||
<h4>血常规小结:</h4>
|
||||
<p id="blood-summary" style="white-space: pre-line">--</p>
|
||||
</div>
|
||||
@ -1229,7 +1229,7 @@
|
||||
<div style="text-align: center;margin-top: 5px;">
|
||||
<span style="font-size: 20px;font-weight: bold;">心电图检查报告</span>
|
||||
</div>
|
||||
<div class="report-content">
|
||||
<div class="report-content" id="ecg-exam-content">
|
||||
|
||||
<img src="" alt="心电图检查">
|
||||
</div>
|
||||
|
||||
@ -176,78 +176,115 @@ const handleIframeLoad = async () => {
|
||||
(item) => item.itemName === '超声' || item.itemName === 'US'
|
||||
)
|
||||
if (ultrasoundData) {
|
||||
// 更新超声检查报告内容
|
||||
//const ultrasoundSummary = doc.querySelector('.report-item.ultrasound-exam .report-summary')
|
||||
const ultrasoundSummary = doc.getElementById('ultrasound-summary')
|
||||
if (ultrasoundSummary) {
|
||||
// 解析 analyse 字段(格式:"检查所见:xxx\n检查结果:xxx")
|
||||
const findings = ultrasoundData.analyse.split('\n')[0].replace('检查所见:', '') || ''
|
||||
const conclusion = ultrasoundData.analyse.split('\n')[1].replace('检查结果:', '') || ''
|
||||
ultrasoundSummary.innerHTML = `
|
||||
<p><strong>【所见】</strong><br>${findings}</p>
|
||||
<p><strong>【所得】</strong><br>${conclusion}</p>
|
||||
`
|
||||
// 检查是否弃检
|
||||
if (ultrasoundData.itemStatus === "2") {
|
||||
// 隐藏所有超声检查相关ID元素
|
||||
const ultrasoundContent = doc.getElementById('ultrasound-exam-content')
|
||||
const ultrasoundPdfContainer = doc.getElementById('ultrasound-exam-pdf-container')
|
||||
const ultrasoundSummary = doc.getElementById('ultrasound-summary')
|
||||
|
||||
if (ultrasoundContent) ultrasoundContent.style.display = 'none'
|
||||
if (ultrasoundPdfContainer) ultrasoundPdfContainer.style.display = 'none'
|
||||
if (ultrasoundSummary) {
|
||||
ultrasoundSummary.innerHTML = '<p class="abandon-notice" style="color:red;font-weight:bold;text-align:center;padding:20px;">该项目已弃检</p>'
|
||||
}
|
||||
} else {
|
||||
console.error('未找到超声检查小结元素')
|
||||
}
|
||||
|
||||
// 更新超声检查PDF链接
|
||||
if (ultrasoundData.data) {
|
||||
// 为PDF URL添加参数
|
||||
const pdfUrl = ultrasoundData.data + '#toolbar=0&navpanes=0&view=Fit'
|
||||
|
||||
// 更新屏幕显示的iframe
|
||||
const iframeElement = doc.querySelector('.ultrasound-exam .screen-only iframe')
|
||||
if (iframeElement) {
|
||||
iframeElement.src = pdfUrl
|
||||
} else {
|
||||
console.error('未找到超声检查iframe元素')
|
||||
// 原有代码逻辑
|
||||
const ultrasoundSummary = doc.getElementById('ultrasound-summary')
|
||||
if (ultrasoundSummary) {
|
||||
const findings = ultrasoundData.analyse.split('\n')[0].replace('检查所见:', '') || ''
|
||||
const conclusion = ultrasoundData.analyse.split('\n')[1].replace('检查结果:', '') || ''
|
||||
ultrasoundSummary.innerHTML = `
|
||||
<p><strong>【所见】</strong><br>${findings}</p>
|
||||
<p><strong>【所得】</strong><br>${conclusion}</p>
|
||||
`
|
||||
}
|
||||
|
||||
// 更新打印用的PDF容器
|
||||
const pdfContainer = doc.querySelector('.ultrasound-exam .print-only.pdf-container')
|
||||
if (pdfContainer) {
|
||||
pdfContainer.setAttribute('data-pdf-url', pdfUrl)
|
||||
} else {
|
||||
console.error('未找到超声检查PDF容器')
|
||||
// 更新超声检查PDF链接
|
||||
if (ultrasoundData.data) {
|
||||
// 为PDF URL添加参数
|
||||
const pdfUrl = ultrasoundData.data + '#toolbar=0&navpanes=0&view=Fit'
|
||||
|
||||
// 更新屏幕显示的iframe
|
||||
const iframeElement = doc.querySelector('.ultrasound-exam .screen-only iframe')
|
||||
if (iframeElement) {
|
||||
iframeElement.src = pdfUrl
|
||||
} else {
|
||||
console.error('未找到超声检查iframe元素')
|
||||
}
|
||||
|
||||
// 更新打印用的PDF容器
|
||||
const pdfContainer = doc.querySelector('.ultrasound-exam .print-only.pdf-container')
|
||||
if (pdfContainer) {
|
||||
pdfContainer.setAttribute('data-pdf-url', pdfUrl)
|
||||
} else {
|
||||
console.error('未找到超声检查PDF容器')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 更新其他检查报告
|
||||
// 尿常规
|
||||
// 更新尿常规检查
|
||||
const urineData = reportData.data.find((item) => item.itemName === '尿常规')
|
||||
if (urineData) {
|
||||
//const urineSummary = doc.querySelector('.report-item:nth-of-type(6) .report-summary p')
|
||||
const urineSummary = doc.getElementById('urine-summary')
|
||||
if (urineSummary) {
|
||||
urineSummary.textContent = urineData.analyse || ''
|
||||
if (urineData.itemStatus === "2") {
|
||||
// 隐藏所有尿常规检查相关ID元素
|
||||
const urineContent = doc.getElementById('urine-exam-content')
|
||||
const urineSummary = doc.getElementById('urine-summary')
|
||||
|
||||
if (urineContent) urineContent.style.display = 'none'
|
||||
if (urineSummary) {
|
||||
urineSummary.innerHTML = '<p class="abandon-notice" style="color:red;font-weight:bold;text-align:center;padding:20px;">该项目已弃检</p>'
|
||||
}
|
||||
} else {
|
||||
const urineSummary = doc.getElementById('urine-summary')
|
||||
if (urineSummary) {
|
||||
urineSummary.textContent = urineData.analyse || ''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 更新生化检查
|
||||
const biochemData = reportData.data.find((item) => item.itemName === '生化')
|
||||
if (biochemData) {
|
||||
// 改为第7个report-item(原4→7)
|
||||
//const biochemSummary = doc.querySelector('.report-item:nth-of-type(7) .report-summary p')
|
||||
const biochemSummary = doc.getElementById('biochemistry-summary')
|
||||
if (biochemSummary) {
|
||||
biochemSummary.textContent = biochemData.analyse || ''
|
||||
if (biochemData.itemStatus === "2") {
|
||||
// 隐藏所有生化检查相关ID元素
|
||||
const biochemContent = doc.getElementById('biochemistry-exam-content')
|
||||
const biochemPdfContainer = doc.getElementById('biochemistry-exam-pdf-container')
|
||||
const biochemSummary = doc.getElementById('biochemistry-summary')
|
||||
|
||||
if (biochemContent) biochemContent.style.display = 'none'
|
||||
if (biochemPdfContainer) biochemPdfContainer.style.display = 'none'
|
||||
if (biochemSummary) {
|
||||
biochemSummary.innerHTML = '<p class="abandon-notice" style="color:red;font-weight:bold;text-align:center;padding:20px;">该项目已弃检</p>'
|
||||
}
|
||||
} else {
|
||||
console.error('未找到生化检查小结元素')
|
||||
const biochemSummary = doc.getElementById('biochemistry-summary')
|
||||
if (biochemSummary) {
|
||||
biochemSummary.textContent = biochemData.analyse || ''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 更新血常规
|
||||
const bloodData = reportData.data.find((item) => item.itemName === '血常规')
|
||||
if (bloodData) {
|
||||
// 改为第8个report-item(原5→8)
|
||||
//const bloodSummary = doc.querySelector('.report-item:nth-of-type(8) .report-summary p')
|
||||
const bloodSummary = doc.getElementById('blood-summary')
|
||||
if (bloodSummary) {
|
||||
bloodSummary.textContent = bloodData.analyse || ''
|
||||
if (bloodData.itemStatus === "2") {
|
||||
// 隐藏所有血常规检查相关ID元素
|
||||
const bloodContent = doc.getElementById('blood-exam-content')
|
||||
const bloodPdfContainer = doc.getElementById('blood-exam-pdf-container')
|
||||
const bloodSummary = doc.getElementById('blood-summary')
|
||||
|
||||
if (bloodContent) bloodContent.style.display = 'none'
|
||||
if (bloodPdfContainer) bloodPdfContainer.style.display = 'none'
|
||||
if (bloodSummary) {
|
||||
bloodSummary.innerHTML = '<p class="abandon-notice" style="color:red;font-weight:bold;text-align:center;padding:20px;">该项目已弃检</p>'
|
||||
}
|
||||
} else {
|
||||
console.error('未找到血常规小结元素')
|
||||
const bloodSummary = doc.getElementById('blood-summary')
|
||||
if (bloodSummary) {
|
||||
bloodSummary.textContent = bloodData.analyse || ''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -265,16 +302,23 @@ const handleIframeLoad = async () => {
|
||||
// 更新心电图
|
||||
const ecgData = reportData.data.find((item) => item.itemName === '心电图')
|
||||
if (ecgData) {
|
||||
// 改为第9个report-item(原last-child→9)
|
||||
//const ecgSummary = doc.querySelector('.report-item:nth-of-type(9) .report-summary')
|
||||
const ecgSummary = doc.getElementById('ecg-summary')
|
||||
if (ecgSummary) {
|
||||
ecgSummary.innerHTML = `
|
||||
<p><strong>【所见】</strong><br>${ecgData.analyse.split('\n')[0].replace('检查所见:', '') || ''}</p>
|
||||
<p><strong>【所得】</strong><br>${ecgData.analyse.split('\n')[1].replace('检查结果:', '') || ''}</p>
|
||||
`
|
||||
if (ecgData.itemStatus === "2") {
|
||||
// 隐藏所有心电图相关ID元素
|
||||
const ecgContent = doc.getElementById('ecg-exam-content')
|
||||
const ecgSummary = doc.getElementById('ecg-summary')
|
||||
|
||||
if (ecgContent) ecgContent.style.display = 'none'
|
||||
if (ecgSummary) {
|
||||
ecgSummary.innerHTML = '<p class="abandon-notice" style="color:red;font-weight:bold;text-align:center;padding:20px;">该项目已弃检</p>'
|
||||
}
|
||||
} else {
|
||||
console.error('未找到心电图小结元素')
|
||||
const ecgSummary = doc.getElementById('ecg-summary')
|
||||
if (ecgSummary) {
|
||||
ecgSummary.innerHTML = `
|
||||
<p><strong>【所见】</strong><br>${ecgData.analyse.split('\n')[0].replace('检查所见:', '') || ''}</p>
|
||||
<p><strong>【所得】</strong><br>${ecgData.analyse.split('\n')[1].replace('检查结果:', '') || ''}</p>
|
||||
`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user