renalware-core 2.0.0.pre.beta12 → 2.0.0.pre.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/assets/stylesheets/renalware/modules/_letters.scss +0 -1
- data/app/assets/stylesheets/renalware/modules/_pathology.scss +4 -0
- data/app/assets/stylesheets/renalware/partials/_beta_banner.scss +26 -0
- data/app/assets/stylesheets/renalware/partials/_errors.scss +4 -0
- data/app/controllers/renalware/admissions/consults_controller.rb +0 -7
- data/app/controllers/renalware/concerns/devise_controller_methods.rb +9 -9
- data/app/controllers/renalware/hd/mdm_controller.rb +2 -3
- data/app/controllers/renalware/hd/mdm_patients_controller.rb +7 -1
- data/app/controllers/renalware/letters/letters_controller.rb +1 -1
- data/app/controllers/renalware/letters/lists_controller.rb +13 -6
- data/app/controllers/renalware/mdm_controller.rb +1 -1
- data/app/controllers/renalware/mdm_patients_controller.rb +1 -1
- data/app/controllers/renalware/patients/bookmarks_controller.rb +1 -1
- data/app/controllers/renalware/patients/clinical_summaries_controller.rb +1 -1
- data/app/controllers/renalware/pd/mdm_controller.rb +2 -3
- data/app/controllers/renalware/pd/mdm_patients_controller.rb +2 -0
- data/app/controllers/renalware/renal/low_clearance/mdm_controller.rb +15 -0
- data/app/controllers/renalware/renal/low_clearance/mdm_patients_controller.rb +29 -0
- data/app/controllers/renalware/session_timeout_controller.rb +2 -0
- data/app/controllers/renalware/system/user_feedback_controller.rb +35 -0
- data/app/controllers/renalware/transplants/mdm_controller.rb +1 -3
- data/app/controllers/renalware/transplants/mdm_patients_controller.rb +2 -0
- data/app/helpers/renalware/application_helper.rb +1 -42
- data/app/helpers/renalware/clinic_helper.rb +3 -1
- data/app/helpers/renalware/infection_organisms_helper.rb +20 -0
- data/app/helpers/renalware/mdm_helper.rb +9 -7
- data/app/helpers/renalware/prescriptions_helper.rb +20 -0
- data/app/helpers/renalware/side_nav_helper.rb +0 -8
- data/app/jobs/application_job.rb +2 -0
- data/app/models/concerns/renalware/explicit_state_model.rb +2 -0
- data/app/models/concerns/renalware/patient_pathology_scopes.rb +39 -0
- data/app/models/concerns/renalware/personable.rb +3 -2
- data/app/models/renalware/clinics/appointment.rb +4 -4
- data/app/models/renalware/clinics/clinic_visit.rb +2 -2
- data/app/models/renalware/drugs/classification.rb +11 -0
- data/app/models/renalware/drugs/drug.rb +3 -3
- data/app/models/renalware/drugs/type.rb +2 -1
- data/app/models/renalware/hd/mdm_patients_query.rb +4 -9
- data/app/models/renalware/hd/session/closed.rb +10 -3
- data/app/models/renalware/hd/session.rb +2 -1
- data/app/models/renalware/hd/sessions/auditable_session_collection.rb +7 -7
- data/app/models/renalware/letters/archive.rb +1 -1
- data/app/models/renalware/letters/description.rb +1 -1
- data/app/models/renalware/letters/event/clinic_visit.rb +4 -0
- data/app/models/renalware/letters/letter_factory.rb +1 -0
- data/app/models/renalware/letters/part/allergies.rb +1 -1
- data/app/models/renalware/letters/part/prescriptions.rb +1 -1
- data/app/models/renalware/letters/part/problems.rb +1 -1
- data/app/models/renalware/letters/part/recent_pathology_results.rb +14 -12
- data/app/models/renalware/letters/part.rb +3 -2
- data/app/models/renalware/letters/recipient.rb +1 -1
- data/app/models/renalware/letters/signature.rb +3 -1
- data/app/models/renalware/pathology/current_observations_for_descriptions_query.rb +7 -4
- data/app/models/renalware/pathology/observations_for_descriptions_query.rb +1 -2
- data/app/models/renalware/patients/bookmark.rb +1 -1
- data/app/models/renalware/patients/patient_hospital_identifiers.rb +4 -4
- data/app/models/renalware/patients/practice.rb +3 -3
- data/app/models/renalware/patients/primary_care_physician.rb +2 -2
- data/app/models/renalware/renal/low_clearance/mdm_patients_query.rb +63 -0
- data/app/models/renalware/renal/low_clearance/modality_description.rb +13 -0
- data/app/models/renalware/renal/profile.rb +2 -0
- data/app/models/renalware/renal/registry/preflight_checks/deaths_query.rb +1 -1
- data/app/models/renalware/renal/version.rb +9 -0
- data/app/models/renalware/renal.rb +4 -0
- data/app/models/renalware/role.rb +4 -3
- data/app/models/renalware/roles_user.rb +6 -0
- data/app/models/renalware/system/user_feedback.rb +16 -0
- data/app/models/renalware/transplants/donor_modality_description.rb +3 -0
- data/app/models/renalware/transplants/recipient_modality_description.rb +3 -0
- data/app/models/renalware/user.rb +14 -9
- data/app/models/renalware.rb +2 -5
- data/app/policies/renalware/base_policy.rb +1 -1
- data/app/policies/renalware/system/user_feedback_policy.rb +8 -0
- data/app/presenters/renalware/hd/mdm_presenter.rb +2 -0
- data/app/presenters/renalware/hd/session_access_presenter.rb +1 -1
- data/app/presenters/renalware/hd/session_presenter.rb +4 -5
- data/app/presenters/renalware/hd/station_presenter.rb +1 -1
- data/app/presenters/renalware/letters/letter_presenter.rb +4 -2
- data/app/presenters/renalware/mdm_presenter.rb +3 -3
- data/app/presenters/renalware/pathology/observations_diff.rb +110 -0
- data/app/presenters/renalware/renal/clinical_summary_presenter.rb +32 -4
- data/app/presenters/renalware/renal/low_clearance/mdm_presenter.rb +14 -0
- data/app/views/renalware/accesses/assessments/show.html.slim +1 -1
- data/app/views/renalware/accesses/dashboards/show.html.slim +1 -1
- data/app/views/renalware/accesses/procedures/show.html.slim +1 -1
- data/app/views/renalware/accesses/profiles/_list.html.slim +1 -1
- data/app/views/renalware/accesses/profiles/show.html.slim +1 -1
- data/app/views/renalware/admissions/consults/_form.html.slim +12 -12
- data/app/views/renalware/admissions/requests/_create_request_link.html.slim +1 -1
- data/app/views/renalware/admissions/requests/_form.html.slim +1 -1
- data/app/views/renalware/clinical/allergies/_new.html.slim +3 -3
- data/app/views/renalware/clinical/allergy_statuses/_form.html.slim +3 -3
- data/app/views/renalware/clinical/dry_weights/{_row.html.slim → _dry_weight.html.slim} +0 -0
- data/app/views/renalware/clinical/dry_weights/_list.html.slim +1 -2
- data/app/views/renalware/clinical/dry_weights/index.html.slim +1 -2
- data/app/views/renalware/clinical/profiles/show.html.slim +1 -1
- data/app/views/renalware/events/types/index.html.slim +1 -1
- data/app/views/renalware/hd/diaries/show.pdf.slim +1 -0
- data/app/views/renalware/hd/diary_slots/_form.html.slim +10 -10
- data/app/views/renalware/hd/diary_slots/_tab.html.slim +4 -4
- data/app/views/renalware/hd/mdm/_sessions.html.slim +1 -1
- data/app/views/renalware/hd/mdm_patients/_table.html.slim +7 -8
- data/app/views/renalware/hd/ongoing_sessions/_table.html.slim +1 -2
- data/app/views/renalware/hd/sessions/_form.html.slim +2 -2
- data/app/views/renalware/hd/sessions/_list.html.slim +1 -1
- data/app/views/renalware/hd/sessions/_row.html.slim +1 -1
- data/app/views/renalware/hd/sessions/_session_nav.html.slim +1 -1
- data/app/views/renalware/hd/sessions/_table.html.slim +1 -1
- data/app/views/renalware/hd/sessions/closed/_row.html.slim +1 -1
- data/app/views/renalware/hd/sessions/open/_row.html.slim +1 -1
- data/app/views/renalware/hd/stations/edit.html.slim +1 -1
- data/app/views/renalware/hd/stations/index.html.slim +1 -1
- data/app/views/renalware/hd/stations/new.html.slim +1 -1
- data/app/views/renalware/layouts/_patient.html.slim +1 -1
- data/app/views/renalware/layouts/application.html.slim +3 -1
- data/app/views/renalware/letters/contacts/_new_person.html.slim +2 -2
- data/app/views/renalware/letters/contacts/_person_from_directory.html.slim +2 -2
- data/app/views/renalware/letters/formatted_letters/_letter.html.slim +3 -3
- data/app/views/renalware/letters/formatted_letters/show.html.slim +1 -1
- data/app/views/renalware/letters/formatted_letters/show.inlinepdf.slim +1 -1
- data/app/views/renalware/letters/formatted_letters/show.pdf.slim +1 -1
- data/app/views/renalware/letters/letters/_electronic_ccs.html.slim +1 -1
- data/app/views/renalware/letters/letters/_form.html.slim +5 -2
- data/app/views/renalware/letters/letters/_pathology.html.slim +26 -0
- data/app/views/renalware/letters/letters/_preview.html.slim +3 -3
- data/app/views/renalware/letters/letters/edit.html.slim +11 -12
- data/app/views/renalware/letters/letters/new.html.slim +1 -1
- data/app/views/renalware/letters/lists/_letter.html.slim +1 -2
- data/app/views/renalware/letters/lists/show.html.slim +13 -14
- data/app/views/renalware/letters/parts/_recent_pathology_results.html.slim +3 -8
- data/app/views/renalware/letters/shared/_electronic_cc_type_tabs.html.slim +3 -3
- data/app/views/renalware/mdm/_letters.html.slim +1 -1
- data/app/views/renalware/mdm/_measurements.html.slim +1 -1
- data/app/views/renalware/mdm_patients/_patient.html.slim +1 -1
- data/app/views/renalware/mdm_patients/_table.html.slim +11 -13
- data/app/views/renalware/messaging/internal/messages/_form.html.slim +7 -7
- data/app/views/renalware/messaging/internal/messages/_send_message_link.html.slim +1 -1
- data/app/views/renalware/messaging/internal/messages/_send_reply_link.html.slim +1 -1
- data/app/views/renalware/messaging/internal/receipts/_sent_receipt.html.slim +1 -1
- data/app/views/renalware/messaging/shared/_messages_type_tabs.html.slim +3 -3
- data/app/views/renalware/navigation/_branding.html.slim +1 -1
- data/app/views/renalware/navigation/_mdms.html.slim +1 -0
- data/app/views/renalware/pathology/observations/_diff.html.slim +22 -0
- data/app/views/renalware/patients/_layout.html.slim +1 -1
- data/app/views/renalware/patients/alerts/_create_alert_link.html.slim +1 -1
- data/app/views/renalware/patients/alerts/_form.html.slim +4 -4
- data/app/views/renalware/patients/alerts/_list.html.slim +1 -2
- data/app/views/renalware/patients/bookmarks/_delete.html.slim +1 -1
- data/app/views/renalware/patients/bookmarks/_new.html.slim +8 -8
- data/app/views/renalware/patients/clinical_summaries/_events.html.slim +6 -4
- data/app/views/renalware/patients/clinical_summaries/_letters.html.slim +6 -3
- data/app/views/renalware/patients/clinical_summaries/_prescriptions.html.slim +2 -2
- data/app/views/renalware/patients/clinical_summaries/_problems.html.slim +2 -2
- data/app/views/renalware/patients/clinical_summaries/show.html.slim +14 -4
- data/app/views/renalware/patients/patients/show.html.slim +1 -1
- data/app/views/renalware/patients/side_menu/_modalities.html.slim +2 -2
- data/app/views/renalware/patients/worries/_delete.html.slim +1 -1
- data/app/views/renalware/patients/worries/_new.html.slim +6 -6
- data/app/views/renalware/pd/dashboards/show.html.slim +1 -1
- data/app/views/renalware/pd/infection_organisms/_table.html.slim +3 -3
- data/app/views/renalware/pd/pet_adequacy_results/_form.html.slim +23 -23
- data/app/views/renalware/pd/regime_bags/_form.html.slim +5 -5
- data/app/views/renalware/pd/regime_bags/_regime_bag.html.slim +2 -2
- data/app/views/renalware/pd/regime_bags/_regime_bags.html.slim +1 -1
- data/app/views/renalware/pd/regimes/_current_regime.html.slim +1 -1
- data/app/views/renalware/problems/problems/index.html.slim +1 -1
- data/app/views/renalware/renal/low_clearance/mdm/_bottom.html.slim +3 -0
- data/app/views/renalware/renal/low_clearance/mdm/_low_clearance_profile.html.slim +4 -0
- data/app/views/renalware/renal/low_clearance/mdm/_top.html.slim +5 -0
- data/app/views/renalware/renal/low_clearance/mdm_patients/_filters.html.slim +9 -0
- data/app/views/renalware/renal/profiles/_mini.html.slim +1 -1
- data/app/views/renalware/reporting/audits/index.html.slim +1 -1
- data/app/views/renalware/research/study_participants/_form.html.slim +3 -3
- data/app/views/renalware/shared/_modal_close_link.html.slim +1 -1
- data/app/views/renalware/shared/documents/_blood_pressure_input.html.slim +1 -1
- data/app/views/renalware/snippets/snippets/_form.html.slim +4 -4
- data/app/views/renalware/snippets/snippets/_list.html.slim +3 -3
- data/app/views/renalware/snippets/snippets/_row.html.slim +2 -2
- data/app/views/renalware/snippets/snippets/_table.html.slim +7 -7
- data/app/views/renalware/snippets/snippets/edit.html.slim +1 -1
- data/app/views/renalware/snippets/snippets/new.html.slim +1 -1
- data/app/views/renalware/system/user_feedback/_banner.html.slim +9 -0
- data/app/views/renalware/system/user_feedback/new.html.slim +13 -0
- data/app/views/renalware/transplants/donor_dashboards/show.html.slim +2 -2
- data/app/views/renalware/transplants/recipient_dashboards/show.html.slim +2 -2
- data/config/initializers/inflections.rb +2 -0
- data/config/locales/custom.yml +7 -0
- data/config/locales/renalware/letters/letter.en.yml +2 -2
- data/config/locales/renalware/navigation/renal.en.yml +1 -0
- data/config/locales/renalware/renal/low_clearance.en.yml +15 -0
- data/config/permissions.yml +1 -0
- data/config/routes.rb +10 -0
- data/db/migrate/20171114120904_add_pathology_snapshot_to_letters.rb +5 -0
- data/db/migrate/20171123123712_add_id_to_roles_users.rb +5 -0
- data/db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb +18 -0
- data/db/migrate/20171123154116_create_renal_versions.rb +14 -0
- data/db/migrate/20171128163543_add_more_missing_indexes.rb +16 -0
- data/db/migrate/20171206121652_add_loinc_code_to_observation_descriptions.rb +5 -0
- data/db/migrate/20171208211206_create_user_feedback.rb +10 -0
- data/db/migrate/20171211130716_remove_unused_patients_cols.rb +6 -0
- data/db/seeds/default/modalities/descriptions.rb +1 -0
- data/db/views/reporting_anaemia_audit_v01.sql +1 -1
- data/db/views/reporting_bone_audit_v01.sql +1 -1
- data/lib/renalware/configuration.rb +3 -0
- data/lib/renalware/version.rb +1 -1
- data/spec/factories/modalities/modality_descriptions.rb +3 -2
- data/spec/factories/renal/lcc_modality_description.rb +9 -0
- data/spec/factories/system/roles.rb +2 -2
- data/spec/factories/system/users.rb +3 -3
- data/spec/support/login_macros.rb +2 -2
- data/spec/support/roles_spec_helper.rb +1 -1
- metadata +35 -6
- data/app/models/renalware/patients/message_listener.rb +0 -31
- data/config/initializers/version.rb +0 -3
- data/spec/support/database_cleaner.rb +0 -16
@@ -25,11 +25,6 @@ module Renalware
|
|
25
25
|
:renal_registry_code,
|
26
26
|
to: :hospital_unit,
|
27
27
|
prefix: true, allow_nil: true
|
28
|
-
|
29
|
-
def state
|
30
|
-
self.class.to_s.demodulize.downcase
|
31
|
-
end
|
32
|
-
|
33
28
|
delegate :class, to: :__getobj__
|
34
29
|
|
35
30
|
def initialize(session, view_context = nil)
|
@@ -38,6 +33,10 @@ module Renalware
|
|
38
33
|
super(session)
|
39
34
|
end
|
40
35
|
|
36
|
+
def state
|
37
|
+
self.class.to_s.demodulize.downcase
|
38
|
+
end
|
39
|
+
|
41
40
|
def performed_on
|
42
41
|
url = view_context.patient_hd_session_path(session.patient, session)
|
43
42
|
text = ::I18n.l(super)
|
@@ -41,11 +41,13 @@ module Renalware
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def parts
|
44
|
-
letter_event.part_classes.values.map
|
44
|
+
letter_event.part_classes.values.map do |part_class|
|
45
|
+
part_class.new(patient, self, letter_event)
|
46
|
+
end
|
45
47
|
end
|
46
48
|
|
47
49
|
def part_for(part_name)
|
48
|
-
letter_event.part_classes[part_name].new(patient, letter_event)
|
50
|
+
letter_event.part_classes[part_name].new(patient, self, letter_event)
|
49
51
|
end
|
50
52
|
|
51
53
|
def to_html
|
@@ -21,9 +21,9 @@ module Renalware
|
|
21
21
|
OpenStruct.new(table: pathology_table_view, rows: presenter.view_model)
|
22
22
|
end
|
23
23
|
|
24
|
-
def latest_pathology_for(code)
|
25
|
-
|
26
|
-
end
|
24
|
+
# def latest_pathology_for(code)
|
25
|
+
# code
|
26
|
+
# end
|
27
27
|
|
28
28
|
def clinic_visits(limit: 6)
|
29
29
|
@clinic_visits ||= Clinics::ClinicVisit.for_patient(patient)
|
@@ -0,0 +1,110 @@
|
|
1
|
+
require "attr_extras"
|
2
|
+
require_dependency "renalware/pathology"
|
3
|
+
|
4
|
+
# Uses Rails 5 `render anywhere` feature.
|
5
|
+
module Renalware
|
6
|
+
module Pathology
|
7
|
+
class ObservationsDiff
|
8
|
+
def initialize(patient:, between_dates:, descriptions:)
|
9
|
+
@patient = patient
|
10
|
+
@descriptions = descriptions
|
11
|
+
@between_dates = Array(between_dates)
|
12
|
+
if between_dates.length != 2
|
13
|
+
raise ArgumentError, "between_dates argument must be an array of 2 dates"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def to_html
|
18
|
+
render
|
19
|
+
end
|
20
|
+
|
21
|
+
def to_h
|
22
|
+
@to_h ||= build_diff_hash
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
attr_reader :patient, :between_dates, :descriptions
|
28
|
+
|
29
|
+
def render
|
30
|
+
renderer.render(
|
31
|
+
partial: "renalware/pathology/observations/diff",
|
32
|
+
locals: {
|
33
|
+
patient: patient,
|
34
|
+
diffs: to_h
|
35
|
+
}
|
36
|
+
)
|
37
|
+
end
|
38
|
+
|
39
|
+
def renderer
|
40
|
+
ApplicationController.renderer
|
41
|
+
end
|
42
|
+
|
43
|
+
def observations1
|
44
|
+
@observations1 ||= begin
|
45
|
+
observations_in_daterange(Time.zone.at(1)..between_dates.first)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def observations2
|
50
|
+
@observations2 ||= begin
|
51
|
+
obs1_ids = observations1.map(&:id)
|
52
|
+
observations_in_daterange(between_dates.first..between_dates.last)
|
53
|
+
.reject{ |obs| obs1_ids.include?(obs.id) }
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def observations_in_daterange(range)
|
58
|
+
Pathology::CurrentObservationsForDescriptionsQuery.new(
|
59
|
+
patient: patient,
|
60
|
+
descriptions: descriptions
|
61
|
+
).call.where(observed_at: range).reject{ |obs| obs.id.nil? }.to_a
|
62
|
+
end
|
63
|
+
|
64
|
+
class ObsWithDiff
|
65
|
+
include Virtus.model
|
66
|
+
attribute :observed_at
|
67
|
+
attribute :result, Float
|
68
|
+
attribute :result_diff
|
69
|
+
|
70
|
+
def result_diff(more_recent)
|
71
|
+
more_recent && result && (result.to_f - more_recent.result&.to_f)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# Build
|
76
|
+
# [
|
77
|
+
# { "HGB" => [
|
78
|
+
# { observed_at:, value: },
|
79
|
+
# { observed_at:, value:, diff: }
|
80
|
+
# ]
|
81
|
+
# }
|
82
|
+
# ]
|
83
|
+
# Note this could be done with a SQL window function
|
84
|
+
# rubocop:disable Metrics/MethodLength
|
85
|
+
# rubocop:disable Metrics/AbcSize
|
86
|
+
def build_diff_hash
|
87
|
+
result = {}
|
88
|
+
|
89
|
+
observations1.each do |older_obs|
|
90
|
+
result[older_obs.description.code] = [
|
91
|
+
ObsWithDiff.new(older_obs.attributes.symbolize_keys),
|
92
|
+
nil
|
93
|
+
]
|
94
|
+
end
|
95
|
+
|
96
|
+
observations2.each do |newer_obs|
|
97
|
+
arr = result[newer_obs.description.code] || Array(2)
|
98
|
+
older_obs = arr[0]
|
99
|
+
args = newer_obs.attributes.symbolize_keys
|
100
|
+
.merge(result_diff: older_obs&.result_diff(newer_obs))
|
101
|
+
arr[1] = ObsWithDiff.new(args)
|
102
|
+
end
|
103
|
+
|
104
|
+
result
|
105
|
+
end
|
106
|
+
# rubocop:enable Metrics/MethodLength Metrics/AbcSize
|
107
|
+
# rubocop:enable Metrics/AbcSize
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
@@ -27,17 +27,45 @@ module Renalware
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def current_events
|
30
|
-
@current_events ||=
|
31
|
-
|
32
|
-
|
30
|
+
@current_events ||= begin
|
31
|
+
Events::Event.includes([:created_by, :event_type])
|
32
|
+
.for_patient(@patient)
|
33
|
+
.limit(Renalware.config.clinical_summary_max_events_to_display)
|
34
|
+
.ordered
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def current_events_count
|
39
|
+
title_friendly_collection_count(
|
40
|
+
actual: current_events.size,
|
41
|
+
total: patient.summary.events_count
|
42
|
+
)
|
33
43
|
end
|
34
44
|
|
35
45
|
def letters
|
36
46
|
present_letters(find_letters)
|
37
47
|
end
|
38
48
|
|
49
|
+
def letters_count
|
50
|
+
title_friendly_collection_count(
|
51
|
+
actual: letters.size,
|
52
|
+
total: patient.summary.letters_count
|
53
|
+
)
|
54
|
+
end
|
55
|
+
|
39
56
|
private
|
40
57
|
|
58
|
+
attr_reader :patient
|
59
|
+
|
60
|
+
# Retuns e.g. "9" or "10 of 11"
|
61
|
+
def title_friendly_collection_count(actual:, total:)
|
62
|
+
if total > actual
|
63
|
+
"#{actual} of #{total}"
|
64
|
+
else
|
65
|
+
actual
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
41
69
|
def find_letters
|
42
70
|
patient = Renalware::Letters.cast_patient(@patient)
|
43
71
|
patient.letters
|
@@ -45,7 +73,7 @@ module Renalware
|
|
45
73
|
.with_letterhead
|
46
74
|
.with_author
|
47
75
|
.with_patient
|
48
|
-
.limit(
|
76
|
+
.limit(Renalware.config.clinical_summary_max_letters_to_display)
|
49
77
|
.order(issued_on: :desc)
|
50
78
|
end
|
51
79
|
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Renalware
|
2
|
+
module Renal
|
3
|
+
module LowClearance
|
4
|
+
class MDMPresenter < Renalware::MDMPresenter
|
5
|
+
def low_clearance
|
6
|
+
@low_clearance ||= begin
|
7
|
+
Renal.cast_patient(patient).profile&.document&.low_clearance ||
|
8
|
+
Renalware::Renal::ProfileDocument::LowClearance.new
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -70,24 +70,24 @@
|
|
70
70
|
include_blank: true,
|
71
71
|
wrapper: :horizontal_medium
|
72
72
|
|
73
|
-
=f.association :hospital_ward,
|
73
|
+
= f.association :hospital_ward,
|
74
74
|
collection: Renalware::Hospitals::Ward.where(hospital_unit_id: consult.hospital_unit_id),
|
75
75
|
wrapper: :horizontal_medium
|
76
|
-
=f.input :started_on, as: :date_picker, wrapper: :horizontal_datepicker
|
77
|
-
=f.input :consult_type, wrapper: :horizontal_medium
|
78
|
-
=f.input :decided_on, as: :date_picker, wrapper: :horizontal_datepicker
|
79
|
-
=f.input :transfer_priority, include_blank: false, wrapper: :horizontal_small
|
80
|
-
=f.input :transferred_on, as: :date_picker, wrapper: :horizontal_datepicker
|
81
|
-
=f.association :seen_by,
|
76
|
+
= f.input :started_on, as: :date_picker, wrapper: :horizontal_datepicker
|
77
|
+
= f.input :consult_type, wrapper: :horizontal_medium
|
78
|
+
= f.input :decided_on, as: :date_picker, wrapper: :horizontal_datepicker
|
79
|
+
= f.input :transfer_priority, include_blank: false, wrapper: :horizontal_small
|
80
|
+
= f.input :transferred_on, as: :date_picker, wrapper: :horizontal_datepicker
|
81
|
+
= f.association :seen_by,
|
82
82
|
as: :user_picker,
|
83
83
|
collection: Renalware::User.ordered,
|
84
84
|
wrapper: :horizontal_medium
|
85
|
-
=f.input :contact_number, wrapper: :horizontal_medium
|
85
|
+
= f.input :contact_number, wrapper: :horizontal_medium
|
86
86
|
|
87
|
-
=f.input :aki_risk, include_blank: "Please select", wrapper: :horizontal_small
|
88
|
-
=f.input :requires_aki_nurse, as: :inline_radio_buttons, wrapper: :horizontal_small
|
89
|
-
=f.input :description, wrapper: :horizontal_large, input_html: { rows: 5 }
|
87
|
+
= f.input :aki_risk, include_blank: "Please select", wrapper: :horizontal_small
|
88
|
+
= f.input :requires_aki_nurse, as: :inline_radio_buttons, wrapper: :horizontal_small
|
89
|
+
= f.input :description, wrapper: :horizontal_large, input_html: { rows: 5 }
|
90
90
|
|
91
91
|
= f.submit class: :button
|
92
92
|
span= " or "
|
93
|
-
=link_to "Cancel", admissions_consults_path
|
93
|
+
= link_to "Cancel", admissions_consults_path
|
@@ -3,7 +3,7 @@
|
|
3
3
|
- url = new_admissions_request_path(patient_id: patient, format: :html)
|
4
4
|
|
5
5
|
/ Link to launch the modal dialog
|
6
|
-
=link_to(url,
|
6
|
+
= link_to(url,
|
7
7
|
id: "create-admissions-request",
|
8
8
|
data: { "reveal-id" => "admissions-request-modal", "reveal-ajax" => "true" }) do
|
9
9
|
- if local_assigns.fetch(:use_icon, true)
|
@@ -5,10 +5,10 @@
|
|
5
5
|
html: { autocomplete: "off" },
|
6
6
|
validate: true do |f|
|
7
7
|
h2= t(".title")
|
8
|
-
=f.input :description, as: :text, autofocus: true
|
9
|
-
=f.submit t(".save"), class: :button, data: { disable_with: t(".save_disable_with") }
|
8
|
+
= f.input :description, as: :text, autofocus: true
|
9
|
+
= f.submit t(".save"), class: :button, data: { disable_with: t(".save_disable_with") }
|
10
10
|
span= " or "
|
11
|
-
=link_to t(".cancel"),
|
11
|
+
= link_to t(".cancel"),
|
12
12
|
"#",
|
13
13
|
"aria-label" => "Close",
|
14
14
|
class: "reveal-modal-close"
|
@@ -8,6 +8,6 @@
|
|
8
8
|
method: :put do |f|
|
9
9
|
.flex-container(class="#{ "disabled" if patient.allergies.count > 0}")
|
10
10
|
|
11
|
-
=f.check_box :no_known_allergies
|
12
|
-
=f.label :no_known_allergies, t(".no_known_allergies")
|
13
|
-
=f.submit t(".save"), class: "button", data: { disable_with: t(".save_disable_with") }
|
11
|
+
= f.check_box :no_known_allergies
|
12
|
+
= f.label :no_known_allergies, t(".no_known_allergies")
|
13
|
+
= f.submit t(".save"), class: "button", data: { disable_with: t(".save_disable_with") }
|
File without changes
|
@@ -7,9 +7,9 @@
|
|
7
7
|
method: :post,
|
8
8
|
wrapper: :horizontal_form) do |f|
|
9
9
|
|
10
|
-
=f.input :station_id, as: :hidden
|
11
|
-
=f.input :diurnal_period_code_id, as: :hidden
|
12
|
-
=f.input :day_of_week, as: :hidden
|
10
|
+
= f.input :station_id, as: :hidden
|
11
|
+
= f.input :diurnal_period_code_id, as: :hidden
|
12
|
+
= f.input :day_of_week, as: :hidden
|
13
13
|
|
14
14
|
.row
|
15
15
|
.col-small-4
|
@@ -24,7 +24,7 @@
|
|
24
24
|
/ The value selected in in change_type above will determine which one to choose.
|
25
25
|
#patient_select2s
|
26
26
|
#dialysing_on_day_and_period
|
27
|
-
=f.input :patient_id,
|
27
|
+
= f.input :patient_id,
|
28
28
|
collection: slot.patients_preferring_to_dialyse_today_in_this_period,
|
29
29
|
label_method: :text,
|
30
30
|
value_method: :id,
|
@@ -33,7 +33,7 @@
|
|
33
33
|
name: "hd_diary_slot[patient_id][]" }
|
34
34
|
|
35
35
|
#dialysing_on_day(style="display:none")
|
36
|
-
=f.input :patient_id,
|
36
|
+
= f.input :patient_id,
|
37
37
|
collection: slot.patients_preferring_to_dialyse_today,
|
38
38
|
label_method: :text,
|
39
39
|
value_method: :id,
|
@@ -47,7 +47,7 @@
|
|
47
47
|
class: "patient-id-select2 patient-ajax-search",
|
48
48
|
name: "hd_diary_slot[patient_id][]",
|
49
49
|
data: { "ajax--url" => hd_patients_dialysing_at_unit_path(unit_id: slot.diary.hospital_unit_id, format: :json),
|
50
|
-
placeholder: "
|
50
|
+
placeholder: "Search by patient name or NHS/hosp no." }\
|
51
51
|
}
|
52
52
|
|
53
53
|
#dialysing_at_hospital(style="display:none")
|
@@ -57,14 +57,14 @@
|
|
57
57
|
class: "patient-id-select2 patient-ajax-search",
|
58
58
|
name: "hd_diary_slot[patient_id][]",
|
59
59
|
data: { "ajax--url" => hd_patients_dialysing_at_hospital_path(format: :json),
|
60
|
-
placeholder: "
|
60
|
+
placeholder: "Search by patient name or NHS/hosp no." }\
|
61
61
|
}
|
62
|
-
=f.submit "Add for this week only", class: "button save weekly"
|
62
|
+
= f.submit "Add for this week only", class: "button save weekly"
|
63
63
|
|
|
64
|
-
=f.submit "Add to this and all future weeks", class: "button secondary master", name: "master"
|
64
|
+
= f.submit "Add to this and all future weeks", class: "button secondary master", name: "master"
|
65
65
|
|
66
66
|
= blank_separator
|
67
|
-
=link_to "Cancel",
|
67
|
+
= link_to "Cancel",
|
68
68
|
"#",
|
69
69
|
"aria-label" => "Close",
|
70
70
|
class: "reveal-modal-close"
|
@@ -5,8 +5,8 @@
|
|
5
5
|
remote: true,
|
6
6
|
wrapper: :horizontal_form) do |f|
|
7
7
|
|
8
|
-
-if scheduled_only
|
9
|
-
=f.input :patient_id,
|
8
|
+
- if scheduled_only
|
9
|
+
= f.input :patient_id,
|
10
10
|
collection: patients,
|
11
11
|
label_method: ->(item){ item.to_s(:long) },
|
12
12
|
value_method: :id,
|
@@ -19,9 +19,9 @@
|
|
19
19
|
data: { "ajax--url" => search_patients_path(format: :json) }\
|
20
20
|
}
|
21
21
|
|
22
|
-
=f.submit "Select", class: :button
|
22
|
+
= f.submit "Select", class: :button
|
23
23
|
= blank_separator
|
24
|
-
=link_to "Cancel",
|
24
|
+
= link_to "Cancel",
|
25
25
|
"#",
|
26
26
|
"aria-label" => "Close",
|
27
27
|
class: "reveal-modal-close"
|
@@ -1,7 +1,8 @@
|
|
1
|
+
- path = [:renalware, presenter.q]
|
1
2
|
table#patients.mdm-patients.columns
|
2
3
|
thead
|
3
4
|
tr
|
4
|
-
th.col-width-large= sort_link(
|
5
|
+
th.col-width-large= sort_link(path, :family_name, t(".name"))
|
5
6
|
th.col-width-nhs-no= t(".nhs_no")
|
6
7
|
th.col-width-reference-no= t(".hosp_no")
|
7
8
|
th.col-width-tiny= t(".sex")
|
@@ -13,12 +14,10 @@ table#patients.mdm-patients.columns
|
|
13
14
|
th.col-width-date= t(".dialysing_at")
|
14
15
|
th.col-width-date= t(".registration_status")
|
15
16
|
th.at-least.col-width-small= t(".transport_type")
|
16
|
-
th.col-width-tiny= t(".hgb")
|
17
|
-
th.col-width-date= t(".hgb_date")
|
17
|
+
th.col-width-tiny= sort_link(path, :hgb, t(".hgb"))
|
18
|
+
th.col-width-date= sort_link(path, :hgb_date, t(".hgb_date"))
|
18
19
|
th.col-width-tiny
|
19
20
|
tbody
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
view_proc: presenter.view_proc,
|
24
|
-
q: presenter.q
|
21
|
+
= render partial: "patient",
|
22
|
+
collection: presenter.patients,
|
23
|
+
locals: { view_proc: presenter.view_proc, q: presenter.q }
|
@@ -4,7 +4,7 @@ ruby:
|
|
4
4
|
= f.input :type, as: :hidden
|
5
5
|
.row.top
|
6
6
|
.large-12.columns
|
7
|
-
=render "form_actions", f: f, back_path: back_path, session: session, patient: @patient
|
7
|
+
= render "form_actions", f: f, back_path: back_path, session: session, patient: @patient
|
8
8
|
|
9
9
|
.form-content
|
10
10
|
= f.simple_fields_for :document, f.object.document do |fd|
|
@@ -128,4 +128,4 @@ ruby:
|
|
128
128
|
|
129
129
|
.row
|
130
130
|
.large-12.columns
|
131
|
-
=render "form_actions", f: f, back_path: back_path, session: session, patient: @patient
|
131
|
+
= render "form_actions", f: f, back_path: back_path, session: session, patient: @patient
|
@@ -21,7 +21,7 @@ tr.hd-session-row(class=[session.state, stripe_class])
|
|
21
21
|
td.print-only(rowspan=2)= session.notes
|
22
22
|
|
23
23
|
tr(class=[session.state, stripe_class])
|
24
|
-
td=tooltip(label: session.summarised_access_used, content: session.access_used)
|
24
|
+
td= tooltip(label: session.summarised_access_used, content: session.access_used)
|
25
25
|
td= session.end_time
|
26
26
|
td
|
27
27
|
= session.after_measurement_for(:weight)
|
@@ -4,6 +4,6 @@ table.auto-layout.hd-sessions
|
|
4
4
|
tbody
|
5
5
|
- sessions.each_with_index do |session, index|
|
6
6
|
- stripe_class = index % 2 == 0 ? "even" : "odd"
|
7
|
-
=render "renalware/hd/sessions/#{session.state}/row",
|
7
|
+
= render "renalware/hd/sessions/#{session.state}/row",
|
8
8
|
session: session,
|
9
9
|
stripe_class: stripe_class
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/ We allow cross-module references in the UI but not in the controller hence:
|
2
2
|
- unit = Renalware::Hospitals::Unit.find(unit_id)
|
3
|
-
- breadcrumbs = [breadcrumb_for("
|
3
|
+
- breadcrumbs = [breadcrumb_for("HD Units", hospitals_units_path),
|
4
4
|
breadcrumb_for(unit.unit_code, edit_hospitals_unit_path(unit)),
|
5
5
|
breadcrumb_for("Stations", hd_unit_stations_path(unit))]
|
6
6
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/ We allow cross-module references in the UI but not in the controller hence:
|
2
2
|
- unit = Renalware::Hospitals::Unit.find(unit_id)
|
3
|
-
- breadcrumbs = [breadcrumb_for("
|
3
|
+
- breadcrumbs = [breadcrumb_for("HD Units", hospitals_units_path),
|
4
4
|
breadcrumb_for(unit.unit_code, edit_hospitals_unit_path(unit))]
|
5
5
|
|
6
6
|
= content_for(:actions) do
|