Bmi Bsa Calculator
by @aipoch-ai
Calculate Body Mass Index (BMI) and Body Surface Area (BSA) for clinical assessment and drug dosing. Supports multiple BSA formulas (DuBois, Mosteller, Hayco...
clawhub install bmi-bsa-calculatorπ About This Skill
name: bmi-bsa-calculator description: Calculate Body Mass Index (BMI) and Body Surface Area (BSA) for clinical assessment and drug dosing. Supports multiple BSA formulas (DuBois, Mosteller, Haycock) and provides weight category classification with pediatric and adult norms. allowed-tools: [Read, Write, Bash, Edit] license: MIT metadata: skill-author: AIPOCH
BMI & BSA Calculator
Overview
Clinical calculator for anthropometric measurements used in health assessment, obesity screening, and chemotherapy dosing calculations.
Key Capabilities:
When to Use
β Use this skill when:
β Do NOT use when:
Integration:
ehr-semantic-compressor (patient data extraction), automated-soap-note-generator (vital signs)drug-interaction-checker (dose calculation), medication-reconciliation (dosing verification)Core Capabilities
1. BMI Calculation
Calculate Body Mass Index with classification:
from scripts.calculator import BMIBSACalculatorcalc = BMIBSACalculator()
Calculate BMI
result = calc.calculate_bmi(
weight_kg=70,
height_cm=175,
age=45,
sex="male"
)print(f"BMI: {result.bmi:.1f} kg/mΒ²")
print(f"Category: {result.category}") # Normal weight
print(f"Ideal weight range: {result.ideal_weight_range}")
BMI Categories (WHO): | Category | BMI Range | Clinical Significance | |----------|-----------|---------------------| | Underweight | < 18.5 | Malnutrition risk | | Normal | 18.5 - 24.9 | Healthy range | | Overweight | 25.0 - 29.9 | Increased risk | | Obese I | 30.0 - 34.9 | High risk | | Obese II | 35.0 - 39.9 | Very high risk | | Obese III | β₯ 40.0 | Extremely high risk |
Adjusted BMI:
2. BSA Calculation
Multiple formulas for different clinical scenarios:
# Calculate BSA using different formulas
bsa_results = calc.calculate_bsa(
weight_kg=70,
height_cm=175,
formulas=["dubois", "mosteller", "haycock", "gehan_george"]
)for formula, bsa in bsa_results.items():
print(f"{formula}: {bsa:.2f} mΒ²")
BSA Formulas: | Formula | Equation | Best For | |---------|----------|----------| | DuBois | 0.007184 Γ W^0.425 Γ H^0.725 | Adults (most common) | | Mosteller | β(W Γ H / 3600) | Adults (simplified) | | Haycock | 0.024265 Γ W^0.5378 Γ H^0.3964 | Pediatrics | | Gehan-George | 0.0235 Γ W^0.51456 Γ H^0.42246 | Oncology | | Yu | 0.015925 Γ W^0.5 Γ H^0.5 | Asian populations |
3. Drug Dosing Calculations
Apply BSA to medication dosing:
# Calculate chemotherapy dose
dose = calc.calculate_dose(
bsa=bsa_results["dubois"],
drug="carboplatin",
dose_per_m2=400, # mg/mΒ²
max_dose=800 # mg cap
)print(f"Calculated dose: {dose:.0f} mg")
print(f"BSA used: {bsa_results['dubois']:.2f} mΒ²")
Common BSA-Based Doses:
4. Pediatric Calculations
Age-appropriate calculations for children:
pediatric = calc.pediatric_mode(
weight_kg=25,
height_cm=120,
age_years=8,
sex="female"
)print(f"BMI-for-age percentile: {pediatric.bmi_percentile}%")
print(f"Weight status: {pediatric.weight_status}")
print(f"BSA (Haycock): {pediatric.bsa:.2f} mΒ²")
Pediatric Considerations:
Common Patterns
Pattern 1: Chemotherapy Dosing
Scenario: Calculate carboplatin dose for cancer patient.
# Calculate BSA and dose
python scripts/main.py \
--weight 70 \
--height 175 \
--drug carboplatin \
--target-auc 5 \
--creatinine-clearance 80 \
--output dose_calculation.txt
Output:
BSA (DuBois): 1.79 mΒ²
Calvert Formula: Dose = Target AUC Γ (GFR + 25)
= 5 Γ (80 + 25)
= 525 mg
Maximum dose check: 525 mg β€ 800 mg β
Recommended dose: 525 mg
Pattern 2: Obesity Screening
Scenario: BMI assessment for weight management clinic.
# BMI with full assessment
assessment = calc.assess_bmi(
weight_kg=95,
height_cm=165,
age=52,
sex="female",
waist_cm=98
)print(f"BMI: {assessment.bmi:.1f} (Obese Class II)")
print(f"Waist-to-height ratio: {assessment.whtr:.2f} (High risk)")
print(f"Comorbidity risk: {assessment.health_risk}")
print(f"Recommended: {assessment.recommendations}")
Pattern 3: Pediatric Growth Assessment
Scenario: Calculate child's BSA for medication dosing.
# Pediatric dosing
child = calc.pediatric_assessment(
weight_kg=20,
height_cm=110,
age_years=6,
sex="male"
)print(f"BSA: {child.bsa:.2f} mΒ² (Haycock formula)")
print(f"BMI percentile: {child.bmi_percentile}th")
print(f"Doxorubicin dose: {child.bsa * 60:.0f} mg")
Pattern 4: Rapid Clinical Assessment
Scenario: Quick BMI/BSA for admission vital signs.
# Quick calculation
python scripts/main.py --weight 80 --height 180 --quickOutput:
BMI: 24.7 kg/mΒ² (Normal)
BSA: 2.00 mΒ² (DuBois)
Ideal weight: 65-80 kg
Complete Workflow Example
Comprehensive patient assessment:
from scripts.calculator import BMIBSACalculator
from scripts.reports import ClinicalReportInitialize
calc = BMIBSACalculator()
report = ClinicalReport()Patient data
patient = {
"weight_kg": 75,
"height_cm": 170,
"age": 55,
"sex": "female",
"waist_cm": 88
}Calculate all metrics
bmi = calc.calculate_bmi(**patient)
bsa = calc.calculate_bsa(**patient, formula="dubois")
assessment = calc.comprehensive_assessment(**patient)Generate report
report_data = {
"bmi": bmi,
"bsa": bsa,
"assessment": assessment,
"recommendations": assessment.recommendations
}report.generate(report_data, output="patient_assessment.pdf")
Quality Checklist
Input Validation:
Calculation Accuracy:
Clinical Interpretation:
Documentation:
Common Pitfalls
Calculation Errors:
Clinical Misuse:
Dosing Errors:
References
Available in references/ directory:
bsa_formulas_comparison.md - Formula accuracy by populationpediatric_norms.md - Growth charts and percentileschemotherapy_dosing.md - BSA-based drug calculationsethnic_adjustments.md - Population-specific cutoffscalculator_validation.md - Comparison with reference standardsScripts
Located in scripts/ directory:
main.py - CLI calculator interfacecalculator.py - Core BMI/BSA calculationsformulas.py - Multiple BSA formula implementationspediatric.py - Child-specific calculationsdosing.py - Medication dose calculationsreports.py - Clinical report generationLimitations
Parameters
| Parameter | Type | Default | Required | Description |
|-----------|------|---------|----------|-------------|
| --weight, -w | float | - | Yes | Weight in kilograms |
| --height, -H | float | - | Yes | Height in centimeters |
| --dose, -d | float | - | No | Standard drug dose per mΒ² in mg (optional) |
| --format, -f | string | text | No | Output format (text, json) |
| --output, -o | string | - | No | Output file path (optional) |
Usage
Basic Usage
# Calculate BMI and BSA
python scripts/main.py --weight 70 --height 175Calculate with drug dosing
python scripts/main.py --weight 70 --height 175 --dose 100Output as JSON
python scripts/main.py --weight 70 --height 175 --format json --output results.json
Risk Assessment
| Risk Indicator | Assessment | Level | |----------------|------------|-------| | Code Execution | Python script executed locally | Low | | Network Access | No external API calls | Low | | File System Access | Optional file output only | Low | | Data Exposure | No sensitive data stored | Low | | Clinical Risk | Results used for medical decisions | Medium |
Security Checklist
Prerequisites
# Python 3.7+
No additional packages required (uses standard library)
Evaluation Criteria
Success Metrics
Test Cases
1. Normal Adult: 70kg, 175cm β BMI 22.9 (Normal), BSA ~1.85 mΒ² 2. Drug Dosing: 70kg, 175cm, 100mg/mΒ² β Dose 185mg 3. JSON Output: Valid JSON with all fieldsLifecycle Status
βοΈ Clinical Note: BMI and BSA are screening and calculation tools, not substitutes for clinical judgment. Always correlate with physical examination, patient history, and other assessments. Double-check all chemotherapy calculations independently.
β‘ When to Use
π‘ Examples
Basic Usage
# Calculate BMI and BSA
python scripts/main.py --weight 70 --height 175Calculate with drug dosing
python scripts/main.py --weight 70 --height 175 --dose 100Output as JSON
python scripts/main.py --weight 70 --height 175 --format json --output results.json
βοΈ Configuration
# Python 3.7+
No additional packages required (uses standard library)