feat(diagnose): Master-detail layout en verbeterde ICD-10 combobox

Diagnose pagina:
- Master-detail layout (lijst links, formulier rechts)
- URL state voor selectie (?selected=uuid of ?selected=new)
- Inline CRUD zonder modals of navigatie
- Vereenvoudigde header (alleen actieve diagnoses teller)

ICD-10 Combobox:
- Vervangen cmdk/Command met simpele Popover + buttons (fix selectie bug)
- Direct typen in input veld (geen extra klik nodig)
- Auto-open dropdown bij focus/typen

Database:
- Fix FK constraint: conditions.encounter_id -> intakes (was encounters)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
colinislit
2025-12-18 09:17:18 +01:00
parent 56bea91d10
commit 4606a975aa
7 changed files with 881 additions and 211 deletions

View File

@@ -0,0 +1,15 @@
-- Migration: Fix conditions.encounter_id foreign key
-- The encounter_id column references intakes, not encounters
-- This migration drops the incorrect FK constraint and adds the correct one
-- Step 1: Drop the incorrect foreign key constraint
ALTER TABLE conditions
DROP CONSTRAINT IF EXISTS conditions_encounter_id_fkey;
-- Step 2: Add the correct foreign key constraint to intakes table
ALTER TABLE conditions
ADD CONSTRAINT conditions_intake_id_fkey
FOREIGN KEY (encounter_id) REFERENCES intakes(id) ON DELETE SET NULL;
-- Add comment for clarity
COMMENT ON COLUMN conditions.encounter_id IS 'Reference to intake (despite column name, links to intakes table for historical reasons)';