Skip to main content

Module assessment

Module assessment 

Source
Expand description

Self-report wellbeing assessment instruments (T2.2) — a data-driven scoring engine plus the two canonical, freely-usable instruments: PHQ-9 (depression) and GAD-7 (anxiety), both by Spitzer, Kroenke & Williams (Pfizer), which are free to reproduce and use without permission.

This is a self-monitoring aid, not a diagnostic instrument. A score never diagnoses a condition — only a qualified clinician can. The engine is deliberately data-driven so that adding an instrument is pure data; the numeric scoring, severity bands, and safety flags are what must be correct, and they are what the tests pin down.

⚑ Curation-grade, Timothy’s call (out of scope for the agent to decide): which validated instruments to ship, sign-off on the interpretation copy for clinical use, and licensing for copyrighted instruments (e.g. BDI-II is Pearson-licensed; DASS-21 and K10 are free and can be added as data here once you approve their inclusion + wording).

Structs§

AssessmentResult
The scored outcome of one assessment sitting.
FlagRule
A safety flag: if the response to item_index (0-based) is >= min_value, surface message regardless of the total score (e.g. PHQ-9 item 9, self-harm).
Instrument
A self-report instrument definition (static data).
InstrumentDto
A serializable snapshot of an instrument for the UI (items, options, bands, disclaimer).
ResponseOption
One selectable response on an instrument’s ordinal scale (e.g. 0 = "Not at all").
SeverityBand
A severity band [min, max] (inclusive) over the total score, with a non-diagnostic interpretation.

Statics§

GAD7
GAD-7 (Generalized Anxiety Disorder-7) — anxiety. Free to use (Spitzer, Kroenke & Williams).
PHQ9
PHQ-9 (Patient Health Questionnaire-9) — depression. Free to use (Spitzer, Kroenke & Williams).

Functions§

assessment_record_id
record ID.
assessment_summary
Lossless JSON of a result — stored as the journal summary so it reconstructs on read.
build_assessment_envelope
Builds the envelope.
instrument
Look up an instrument by id ("phq9" | "gad7").
instrument_dto
Instrument DTO.
instruments
All instruments this build ships.
parse_assessment
Reconstruct a result from its stored JSON.
score
Score a set of responses against an instrument. Fail-closed: wrong response count or an out-of-range value is an error, not a silently mis-scored result.