class VaccinationRecord

Schema Information

Table name: vaccination_records

id                                          :bigint           not null, primary key
batch_expiry                                :date
batch_number                                :string
confirmation_sent_at                        :datetime
delivery_method                             :integer
delivery_site                               :integer
discarded_at                                :datetime
disease_types                               :enum             not null, is an Array
dose_sequence                               :integer
full_dose                                   :boolean
local_patient_id_uri                        :string
location_name                               :string
nhs_immunisations_api_etag                  :string
nhs_immunisations_api_identifier_system     :string
nhs_immunisations_api_identifier_value      :string
nhs_immunisations_api_primary_source        :boolean
nhs_immunisations_api_recorded_at           :datetime
nhs_immunisations_api_snomed_procedure_code :string
nhs_immunisations_api_snomed_procedure_term :string
nhs_immunisations_api_snomed_product_code   :string
nhs_immunisations_api_snomed_product_term   :string
nhs_immunisations_api_snomed_reason_code    :string
nhs_immunisations_api_snomed_reason_term    :string
nhs_immunisations_api_sync_pending_at       :datetime
nhs_immunisations_api_synced_at             :datetime
notes                                       :text
notify_parents                              :boolean
outcome                                     :integer          not null
pending_changes                             :jsonb            not null
performed_at_date                           :date             not null
performed_at_time                           :time
performed_by_family_name                    :string
performed_by_given_name                     :string
performed_ods_code                          :string
programme_type                              :enum             not null
protocol                                    :integer
source                                      :integer          not null
uuid                                        :uuid             not null
created_at                                  :datetime         not null
updated_at                                  :datetime         not null
duplicate_of_vaccination_record_id          :bigint
local_patient_id                            :string
location_id                                 :bigint
next_dose_delay_triage_id                   :bigint
nhs_immunisations_api_id                    :string
patient_id                                  :bigint           not null
performed_by_user_id                        :bigint
reported_by_id                              :bigint
session_id                                  :bigint
supplied_by_user_id                         :bigint
vaccine_id                                  :bigint

Indexes

idx_on_duplicate_of_vaccination_record_id_5071adce87            (duplicate_of_vaccination_record_id)
idx_on_patient_id_programme_type_outcome_453b557b54             (patient_id,programme_type,outcome) WHERE (discarded_at IS NULL)
index_vaccination_records_on_discarded_at                       (discarded_at)
index_vaccination_records_on_location_id                        (location_id)
index_vaccination_records_on_next_dose_delay_triage_id          (next_dose_delay_triage_id)
index_vaccination_records_on_nhs_immunisations_api_id           (nhs_immunisations_api_id) UNIQUE
index_vaccination_records_on_patient_id                         (patient_id)
index_vaccination_records_on_patient_id_and_session_id          (patient_id,session_id)
index_vaccination_records_on_pending_changes_not_empty          (id) WHERE (pending_changes <> '{}'::jsonb)
index_vaccination_records_on_performed_by_user_id               (performed_by_user_id)
index_vaccination_records_on_performed_ods_code_and_patient_id  (performed_ods_code,patient_id) WHERE (session_id IS NULL)
index_vaccination_records_on_programme_type                     (programme_type)
index_vaccination_records_on_reported_by_id                     (reported_by_id)
index_vaccination_records_on_session_id                         (session_id)
index_vaccination_records_on_supplied_by_user_id                (supplied_by_user_id)
index_vaccination_records_on_uuid                               (uuid) UNIQUE
index_vaccination_records_on_vaccine_id                         (vaccine_id)

Foreign Keys

fk_rails_...  (duplicate_of_vaccination_record_id => vaccination_records.id)
fk_rails_...  (next_dose_delay_triage_id => triages.id)
fk_rails_...  (patient_id => patients.id)
fk_rails_...  (performed_by_user_id => users.id)
fk_rails_...  (reported_by_id => users.id)
fk_rails_...  (session_id => sessions.id)
fk_rails_...  (supplied_by_user_id => users.id)
fk_rails_...  (vaccine_id => vaccines.id)