Skip to content

Commit 5fa8c75

Browse files
Add columns for saving the reason code and term from the Imms API
These columns will be used to save the SNOMED reason code and reason term for records which we pull from the Imms API. This will be useful for us to query when investigating for the Vaccs History Alpha. Jira-Issue: MAV-5719
1 parent 51bf616 commit 5fa8c75

5 files changed

Lines changed: 19 additions & 2 deletions

File tree

app/models/vaccination_record.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
# nhs_immunisations_api_primary_source :boolean
2323
# nhs_immunisations_api_snomed_procedure_code :string
2424
# nhs_immunisations_api_snomed_procedure_term :string
25+
# nhs_immunisations_api_snomed_reason_code :string
26+
# nhs_immunisations_api_snomed_reason_term :string
2527
# nhs_immunisations_api_sync_pending_at :datetime
2628
# nhs_immunisations_api_synced_at :datetime
2729
# notes :text
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# frozen_string_literal: true
2+
3+
class AddReasonCodeToVaccinationRecords < ActiveRecord::Migration[8.1]
4+
def change
5+
change_table :vaccination_records, bulk: true do |t|
6+
t.string :nhs_immunisations_api_snomed_reason_code
7+
t.string :nhs_immunisations_api_snomed_reason_term
8+
end
9+
end
10+
end

db/schema.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
#
1111
# It's strongly recommended that you check this file into your version control system.
1212

13-
14-
ActiveRecord::Schema[8.1].define(version: 2026_03_30_130232) do
13+
ActiveRecord::Schema[8.1].define(version: 2026_03_31_100000) do
1514
# These are extensions that must be enabled in order to support this database
1615
enable_extension "pg_catalog.plpgsql"
1716
enable_extension "pg_trgm"
@@ -1007,6 +1006,8 @@
10071006
t.boolean "nhs_immunisations_api_primary_source"
10081007
t.string "nhs_immunisations_api_snomed_procedure_code"
10091008
t.string "nhs_immunisations_api_snomed_procedure_term"
1009+
t.string "nhs_immunisations_api_snomed_reason_code"
1010+
t.string "nhs_immunisations_api_snomed_reason_term"
10101011
t.datetime "nhs_immunisations_api_sync_pending_at"
10111012
t.datetime "nhs_immunisations_api_synced_at"
10121013
t.text "notes"

spec/factories/vaccination_records.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
# nhs_immunisations_api_primary_source :boolean
2323
# nhs_immunisations_api_snomed_procedure_code :string
2424
# nhs_immunisations_api_snomed_procedure_term :string
25+
# nhs_immunisations_api_snomed_reason_code :string
26+
# nhs_immunisations_api_snomed_reason_term :string
2527
# nhs_immunisations_api_sync_pending_at :datetime
2628
# nhs_immunisations_api_synced_at :datetime
2729
# notes :text

spec/models/vaccination_record_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
# nhs_immunisations_api_primary_source :boolean
2323
# nhs_immunisations_api_snomed_procedure_code :string
2424
# nhs_immunisations_api_snomed_procedure_term :string
25+
# nhs_immunisations_api_snomed_reason_code :string
26+
# nhs_immunisations_api_snomed_reason_term :string
2527
# nhs_immunisations_api_sync_pending_at :datetime
2628
# nhs_immunisations_api_synced_at :datetime
2729
# notes :text

0 commit comments

Comments
 (0)