renalware-core 2.0.0.pre.beta4 → 2.0.0.pre.beta5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -2
- data/app/assets/javascripts/renalware/application.js.erb +3 -0
- data/app/assets/javascripts/renalware/dialogs.js.erb +3 -1
- data/app/assets/javascripts/renalware/forms.js +0 -17
- data/app/assets/javascripts/renalware/keyboard_shortcuts.js +4 -0
- data/app/assets/javascripts/renalware/messaging.js +15 -0
- data/app/assets/javascripts/renalware/modality_codes.js +1 -0
- data/app/assets/javascripts/renalware/pdf.js +6 -3
- data/app/assets/javascripts/renalware/renal.js +2 -1
- data/app/assets/javascripts/renalware/session_timeout_redirect.js.erb +10 -4
- data/app/assets/javascripts/renalware/toggler.js +5 -0
- data/app/assets/stylesheets/renalware/base/_variables.scss +3 -1
- data/app/assets/stylesheets/renalware/lib/_foundation_and_overrides.scss +1 -1
- data/app/assets/stylesheets/renalware/lib/_select2-foundation5-overrides.scss +22 -1
- data/app/assets/stylesheets/renalware/lib/_select2-foundation5.scss +7 -4
- data/app/assets/stylesheets/renalware/modules/_dashboard.scss +1 -0
- data/app/assets/stylesheets/renalware/modules/_messaging.scss +55 -0
- data/app/assets/stylesheets/renalware/modules/_patients.scss +70 -0
- data/app/assets/stylesheets/renalware/partials/_button.scss +10 -0
- data/app/assets/stylesheets/renalware/partials/_forms.scss +9 -1
- data/app/assets/stylesheets/renalware/partials/_lists.scss +6 -1
- data/app/assets/stylesheets/renalware/partials/_navigation.scss +36 -1
- data/app/assets/stylesheets/renalware/partials/_simple_form.scss +1 -1
- data/app/assets/stylesheets/renalware/partials/_tables.scss +40 -1
- data/app/controllers/renalware/accesses/assessments_controller.rb +2 -2
- data/app/controllers/renalware/accesses/procedures_controller.rb +2 -2
- data/app/controllers/renalware/accesses/profiles_controller.rb +2 -2
- data/app/controllers/renalware/admin/users_controller.rb +1 -1
- data/app/controllers/renalware/base_controller.rb +1 -1
- data/app/controllers/renalware/clinical/body_compositions_controller.rb +1 -14
- data/app/controllers/renalware/clinical/dry_weights_controller.rb +1 -1
- data/app/controllers/renalware/clinics/clinic_visits_controller.rb +3 -3
- data/app/controllers/renalware/concerns/pdf_renderable.rb +0 -1
- data/app/controllers/renalware/deaths_controller.rb +1 -1
- data/app/controllers/renalware/devise/sessions_controller.rb +24 -0
- data/app/controllers/renalware/directory/people_controller.rb +30 -20
- data/app/controllers/renalware/drugs/drugs_controller.rb +2 -2
- data/app/controllers/renalware/events/events_controller.rb +19 -4
- data/app/controllers/renalware/events/types_controller.rb +2 -2
- data/app/controllers/renalware/hd/cannulation_types_controller.rb +2 -2
- data/app/controllers/renalware/hd/current_profile_controller.rb +1 -1
- data/app/controllers/renalware/hd/dialysers_controller.rb +2 -2
- data/app/controllers/renalware/hd/preference_sets_controller.rb +1 -1
- data/app/controllers/renalware/hd/sessions_controller.rb +1 -1
- data/app/controllers/renalware/hd/stations_controller.rb +79 -0
- data/app/controllers/renalware/hospitals/units_controller.rb +4 -3
- data/app/controllers/renalware/letters/contacts_controller.rb +3 -3
- data/app/controllers/renalware/letters/letters_controller.rb +2 -2
- data/app/controllers/renalware/medications/drug_types/prescriptions_controller.rb +3 -0
- data/app/controllers/renalware/messaging/messages_controller.rb +73 -0
- data/app/controllers/renalware/messaging/receipts_controller.rb +55 -0
- data/app/controllers/renalware/messaging/sent_messages_controller.rb +22 -0
- data/app/controllers/renalware/modalities/descriptions_controller.rb +31 -17
- data/app/controllers/renalware/modalities/modalities_controller.rb +21 -13
- data/app/controllers/renalware/pathology/current_observation_results_controller.rb +1 -1
- data/app/controllers/renalware/pathology/historical_observation_results_controller.rb +1 -1
- data/app/controllers/renalware/pathology/patient_rules_controller.rb +2 -2
- data/app/controllers/renalware/pathology/recent_observation_results_controller.rb +1 -1
- data/app/controllers/renalware/pathology/requests/requests_controller.rb +1 -1
- data/app/controllers/renalware/patients/alerts_controller.rb +61 -0
- data/app/controllers/renalware/patients/clinical_summaries_controller.rb +15 -0
- data/app/controllers/renalware/patients/patients_controller.rb +109 -0
- data/app/controllers/renalware/patients/primary_care_physicians_controller.rb +3 -2
- data/app/controllers/renalware/patients/worry_controller.rb +13 -2
- data/app/controllers/renalware/patients/worryboard_controller.rb +15 -1
- data/app/controllers/renalware/pd/bag_types_controller.rb +2 -2
- data/app/controllers/renalware/pd/exit_site_infections_controller.rb +2 -2
- data/app/controllers/renalware/pd/peritonitis_episodes_controller.rb +1 -1
- data/app/controllers/renalware/pd/pet_adequacy_results_controller.rb +2 -2
- data/app/controllers/renalware/pd/regimes_controller.rb +2 -2
- data/app/controllers/renalware/problems/problems_controller.rb +2 -2
- data/app/controllers/renalware/system/errors_controller.rb +20 -0
- data/app/controllers/renalware/system/mock_errors_controller.rb +12 -0
- data/app/controllers/renalware/transplants/donations_controller.rb +2 -2
- data/app/controllers/renalware/transplants/donor_operations_controller.rb +2 -2
- data/app/controllers/renalware/transplants/donor_workups_controller.rb +1 -1
- data/app/controllers/renalware/transplants/recipient_followups_controller.rb +2 -2
- data/app/controllers/renalware/transplants/recipient_operations_controller.rb +2 -2
- data/app/controllers/renalware/transplants/recipient_workups_controller.rb +1 -1
- data/app/controllers/renalware/transplants/registration_statuses_controller.rb +2 -2
- data/app/controllers/renalware/transplants/registrations_controller.rb +1 -1
- data/app/documents/renalware/renal/profile_document.rb +1 -0
- data/app/documents/renalware/smoking_status.rb +9 -0
- data/app/helpers/renalware/application_helper.rb +1 -1
- data/app/helpers/renalware/navigation_helper.rb +1 -1
- data/app/models/concerns/renalware/accountable.rb +16 -1
- data/app/models/concerns/renalware/broadcasting.rb +33 -0
- data/app/models/renalware/clinical/modality_description.rb +3 -0
- data/app/models/renalware/deaths/modality_description.rb +3 -0
- data/app/models/renalware/directory/person.rb +1 -1
- data/app/models/renalware/events/event.rb +3 -1
- data/app/models/renalware/events/event_query.rb +29 -0
- data/app/models/renalware/events/line_change_event_query.rb +25 -0
- data/app/models/renalware/events/patient_listener.rb +8 -0
- data/app/models/renalware/events/simple.rb +1 -1
- data/app/models/renalware/hd/diurnal_period_code.rb +9 -0
- data/app/models/renalware/hd/mdm_patients_query.rb +1 -0
- data/app/models/renalware/hd/modality_description.rb +3 -0
- data/app/models/renalware/hd/patient_listener.rb +20 -0
- data/app/models/renalware/hd/patients_with_unmet_preferences_query.rb +2 -0
- data/app/models/renalware/hd/session/closed.rb +2 -2
- data/app/models/renalware/hd/station.rb +24 -0
- data/app/models/renalware/hospitals/unit.rb +1 -0
- data/app/models/renalware/letters/draft_letter.rb +1 -1
- data/app/models/renalware/letters/letter_params_processor.rb +2 -2
- data/app/models/renalware/letters/letter_query.rb +1 -1
- data/app/models/renalware/letters/part/recent_pathology_results.rb +9 -4
- data/app/models/renalware/letters/patient_listener.rb +16 -0
- data/app/models/renalware/letters/revise_letter.rb +1 -1
- data/app/models/renalware/medications/patient_listener.rb +11 -0
- data/app/models/renalware/medications/prescriptions_by_drug_type_query.rb +2 -1
- data/app/models/renalware/medications/terminate_all_patient_prescriptions.rb +24 -0
- data/app/models/renalware/messaging/author.rb +9 -0
- data/app/models/renalware/messaging/message.rb +19 -0
- data/app/models/renalware/messaging/message_factory.rb +18 -0
- data/app/models/renalware/messaging/message_form.rb +34 -0
- data/app/models/renalware/messaging/message_form_builder.rb +50 -0
- data/app/models/renalware/messaging/patient.rb +13 -0
- data/app/models/renalware/messaging/receipt.rb +19 -0
- data/app/models/renalware/messaging/recipient.rb +10 -0
- data/app/models/renalware/messaging/recipient_options.rb +85 -0
- data/app/models/renalware/messaging/send_message.rb +22 -0
- data/app/models/renalware/messaging.rb +21 -0
- data/app/models/renalware/modalities/change_patient_modality.rb +112 -0
- data/app/models/renalware/modalities/description.rb +9 -5
- data/app/models/renalware/modalities/modality.rb +4 -10
- data/app/models/renalware/pathology/measurement_unit.rb +10 -0
- data/app/models/renalware/pathology/observation_description.rb +2 -0
- data/app/models/renalware/pathology/requests/global_algorithm.rb +1 -1
- data/app/models/renalware/pathology/requests/high_risk_rule_set.rb +1 -1
- data/app/models/renalware/patient.rb +14 -8
- data/app/models/renalware/patients/alert.rb +15 -0
- data/app/models/renalware/patients/patient_search.rb +13 -0
- data/app/models/renalware/patients/summary.rb +13 -0
- data/app/models/renalware/patients/worry_query.rb +27 -0
- data/app/models/renalware/pd/modality_description.rb +3 -0
- data/app/models/renalware/pd.rb +1 -1
- data/app/models/renalware/transplants/mdm_patients_query.rb +1 -0
- data/app/policies/renalware/hd/station_policy.rb +9 -0
- data/app/policies/renalware/messaging/message_policy.rb +11 -0
- data/app/policies/renalware/messaging/receipt_policy.rb +19 -0
- data/app/policies/renalware/modalities/description_policy.rb +22 -0
- data/app/policies/renalware/patients/alert_policy.rb +8 -0
- data/app/presenters/renalware/clinical/profile_presenter.rb +6 -1
- data/app/presenters/renalware/dashboard/dashboard_presenter.rb +18 -8
- data/app/presenters/renalware/events/events_presenter.rb +37 -0
- data/app/presenters/renalware/hd/station_presenter.rb +10 -0
- data/app/presenters/renalware/messaging/internal_message_presenter.rb +19 -0
- data/app/presenters/renalware/messaging/receipt_presenter.rb +11 -0
- data/app/presenters/renalware/pd/dashboard_presenter.rb +7 -0
- data/app/presenters/renalware/pd/mdm_presenter.rb +4 -0
- data/app/views/renalware/admin/users/edit.html.slim +34 -34
- data/app/views/renalware/admin/users/index.html.slim +9 -3
- data/app/views/renalware/clinical/body_compositions/_form.html.slim +1 -1
- data/app/views/renalware/clinical/body_compositions/_list.html.slim +1 -1
- data/app/views/renalware/clinical/body_compositions/edit.html.slim +2 -2
- data/app/views/renalware/clinics/clinic_visits/_form.html.slim +2 -2
- data/app/views/renalware/dashboard/bookmarks/_bookmark.html.slim +4 -5
- data/app/views/renalware/dashboard/bookmarks/_table.html.slim +1 -2
- data/app/views/renalware/dashboard/dashboards/_content.html.slim +7 -1
- data/app/views/renalware/dashboard/letters/_letter.html.slim +1 -1
- data/app/views/renalware/deaths/edit.html.slim +23 -26
- data/app/views/renalware/deaths/index.html.slim +0 -1
- data/app/views/renalware/devise/registrations/edit.html.slim +2 -2
- data/app/views/renalware/devise/sessions/new.html.slim +1 -1
- data/app/views/renalware/directory/people/_address_form.html.slim +13 -11
- data/app/views/renalware/directory/people/_filters.html.slim +9 -0
- data/app/views/renalware/directory/people/_form.html.slim +12 -14
- data/app/views/renalware/directory/people/_person.html.slim +1 -1
- data/app/views/renalware/directory/people/_table.html.slim +10 -0
- data/app/views/renalware/directory/people/edit.html.slim +4 -4
- data/app/views/renalware/directory/people/index.html.slim +7 -29
- data/app/views/renalware/directory/people/new.html.slim +4 -4
- data/app/views/renalware/directory/people/show.html.slim +27 -40
- data/app/views/renalware/drugs/drugs/_filters.html.slim +11 -0
- data/app/views/renalware/drugs/drugs/_form.html.slim +1 -3
- data/app/views/renalware/drugs/drugs/edit.html.slim +3 -1
- data/app/views/renalware/drugs/drugs/index.html.slim +7 -16
- data/app/views/renalware/drugs/drugs/new.html.slim +3 -1
- data/app/views/renalware/events/events/_filters.html.slim +21 -0
- data/app/views/renalware/events/events/_list.html.slim +5 -0
- data/app/views/renalware/events/events/_table.html.slim +3 -3
- data/app/views/renalware/events/events/index.html.slim +3 -2
- data/app/views/renalware/events/events/simple/_event.html.slim +10 -0
- data/app/views/renalware/events/events/simple/_list.html.slim +5 -0
- data/app/views/renalware/events/events/simple/_table.html.slim +15 -0
- data/app/views/renalware/events/events/toggled_cell/_simple.html.slim +2 -0
- data/app/views/renalware/hd/current_profile/_form.html.slim +64 -28
- data/app/views/renalware/hd/mdm_patients/_table.html.slim +26 -0
- data/app/views/renalware/hd/mdm_patients/index.html.slim +3 -33
- data/app/views/renalware/hd/stations/_form.html.slim +11 -0
- data/app/views/renalware/hd/stations/_station.html.slim +6 -0
- data/app/views/renalware/hd/stations/_table.html.slim +9 -0
- data/app/views/renalware/hd/stations/edit.html.slim +8 -0
- data/app/views/renalware/hd/stations/index.html.slim +14 -0
- data/app/views/renalware/hd/stations/new.html.slim +8 -0
- data/app/views/renalware/hospitals/units/_form.html.slim +16 -15
- data/app/views/renalware/hospitals/units/edit.html.slim +3 -1
- data/app/views/renalware/hospitals/units/index.html.slim +8 -3
- data/app/views/renalware/hospitals/units/new.html.slim +3 -1
- data/app/views/renalware/layouts/_patient.html.slim +1 -0
- data/app/views/renalware/letters/letters/_table.html.slim +1 -1
- data/app/views/renalware/letters/letters/author.html.slim +1 -3
- data/app/views/renalware/letters/parts/_problems.html.slim +10 -7
- data/app/views/renalware/letters/parts/_recent_pathology_results.html.slim +11 -8
- data/app/views/renalware/mdm_patients/_table.html.slim +23 -0
- data/app/views/renalware/mdm_patients/index.html.slim +5 -28
- data/app/views/renalware/medications/prescriptions/_current.html.slim +2 -2
- data/app/views/renalware/medications/prescriptions/_recently_stopped.html.slim +1 -1
- data/app/views/renalware/messaging/messages/_form.html.slim +31 -0
- data/app/views/renalware/messaging/messages/_message.html.slim +19 -0
- data/app/views/renalware/messaging/messages/_modal_dialog_placeholder.html.slim +2 -0
- data/app/views/renalware/messaging/messages/_send_message_link.html.slim +11 -0
- data/app/views/renalware/messaging/messages/_send_reply_link.html.slim +12 -0
- data/app/views/renalware/messaging/messages/_table.html.slim +13 -0
- data/app/views/renalware/messaging/messages/create.js.erb +13 -0
- data/app/views/renalware/messaging/messages/new.html.slim +5 -0
- data/app/views/renalware/messaging/messages/new.js.erb +7 -0
- data/app/views/renalware/messaging/messages/sent.html.slim +4 -0
- data/app/views/renalware/messaging/receipts/_receipt.html.slim +45 -0
- data/app/views/renalware/messaging/receipts/_table.html.slim +16 -0
- data/app/views/renalware/messaging/receipts/mark_as_read.js.erb +6 -0
- data/app/views/renalware/messaging/receipts/read.html.slim +5 -0
- data/app/views/renalware/messaging/receipts/unread.html.slim +5 -0
- data/app/views/renalware/messaging/shared/_key.html.slim +3 -0
- data/app/views/renalware/messaging/shared/_messages_type_tabs.html.slim +7 -0
- data/app/views/renalware/modalities/descriptions/_form.html.slim +12 -10
- data/app/views/renalware/modalities/descriptions/edit.html.slim +6 -1
- data/app/views/renalware/modalities/descriptions/index.html.slim +16 -11
- data/app/views/renalware/modalities/descriptions/new.html.slim +6 -1
- data/app/views/renalware/navigation/_user.html.slim +1 -0
- data/app/views/renalware/pathology/requests/requests/new.html.slim +1 -1
- data/app/views/renalware/patients/_layout.html.slim +0 -1
- data/app/views/renalware/patients/_person_form_fields.html.slim +1 -0
- data/app/views/renalware/patients/{_prescriptions.html.slim → _prescriptions.html.slim.dead} +0 -0
- data/app/views/renalware/patients/_side_menu.html.slim +1 -1
- data/app/views/renalware/patients/alerts/_alert.html.slim +12 -0
- data/app/views/renalware/patients/alerts/_create_alert_link.html.slim +8 -0
- data/app/views/renalware/patients/alerts/_form.html.slim +14 -0
- data/app/views/renalware/patients/alerts/_list.html.slim +4 -0
- data/app/views/renalware/patients/alerts/_modal_dialog_placeholder.html.slim +2 -0
- data/app/views/renalware/patients/alerts/create.js.erb +3 -0
- data/app/views/renalware/patients/alerts/destroy.js.erb +2 -0
- data/app/views/renalware/patients/alerts/new.html.slim +5 -0
- data/app/views/renalware/patients/alerts/new.js.erb +4 -0
- data/app/views/renalware/patients/bookmarks/_delete.html.slim +4 -3
- data/app/views/renalware/patients/bookmarks/_new.html.slim +4 -2
- data/app/views/renalware/{clinical_summaries → patients/clinical_summaries}/_events.html.slim +0 -0
- data/app/views/renalware/{clinical_summaries → patients/clinical_summaries}/_letters.html.slim +0 -0
- data/app/views/renalware/{clinical_summaries → patients/clinical_summaries}/_prescriptions.html.slim +0 -0
- data/app/views/renalware/{clinical_summaries → patients/clinical_summaries}/_problems.html.slim +0 -0
- data/app/views/renalware/{clinical_summaries → patients/clinical_summaries}/show.html.slim +1 -1
- data/app/views/renalware/patients/{_form.html.slim → patients/_form.html.slim} +0 -0
- data/app/views/renalware/patients/{_patient.html.slim → patients/_patient.html.slim} +0 -0
- data/app/views/renalware/patients/{_table.html.slim → patients/_table.html.slim} +1 -1
- data/app/views/renalware/patients/{edit.html.slim → patients/edit.html.slim} +1 -1
- data/app/views/renalware/patients/{index.html.slim → patients/index.html.slim} +0 -0
- data/app/views/renalware/patients/{new.html.slim → patients/new.html.slim} +1 -1
- data/app/views/renalware/patients/{show → patients/show}/_contact_details.html.slim +0 -0
- data/app/views/renalware/patients/{show → patients/show}/_hospital_numbers.html.slim +0 -0
- data/app/views/renalware/patients/{show → patients/show}/_letter_preferences.html.slim +0 -0
- data/app/views/renalware/patients/{show → patients/show}/_patient_demographics.html.slim +0 -0
- data/app/views/renalware/patients/{show → patients/show}/_person.html.slim +0 -0
- data/app/views/renalware/patients/{show → patients/show}/_primary_care_physician.html.slim +0 -0
- data/app/views/renalware/patients/{show → patients/show}/_referral.html.slim +0 -0
- data/app/views/renalware/patients/{show → patients/show}/_ukrdc_preferences.html.slim +0 -0
- data/app/views/renalware/patients/{show.html.slim → patients/show.html.slim} +7 -7
- data/app/views/renalware/patients/side_menu/_actions.html.slim +27 -0
- data/app/views/renalware/patients/side_menu/_general.html.slim +4 -2
- data/app/views/renalware/patients/side_menu/_modalities.html.slim +2 -2
- data/app/views/renalware/patients/side_menu/{_options.html.slim → _options.html.slim.redundant} +5 -0
- data/app/views/renalware/patients/side_menu/_transplants.html.slim +2 -1
- data/app/views/renalware/patients/worries/_delete.html.slim +4 -3
- data/app/views/renalware/patients/worries/_new.html.slim +23 -4
- data/app/views/renalware/patients/worryboard/_filters.html.slim +15 -0
- data/app/views/renalware/patients/worryboard/_table.html.slim +13 -6
- data/app/views/renalware/patients/worryboard/_worry.html.slim +6 -4
- data/app/views/renalware/patients/worryboard/show.html.slim +3 -5
- data/app/views/renalware/pd/dashboards/show.html.slim +11 -2
- data/app/views/renalware/pd/mdm/_top.html.slim +6 -1
- data/app/views/renalware/renal/profiles/_form.html.slim +2 -1
- data/app/views/renalware/renal/profiles/show.html.slim +1 -1
- data/app/views/renalware/shared/documents/_smoking_status.html.slim +1 -0
- data/app/views/renalware/shared/documents/_smoking_status_input.html.slim +5 -0
- data/app/views/renalware/{errors → system/errors}/internal_server_error.html.slim +0 -0
- data/app/views/renalware/{errors → system/errors}/not_found.html.slim +0 -0
- data/app/views/renalware/transplants/mdm_patients/_filters.html.slim +6 -7
- data/config/cucumber.yml +5 -2
- data/config/initializers/renalware.rb +13 -0
- data/config/initializers/simple_form_foundation.rb +3 -1
- data/config/locales/renalware/dashboard/dashboard.yml +0 -1
- data/config/locales/renalware/errors.en.yml +15 -14
- data/config/locales/renalware/events/events.yml +5 -0
- data/config/locales/renalware/hd/mdm_patients.yml +1 -1
- data/config/locales/renalware/hospitals/unit.yml +1 -0
- data/config/locales/renalware/mdm.yml +1 -1
- data/config/locales/renalware/messaging/messages.en.yml +29 -0
- data/config/locales/renalware/patients/alerts.en.yml +10 -0
- data/config/locales/renalware/patients/side_menu.en.yml +7 -4
- data/config/locales/renalware/patients/worries.en.yml +1 -1
- data/config/routes.rb +25 -6
- data/config/spring.rb +2 -0
- data/db/migrate/20170725120242_add_units_to_pathology_observation_descriptions.rb +19 -0
- data/db/migrate/20170809080925_add_notes_to_patient_worries.rb +5 -0
- data/db/migrate/20170810092953_create_messaging_messages.rb +13 -0
- data/db/migrate/20170810093532_create_messaging_receipts.rb +9 -0
- data/db/migrate/20170821100353_add_replying_to_message_id_to_messages.rb +12 -0
- data/db/migrate/20170823084127_create_patient_alerts.rb +16 -0
- data/db/migrate/20170824113401_add_stations_to_hospital_units.rb +8 -0
- data/db/migrate/20170830085137_create_hd_unit_stations.rb +17 -0
- data/db/migrate/20170830171726_create_hd_diurnal_period_codes.rb +10 -0
- data/db/seeds/default/hd/diurnal_period_codes.csv +4 -0
- data/db/seeds/default/hd/diurnal_period_codes.rb +13 -0
- data/db/seeds/default/hd/seeds.rb +1 -0
- data/db/seeds/default/pathology/measurement_units.csv +38 -0
- data/db/seeds/default/pathology/measurement_units.rb +13 -0
- data/db/seeds/default/pathology/pathology_observation_descriptions.csv +1741 -1741
- data/db/seeds/default/pathology/pathology_observation_descriptions.rb +8 -10
- data/db/seeds/default/pathology/seeds.rb +1 -0
- data/db/seeds/default/seeds.rb +0 -1
- data/db/seeds/default/system/roles.rb +1 -1
- data/{app/models → lib}/renalware/breadcrumb.rb +0 -0
- data/lib/renalware/configuration.rb +2 -0
- data/{app/models → lib}/renalware/failure.rb +0 -0
- data/{app/models → lib}/renalware/month_period.rb +0 -0
- data/{app/models → lib}/renalware/remembered_preferences.rb +0 -0
- data/{app/models → lib}/renalware/service_result.rb +0 -0
- data/{app/models → lib}/renalware/success.rb +0 -0
- data/lib/renalware/version.rb +1 -1
- data/lib/subscription_registry.rb +5 -0
- metadata +152 -61
- data/app/controllers/renalware/clinical_summaries_controller.rb +0 -13
- data/app/controllers/renalware/errors_controller.rb +0 -18
- data/app/controllers/renalware/mock_errors_controller.rb +0 -10
- data/app/controllers/renalware/patients_controller.rb +0 -107
- data/app/models/renalware/patient_search.rb +0 -11
- data/app/models/renalware/patient_summary.rb +0 -6
- data/app/views/renalware/admin/users/_header.html.slim +0 -6
- data/app/views/renalware/clinical/body_compositions/_row.html.slim +0 -15
- data/app/views/renalware/clinical/body_compositions/index.html.slim +0 -12
- data/app/views/renalware/deaths/_navigation.html.slim +0 -3
- data/app/views/renalware/directory/people/_header.html.slim +0 -5
- data/app/views/renalware/drugs/drugs/_header.html.slim +0 -5
- data/app/views/renalware/hospitals/units/_header.html.slim +0 -5
- data/db/seeds/default/hospitals/dialysis_units.csv +0 -7
- data/db/seeds/default/hospitals/dialysis_units.rb +0 -17
- data/db/seeds/default/hospitals/hospital_centres.csv +0 -86
- data/db/seeds/default/hospitals/hospitals.rb +0 -17
- data/db/seeds/default/hospitals/seeds.rb +0 -2
@@ -0,0 +1,19 @@
|
|
1
|
+
require_dependency "renalware/messaging"
|
2
|
+
|
3
|
+
module Renalware
|
4
|
+
module Messaging
|
5
|
+
class Message < ApplicationRecord
|
6
|
+
validates :body, presence: true
|
7
|
+
validates :subject, presence: true
|
8
|
+
validates :author, presence: true
|
9
|
+
validates :patient, presence: true
|
10
|
+
validates :sent_at, presence: true
|
11
|
+
|
12
|
+
belongs_to :patient
|
13
|
+
belongs_to :author
|
14
|
+
belongs_to :replying_to_message, class_name: name
|
15
|
+
has_many :receipts
|
16
|
+
has_many :recipients, through: :receipts
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require_dependency "renalware/messaging"
|
2
|
+
|
3
|
+
module Renalware
|
4
|
+
module Messaging
|
5
|
+
class MessageFactory
|
6
|
+
def self.build(**attributes)
|
7
|
+
attributes[:sent_at] ||= Time.zone.now
|
8
|
+
recipient_ids = attributes.delete(:recipient_ids) || []
|
9
|
+
|
10
|
+
Message.new(attributes).tap do |message|
|
11
|
+
recipient_ids.each do |recipient_id|
|
12
|
+
message.receipts.build(recipient_id: recipient_id)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require_dependency "renalware/messaging"
|
2
|
+
|
3
|
+
# A form object used behind the html messages#new form, and serving to helps us capture
|
4
|
+
# attributes for a Message and its Recipients. The MessageForm is passed to the SendMessage
|
5
|
+
# object where it is persisted as a Message with many Recipients through Receipts.
|
6
|
+
module Renalware
|
7
|
+
module Messaging
|
8
|
+
class MessageForm
|
9
|
+
include ActiveModel::Model
|
10
|
+
include Virtus::Model
|
11
|
+
|
12
|
+
attribute :body, String
|
13
|
+
attribute :subject, String
|
14
|
+
attribute :urgent, Boolean, default: false
|
15
|
+
attribute :recipient_ids, Array, default: []
|
16
|
+
attribute :replying_to_message_id
|
17
|
+
|
18
|
+
validates :body, presence: true
|
19
|
+
validates :subject, presence: true
|
20
|
+
validates :recipient_ids, presence: true, length: { minimum: 1 }
|
21
|
+
|
22
|
+
def initialize(attributes = {})
|
23
|
+
remove_blank_recipient_ids_from(attributes)
|
24
|
+
super
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def remove_blank_recipient_ids_from(params)
|
30
|
+
params[:recipient_ids].reject!(&:blank?) if params.key?(:recipient_ids)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
require_dependency "renalware/messaging"
|
2
|
+
|
3
|
+
# Builds a new MessageForm form object. MessageForm is used behind the html form when displaying a
|
4
|
+
# `Send Message` Dialog the first time. Note that we don't use this builder again on e.g.
|
5
|
+
# form submission - at that point all the required params are in the form payload - this is
|
6
|
+
# only for the initial MesageForm creation.
|
7
|
+
#
|
8
|
+
module Renalware
|
9
|
+
module Messaging
|
10
|
+
class MessageFormBuilder
|
11
|
+
attr_reader :patient, :params
|
12
|
+
|
13
|
+
def initialize(patient:, params:)
|
14
|
+
@patient = patient
|
15
|
+
@params = params
|
16
|
+
end
|
17
|
+
|
18
|
+
def call
|
19
|
+
MessageForm.new(
|
20
|
+
subject: build_subject,
|
21
|
+
recipient_ids: build_recipient_ids,
|
22
|
+
replying_to_message_id: replying_to_message_id
|
23
|
+
)
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def build_subject
|
29
|
+
replying? ? "Re: #{replying_to_message.subject}" : patient.to_s
|
30
|
+
end
|
31
|
+
|
32
|
+
def build_recipient_ids
|
33
|
+
replying? ? Array(replying_to_message.author_id) : []
|
34
|
+
end
|
35
|
+
|
36
|
+
def replying_to_message
|
37
|
+
return NullObject.instance unless replying?
|
38
|
+
@replying_to_message ||= Message.find(replying_to_message_id)
|
39
|
+
end
|
40
|
+
|
41
|
+
def replying_to_message_id
|
42
|
+
params[:replying_to_message_id]
|
43
|
+
end
|
44
|
+
|
45
|
+
def replying?
|
46
|
+
replying_to_message_id.present?
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require_dependency "renalware/messaging"
|
2
|
+
|
3
|
+
module Renalware
|
4
|
+
module Messaging
|
5
|
+
class Receipt < ApplicationRecord
|
6
|
+
validates :recipient, presence: true
|
7
|
+
validates :message, presence: true
|
8
|
+
|
9
|
+
belongs_to :message
|
10
|
+
belongs_to :recipient
|
11
|
+
|
12
|
+
scope :unread, -> { where(read_at: nil) }
|
13
|
+
|
14
|
+
def read?
|
15
|
+
read_at.present?
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,85 @@
|
|
1
|
+
require_dependency "renalware/messaging"
|
2
|
+
|
3
|
+
# Builds grouped drop down options for potential private message recipients.
|
4
|
+
# The groups are:
|
5
|
+
# - users who have recently received a message about the current patient
|
6
|
+
# - users who have recently received a message from the current author (excluding those already
|
7
|
+
# listed in the above group)
|
8
|
+
# - all remaining users
|
9
|
+
#
|
10
|
+
# The author is excluded from all lists so they cannot send to themselves
|
11
|
+
#
|
12
|
+
module Renalware
|
13
|
+
module Messaging
|
14
|
+
class RecipientOptions
|
15
|
+
attr_reader :patient, :author
|
16
|
+
|
17
|
+
class Group
|
18
|
+
include Virtus.model
|
19
|
+
attribute :name, String
|
20
|
+
attribute :users, Array, default: []
|
21
|
+
end
|
22
|
+
|
23
|
+
def initialize(patient, author)
|
24
|
+
@patient = patient
|
25
|
+
@author = author
|
26
|
+
end
|
27
|
+
|
28
|
+
def to_a
|
29
|
+
[
|
30
|
+
users_having_previously_received_a_message_about_patient,
|
31
|
+
users_having_recently_received_messages_from_author,
|
32
|
+
all_other_users
|
33
|
+
]
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
|
+
def users_having_previously_received_a_message_about_patient
|
39
|
+
Group.new(
|
40
|
+
name: "Previous patient recipients",
|
41
|
+
users: Recipient.where(id: ids_of_users_having_received_a_message_about_patient)
|
42
|
+
)
|
43
|
+
end
|
44
|
+
|
45
|
+
def users_having_recently_received_messages_from_author
|
46
|
+
Group.new(
|
47
|
+
name: "Other recent recipients",
|
48
|
+
users: Recipient.where(id: ids_of_users_having_received_messages_from_author)
|
49
|
+
)
|
50
|
+
end
|
51
|
+
|
52
|
+
def all_other_users
|
53
|
+
ids_to_exclude = ids_of_users_having_received_a_message_about_patient +
|
54
|
+
ids_of_users_having_received_messages_from_author
|
55
|
+
Group.new(
|
56
|
+
name: "KCH",
|
57
|
+
users: Recipient.where.not(id: ids_to_exclude)
|
58
|
+
)
|
59
|
+
end
|
60
|
+
|
61
|
+
def ids_of_users_having_received_a_message_about_patient
|
62
|
+
@ids_of_users_having_received_a_message_about_patient ||= begin
|
63
|
+
Message
|
64
|
+
.includes(:receipts)
|
65
|
+
.eager_load(:receipts)
|
66
|
+
.where(patient: patient)
|
67
|
+
.limit(20)
|
68
|
+
.pluck(:author_id, :recipient_id)
|
69
|
+
.flatten.uniq.compact
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
def ids_of_users_having_received_messages_from_author
|
74
|
+
@ids_of_users_having_received_messages_from_author ||= begin
|
75
|
+
ids = Message
|
76
|
+
.includes(:receipts).eager_load(:receipts)
|
77
|
+
.where(author: author)
|
78
|
+
.limit(20)
|
79
|
+
.pluck(:recipient_id).uniq.compact
|
80
|
+
ids - ids_of_users_having_received_a_message_about_patient
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require_dependency "renalware/messaging"
|
2
|
+
|
3
|
+
module Renalware
|
4
|
+
module Messaging
|
5
|
+
class SendMessage
|
6
|
+
|
7
|
+
def self.call(*args)
|
8
|
+
new.call(*args)
|
9
|
+
end
|
10
|
+
|
11
|
+
def call(author:, patient:, form:)
|
12
|
+
Message.transaction do
|
13
|
+
message = MessageFactory.build(patient: patient,
|
14
|
+
author: author,
|
15
|
+
**form.attributes)
|
16
|
+
message.save!
|
17
|
+
message
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require_dependency "renalware"
|
2
|
+
|
3
|
+
module Renalware
|
4
|
+
module Messaging
|
5
|
+
def self.table_name_prefix
|
6
|
+
"messaging_"
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.cast_patient(patient)
|
10
|
+
ActiveType.cast(patient, ::Renalware::Messaging::Patient)
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.cast_author(author)
|
14
|
+
ActiveType.cast(author, ::Renalware::Messaging::Author)
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.cast_recipient(recipient)
|
18
|
+
ActiveType.cast(recipient, ::Renalware::Messaging::Recipient)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,112 @@
|
|
1
|
+
require_dependency "renalware/modalities"
|
2
|
+
|
3
|
+
module Renalware
|
4
|
+
module Modalities
|
5
|
+
class ChangePatientModality
|
6
|
+
include Broadcasting
|
7
|
+
|
8
|
+
attr_reader :patient, :user
|
9
|
+
|
10
|
+
def initialize(patient:, user:)
|
11
|
+
@patient = patient
|
12
|
+
@user = user
|
13
|
+
end
|
14
|
+
|
15
|
+
# Accepts an existing (unsaved) :modality, or builds a new one from the options hash.
|
16
|
+
# Terminates an existing current modality if once exists, and saves and make the new
|
17
|
+
# modality current.
|
18
|
+
# Example usage:
|
19
|
+
#
|
20
|
+
# result = Modalities::ChangePatientModality
|
21
|
+
# .new(patient: patient, user: curret_user)
|
22
|
+
# .call(
|
23
|
+
# description: HD::ModalityDescription.first!,
|
24
|
+
# started_on: Time.zone.now
|
25
|
+
# )
|
26
|
+
#
|
27
|
+
# or
|
28
|
+
#
|
29
|
+
# modality = patient.modalities.new(
|
30
|
+
# description: HD::ModalityDescription.first!,
|
31
|
+
# started_on: Time.zone.now
|
32
|
+
# )
|
33
|
+
# result = Modalities::ChangePatientModality
|
34
|
+
# .new(patient: patient, user: curret_user)
|
35
|
+
# .call(modality: modality)
|
36
|
+
# )
|
37
|
+
#
|
38
|
+
# A Success or Failure result object is returned and the actual modality can be accessed on
|
39
|
+
# the result.object property.
|
40
|
+
#
|
41
|
+
# We can broadcast events to inform listeners the modality has changed.
|
42
|
+
# See #broadcast_modality_change_event_to_any_listeners for configuration.
|
43
|
+
#
|
44
|
+
def call(options)
|
45
|
+
new_modality = parse_options(options)
|
46
|
+
if new_modality.valid?
|
47
|
+
make_new_modality_the_current_one(new_modality)
|
48
|
+
broadcast_modality_change_event_to_any_listeners(new_modality)
|
49
|
+
Success.new(new_modality)
|
50
|
+
else
|
51
|
+
Failure.new(new_modality)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
private
|
56
|
+
|
57
|
+
def make_new_modality_the_current_one(new_modality)
|
58
|
+
Modality.transaction do
|
59
|
+
current_modality.terminate_by(user, on: new_modality.started_on)
|
60
|
+
new_modality.save_by!(user)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
# Broadcast (using Wisper) an event to indicate the patient's current modality has changed,
|
65
|
+
# This allows classes in other modules/parts of the application to take appropriate action.
|
66
|
+
# For example the Letters module may want to terminate all patient prescriptions if the
|
67
|
+
# modality changes to Death.
|
68
|
+
#
|
69
|
+
# The list of subscribers/listeners who will receive the message is set in the Broadcasting
|
70
|
+
# module which we mix in above _proveided_ the caller has chained the
|
71
|
+
# #broadcasting_to_configured_subscribers method like so
|
72
|
+
#
|
73
|
+
# result = Modalities::ChangePatientModality
|
74
|
+
# .new(..)
|
75
|
+
# .broadcasting_to_configured_subscribers
|
76
|
+
# .call(..)
|
77
|
+
#
|
78
|
+
# If you wish to add more listeners and these are site/hospital-specific, this can be done
|
79
|
+
# by configuring Renalware.config.broadcast_subscription_map. Be careful to append to rather
|
80
|
+
# than replace the default entries in the hash map.
|
81
|
+
# For example in a your applications config/initalizers/renalware_core.rb, add:
|
82
|
+
# Renalware.configure do |config|
|
83
|
+
# map = config.broadcast_subscription_map
|
84
|
+
# map["Renalware::Modalities::ChangePatientModality"] << "SomeNamespace::SomeListenerClass"
|
85
|
+
# end
|
86
|
+
#
|
87
|
+
# When broadcasting events, if the event description has a #.to_sym e.g :hd or :death
|
88
|
+
# then we use that in the name of the event, e.g. `patient_modality_changed_to_death`.
|
89
|
+
# Otherwise, for more generic events we use `patient_modality_changed`.
|
90
|
+
# I'm not sure this is a very consistent approach so may need to revisit.
|
91
|
+
def broadcast_modality_change_event_to_any_listeners(new_modality)
|
92
|
+
type = new_modality.description.to_sym
|
93
|
+
method_name = type.nil? ? :patient_modality_changed : :"patient_modality_changed_to_#{type}"
|
94
|
+
broadcast(
|
95
|
+
method_name,
|
96
|
+
patient: patient,
|
97
|
+
modality: new_modality,
|
98
|
+
actor: user
|
99
|
+
)
|
100
|
+
end
|
101
|
+
|
102
|
+
def parse_options(options)
|
103
|
+
return options[:modality] if options.key?(:modality)
|
104
|
+
patient.modalities.new(options)
|
105
|
+
end
|
106
|
+
|
107
|
+
def current_modality
|
108
|
+
patient.current_modality || NullObject.instance
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
@@ -5,15 +5,19 @@ module Renalware
|
|
5
5
|
class Description < ApplicationRecord
|
6
6
|
acts_as_paranoid
|
7
7
|
|
8
|
-
validates :name, presence: true
|
9
|
-
|
10
|
-
def self.policy_class
|
11
|
-
BasePolicy
|
12
|
-
end
|
8
|
+
validates :name, presence: true, uniqueness: true
|
13
9
|
|
14
10
|
def to_s
|
15
11
|
name
|
16
12
|
end
|
13
|
+
|
14
|
+
def to_sym
|
15
|
+
nil
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.policy_class
|
19
|
+
Modalities::DescriptionPolicy
|
20
|
+
end
|
17
21
|
end
|
18
22
|
end
|
19
23
|
end
|
@@ -11,25 +11,19 @@ module Renalware
|
|
11
11
|
belongs_to :reason, class_name: "Reason"
|
12
12
|
|
13
13
|
scope :ordered, -> { order(ended_on: :desc, updated_at: :desc) }
|
14
|
-
|
15
14
|
scope :started_on_reversed, -> { order(started_on: :desc, updated_at: :desc) }
|
16
15
|
scope :last_started_on, -> { started_on_reversed.where(ended_on: nil) }
|
17
16
|
|
18
17
|
validates :patient, presence: true
|
19
18
|
validates :started_on, presence: true
|
20
19
|
validates :description, presence: true
|
21
|
-
|
22
20
|
validates :started_on, timeliness: { type: :date }
|
23
|
-
|
24
21
|
validate :validate_modality_starts_later_than_previous, on: :create, if: :patient
|
25
22
|
|
26
|
-
def
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
terminate!(successor) if successor.valid?
|
31
|
-
successor
|
32
|
-
end
|
23
|
+
def terminate_by(user, on:)
|
24
|
+
self.ended_on = on
|
25
|
+
self.state = "terminated"
|
26
|
+
save_by!(user)
|
33
27
|
end
|
34
28
|
|
35
29
|
def to_s
|
@@ -13,7 +13,7 @@ module Renalware
|
|
13
13
|
def determine_required_request_descriptions
|
14
14
|
rule_sets
|
15
15
|
.select { |rule_set| rule_set.observation_required_for_patient?(@patient, @date) }
|
16
|
-
.map
|
16
|
+
.map(&:request_description)
|
17
17
|
.uniq
|
18
18
|
end
|
19
19
|
|
@@ -29,11 +29,12 @@ module Renalware
|
|
29
29
|
|
30
30
|
has_one :current_key_observation_set, class_name: "Pathology::CurrentKeyObservationSet"
|
31
31
|
has_one :current_address, as: :addressable, class_name: "Address"
|
32
|
-
has_one :summary, class_name: "
|
32
|
+
has_one :summary, class_name: "Patients::Summary"
|
33
33
|
belongs_to :ethnicity, class_name: "Patients::Ethnicity"
|
34
34
|
belongs_to :religion, class_name: "Patients::Religion"
|
35
35
|
belongs_to :language, class_name: "Patients::Language"
|
36
36
|
has_many :bookmarks, class_name: "Patients::Bookmark"
|
37
|
+
has_many :alerts, class_name: "Patients::Alert"
|
37
38
|
has_one :worry, class_name: "Patients::Worry"
|
38
39
|
|
39
40
|
belongs_to :first_cause, class_name: "Deaths::Cause", foreign_key: :first_cause_id
|
@@ -123,13 +124,18 @@ module Renalware
|
|
123
124
|
|
124
125
|
# @section services
|
125
126
|
|
126
|
-
def set_modality(attrs)
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
end
|
127
|
+
# def set_modality(attrs, by: nil)
|
128
|
+
# by ||= attrs[:by]
|
129
|
+
# # if current_modality.present?
|
130
|
+
# # current_modality.transfer!(attrs)
|
131
|
+
# # else
|
132
|
+
# # modalities.create(attrs)
|
133
|
+
# # end
|
134
|
+
# new_modality = modalities.new(attrs)
|
135
|
+
# Modalities::ChangePatientModality
|
136
|
+
# .new(patient: self, by: by)
|
137
|
+
# .call(old_modality: current_modality, new_modality:new_modality)
|
138
|
+
# end
|
133
139
|
|
134
140
|
def current_modality_death?
|
135
141
|
return false if current_modality.blank?
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require_dependency "renalware/patients"
|
2
|
+
|
3
|
+
module Renalware
|
4
|
+
module Patients
|
5
|
+
class Alert < ApplicationRecord
|
6
|
+
include Accountable
|
7
|
+
acts_as_paranoid
|
8
|
+
|
9
|
+
validates :patient, presence: true
|
10
|
+
validates :notes, presence: true
|
11
|
+
|
12
|
+
belongs_to :patient
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Renalware
|
2
|
+
module Patients
|
3
|
+
class PatientSearch
|
4
|
+
def self.call(params)
|
5
|
+
Renalware::Patient
|
6
|
+
.includes(current_modality: [:description])
|
7
|
+
.search(params[:q]).tap do |search|
|
8
|
+
search.sorts = %w(family_name given_name)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require_dependency "renalware"
|
2
|
+
|
3
|
+
##
|
4
|
+
# Backed by a SQL view, the patient summary is principally a set of counts fo various entities
|
5
|
+
# which hang off a patient, for example prescriptions_count, problems_count etc.
|
6
|
+
# These can be used for instance when building the patient navigation.
|
7
|
+
#
|
8
|
+
module Renalware
|
9
|
+
module Patients
|
10
|
+
class Summary < ApplicationRecord
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require_dependency "renalware/patients"
|
2
|
+
|
3
|
+
module Renalware
|
4
|
+
module Patients
|
5
|
+
class WorryQuery
|
6
|
+
attr_reader :query_params
|
7
|
+
|
8
|
+
def initialize(query_params)
|
9
|
+
@query_params = query_params
|
10
|
+
@query_params[:s] = "date_time DESC" if @query_params[:s].blank?
|
11
|
+
end
|
12
|
+
|
13
|
+
def call
|
14
|
+
search
|
15
|
+
.result
|
16
|
+
.includes(:created_by, patient: { current_modality: [:description] })
|
17
|
+
.order(created_at: :asc)
|
18
|
+
.page(query_params[:page])
|
19
|
+
.per(query_params[:per_page])
|
20
|
+
end
|
21
|
+
|
22
|
+
def search
|
23
|
+
@search ||= Worry.ransack(query_params)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/app/models/renalware/pd.rb
CHANGED