Skip to main content

med.scores - Clinical Scores

12 validated clinical scoring systems across sepsis, cardiology, hepatology, pulmonology, renal, and general assessment.

Sepsis

qsofa(patient) ? int

Quick Sequential Organ Failure Assessment (0-3):

  • RR 22 or above: +1
  • SBP 100 or below: +1
  • GCS below 15: +1
let score = med.scores.qsofa(p);

sofa(patient) ? int

Full SOFA score (0-24) across 6 organ systems: respiratory (PaO2/FiO2), coagulation (platelets), liver (bilirubin), cardiovascular (MAP/vasopressors), neurologic (GCS), renal (creatinine).


General / Early Warning

news2(patient) ? dict

National Early Warning Score 2 (NHS). Score 0-20, triggers clinical escalation.

ParameterScoring Range
Respiratory rate3-1-0-2-3
SpO23-2-1-0
Systolic BP3-2-1-0-3
Heart rate3-1-0-1-2-3
Temperature3-1-0-1-2
Consciousness0 or 3

Returns risk (LOW, LOW-MEDIUM, MEDIUM, HIGH) and action.

# Via Python SDK
lib.scores.news2(patient)
# {'score': 7, 'risk': 'HIGH', 'action': 'Emergency assessment by clinical team'}

apache_ii(patient) ? dict

APACHE II - ICU severity scoring. Considers age, chronic health, and acute physiology (temperature, MAP, HR, RR, oxygenation, pH, sodium, potassium, creatinine, hematocrit, WBC, GCS).

Returns score (0-71) and predicted mortality range.


Cardiology

cha2ds2_vasc(patient) ? dict

CHA2DS2-VASc - Stroke risk in atrial fibrillation:

FactorPoints
CHF1
Hypertension1
Age 75 or older2
Diabetes1
Stroke/TIA history2
Vascular disease1
Age 65-741
Female sex1

Returns score and anticoagulation recommendation.

heart_score(patient) ? dict

HEART score for chest pain evaluation:

ComponentScoring
History0-2
ECG0-2
Age0-2
Risk factors0-2
Troponin0-2

Returns risk (LOW, MODERATE, HIGH) and disposition recommendation.

framingham(patient) ? dict

Framingham Risk Score - 10-year cardiovascular event risk based on age, sex, total cholesterol, HDL, systolic BP, smoking status, and diabetes.


Hepatology

meld_na(patient) ? dict

MELD-Na - Model for End-Stage Liver Disease (includes sodium correction):

MELD = 10 * (0.957 * ln(Cr) + 0.378 * ln(Bili) + 1.120 * ln(INR) + 0.643)

Returns score, priority classification, and transplant recommendation.

child_pugh(patient) ? dict

Child-Pugh classification for cirrhosis severity:

Parameter1 point2 points3 points
Bilirubinunder 22-3over 3
Albuminover 3.52.8-3.5under 2.8
INRunder 1.71.7-2.3over 2.3
AscitesNoneMildModerate
EncephalopathyNoneGrade 1-2Grade 3-4

Returns class (A, B, C) and survival estimate.


Pulmonology

curb65(patient) ? dict

CURB-65 - Community-acquired pneumonia severity:

  • Confusion (GCS under 15)
  • Urea over 7 mmol/L
  • Respiratory rate 30 or above
  • Blood pressure (SBP under 90 or DBP 60 or below)
  • Age 65 or older

Returns score (0-5), mortality risk, and disposition.

wells_pe(patient) ? dict

Wells Score for pulmonary embolism probability:

CriteriaPoints
Clinical DVT signs3.0
PE most likely diagnosis3.0
Heart rate over 1001.5
Immobilization/surgery1.5
Previous DVT/PE1.5
Hemoptysis1.0
Malignancy1.0

Returns probability (LOW, MODERATE, HIGH) and recommended workup.


Renal

kdigo_aki(patient) ? dict

KDIGO AKI staging based on creatinine rise from baseline:

StageCreatinine Rise
11.5-1.9x baseline
22.0-2.9x baseline
33.0x or more baseline, or 4.0+ mg/dL

Returns stage, management recommendations.


GI / Bleeding

glasgow_blatchford(patient) ? dict

Glasgow-Blatchford Bleeding Score - upper GI bleed risk assessment. Considers BUN, hemoglobin, systolic BP, heart rate, melena, syncope, hepatic disease, and heart failure.

Returns score (0-23) and intervention recommendation.


See Also

  • med.lab — interpret lab values alongside clinical scores
  • med.pk — pharmacokinetic dosing after severity assessment
  • med.fhir — export score results as FHIR Observations
  • Diabetes CGM Dashboard — walkthrough using scores with glucose and lab modules