form

The clinical spine — every entry belongs to a form.

The clinical spine — every entry belongs to a form.

Source

ModelLegRole
formopenEHRdefines 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

ColumnTypeNullDescriptionSource
iduuid primary keynoPrimary key.
template_idtextnoIdentifier of the form template this was captured with.
patient_iduuidyesPatient the form was recorded for; foreign key added at the end of the apply order.
encounter_iduuidyesEncounter the form was recorded in; foreign key added at the end of the apply order.
nametextyesDisplay name of the form.
created_attimestamptznoRow creation timestamp.
updated_attimestamptznoRow update timestamp; maintained by the application.
created_bytextnoActor who created the row.
updated_bytextnoActor who last updated the row.

Referenced by

156 tables reference form, via form_id. The first 15 alphabetically:

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
);