{"findings":[{"severity":"Important","file":"scripts/health/dashboard_v5/medication_contract.py","line":334,"issue":"Correction validation does not enforce dose semantics against corrected_target_status. A correction to administered may omit actual dose/value entirely, while corrections to planned or missed may carry actual-dose fields. This permits internally contradictory correction events and breaks planned/administered/missed separation.","remediation":"For corrected events, validate fields according to corrected_target_status: administered must require actual dose value and unit; planned must reject actual-dose fields and require only explicitly documented planned fields as applicable; missed must reject both actual-dose and misleading planned-dose payloads. Add regression tests for every target status."},{"severity":"Important","file":"scripts/health/dashboard_v5/read_api.py","line":4207,"issue":"The doctor-report projection drops superseded_by_correction and correction-chain linkage. Consequently, a corrected original remains presented affirmatively in its original administered/missed/planned section while the correction appears separately, and intermediate corrections in a cycle are indistinguishable from the latest effective revision.","remediation":"Resolve each correction chain to its latest effective revision for report output, or retain explicit non-private superseded/effective markers and visibly label or exclude superseded originals. Add report tests for administered→missed and multi-step correction chains, including unknown/incomplete targets."},{"severity":"Important","file":"scripts/health/assets/health-assets/dashboard-v5-record.js","line":808,"issue":"The medication detail disclosure labels legacy free-text dose as “Tatsächliche Dosis” whenever structured actual dose is absent, including planned, missed, corrected, and unknown rows. This converts an intentionally uninterpreted legacy value into an affirmative actual-dose display.","remediation":"Never use legacy_dose as fallback for the actual-dose field. Render structured planned dose, structured actual dose, and legacy free text as separate labeled facts; keep legacy text explicitly uninterpreted for every status."},{"severity":"Important","file":"scripts/health/dashboard_v5/read_api.py","line":3875,"issue":"The “next planned medication” overview only considers scheduled_next_date and does not exclude plans already consumed by a linked administered or missed event. A valid future planned event whose optional scheduled_next_date is null disappears, while an already fulfilled or missed plan can still be shown as the next plan.","remediation":"Derive the effective plan date from the controlled planned event date with scheduled_next_date only as an optional explicit override, and exclude plans consumed through planned_event_id by administered or missed events. Add counterexamples for null scheduled_next_date and consumed plans."},{"severity":"Important","file":"scripts/health/dashboard_v5/read_api.py","line":3558,"issue":"A prescription is exposed as active—and receives an immediate administration action—solely from prescription_status='active'. Missing status source, provenance, or structured revision does not demote it to unknown, even though the schema permits those fields to be absent. This can turn an unsupported raw status into an affirmative current prescription.","remediation":"Require the complete trusted active-status contract at the read boundary, including controlled source/provenance and the required structured revision; otherwise expose status as unknown and do not offer the active-prescription action. Enforce the same invariant in schema/write validation and add missing-provenance tests."}],"verdict":"BLOCK"}