Schema reference / Tables / view MDX source
form
The clinical spine — every entry belongs to a form.
The clinical spine — every entry belongs to a form.
Source
| Model | Leg | Role |
|---|---|---|
form | openEHR | defines this table |
An ENTRY-derived table (an observation, evaluation, instruction or action) is always recorded on a form, which carries the patient and encounter context for everything on it. Deleting a form cascades to every entry recorded against it.
patient_id and encounter_id are plain uuid columns here and gain their foreign keys at the very end of the apply order, because form is created before the administrative tables exist. A build without an administrative Patient or Encounter leaves them unconstrained and says so in the compile report.
Columns
| Column | Type | Null | Description | Source |
|---|---|---|---|---|
id | uuid primary key | no | Primary key. | — |
template_id | text | no | Identifier of the form template this was captured with. | — |
patient_id | uuid | yes | Patient the form was recorded for; foreign key added at the end of the apply order. | — |
encounter_id | uuid | yes | Encounter the form was recorded in; foreign key added at the end of the apply order. | — |
name | text | yes | Display name of the form. | — |
created_at | timestamptz | no | Row creation timestamp. | — |
updated_at | timestamptz | no | Row update timestamp; maintained by the application. | — |
created_by | text | no | Actor who created the row. | — |
updated_by | text | no | Actor who last updated the row. | — |
Referenced by
156 tables reference form, via form_id. The first 15 alphabetically:
absenceviaform_idacvpuviaform_idadvance_care_directiveviaform_idadvance_intervention_decisionsviaform_idadverse_reaction_monitoringviaform_idadverse_reaction_riskviaform_idadverse_reaction_screeningviaform_idage_assertionviaform_idalcohol_consumption_summaryviaform_idapgarviaform_idart_cycle_summaryviaform_idasa_statusviaform_idberg_balance_scaleviaform_idblood_pressureviaform_idbody_mass_indexviaform_id
Definition
create table form (
id uuid primary key default uuid_generate_v4(),
template_id text not null,
-- context links into the administrative layer; the foreign keys land in
-- 900_foreign_keys.sql because form is created before the admin tables exist
patient_id uuid,
encounter_id uuid,
name text,
created_at timestamptz not null default current_timestamp,
updated_at timestamptz not null default current_timestamp,
created_by text not null,
updated_by text not null
);