renalware-core 2.0.64 → 2.0.67
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/renalware/application.js.erb +2 -2
- data/app/controllers/renalware/admin/users_controller.rb +1 -1
- data/app/controllers/renalware/api/ukrdc/patients_controller.rb +14 -67
- data/app/controllers/renalware/drugs/drugs_controller.rb +1 -1
- data/app/controllers/renalware/hd/protocols_controller.rb +1 -1
- data/app/controllers/renalware/patients/bookmarks_controller.rb +16 -5
- data/app/controllers/renalware/snippets/snippets_controller.rb +1 -1
- data/app/controllers/renalware/system/user_feedback_controller.rb +1 -1
- data/app/documents/renalware/hd/session_document.rb +1 -0
- data/app/models/renalware/admissions/consult_query.rb +1 -1
- data/app/models/renalware/clinical/dry_weight.rb +4 -0
- data/app/models/renalware/clinical/patient.rb +5 -0
- data/app/models/renalware/clinical/patient_dry_weights_query.rb +1 -1
- data/app/models/renalware/directory/person_query.rb +1 -1
- data/app/models/renalware/hd/mdm_patients_query.rb +1 -1
- data/app/models/renalware/hd/patient.rb +6 -0
- data/app/models/renalware/hd/patient_listener.rb +8 -0
- data/app/models/renalware/hd/sessions/ongoing_query.rb +1 -1
- data/app/models/renalware/hd/sessions/patient_query.rb +1 -1
- data/app/models/renalware/letters/descriptions/search_query.rb +1 -1
- data/app/models/renalware/letters/letter_factory.rb +55 -2
- data/app/models/renalware/letters/letter_query.rb +1 -1
- data/app/models/renalware/letters/recipient.rb +11 -0
- data/app/models/renalware/letters/resolve_default_electronic_ccs.rb +47 -0
- data/app/models/renalware/low_clearance/mdm_patients_query.rb +1 -1
- data/app/models/renalware/medications/prescriptions_by_drug_type_query.rb +1 -1
- data/app/models/renalware/medications/prescriptions_query.rb +1 -1
- data/app/models/renalware/patients/bookmarks_query.rb +49 -0
- data/app/models/renalware/patients/patient_search.rb +1 -1
- data/app/models/renalware/pd/mdm_patients_query.rb +1 -1
- data/app/models/renalware/renal/prd_descriptions/search_query.rb +1 -1
- data/app/models/renalware/transplants/live_donors_query.rb +1 -1
- data/app/models/renalware/transplants/mdm_patients_query.rb +1 -1
- data/app/models/renalware/transplants/registrations/wait_list_query.rb +1 -1
- data/app/models/renalware/ukrdc/create_encrypted_patient_xml_files.rb +13 -11
- data/app/models/renalware/ukrdc/create_patient_xml_file.rb +33 -21
- data/app/models/renalware/ukrdc/transmission_log.rb +1 -1
- data/app/models/renalware/ukrdc/xml_renderer.rb +126 -0
- data/app/presenters/renalware/clinical/dry_weight_presenter.rb +4 -0
- data/app/presenters/renalware/clinical/dry_weights_presenter.rb +15 -9
- data/app/presenters/renalware/ukrdc/modality_presenter.rb +8 -0
- data/app/presenters/renalware/ukrdc/patient_presenter.rb +9 -6
- data/app/views/renalware/api/ukrdc/patients/_clinical_relationships.xml.builder +4 -4
- data/app/views/renalware/api/ukrdc/patients/_encounters.xml.builder +9 -9
- data/app/views/renalware/api/ukrdc/patients/_family_histories.xml.builder +4 -4
- data/app/views/renalware/api/ukrdc/patients/_patient.xml.builder +1 -20
- data/app/views/renalware/api/ukrdc/patients/_program_memberships.xml.builder +4 -4
- data/app/views/renalware/api/ukrdc/patients/_surveys.xml.builder +4 -4
- data/app/views/renalware/api/ukrdc/patients/encounters/_hd_session.xml.builder +31 -31
- data/app/views/renalware/api/ukrdc/patients/encounters/_treatment.xml.builder +34 -0
- data/app/views/renalware/api/ukrdc/patients/lab_orders/_lab_order.xml.builder +1 -1
- data/app/views/renalware/api/ukrdc/patients/show.xml.builder +1 -1
- data/app/views/renalware/hd/mdm/_summary.html.slim +12 -4
- data/app/views/renalware/hd/protocols/_recent_pathology.html.slim +4 -0
- data/app/views/renalware/hd/sessions/_form.html.slim +1 -0
- data/app/views/renalware/mdm/_prescription_buttons.html.slim +15 -0
- data/app/views/renalware/mdm/_prescriptions.html.slim +1 -8
- data/app/views/renalware/patients/bookmarks/_bookmark.html.slim +16 -0
- data/app/views/renalware/patients/bookmarks/_table.html.slim +20 -0
- data/app/views/renalware/patients/bookmarks/index.html.slim +3 -1
- data/app/views/renalware/transplants/mdm/_prescriptions.html.slim +1 -8
- data/config/initializers/core_extensions.rb +1 -1
- data/config/initializers/renalware.rb +3 -0
- data/config/locales/renalware/hd/session.en.yml +7 -0
- data/config/locales/renalware/patients/bookmarks.en.yml +12 -0
- data/config/locales/renalware/patients/side_menu.en.yml +1 -1
- data/db/migrate/20150119160039_create_versions.rb +3 -3
- data/db/migrate/20150120155952_create_problem_versions.rb +3 -3
- data/db/migrate/20150203161438_create_medication_prescription_versions.rb +3 -3
- data/db/migrate/20150515155052_users_have_and_belong_to_many_roles.rb +3 -1
- data/db/migrate/20160120203747_create_access_versions.rb +3 -3
- data/db/migrate/20160121175711_create_hd_versions.rb +3 -3
- data/db/migrate/20170217141529_create_clinic_versions.rb +3 -3
- data/db/migrate/20170217161409_create_patient_versions.rb +3 -3
- data/db/migrate/20170605102519_create_clinical_versions.rb +3 -3
- data/db/migrate/20171002175804_add_rr_columns_to_transplant_registration_status_descriptions.rb +9 -7
- data/db/migrate/20171003093347_create_hospital_wards.rb +14 -12
- data/db/migrate/20171003111228_create_aki_alert_actions.rb +6 -4
- data/db/migrate/20171003122425_create_renal_aki_alerts.rb +18 -16
- data/db/migrate/20171004092235_create_hd_dialysates.rb +9 -7
- data/db/migrate/20171004110909_add_dialysate_id_to_profile_and_session.rb +6 -4
- data/db/migrate/20171005081224_create_reporting_bone_audit.rb +3 -1
- data/db/migrate/20171005091202_reporting_audit_changes.rb +5 -3
- data/db/migrate/20171005130109_create_medication_current_prescriptions.rb +3 -1
- data/db/migrate/20171005144505_create_reporting_anaemia_audit.rb +3 -1
- data/db/migrate/20171009104106_add_legacy_patient_id_to_patients.rb +4 -2
- data/db/migrate/20171009181615_add_columns_to_drug_drugs.rb +6 -4
- data/db/migrate/20171012110133_create_research_studies.rb +19 -17
- data/db/migrate/20171012143050_create_research_study_participants.rb +27 -25
- data/db/migrate/20171013145849_set_patients_secure_id.rb +12 -10
- data/db/migrate/20171016152223_add_index_to_diary_slots.rb +14 -12
- data/db/migrate/20171017132738_add_unique_indexes_to_local_patient_ids.rb +11 -9
- data/db/migrate/20171017171625_update_hd_overall_audit_view.rb +7 -5
- data/db/migrate/20171101121130_create_function_to_render_audit_view_as_json.rb +6 -4
- data/db/migrate/20171101162244_create_consults.rb +21 -19
- data/db/migrate/20171106100216_create_pd_audit_view.rb +3 -1
- data/db/migrate/20171109084751_remove_local_patient_id_unique_idx.rb +11 -9
- data/db/migrate/20171113120217_add_uuid_to_hd_sessions.rb +4 -2
- data/db/migrate/20171114120904_add_pathology_snapshot_to_letters.rb +3 -1
- data/db/migrate/20171118160030_add_tags_to_patient_bookmarks.rb +3 -1
- data/db/migrate/20171123123712_add_id_to_roles_users.rb +3 -1
- data/db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb +13 -12
- data/db/migrate/20171123154116_create_renal_versions.rb +11 -9
- data/db/migrate/20171127082158_add_region_to_addresses.rb +3 -1
- data/db/migrate/20171127092158_create_function_to_import_practices.rb +6 -2
- data/db/migrate/20171127092359_create_fn_to_insert_gps.rb +6 -2
- data/db/migrate/20171128163543_add_more_missing_indexes.rb +14 -12
- data/db/migrate/20171204112150_create_consult_sites.rb +13 -9
- data/db/migrate/20171206121652_add_loinc_code_to_observation_descriptions.rb +3 -1
- data/db/migrate/20171206140738_create_fn_to_load_practice_memberships_csv.rb +9 -5
- data/db/migrate/20171208211206_create_user_feedback.rb +7 -5
- data/db/migrate/20171211130716_remove_unused_patients_cols.rb +4 -2
- data/db/migrate/20171211131918_remove_email_from_primary_care_physicians.rb +5 -3
- data/db/migrate/20171211161400_create_pathology_current_table.rb +9 -7
- data/db/migrate/20171213111513_create_fn_to_refresh_current_obs.rb +6 -2
- data/db/migrate/20171214141335_create_trigger_to_update_current_observation_sets.rb +10 -6
- data/db/migrate/20171214190849_enforce_request_id_on_observations.rb +3 -1
- data/db/migrate/20171215122454_add_pathology_observation_set_to_letters.rb +8 -6
- data/db/migrate/20171219154529_create_admission_admissions.rb +25 -23
- data/db/migrate/20180102155055_update_patient_summaries_to_version_5.rb +3 -1
- data/db/migrate/20180105132358_add_emailed_at_to_letter_recipients.rb +4 -2
- data/db/migrate/20180108185400_remove_null_constraint_from_letters_pathology_snapshot.rb +3 -1
- data/db/migrate/20180112151706_create_low_clearance_profiles.rb +43 -41
- data/db/migrate/20180112151813_create_low_clearance_versions.rb +11 -9
- data/db/migrate/20180119121243_create_trigger_to_preprocess_hl7_msg.rb +10 -6
- data/db/migrate/20180121115246_add_include_pathology_in_letter_to_letters_letterheads.rb +3 -1
- data/db/migrate/20180122173922_create_virology_profiles.rb +5 -1
- data/db/migrate/20180125201356_make_obs_set_trigger_change_updated_at.rb +6 -2
- data/db/migrate/20180126142314_add_uuid_to_letters.rb +4 -2
- data/db/migrate/20180130165803_add_deleted_at_indexes.rb +14 -12
- data/db/migrate/20180201090444_add_created_at_to_delayed_jobs_in_hl7_trig_fn.rb +6 -2
- data/db/migrate/20180202184954_create_view_pathology_observation_digests.rb +3 -1
- data/db/migrate/20180206225525_update_fn_update_current_observation_set_from_trigger.rb +6 -2
- data/db/migrate/20180207082540_create_count_estimate_function.rb +6 -2
- data/db/migrate/20180208150629_add_authentication_token_to_users.rb +3 -1
- data/db/migrate/20180213124203_add_cancelled_to_pathology_observations.rb +7 -5
- data/db/migrate/20180213125734_update_fn_update_current_obs_set_trgger.rb +6 -2
- data/db/migrate/20180213171805_add_display_order_cols_to_observation_descriptions.rb +10 -8
- data/db/migrate/20180214124317_add_cols_to_aki_alerts.rb +7 -5
- data/db/migrate/20180216132741_disable_some_audits.rb +6 -4
- data/db/migrate/20180221210458_add_state_index_on_modalities.rb +3 -1
- data/db/migrate/20180222090501_add_partial_index_to_bookmarks.rb +4 -2
- data/db/migrate/20180223100420_add_sent_to_ukrdc_at_to_patients.rb +3 -1
- data/db/migrate/20180226124724_add_patient_id_to_virology_profile.rb +9 -5
- data/db/migrate/20180226132410_create_ukrdc_transmission_logs.rb +12 -10
- data/db/migrate/20180301095040_update_fn_to_upsert_gp_practive_memberships.rb +7 -3
- data/db/migrate/20180305134959_add_display_group_to_observation_desriptions.rb +23 -22
- data/db/migrate/20180306071308_remove_rogue_aki_alerts_column.rb +3 -1
- data/db/migrate/20180306080518_add_state_tracking_cols_to_letters.rb +17 -15
- data/db/migrate/20180307191650_add_dwell_time_to_pd_regime.rb +3 -1
- data/db/migrate/20180307223111_create_system_visits_and_events.rb +42 -39
- data/db/migrate/20180309140316_add_unique_constraint_to_obr_requestor.rb +3 -1
- data/db/migrate/20180311104609_remove_unique_obr_requestor_order_number_index.rb +4 -2
- data/db/migrate/20180313114927_remove_deleted_at_from_admission_consults.rb +3 -1
- data/db/migrate/20180313124819_remove_tx_operation_constraints.rb +7 -5
- data/db/migrate/20180319191942_create_function_to_sort_without_failing_on_nonnumerics.rb +6 -2
- data/db/migrate/20180323150241_update_path_obs_descs_for_letter_groupings.rb +25 -23
- data/db/migrate/20180326155400_add_admin_notes_to_system_user_feedback.rb +4 -2
- data/db/migrate/20180327100423_add_constraints_to_recipient_operations.rb +3 -1
- data/db/migrate/20180328210434_add_rrt_to_admission_consults.rb +3 -1
- data/db/migrate/20180419141524_add_cols_to_hd_patient_statistics.rb +8 -6
- data/db/migrate/20180422090043_update_hd_overall_audit_to_version_6.rb +85 -84
- data/db/migrate/20180427133558_add_code_to_hospitals_wards.rb +3 -1
- data/db/migrate/20180502093256_add_document_to_virology_profiles.rb +22 -21
- data/db/migrate/20180502110638_create_virology_versions.rb +7 -5
- data/db/migrate/20180510151959_update_hd_overall_audit_to_version_7.rb +8 -4
- data/db/migrate/20180511100345_add_notes_to_transplant_registration_statuses.rb +3 -1
- data/db/migrate/20180511140415_add_message_hash_messaging_messages.rb +4 -2
- data/db/migrate/20180511171835_create_unique_indexes_on_obr_obr_codes.rb +5 -3
- data/db/migrate/20180514151627_create_system_messages.rb +10 -8
- data/db/migrate/20180516111411_create_view_patient_current_modalities.rb +3 -1
- data/db/migrate/20180524072633_add_columns_to_dialysates.rb +10 -8
- data/db/migrate/20180524074320_add_columns_to_hd_dialysers.rb +8 -6
- data/db/migrate/20180605114332_create_pseudo_encrypt_function.rb +6 -2
- data/db/migrate/20180605141806_add_external_id_to_research_study_participants.rb +33 -31
- data/db/migrate/20180605175211_add_application_url_to_research_studies.rb +3 -1
- data/db/migrate/20180622130552_add_external_id_to_hd_sessions.rb +4 -2
- data/db/migrate/20180625124431_add_patient_identifier_to_feed_messages.rb +3 -1
- data/db/migrate/20180628132323_add_letter_date_indexes.rb +9 -7
- data/db/migrate/20180702091222_create_hd_providers.rb +5 -3
- data/db/migrate/20180702091237_create_hd_provider_units.rb +8 -6
- data/db/migrate/20180702091352_create_hd_transmission_log.rb +15 -13
- data/db/migrate/20180712143314_add_hidden_to_modality_descriptions.rb +3 -1
- data/db/migrate/20180718172750_update_audit_letters_authors_to_version_3.rb +13 -11
- data/db/migrate/20180725132557_add_days_text_to_hd_schedule_definitions.rb +21 -19
- data/db/migrate/20180725132808_create_hd_schedule_definition_filters_view.rb +3 -1
- data/db/migrate/20180730154454_add_external_session_id_to_hd_transmission_logs.rb +7 -5
- data/db/migrate/20180802103013_add_hd_mdm_missing_indexes.rb +6 -4
- data/db/migrate/20180802132417_add_missing_indexes_2.rb +16 -14
- data/db/migrate/20180802144507_add_missing_foreign_key_indexes.rb +14 -12
- data/db/migrate/20180803131157_add_uuid_to_hd_transmission_logs.rb +7 -1
- data/db/migrate/20180814103916_create_index_on_lower_patient_family_name.rb +5 -3
- data/db/migrate/20180815144429_update_hd_overall_audit_to_version_8.rb +8 -4
- data/db/migrate/20180831134926_create_daily_reports.rb +3 -6
- data/db/migrate/20180907100545_add_page_count_to_letters.rb +3 -1
- data/db/migrate/20181001162513_add_active_to_hospital_wards.rb +3 -1
- data/db/migrate/20181008144324_update_daily_letters_report_view_to_version_2.rb +0 -2
- data/db/migrate/20181008145159_create_reporting_daily_ukrdc_view.rb +0 -4
- data/db/migrate/20181013115138_update_reporting_daily_pathology_view_to_v2.rb +0 -2
- data/db/migrate/20181025170410_add_ukrdc_helper_column_to_patients.rb +0 -2
- data/db/migrate/20181026145459_create_ukrdc_batch_numbers.rb +5 -3
- data/db/migrate/20181106133500_update_hd_overall_audit_to_version_9.rb +0 -2
- data/db/migrate/20181109110616_create_hd_grouped_transmission_logs_view.rb +0 -2
- data/db/migrate/20181126090401_add_warnings_to_hd_transmission_logs.rb +7 -0
- data/db/migrate/20181126123745_refresh_hd_grouped_transmission_logs_view.rb +8 -0
- data/db/migrate/20181217124025_change_ukrdc_transmission_log_error_type.rb +15 -0
- data/db/seeds/default/practices/nhs_practices_sample.csv +2 -2
- data/db/seeds/default/practices/primary_care_physicians_sample.csv +2 -2
- data/lib/core_extensions/active_record/migration_helpers.rb +43 -1
- data/lib/renalware/engine.rb +2 -0
- data/lib/renalware/version.rb +1 -1
- metadata +55 -19
- data/lib/migration_helper.rb +0 -11
- data/vendor/assets/javascripts/renalware/moment.min.js +0 -1
- data/vendor/assets/javascripts/renalware/mousetrap.js +0 -1044
@@ -1,19 +1,21 @@
|
|
1
1
|
class AddStateTrackingColsToLetters < ActiveRecord::Migration[5.1]
|
2
2
|
def change
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
3
|
+
within_renalware_schema do
|
4
|
+
add_column :letter_letters, :submitted_for_approval_at, :datetime
|
5
|
+
add_reference :letter_letters,
|
6
|
+
:submitted_for_approval_by,
|
7
|
+
foreign_key: { to_table: :users },
|
8
|
+
index: true
|
9
|
+
add_column :letter_letters, :approved_at, :datetime
|
10
|
+
add_reference :letter_letters,
|
11
|
+
:approved_by,
|
12
|
+
foreign_key: { to_table: :users },
|
13
|
+
index: true
|
14
|
+
add_column :letter_letters, :completed_at, :datetime
|
15
|
+
add_reference :letter_letters,
|
16
|
+
:completed_by,
|
17
|
+
foreign_key: { to_table: :users },
|
18
|
+
index: true
|
19
|
+
end
|
18
20
|
end
|
19
21
|
end
|
@@ -1,44 +1,47 @@
|
|
1
|
+
# rubocop:disable Rails/CreateTableWithTimestamps
|
1
2
|
class CreateSystemVisitsAndEvents < ActiveRecord::Migration[5.1]
|
2
3
|
def change
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
4
|
+
within_renalware_schema do
|
5
|
+
create_table :system_visits do |t|
|
6
|
+
t.string :visit_token
|
7
|
+
t.string :visitor_token
|
8
|
+
|
9
|
+
# the rest are recommended but optional
|
10
|
+
# simply remove any you don't want
|
11
|
+
|
12
|
+
# user
|
13
|
+
t.references :user, index: true
|
14
|
+
|
15
|
+
# standard
|
16
|
+
t.string :ip
|
17
|
+
t.text :user_agent
|
18
|
+
t.text :referrer
|
19
|
+
t.string :referring_domain
|
20
|
+
t.string :search_keyword
|
21
|
+
t.text :landing_page
|
22
|
+
|
23
|
+
# technology
|
24
|
+
t.string :browser
|
25
|
+
t.string :os
|
26
|
+
t.string :device_type
|
27
|
+
|
28
|
+
t.timestamp :started_at
|
29
|
+
end
|
30
|
+
|
31
|
+
add_index :system_visits, [:visit_token], unique: true
|
32
|
+
|
33
|
+
create_table :system_events do |t|
|
34
|
+
t.references :visit
|
35
|
+
t.references :user, index: true
|
36
|
+
t.timestamp :time
|
37
|
+
|
38
|
+
t.string :name
|
39
|
+
t.jsonb :properties
|
40
|
+
end
|
41
|
+
|
42
|
+
add_index :system_events, [:name, :time]
|
43
|
+
add_index :system_events, "properties jsonb_path_ops", using: "gin"
|
27
44
|
end
|
28
|
-
|
29
|
-
add_index :system_visits, [:visit_token], unique: true
|
30
|
-
|
31
|
-
create_table :system_events do |t|
|
32
|
-
t.references :visit
|
33
|
-
t.references :user, index: true
|
34
|
-
t.timestamp :time
|
35
|
-
|
36
|
-
t.string :name
|
37
|
-
t.jsonb :properties
|
38
|
-
end
|
39
|
-
|
40
|
-
add_index :system_events, [:name, :time]
|
41
|
-
add_index :system_events, "properties jsonb_path_ops", using: "gin"
|
42
45
|
end
|
43
46
|
end
|
44
|
-
|
47
|
+
# rubocop:enable Rails/CreateTableWithTimestamps
|
@@ -1,5 +1,7 @@
|
|
1
1
|
class AddUniqueConstraintToObrRequestor < ActiveRecord::Migration[5.1]
|
2
2
|
def change
|
3
|
-
|
3
|
+
within_renalware_schema do
|
4
|
+
add_index :pathology_observation_requests, :requestor_order_number, unique: true
|
5
|
+
end
|
4
6
|
end
|
5
7
|
end
|
@@ -1,6 +1,8 @@
|
|
1
1
|
class RemoveUniqueObrRequestorOrderNumberIndex < ActiveRecord::Migration[5.1]
|
2
2
|
def change
|
3
|
-
|
4
|
-
|
3
|
+
within_renalware_schema do
|
4
|
+
remove_index :pathology_observation_requests, :requestor_order_number # was unique
|
5
|
+
add_index :pathology_observation_requests, :requestor_order_number
|
6
|
+
end
|
5
7
|
end
|
6
8
|
end
|
@@ -1,9 +1,11 @@
|
|
1
1
|
class RemoveTxOperationConstraints < ActiveRecord::Migration[5.1]
|
2
2
|
def change
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
within_renalware_schema do
|
4
|
+
change_column_null :transplant_recipient_operations, :theatre_case_start_time, true
|
5
|
+
change_column_null :transplant_recipient_operations, :donor_kidney_removed_from_ice_at, true
|
6
|
+
change_column_null :transplant_recipient_operations, :kidney_perfused_with_blood_at, true
|
7
|
+
change_column_null :transplant_recipient_operations, :warm_ischaemic_time, true
|
8
|
+
change_column_null :transplant_recipient_operations, :cold_ischaemic_time, true
|
9
|
+
end
|
8
10
|
end
|
9
11
|
end
|
@@ -1,9 +1,13 @@
|
|
1
1
|
class CreateFunctionToSortWithoutFailingOnNonnumerics < ActiveRecord::Migration[5.1]
|
2
2
|
def up
|
3
|
-
|
3
|
+
within_renalware_schema do
|
4
|
+
load_function("convert_to_float_v01.sql")
|
5
|
+
end
|
4
6
|
end
|
5
7
|
|
6
8
|
def down
|
7
|
-
|
9
|
+
within_renalware_schema do
|
10
|
+
connection.execute("drop function if exists convert_to_float(text)")
|
11
|
+
end
|
8
12
|
end
|
9
13
|
end
|
@@ -1,27 +1,29 @@
|
|
1
1
|
class UpdatePathObsDescsForLetterGroupings < ActiveRecord::Migration[5.1]
|
2
2
|
def change
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
3
|
+
within_renalware_schema do
|
4
|
+
sql = <<-SQL.squish
|
5
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group = NULL, letter_order = NULL;
|
6
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=1, letter_order=1 where code = 'HGB';
|
7
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=1, letter_order=2 where code = 'WBC';
|
8
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=1, letter_order=3 where code = 'PLT';
|
9
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=2, letter_order=1 where code = 'URE';
|
10
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=3, letter_order=1 where code = 'CRE';
|
11
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=3, letter_order=2 where code = 'EGFR';
|
12
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=4, letter_order=1 where code = 'NA';
|
13
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=4, letter_order=2 where code = 'POT';
|
14
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=5, letter_order=1 where code = 'BIC';
|
15
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=6, letter_order=1 where code = 'CCA';
|
16
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=6, letter_order=2 where code = 'PHOS';
|
17
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=7, letter_order=1 where code = 'PTHI';
|
18
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=8, letter_order=1 where code = 'ALB';
|
19
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=9, letter_order=1 where code = 'BIL';
|
20
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=9, letter_order=2 where code = 'AST';
|
21
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=9, letter_order=3 where code = 'ALP';
|
22
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=9, letter_order=4 where code = 'GGT';
|
23
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=10, letter_order=1 where code = 'HBA';
|
24
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=11, letter_order=1 where code = 'CHOL';
|
25
|
+
SQL
|
26
|
+
connection.execute(sql)
|
27
|
+
end
|
26
28
|
end
|
27
29
|
end
|
@@ -1,6 +1,8 @@
|
|
1
1
|
class AddAdminNotesToSystemUserFeedback < ActiveRecord::Migration[5.1]
|
2
2
|
def change
|
3
|
-
|
4
|
-
|
3
|
+
within_renalware_schema do
|
4
|
+
add_column :system_user_feedback, :admin_notes, :text
|
5
|
+
add_column :system_user_feedback, :acknowledged, :boolean
|
6
|
+
end
|
5
7
|
end
|
6
8
|
end
|
@@ -1,5 +1,7 @@
|
|
1
1
|
class AddConstraintsToRecipientOperations < ActiveRecord::Migration[5.1]
|
2
2
|
def change
|
3
|
-
|
3
|
+
within_renalware_schema do
|
4
|
+
change_column_null(:transplant_recipient_operations, :patient_id, false)
|
5
|
+
end
|
4
6
|
end
|
5
7
|
end
|
@@ -1,5 +1,7 @@
|
|
1
1
|
class AddRrtToAdmissionConsults < ActiveRecord::Migration[5.1]
|
2
2
|
def change
|
3
|
-
|
3
|
+
within_renalware_schema do
|
4
|
+
add_column :admission_consults, :rrt, :boolean, default: false, null: false
|
5
|
+
end
|
4
6
|
end
|
5
7
|
end
|
@@ -1,10 +1,12 @@
|
|
1
1
|
class AddColsToHDPatientStatistics < ActiveRecord::Migration[5.1]
|
2
2
|
def change
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
3
|
+
within_renalware_schema do
|
4
|
+
add_column :hd_patient_statistics,
|
5
|
+
:pathology_snapshot,
|
6
|
+
:jsonb,
|
7
|
+
index: { using: :gin },
|
8
|
+
default: {},
|
9
|
+
null: false
|
10
|
+
end
|
9
11
|
end
|
10
12
|
end
|
@@ -1,90 +1,91 @@
|
|
1
|
-
# rubocop:disable Metrics/MethodLength
|
2
1
|
class UpdateHDOverallAuditToVersion6 < ActiveRecord::Migration[5.1]
|
3
2
|
def change
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
within_renalware_schema do
|
4
|
+
update_view :reporting_hd_overall_audit,
|
5
|
+
materialized: true,
|
6
|
+
version: 6,
|
7
|
+
revert_to_version: 5
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
9
|
+
reversible do |direction|
|
10
|
+
direction.up do
|
11
|
+
connection.execute <<-SQL
|
12
|
+
update reporting_audits set display_configuration = '
|
13
|
+
{
|
14
|
+
"columnDefs": [
|
15
|
+
{
|
16
|
+
"title": "Unit",
|
17
|
+
"width": "300",
|
18
|
+
"data": "name"
|
19
|
+
},
|
20
|
+
{
|
21
|
+
"title": "Year",
|
22
|
+
"width": "100",
|
23
|
+
"data": "year"
|
24
|
+
},
|
25
|
+
{
|
26
|
+
"title": "Month",
|
27
|
+
"width": "100",
|
28
|
+
"data": "month"
|
29
|
+
},
|
30
|
+
{
|
31
|
+
"title": "No. patients",
|
32
|
+
"width": "100",
|
33
|
+
"data": "patient_count"
|
34
|
+
},
|
35
|
+
{
|
36
|
+
"title": "% HGB > 100",
|
37
|
+
"width": "120",
|
38
|
+
"data": "percentage_hgb_gt_100"
|
39
|
+
},
|
40
|
+
{
|
41
|
+
"title": "% HGB > 130",
|
42
|
+
"width": "120",
|
43
|
+
"data": "percentage_hgb_gt_130"
|
44
|
+
},
|
45
|
+
{
|
46
|
+
"title": "% Phosphate < 1.8",
|
47
|
+
"width": "120",
|
48
|
+
"data": "percentage_phosphate_lt_1_8"
|
49
|
+
},
|
50
|
+
{
|
51
|
+
"title": "% PTH < 300",
|
52
|
+
"width": "120",
|
53
|
+
"data": "percentage_pth_lt_300"
|
54
|
+
},
|
55
|
+
{
|
56
|
+
"title": "% URR > 64",
|
57
|
+
"width": "120",
|
58
|
+
"data": "percentage_urr_gt_64"
|
59
|
+
},
|
60
|
+
{
|
61
|
+
"title": "% URR > 69",
|
62
|
+
"width": "120",
|
63
|
+
"data": "percentage_urr_gt_69"
|
64
|
+
},
|
65
|
+
{
|
66
|
+
"title": "% w/fistula or graft",
|
67
|
+
"width": "120",
|
68
|
+
"data": "percentage_access_fistula_or_graft"
|
69
|
+
},
|
70
|
+
{
|
71
|
+
"title": "Avg. missed HD time",
|
72
|
+
"width": "120",
|
73
|
+
"data": "avg_missed_hd_time"
|
74
|
+
},
|
75
|
+
{
|
76
|
+
"title": "% sessions >5% dialysis time missed",
|
77
|
+
"width": "200",
|
78
|
+
"data": "pct_missed_sessions_gt_10_pct"
|
79
|
+
},
|
80
|
+
{
|
81
|
+
"title": "% missing >10% HD sessions",
|
82
|
+
"width": "150",
|
83
|
+
"data": "pct_shortfall_gt_5_pct"
|
84
|
+
}
|
85
|
+
]
|
86
|
+
}' where view_name ='reporting_hd_overall_audit';
|
87
|
+
SQL
|
88
|
+
end
|
88
89
|
end
|
89
90
|
end
|
90
91
|
end
|