This repository has been archived by the owner on May 2, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SARAALERT-1599: Update Vaccine Products Names to CDC Formatting (#1064)
* Update vaccine names to match CDC product names We are updating vaccine names again to match the names listed here: https://www2a.cdc.gov/vaccines/iis/iisstandards/vaccines.asp?rpt=tradename for sake of consistency over time. * Migration to update vaccine names to match cdc product name We had previously updated the names of the vaccines and added new vaccines in a prior migration, but this migration is needed to update all of the existing vaccines to match the product name values used by the cdc. * Update excel guidance and test fixtures to include new vaccine names * Fix vaccine names in where clauses in migration Co-authored-by: Tom Strassner <tstrassner@mitre.org>
- Loading branch information
Showing
14 changed files
with
140 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
db/migrate/20210901192909_update_vaccine_product_names_to_match_cdc.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
class UpdateVaccineProductNamesToMatchCdc < ActiveRecord::Migration[6.1] | ||
def up | ||
# Update all vaccine names which have changed | ||
Vaccine.where(product_name: 'Moderna COVID-19 Vaccine (Non-US tradename: Spikevax)').update_all(product_name: 'Moderna COVID-19 Vaccine (non-US Spikevax)') | ||
Vaccine.where(product_name: 'Pfizer-BioNTech COVID-19 Vaccine (Tradename: COMIRNATY)').update_all(product_name: 'Pfizer-BioNTech COVID-19 Vaccine (COMIRNATY)') | ||
Vaccine.where(product_name: 'AstraZeneca COVID-19 Vaccine (Non-US tradenames: VAXZEVRIA, COVISHIELD)').update_all(product_name: 'AstraZeneca COVID-19 Vaccine (Non-US tradenames include VAXZEVRIA, COVISHIELD)') | ||
Vaccine.where(product_name: 'Coronavac (Sinovac) COVID-19 Vaccine (Non-US)').update_all(product_name: 'Coronavac (Sinovac) COVID-19 Vaccine') | ||
Vaccine.where(product_name: 'Sinopharm (BIBP) COVID-19 Vaccine (Non-US)').update_all(product_name: 'Sinopharm (BIBP) COVID-19 Vaccine') | ||
|
||
# Update all saved user_export_presets | ||
ActiveRecord::Base.connection.raw_connection.prepare(Arel.sql("UPDATE user_export_presets SET config = REPLACE(config, 'Moderna COVID-19 Vaccine (Non-US tradename: Spikevax)', 'Moderna COVID-19 Vaccine (non-US Spikevax)') WHERE config REGEXP 'Moderna'")).execute | ||
ActiveRecord::Base.connection.raw_connection.prepare(Arel.sql("UPDATE user_export_presets SET config = REPLACE(config, 'Pfizer-BioNTech COVID-19 Vaccine (Tradename: COMIRNATY)', 'Pfizer-BioNTech COVID-19 Vaccine (COMIRNATY)') WHERE config REGEXP 'Pfizer'")).execute | ||
ActiveRecord::Base.connection.raw_connection.prepare(Arel.sql("UPDATE user_export_presets SET config = REPLACE(config, 'AstraZeneca COVID-19 Vaccine (Non-US tradenames: VAXZEVRIA, COVISHIELD)', 'AstraZeneca COVID-19 Vaccine (Non-US tradenames include VAXZEVRIA, COVISHIELD)') WHERE config REGEXP 'AstraZeneca'")).execute | ||
ActiveRecord::Base.connection.raw_connection.prepare(Arel.sql("UPDATE user_export_presets SET config = REPLACE(config, 'Coronavac (Sinovac) COVID-19 Vaccine (Non-US)', 'Coronavac (Sinovac) COVID-19 Vaccine') WHERE config REGEXP 'Coronavac'")).execute | ||
ActiveRecord::Base.connection.raw_connection.prepare(Arel.sql("UPDATE user_export_presets SET config = REPLACE(config, 'Sinopharm (BIBP) COVID-19 Vaccine (Non-US)', 'Sinopharm (BIBP) COVID-19 Vaccine') WHERE config REGEXP 'Sinopharm'")).execute | ||
|
||
# Update all saved user_filters | ||
ActiveRecord::Base.connection.raw_connection.prepare(Arel.sql("UPDATE user_filters SET contents = REPLACE(contents, 'Moderna COVID-19 Vaccine (Non-US tradename: Spikevax)', 'Moderna COVID-19 Vaccine (non-US Spikevax)') WHERE contents REGEXP 'Moderna'")).execute | ||
ActiveRecord::Base.connection.raw_connection.prepare(Arel.sql("UPDATE user_filters SET contents = REPLACE(contents, 'Pfizer-BioNTech COVID-19 Vaccine (Tradename: COMIRNATY)', 'Pfizer-BioNTech COVID-19 Vaccine (COMIRNATY)') WHERE contents REGEXP 'Pfizer'")).execute | ||
ActiveRecord::Base.connection.raw_connection.prepare(Arel.sql("UPDATE user_filters SET contents = REPLACE(contents, 'AstraZeneca COVID-19 Vaccine (Non-US tradenames: VAXZEVRIA, COVISHIELD)', 'AstraZeneca COVID-19 Vaccine (Non-US tradenames include VAXZEVRIA, COVISHIELD)') WHERE contents REGEXP 'AstraZeneca'")).execute | ||
ActiveRecord::Base.connection.raw_connection.prepare(Arel.sql("UPDATE user_filters SET contents = REPLACE(contents, 'Coronavac (Sinovac) COVID-19 Vaccine (Non-US)', 'Coronavac (Sinovac) COVID-19 Vaccine') WHERE contents REGEXP 'Coronavac'")).execute | ||
ActiveRecord::Base.connection.raw_connection.prepare(Arel.sql("UPDATE user_filters SET contents = REPLACE(contents, 'Sinopharm (BIBP) COVID-19 Vaccine (Non-US)', 'Sinopharm (BIBP) COVID-19 Vaccine') WHERE contents REGEXP 'Sinopharm'")).execute | ||
end | ||
|
||
def down | ||
# Revert the vaccine names which have changed | ||
Vaccine.where(product_name: 'Moderna COVID-19 Vaccine (non-US Spikevax)').update_all(product_name: 'Moderna COVID-19 Vaccine (Non-US tradename: Spikevax)') | ||
Vaccine.where(product_name: 'Pfizer-BioNTech COVID-19 Vaccine (COMIRNATY)').update_all(product_name: 'Pfizer-BioNTech COVID-19 Vaccine (Tradename: COMIRNATY)') | ||
Vaccine.where(product_name: 'AstraZeneca COVID-19 Vaccine (Non-US tradenames include VAXZEVRIA, COVISHIELD)').update_all(product_name: 'AstraZeneca COVID-19 Vaccine (Non-US tradenames: VAXZEVRIA, COVISHIELD)') | ||
Vaccine.where(product_name: 'Coronavac (Sinovac) COVID-19 Vaccine').update_all(product_name: 'Coronavac (Sinovac) COVID-19 Vaccine (Non-US)') | ||
Vaccine.where(product_name: 'Sinopharm (BIBP) COVID-19 Vaccine').update_all(product_name: 'Sinopharm (BIBP) COVID-19 Vaccine (Non-US)') | ||
|
||
# Revert the saved user_export_presets | ||
ActiveRecord::Base.connection.raw_connection.prepare(Arel.sql("UPDATE user_export_presets SET config = REPLACE(config, 'Moderna COVID-19 Vaccine (non-US Spikevax)', 'Moderna COVID-19 Vaccine (Non-US tradename: Spikevax)') WHERE config REGEXP 'Moderna'")).execute | ||
ActiveRecord::Base.connection.raw_connection.prepare(Arel.sql("UPDATE user_export_presets SET config = REPLACE(config, 'Pfizer-BioNTech COVID-19 Vaccine (COMIRNATY)', 'Pfizer-BioNTech COVID-19 Vaccine (Tradename: COMIRNATY)') WHERE config REGEXP 'Pfizer'")).execute | ||
ActiveRecord::Base.connection.raw_connection.prepare(Arel.sql("UPDATE user_export_presets SET config = REPLACE(config, 'Coronavac (Sinovac) COVID-19 Vaccine', 'Coronavac (Sinovac) COVID-19 Vaccine (Non-US)') WHERE config REGEXP 'Coronovac'")).execute | ||
ActiveRecord::Base.connection.raw_connection.prepare(Arel.sql("UPDATE user_export_presets SET config = REPLACE(config, 'Sinopharm (BIBP) COVID-19 Vaccine', 'Sinopharm (BIBP) COVID-19 Vaccine (Non-US)') WHERE config REGEXP 'Sinopharm'")).execute | ||
ActiveRecord::Base.connection.raw_connection.prepare(Arel.sql("UPDATE user_export_presets SET config = REPLACE(config, 'AstraZeneca COVID-19 Vaccine (Non-US tradenames include VAXZEVRIA, COVISHIELD)', 'AstraZeneca COVID-19 Vaccine (Non-US tradenames: VAXZEVRIA, COVISHIELD)') WHERE config REGEXP 'AstraZeneca'")).execute | ||
|
||
# Revert the saved user_filter_presets | ||
ActiveRecord::Base.connection.raw_connection.prepare(Arel.sql("UPDATE user_filters SET contents = REPLACE(contents, 'Moderna COVID-19 Vaccine (non-US Spikevax)', 'Moderna COVID-19 Vaccine (Non-US tradename: Spikevax)') WHERE contents REGEXP 'Moderna'")).execute | ||
ActiveRecord::Base.connection.raw_connection.prepare(Arel.sql("UPDATE user_filters SET contents = REPLACE(contents, 'Pfizer-BioNTech COVID-19 Vaccine (COMIRNATY)', 'Pfizer-BioNTech COVID-19 Vaccine (Tradename: COMIRNATY)') WHERE contents REGEXP 'Pfizer'")).execute | ||
ActiveRecord::Base.connection.raw_connection.prepare(Arel.sql("UPDATE user_filters SET contents = REPLACE(contents, 'Coronavac (Sinovac) COVID-19 Vaccine', 'Coronavac (Sinovac) COVID-19 Vaccine (Non-US)') WHERE contents REGEXP 'Coronovac'")).execute | ||
ActiveRecord::Base.connection.raw_connection.prepare(Arel.sql("UPDATE user_filters SET contents = REPLACE(contents, 'Sinopharm (BIBP) COVID-19 Vaccine', 'Sinopharm (BIBP) COVID-19 Vaccine (Non-US)') WHERE contents REGEXP 'Sinopharm'")).execute | ||
ActiveRecord::Base.connection.raw_connection.prepare(Arel.sql("UPDATE user_filters SET contents = REPLACE(contents, 'AstraZeneca COVID-19 Vaccine (Non-US tradenames include VAXZEVRIA, COVISHIELD)', 'AstraZeneca COVID-19 Vaccine (Non-US tradenames: VAXZEVRIA, COVISHIELD)') WHERE contents REGEXP 'AstraZeneca'")).execute | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Git LFS file not shown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Git LFS file not shown
Git LFS file not shown
4 changes: 2 additions & 2 deletions
4
test/fixtures/files/Sara-Alert-Format-Isolation-Workflow.xlsx
Git LFS file not shown
4 changes: 2 additions & 2 deletions
4
test/fixtures/files/Sara-Alert-Format-With-Jurisdictions-EW.xlsx
Git LFS file not shown
4 changes: 2 additions & 2 deletions
4
test/fixtures/files/Sara-Alert-Format-With-Jurisdictions-IW.xlsx
Git LFS file not shown
Oops, something went wrong.