# RC11 — Creatinine Parser Strengthening

## Goal

Improve the probability that a patient screen capture produces a usable serum creatinine for:

- Cockcroft-Gault CrCl
- renal-dose review
- AKI/unstable renal-function findings
- vancomycin and aminoglycoside workflows
- anticoagulant and antimicrobial dosing support

## Changes

### Alias recognition

The parser now recognizes common and OCR-degraded labels including:

- Creatinine
- Serum creatinine
- SCr
- SrCr
- CREAT
- CREA
- Creat
- Creatlnine
- Creatinlne
- Creatininc
- spaced OCR variants such as S C r

### Numeric normalization

The parser normalizes number-like OCR errors such as:

- `1,24` -> `1.24`
- `1;24` -> `1.24`
- `I.06` -> `1.06`
- internal spacing around decimal points

### Table-aware extraction

- scans labeled rows before generic lab parsing
- examines the next OCR line when the result is placed in a separate table cell
- supports multiple result columns
- selects the right-most plausible result for horizontal Cerner-style trends
- removes common trailing reference intervals
- rejects creatinine-clearance and urine albumin/creatinine-ratio rows

### Unit handling

- mg/dL is retained directly
- explicitly labeled µmol/L or umol/L values are converted to mg/dL using 88.4 µmol/L per mg/dL
- unitless fallback remains possible only next to a recognizable creatinine label

### Structured storage

Each extracted lab can now retain:

- value
- unit
- collection time when visible
- capture number
- confidence
- extraction source
- raw OCR line

### Trend intelligence

The patient context now produces:

- current SCr
- prior SCr
- absolute delta
- percentage change
- increasing/stable/decreasing direction

A captured SCr increase of at least 0.3 mg/dL marks renal function as unstable for downstream review.

## Visible behavior

The patient review can display a compact summary such as:

`SCr 1.31 mg/dL; prior 1.02; delta +0.29, +28.4%; trend increasing`

The raw provenance and complete lab history remain backend data.
