885 B
Session parameters are JSON, described by the resource type
What an operator records for a treated area splits in two: facts every specialty shares — which
resource, when it started and finished, the note — and readings that belong to one kind of device,
like a laser's energy, pulse and shot count. The shared facts are real columns on the session's area
record; the device-specific readings live in a parameters JSON column, and the field list that
drives the form and its validation is declared on the resource type. Adding a dentistry or RF device
is then a settings change, not a migration.
Consequences
Aggregate reporting over a JSON key (average energy per area over a quarter) has no index behind it and will be slow. If such a report becomes a first-class requirement, the specific keys get promoted to real columns rather than the whole design being reversed.