糖尿病風險計算器
分類:糖尿病
// Toggle height and weight input fields based on selected units
document.getElementById('custom-calculator-unit').addEventListener('change', function () {
const selectedUnit = this.value;
const usSection = document.getElementById('custom-calculator-us-section');
const metricSection = document.getElementById('custom-calculator-metric-section');
if (selectedUnit === 'us') {
usSection.style.display = 'block';
metricSection.style.display = 'none';
} else if (selectedUnit === 'metric') {
usSection.style.display = 'none';
metricSection.style.display = 'block';
}
});
// Validate fasting glucose when the user leaves the input field
document.getElementById('custom-calculator-fasting-glucose').addEventListener('blur', function () {
const fastingGlucose = parseFloat(this.value);
const glucoseWarning = document.createElement('small');
const glucoseInput = this;
// Remove any existing warnings
const existingWarning = glucoseInput.parentElement.querySelector('.glucose-warning');
if (existingWarning) {
existingWarning.remove();
}
// Check glucose levels and add appropriate warnings
if (fastingGlucose > 200) {
glucoseWarning.textContent = '您的血糖水平危險地高 - 您可能已經患有糖尿病!';
glucoseWarning.className = 'glucose-warning';
glucoseInput.style.borderColor = 'red';
glucoseInput.parentElement.appendChild(glucoseWarning);
} else if (fastingGlucose < 60 && fastingGlucose > 0) {
glucoseWarning.textContent =
'您的血糖水平過低 - 這可能表明低血糖。請諮詢醫生。';
glucoseWarning.className = 'glucose-warning';
glucoseInput.style.borderColor = 'red';
glucoseInput.parentElement.appendChild(glucoseWarning);
} else {
glucoseInput.style.borderColor = '';
}
});
// Add an event listener to the Calculate button
document.getElementById('custom-calculator-calculate-button').addEventListener('click', function () {
// Clear previous results
const resultElement = document.getElementById('custom-calculator-risk');
resultElement.textContent = ''; // Clear the risk result
document.getElementById('custom-calculator-results').style.display = 'none'; // Hide the results section
const gender = document.getElementById('custom-calculator-gender').value;
const age = parseFloat(document.getElementById('custom-calculator-age').value);
const unit = document.getElementById('custom-calculator-unit').value;
const familyHistory = document.getElementById('custom-calculator-family-history').value;
const ethnicity = document.getElementById('custom-calculator-ethnicity').value;
const fastingGlucose = parseFloat(document.getElementById('custom-calculator-fasting-glucose').value);
const systolicBP = parseFloat(document.getElementById('custom-calculator-systolic-bp').value);
const hdl = parseFloat(document.getElementById('custom-calculator-hdl').value);
let height = 0;
let weight = 0;
let bmi = 0;
// Retrieve height and weight based on selected units
if (unit === 'us') {
const heightFt = parseFloat(document.getElementById('custom-calculator-height-ft').value) || 0;
const heightIn = parseFloat(document.getElementById('custom-calculator-height-in').value) || 0;
height = heightFt * 12 + heightIn; // Convert height to inches
weight = parseFloat(document.getElementById('custom-calculator-weight-us').value) || 0; // Weight in lbs
if (weight < 44) {
alert('體重必須至少為 44 磅(20 公斤)。');
return;
}
bmi = (weight / (height * height)) * 703; // BMI calculation for US units
} else if (unit === 'metric') {
height = parseFloat(document.getElementById('custom-calculator-height-metric').value) || 0; // Height in cm
weight = parseFloat(document.getElementById('custom-calculator-weight-metric').value) || 0; // Weight in kg
if (weight < 20) {
alert('體重必須至少為 20 公斤。');
return;
}
bmi = weight / ((height / 100) * (height / 100)); // BMI calculation for metric units
}
// Validation for age range
if (age < 18 || age > 100) {
alert('年齡必須在 18 到 100 歲之間。');
return;
}
if (
!gender ||
isNaN(age) ||
height <= 0 ||
weight <= 0 ||
!familyHistory ||
!ethnicity ||
isNaN(fastingGlucose) ||
isNaN(systolicBP) ||
isNaN(hdl)
) {
alert('請填寫所有必填欄位並輸入有效數據!');
return;
}
// Risk Calculation Logic
let riskFactor = 0;
// Gender: Males generally have higher risk
if (gender === 'Male') riskFactor += 1.5;
// Family History: Strong predictor of risk
if (familyHistory === 'Yes') riskFactor += 3;
// Ethnicity: Certain ethnic groups are at higher risk
if (ethnicity === 'Latin American') riskFactor += 2;
// Age Factor: Risk increases with age
riskFactor += (age - 18) * 0.2;
// Fasting Glucose: High fasting glucose significantly increases risk
if (fastingGlucose > 200) {
riskFactor += 20; // Critical fasting glucose level
} else if (fastingGlucose > 140) {
riskFactor += 10; // Very high fasting glucose
} else if (fastingGlucose > 100) {
riskFactor += 5; // Pre-diabetic range
}
// Systolic Blood Pressure: Extremely weighted
if (systolicBP > 180) {
riskFactor += 30; // Critical hypertension
} else if (systolicBP > 160) {
riskFactor += 20; // Severe hypertension
} else if (systolicBP > 140) {
riskFactor += 10; // Moderate hypertension
} else if (systolicBP > 120) {
riskFactor += 5; // Mildly elevated
}
// HDL Cholesterol: Extremely weighted
if (hdl < 20) {
riskFactor += 50; // Critically low HDL
} else if (hdl < 40) {
riskFactor += 25; // Low HDL
} else if (hdl > 60) {
riskFactor -= 10; // Protective high HDL
}
// BMI Factor
if (bmi >= 30) {
riskFactor += 10; // Obesity significantly increases risk
} else if (bmi >= 25) {
riskFactor += 5; // Overweight increases risk moderately
} else if (bmi < 18.5) {
riskFactor += 1; // Underweight may slightly increase risk
}
// Cap risk at 100%
const calculatedRisk = Math.min(100, riskFactor.toFixed(2));
// Display the result
resultElement.textContent = `您的 7.5 年糖尿病風險約為 ${calculatedRisk}%。`;
document.getElementById('custom-calculator-results').style.display = 'block'; // Show the results section
});
// Add an event listener to the Reset button to clear the results
document.getElementById('custom-calculator-clear-button').addEventListener('click', function () {
document.getElementById('custom-calculator-results').style.display = 'none'; // Hide the results section
document.getElementById('custom-calculator-risk').textContent = ''; // Clear the result text
});
什麼是糖尿病風險計算器?
糖尿病風險計算器是一個使用者友好的工具,旨在幫助您估算在接下來的7.5年內發展成2型糖尿病的可能性。通過使用臨床相關數據,例如您的年齡、性別、家族史、生活方式因素以及一些實驗室檢測結果,該計算器提供一個百分比風險分數,幫助您了解潛在風險。
這個工具使您能夠通過識別關鍵風險因素來採取早期預防措施。這是一種簡單而有效的方式來評估您是否屬於高風險群體,可能會發展成2型糖尿病。
為什麼使用糖尿病風險計算器?
2型糖尿病是一種主要可預防的疾病,隨著時間的推移而發展,通常沒有明顯的症狀。了解您的風險水平可以激勵您主動改變以改善健康。這個計算器特別有價值,因為它考慮了多個風險因素,包括:
- 年齡:隨著年齡增長,風險增加。
- 性別:由於生物因素,男性和女性的風險可能略有不同。
- 身體質量指數 (BMI):根據您的體重和身高計算,這是糖尿病風險的關鍵預測指標。
- 種族:某些族群,例如拉丁美洲人,可能對糖尿病有更高的易感性。
- 家族史:近親(父母或兄弟姐妹)有糖尿病的歷史會增加您發展此病的可能性。
- 空腹血糖水平:高水平可能表明前糖尿病或糖尿病。
- 收縮壓:高血壓與糖尿病密切相關。
- HDL膽固醇:低水平的HDL(“好膽固醇”)是一個重要的風險因素。
根據這些信息,計算器提供基於證據的風險估算,並鼓勵在需要時進行早期干預。
如何使用糖尿病風險計算器
使用計算器非常簡單。請按照以下步驟操作:
1. 輸入個人信息
- 從下拉菜單中選擇您的性別(男性/女性)。
- 輸入您的年齡(介於18至100歲之間)。
2. 提供身體測量數據
- 選擇您偏好的單位系統:美制(英尺,磅)或公制(厘米,千克)。
- 對於美制單位:
- 輸入您的身高(英尺和英寸)。
- 提供您的體重(磅)。
- 對於公制單位:
3. 添加醫療和家族史
- 通過選擇“是”或“否”來指示任何近親(父母或兄弟姐妹)是否有糖尿病。
- 從下拉菜單中選擇您的種族。
4. 輸入實驗室檢測結果
- 提供您的空腹血糖水平(mg/dL)。正常範圍為70-140 mg/dL。
- 輸入您的收縮壓(mmHg)。典型值範圍在80-120 mmHg之間。
- 輸入您的HDL膽固醇水平(mg/dL)。健康水平通常在40-60 mg/dL之間。
5. 計算您的風險
- 點擊“計算”按鈕以查看您的結果。計算器將顯示您在接下來的7.5年內發展成2型糖尿病的風險百分比。
6. 重置表單
計算器如何運作?
計算器使用基於廣泛臨床研究的預測公式。它分析輸入數據與糖尿病風險之間的關係,以生成個性化的風險百分比。空腹血糖、HDL膽固醇和收縮壓等因素對計算有顯著影響,確保對各種個體的準確預測。
風險上限為100%,代表發展糖尿病的最大可能性。請注意,結果基於統計模型,並不應替代醫療建議。
重要說明和免責聲明
- 僅供參考:此計算器不是診斷工具。如果您擔心自己的風險或有糖尿病症狀,請諮詢醫療專業人員。
- 保持結果準備:為了有效使用此工具,請確保您擁有最近的空腹血糖和HDL膽固醇的實驗室結果,以及您的血壓讀數。
- 健康是可管理的:即使您的風險較高,通過均衡飲食、定期運動和戒煙等生活方式改變,可以顯著降低您發展糖尿病的可能性。
使用此計算器的好處
- 了解您的風險:深入了解您是否屬於2型糖尿病的低、中或高風險類別。
- 個性化反饋:根據您的個人數據獲得量身定制的風險百分比。
- 通過知識賦能:利用這些信息採取主動措施改善您的健康。
為什麼要監測您的糖尿病風險?
糖尿病是全球最常見和最嚴重的慢性疾病之一。如果不進行干預,可能會導致心臟病、腎衰竭、視力問題和神經損傷等併發症。然而,2型糖尿病在很大程度上是可預防的。了解您的風險使您能夠做出明智的決策,並優先考慮您的健康。
接下來該怎麼做?
- 高風險:諮詢醫療提供者以獲得進一步評估和指導。
- 中風險:採取更健康的習慣,包括定期運動和飲食改變,以降低風險。
- 低風險:繼續保持健康的生活方式,以維持您的低風險狀態。
記住,意識是預防的第一步。今天就通過使用糖尿病風險計算器來評估和了解您的風險,掌控您的健康。