class Consent

Table name: consents

id                                              :bigint           not null, primary key
academic_year                                   :integer          not null
disease_types                                   :enum             not null, is an Array
follow_up_outcome                               :integer
follow_up_requested                             :boolean
follow_up_resolved_at                           :datetime
health_answers                                  :jsonb            not null
invalidated_at                                  :datetime
notes                                           :text             default(""), not null
notify_parent_on_refusal                        :boolean
notify_parents_on_vaccination                   :boolean
parent_email                                    :string
parent_full_name                                :string
parent_phone                                    :string
parent_phone_receive_updates                    :boolean
parent_relationship_other_name                  :string
parent_relationship_type                        :string
patient_already_vaccinated_notification_sent_at :datetime
programme_type                                  :enum             not null
reason_for_refusal                              :integer
response                                        :integer          not null
route                                           :integer          not null
submitted_at                                    :datetime         not null
vaccine_methods                                 :integer          default([]), not null, is an Array
withdrawn_at                                    :datetime
without_gelatine                                :boolean
created_at                                      :datetime         not null
updated_at                                      :datetime         not null
consent_form_id                                 :bigint
parent_id                                       :bigint
patient_id                                      :bigint           not null
recorded_by_user_id                             :bigint
team_id                                         :bigint           not null

Indexes

index_consents_on_academic_year        (academic_year)
index_consents_on_consent_form_id      (consent_form_id)
index_consents_on_parent_id            (parent_id)
index_consents_on_patient_id           (patient_id)
index_consents_on_programme_type       (programme_type)
index_consents_on_recorded_by_user_id  (recorded_by_user_id)
index_consents_on_team_id              (team_id)

Foreign Keys

fk_rails_...  (consent_form_id => consent_forms.id)
fk_rails_...  (parent_id => parents.id)
fk_rails_...  (patient_id => patients.id)
fk_rails_...  (recorded_by_user_id => users.id)
fk_rails_...  (team_id => teams.id)