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.
| Parameter | Scoring Range |
|---|---|
| Respiratory rate | 3-1-0-2-3 |
| SpO2 | 3-2-1-0 |
| Systolic BP | 3-2-1-0-3 |
| Heart rate | 3-1-0-1-2-3 |
| Temperature | 3-1-0-1-2 |
| Consciousness | 0 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:
| Factor | Points |
|---|---|
| CHF | 1 |
| Hypertension | 1 |
| Age 75 or older | 2 |
| Diabetes | 1 |
| Stroke/TIA history | 2 |
| Vascular disease | 1 |
| Age 65-74 | 1 |
| Female sex | 1 |
Returns score and anticoagulation recommendation.
heart_score(patient) ? dict
HEART score for chest pain evaluation:
| Component | Scoring |
|---|---|
| History | 0-2 |
| ECG | 0-2 |
| Age | 0-2 |
| Risk factors | 0-2 |
| Troponin | 0-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:
| Parameter | 1 point | 2 points | 3 points |
|---|---|---|---|
| Bilirubin | under 2 | 2-3 | over 3 |
| Albumin | over 3.5 | 2.8-3.5 | under 2.8 |
| INR | under 1.7 | 1.7-2.3 | over 2.3 |
| Ascites | None | Mild | Moderate |
| Encephalopathy | None | Grade 1-2 | Grade 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:
| Criteria | Points |
|---|---|
| Clinical DVT signs | 3.0 |
| PE most likely diagnosis | 3.0 |
| Heart rate over 100 | 1.5 |
| Immobilization/surgery | 1.5 |
| Previous DVT/PE | 1.5 |
| Hemoptysis | 1.0 |
| Malignancy | 1.0 |
Returns probability (LOW, MODERATE, HIGH) and recommended workup.
Renal
kdigo_aki(patient) ? dict
KDIGO AKI staging based on creatinine rise from baseline:
| Stage | Creatinine Rise |
|---|---|
| 1 | 1.5-1.9x baseline |
| 2 | 2.0-2.9x baseline |
| 3 | 3.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