智能判断
This commit is contained in:
parent
7ab3e2e68d
commit
2aa41fec67
@ -981,57 +981,6 @@ const processItemData = (item) => {
|
|||||||
itemStatus: item.itemStatus || '0',
|
itemStatus: item.itemStatus || '0',
|
||||||
sectionID: item.sectionID
|
sectionID: item.sectionID
|
||||||
}
|
}
|
||||||
|
|
||||||
// 对体质指数(BMI)进行特殊处理
|
|
||||||
if (item.itemName && item.itemName.includes('体质指数') && item.itemName.includes('BMI') && item.itemResult) {
|
|
||||||
// 应用BMI特定的判断逻辑
|
|
||||||
const bmiValue = parseFloat(item.itemResult)
|
|
||||||
if (!isNaN(bmiValue)) {
|
|
||||||
// BMI判断标准:体重过低<18.5,正常18.5≤BMI<24,超重24≤BMI<28,肥胖28≤BMI
|
|
||||||
if (bmiValue < 18.5) {
|
|
||||||
processedItem.note = '↓'
|
|
||||||
processedItem.risk = '体重过低'
|
|
||||||
processedItem.status = 'danger'
|
|
||||||
} else if (bmiValue >= 18.5 && bmiValue < 24) {
|
|
||||||
processedItem.note = '-'
|
|
||||||
processedItem.risk = '正常'
|
|
||||||
processedItem.status = ''
|
|
||||||
} else if (bmiValue >= 24 && bmiValue < 28) {
|
|
||||||
processedItem.note = '↑'
|
|
||||||
processedItem.risk = '超重'
|
|
||||||
processedItem.status = 'danger'
|
|
||||||
} else if (bmiValue >= 28) {
|
|
||||||
processedItem.note = '↑↑'
|
|
||||||
processedItem.risk = '肥胖'
|
|
||||||
processedItem.status = 'danger'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 对血压进行特殊处理
|
|
||||||
if (item.itemName && item.itemName.includes('血压') && item.itemResult) {
|
|
||||||
// 血压值通常是systolic/diastolic格式,例如 125/90
|
|
||||||
const bpMatch = item.itemResult.match(/(\d+)\/(\d+)/)
|
|
||||||
if (bpMatch) {
|
|
||||||
const systolic = parseInt(bpMatch[1]) // 收缩压
|
|
||||||
const diastolic = parseInt(bpMatch[2]) // 舒张压
|
|
||||||
|
|
||||||
if (!isNaN(systolic) && !isNaN(diastolic)) {
|
|
||||||
// 判断标准: 收缩压<130 且 舒张压<85为正常
|
|
||||||
if (systolic >= 130 || diastolic >= 85) {
|
|
||||||
processedItem.note = '↑'
|
|
||||||
processedItem.risk = '血压偏高'
|
|
||||||
processedItem.status = 'danger'
|
|
||||||
} else {
|
|
||||||
processedItem.note = '-'
|
|
||||||
processedItem.risk = '正常'
|
|
||||||
processedItem.status = ''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return processedItem
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 辅助函数:处理小结数据
|
// 辅助函数:处理小结数据
|
||||||
@ -1615,6 +1564,9 @@ const handleSync = async () => {
|
|||||||
// 重新加载当前患者的数据,但不清空左侧列表
|
// 重新加载当前患者的数据,但不清空左侧列表
|
||||||
await loadPatientData(currentSelectedPatient)
|
await loadPatientData(currentSelectedPatient)
|
||||||
|
|
||||||
|
// 同步后自动处理BMI和血压值
|
||||||
|
processAutoFields()
|
||||||
|
|
||||||
loading.close()
|
loading.close()
|
||||||
ElMessage.success(`同步成功`)
|
ElMessage.success(`同步成功`)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -1628,6 +1580,36 @@ const handleSync = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 添加一个函数处理BMI和血压值,同步完成后调用
|
||||||
|
const processAutoFields = () => {
|
||||||
|
if (!selectedPatient.value?.medicalSn) return
|
||||||
|
|
||||||
|
// 获取当前所有检查项目
|
||||||
|
const allItems = Object.values(examItems.value).flat()
|
||||||
|
|
||||||
|
// 处理BMI项目
|
||||||
|
const bmiItem = allItems.find(item =>
|
||||||
|
item.name && item.name.includes('体质指数') && item.name.includes('BMI') &&
|
||||||
|
item.value
|
||||||
|
)
|
||||||
|
|
||||||
|
if (bmiItem) {
|
||||||
|
console.log('处理BMI值...')
|
||||||
|
handleBmiResult(bmiItem)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理血压项目
|
||||||
|
const bpItem = allItems.find(item =>
|
||||||
|
item.name && item.name.includes('血压') &&
|
||||||
|
item.value
|
||||||
|
)
|
||||||
|
|
||||||
|
if (bpItem) {
|
||||||
|
console.log('处理血压值...')
|
||||||
|
handleBloodPressureResult(bpItem)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const handleRefresh = async (e) => {
|
const handleRefresh = async (e) => {
|
||||||
// 阻止默认行为,防止触发浏览器刷新
|
// 阻止默认行为,防止触发浏览器刷新
|
||||||
if (e) e.preventDefault()
|
if (e) e.preventDefault()
|
||||||
@ -2804,6 +2786,11 @@ const truncateMedicalSn = (sn) => {
|
|||||||
// 如果编号长度超过10个字符,则截断并添加省略号
|
// 如果编号长度超过10个字符,则截断并添加省略号
|
||||||
return sn.length > 10 ? sn.substring(0, 8) + '...' : sn;
|
return sn.length > 10 ? sn.substring(0, 8) + '...' : sn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 在组件卸载时清理缓存
|
||||||
|
onBeforeUnmount(() => {
|
||||||
|
clearPatientCache()
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
Loading…
Reference in New Issue
Block a user