renalware-core 2.0.139 → 2.0.140
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/renalware/rollup_compiled.js +50 -0
- data/app/assets/stylesheets/renalware/medications_pdf.scss +17 -1
- data/app/assets/stylesheets/renalware/modules/_medications.scss +17 -0
- data/app/assets/stylesheets/renalware/partials/_utilities.scss +8 -0
- data/app/controllers/renalware/medications/home_delivery/events_controller.rb +134 -0
- data/app/javascript/renalware/controllers/foundation_modal_controller.js +19 -0
- data/app/javascript/renalware/controllers/medications/home_delivery_modal_controller.js +24 -0
- data/app/javascript/renalware/index.js +4 -0
- data/app/models/renalware/drugs/homecare_form.rb +17 -0
- data/app/models/renalware/drugs/supplier.rb +12 -0
- data/app/models/renalware/feeds/hl7_message.rb +2 -2
- data/app/models/renalware/medications.rb +6 -0
- data/app/models/renalware/medications/delivery/event.rb +48 -0
- data/app/models/renalware/medications/delivery/event_prescription.rb +24 -0
- data/app/models/renalware/medications/delivery/homecare_forms_adapter.rb +104 -0
- data/app/models/renalware/medications/delivery/purchase_order_number.rb +27 -0
- data/app/models/renalware/medications/prescriptions_by_drug_type_id_query.rb +21 -0
- data/app/models/renalware/medications/provider.rb +20 -0
- data/app/views/renalware/medications/home_delivery/events/_edit.html.slim +71 -0
- data/app/views/renalware/medications/home_delivery/events/edit.html.slim +1 -0
- data/app/views/renalware/medications/home_delivery/events/edit.js.erb +4 -0
- data/app/views/renalware/medications/home_delivery/events/new.js.erb +3 -0
- data/app/views/renalware/medications/home_delivery/events/update.js.erb +5 -0
- data/app/views/renalware/medications/home_delivery/prescriptions/index.pdf.slim +4 -1
- data/app/views/renalware/medications/prescriptions/_form.html.slim +4 -0
- data/app/views/renalware/medications/prescriptions/index.html.slim +15 -5
- data/app/views/renalware/shared/_modal_close_link.html.slim +1 -1
- data/config/routes/medications.rb +5 -4
- data/db/migrate/20200301113102_create_drug_homecare_suppliers.rb +73 -0
- data/db/migrate/20200301124200_create_medication_delivery_events.rb +49 -0
- data/db/migrate/20200301124300_create_medication_delivery_event_prescriptions.rb +35 -0
- data/db/migrate/20200306183423_add_next_delivery_date_to_prescriptions.rb +7 -0
- data/lib/renalware/configuration.rb +7 -0
- data/lib/renalware/engine.rb +1 -0
- data/lib/renalware/version.rb +1 -1
- data/spec/factories/drugs/homecare_forms.rb +13 -0
- data/spec/factories/drugs/suppliers.rb +7 -0
- data/spec/factories/medications/delivery/events.rb +13 -0
- data/spec/support/pages/medications/home_delivery_dialog.rb +77 -0
- metadata +39 -13
- data/app/controllers/renalware/medications/home_delivery/prescriptions_controller.rb +0 -51
- data/app/models/renalware/letters/printing/create_pdf_by_interleaving_address_sheet_and_letter_for_each_recipient.rb.dead +0 -90
- data/app/models/renalware/pathology/consultant.rb.dead +0 -10
- data/app/models/renalware/pathology/view_observation_results.rb.dead +0 -64
- data/app/models/renalware/patients/ingestion/update_master_patient_index_job.rb.dead +0 -20
- data/app/presenters/renalware/admin/users/summary_part.rb.dead +0 -25
- data/app/presenters/renalware/ukrdc/modality_presenter.rb.dead +0 -8
- data/app/views/renalware/admin/users/_summary_part.html.slim.dead +0 -4
- data/app/views/renalware/letters/lists/index.html.slim.dead +0 -101
- data/app/views/renalware/letters/lists/index.html.slim.dead1 +0 -90
- data/app/views/renalware/mdm/_biopsies.html.slim.dead +0 -18
@@ -1,64 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_dependency "renalware/pathology"
|
4
|
-
|
5
|
-
module Renalware
|
6
|
-
module Pathology
|
7
|
-
# An application service responsible for coordinating the querying of
|
8
|
-
# observations and the building of the observation results view model.
|
9
|
-
#
|
10
|
-
class ViewObservationResults
|
11
|
-
def initialize(observations, presenter, descriptions: default_descriptions)
|
12
|
-
@observations = observations
|
13
|
-
@descriptions = descriptions
|
14
|
-
@presenter = presenter
|
15
|
-
end
|
16
|
-
|
17
|
-
def call(params = {})
|
18
|
-
observations_for_descriptions = find_observations_for_descriptions
|
19
|
-
observation_date_series = determine_observation_date_series(observations_for_descriptions)
|
20
|
-
paginated_date_series = paginate(observation_date_series, params)
|
21
|
-
date_range = build_date_range(paginated_date_series)
|
22
|
-
observations = filter_within_date_range(observations_for_descriptions, date_range)
|
23
|
-
results = build_results(observations)
|
24
|
-
present(results, paginated_date_series)
|
25
|
-
end
|
26
|
-
|
27
|
-
private
|
28
|
-
|
29
|
-
def find_observations_for_descriptions
|
30
|
-
ObservationsForDescriptionsQuery.new(
|
31
|
-
relation: @observations, descriptions: @descriptions).call
|
32
|
-
end
|
33
|
-
|
34
|
-
def determine_observation_date_series(observations)
|
35
|
-
DetermineObservationDateSeries.new(relation: observations).call
|
36
|
-
end
|
37
|
-
|
38
|
-
def paginate(array, params)
|
39
|
-
Kaminari.paginate_array(array).page(params[:page]).per(@limit)
|
40
|
-
end
|
41
|
-
|
42
|
-
def build_date_range(date_series)
|
43
|
-
ObservationDateRange.build(date_series.reverse)
|
44
|
-
end
|
45
|
-
|
46
|
-
def filter_within_date_range(observations, date_range)
|
47
|
-
ObservationsWithinDateRangeQuery.new(
|
48
|
-
relation: observations, date_range: date_range).call
|
49
|
-
end
|
50
|
-
|
51
|
-
def build_results(observations)
|
52
|
-
Results.new(observations.ordered, @descriptions)
|
53
|
-
end
|
54
|
-
|
55
|
-
def present(results_archive, paginator)
|
56
|
-
@presenter.present(results_archive, paginator)
|
57
|
-
end
|
58
|
-
|
59
|
-
def default_descriptions
|
60
|
-
RelevantObservationDescription.all
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
# # frozen_string_literal: true
|
2
|
-
|
3
|
-
# require "renalware/feeds"
|
4
|
-
# require "attr_extras"
|
5
|
-
|
6
|
-
# module Renalware
|
7
|
-
# module Patients
|
8
|
-
# module Ingestion
|
9
|
-
# class UpdateMasterPatientIndex < ApplicationJob
|
10
|
-
# queue_as :master_patient_index
|
11
|
-
# queue_with_priority 10
|
12
|
-
|
13
|
-
# def perform(feed_message:)
|
14
|
-
# raise "todo"
|
15
|
-
# # UpdateMasterPatientIndex.call()
|
16
|
-
# end
|
17
|
-
# end
|
18
|
-
# end
|
19
|
-
# end
|
20
|
-
# end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Renalware
|
4
|
-
module Admin
|
5
|
-
module Users
|
6
|
-
class SummaryPart < Renalware::SummaryPart
|
7
|
-
def to_partial_path
|
8
|
-
"renalware/admin/users/summary_part"
|
9
|
-
end
|
10
|
-
|
11
|
-
def users_needing_approval_count
|
12
|
-
@users_needing_approval_count ||= User.unapproved.count
|
13
|
-
end
|
14
|
-
|
15
|
-
def users_needing_approval_title
|
16
|
-
[
|
17
|
-
users_needing_approval_count,
|
18
|
-
"user".pluralize(users_needing_approval_count),
|
19
|
-
"awaiting approval"
|
20
|
-
].join(" ")
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1,101 +0,0 @@
|
|
1
|
-
/ OK
|
2
|
-
/ elements
|
3
|
-
/ tabs - ok done
|
4
|
-
/ filters
|
5
|
-
/ for each named_dfilter
|
6
|
-
/ - what is displayed
|
7
|
-
/ - what is enabled
|
8
|
-
/ - what values it has
|
9
|
-
/ { filter: { enclosures_present: { disabled: true, options: [], visible: false } } }
|
10
|
-
|
11
|
-
= content_for(:tabs) do
|
12
|
-
= render "tabs"
|
13
|
-
|
14
|
-
= content_for(:filters) do
|
15
|
-
.search-form.filters
|
16
|
-
= simple_form_for q,
|
17
|
-
as: :q,
|
18
|
-
url: renalware.letters_filtered_letters_list_path(named_filter: params[:named_filter]),
|
19
|
-
html: { autocomplete: "off" },
|
20
|
-
method: :get do |f|
|
21
|
-
.row
|
22
|
-
- unless filter_options.dig(:enclosures_present, :hidden)
|
23
|
-
.small-6.medium-1.large-1.columns
|
24
|
-
= f.input :enclosures_present,
|
25
|
-
as: :select,
|
26
|
-
label: "Enclosure",
|
27
|
-
input_html: { disabled: filter_options.dig(:enclosures_present, :disabled) }
|
28
|
-
.small-6.medium-2.large-2.columns
|
29
|
-
= f.input :state_eq,
|
30
|
-
collection: filter_options.dig(:state_eq, :options)&.call,
|
31
|
-
label: "State",
|
32
|
-
input_html: { disabled: filter_options.dig(:state_eq, :disabled) }
|
33
|
-
.small-6.medium-2.large-2.columns
|
34
|
-
= f.input :author_id_eq,
|
35
|
-
as: :user_picker,
|
36
|
-
collection: authors,
|
37
|
-
label: "Author",
|
38
|
-
input_html: { disabled: filter_options.dig(:author_id_eq, :disabled) }
|
39
|
-
.small-6.medium-2.large-2.columns
|
40
|
-
= f.input :created_by_id_eq,
|
41
|
-
as: :user_picker,
|
42
|
-
collection: typists,
|
43
|
-
label: "Typist"
|
44
|
-
.small-6.medium-2.large-2.columns
|
45
|
-
= f.input :letterhead_id_eq, collection: letterheads, label: "Letterhead"
|
46
|
-
.small-6.medium-1.large-1.columns
|
47
|
-
= f.input :page_count_in_array,
|
48
|
-
collection: [["1 or 2", "[1,2]"],["3 or 4", "[3,4]"]],
|
49
|
-
label: "Pages"
|
50
|
-
.small-12.medium-2.large-2.columns.actions.end
|
51
|
-
= f.submit t("helpers.submit.filter"), class: "button secondary"
|
52
|
-
span= " or "
|
53
|
-
= link_to t("helpers.reset"), letters_list_path
|
54
|
-
|
55
|
-
= link_to("#", data: { "reveal-id" => "batch-print-modal" }, class: "button") do
|
56
|
-
i.fas.fa-print
|
57
|
-
| Batch print these letters
|
58
|
-
|
59
|
-
#batch-print-modal.reveal-modal.medium(data-reveal)
|
60
|
-
.modal
|
61
|
-
.modal__header
|
62
|
-
h1= "Batch print #{letters.total_count} letters"
|
63
|
-
/= render "renalware/shared/modal_close_link"
|
64
|
-
.modal__body
|
65
|
-
p Excludes 2 letters with enclosures
|
66
|
-
.content
|
67
|
-
/ This for uses the same attributes as the filter form but when submitted will
|
68
|
-
/ queue a print job for the current search criteria.
|
69
|
-
= simple_form_for q,
|
70
|
-
as: :batch,
|
71
|
-
url: letters_batches_path,
|
72
|
-
method: :post,
|
73
|
-
remote: true do |f|
|
74
|
-
= f.input :enclosures_present, as: :hidden
|
75
|
-
= f.input :state_eq, as: :hidden
|
76
|
-
= f.input :author_id_eq, as: :hidden
|
77
|
-
= f.input :created_by_id_eq, as: :hidden
|
78
|
-
= f.input :letterhead_id_eq, as: :hidden
|
79
|
-
= f.input :page_count_in_array, as: :hidden
|
80
|
-
= f.submit "Print", class: "button", data: { disable_with: "Printing" }
|
81
|
-
n= " or "
|
82
|
-
= link_to "Cancel",
|
83
|
-
"#",
|
84
|
-
"aria-label" => "Close",
|
85
|
-
class: "reveal-modal-close"
|
86
|
-
.modal__footer
|
87
|
-
|
88
|
-
= within_admin_layout(title: "Letters") do
|
89
|
-
= render "table", letters: letters, q: q
|
90
|
-
|
91
|
-
/ The modal dialog container for the dialog which will ask the user
|
92
|
-
/ if they want to mark the letter as printed. We load this dialog via ajax.
|
93
|
-
/ See letters/completed_letters/new.html.slim for th dialog content.
|
94
|
-
/ See also
|
95
|
-
/ - letters/completed_letters/create.js.erb
|
96
|
-
/ - ./show.js.erb
|
97
|
-
/ - letters.js
|
98
|
-
/ for the complete works. Using ujs for these sort of dialog -> -> post -> page refresh
|
99
|
-
/ cycles is a bit complex and we could move to using something like stimulus
|
100
|
-
/ to keep thing a bit simpler
|
101
|
-
#letter-print-modal.reveal-modal.medium(data-reveal data-refresh-url=request.original_fullpath)
|
@@ -1,90 +0,0 @@
|
|
1
|
-
= content_for(:tabs) do
|
2
|
-
= render "tabs"
|
3
|
-
|
4
|
-
= content_for(:filters) do
|
5
|
-
.search-form.filters
|
6
|
-
= simple_form_for q,
|
7
|
-
as: :q,
|
8
|
-
url: renalware.letters_filtered_letters_list_path(named_filter: params[:named_filter]),
|
9
|
-
html: { autocomplete: "off" },
|
10
|
-
method: :get do |f|
|
11
|
-
.row
|
12
|
-
- unless filter_options.dig(:enclosures_present, :hidden)
|
13
|
-
.small-6.medium-1.large-1.columns
|
14
|
-
= f.input :enclosures_present,
|
15
|
-
as: :select,
|
16
|
-
label: "Enclosure",
|
17
|
-
input_html: { disabled: filter_options.dig(:enclosures_present, :disabled) }
|
18
|
-
.small-6.medium-2.large-2.columns
|
19
|
-
= f.input :state_eq,
|
20
|
-
collection: filter_options.dig(:state_eq, :options)&.call,
|
21
|
-
label: "State",
|
22
|
-
input_html: { disabled: filter_options.dig(:state_eq, :disabled) }
|
23
|
-
.small-6.medium-2.large-2.columns
|
24
|
-
= f.input :author_id_eq,
|
25
|
-
as: :user_picker,
|
26
|
-
collection: authors,
|
27
|
-
label: "Author",
|
28
|
-
input_html: { disabled: filter_options.dig(:author_id_eq, :disabled) }
|
29
|
-
.small-6.medium-2.large-2.columns
|
30
|
-
= f.input :created_by_id_eq,
|
31
|
-
as: :user_picker,
|
32
|
-
collection: typists,
|
33
|
-
label: "Typist"
|
34
|
-
.small-6.medium-2.large-2.columns
|
35
|
-
= f.input :letterhead_id_eq, collection: letterheads, label: "Letterhead"
|
36
|
-
.small-6.medium-1.large-1.columns
|
37
|
-
= f.input :page_count_in_array,
|
38
|
-
collection: [["1 or 2", "[1,2]"],["3 or 4", "[3,4]"]],
|
39
|
-
label: "Pages"
|
40
|
-
.small-12.medium-2.large-2.columns.actions.end
|
41
|
-
= f.submit t("helpers.submit.filter"), class: "button secondary"
|
42
|
-
span= " or "
|
43
|
-
= link_to t("helpers.reset"), letters_list_path
|
44
|
-
|
45
|
-
= link_to("#", data: { "reveal-id" => "batch-print-modal" }, class: "button") do
|
46
|
-
i.fas.fa-print
|
47
|
-
| Batch print these letters
|
48
|
-
|
49
|
-
#batch-print-modal.reveal-modal.medium(data-reveal)
|
50
|
-
.modal
|
51
|
-
.modal__header
|
52
|
-
h1= "Batch print #{letters.total_count} letters"
|
53
|
-
/= render "renalware/shared/modal_close_link"
|
54
|
-
.modal__body
|
55
|
-
.content
|
56
|
-
/ This for uses the same attributes as the filter form but when submitted will
|
57
|
-
/ queue a print job for the current search criteria.
|
58
|
-
= simple_form_for q,
|
59
|
-
as: :batch,
|
60
|
-
url: letters_batches_path,
|
61
|
-
method: :post,
|
62
|
-
remote: true do |f|
|
63
|
-
= f.input :enclosures_present, as: :hidden
|
64
|
-
= f.input :state_eq, as: :hidden
|
65
|
-
= f.input :author_id_eq, as: :hidden
|
66
|
-
= f.input :created_by_id_eq, as: :hidden
|
67
|
-
= f.input :letterhead_id_eq, as: :hidden
|
68
|
-
= f.input :page_count_in_array, as: :hidden
|
69
|
-
= f.submit "Print", class: "button", data: { disable_with: "Printing" }
|
70
|
-
n= " or "
|
71
|
-
= link_to "Cancel",
|
72
|
-
"#",
|
73
|
-
"aria-label" => "Close",
|
74
|
-
class: "reveal-modal-close"
|
75
|
-
.modal__footer
|
76
|
-
|
77
|
-
= within_admin_layout(title: "Letters") do
|
78
|
-
= render "table", letters: letters, q: q
|
79
|
-
|
80
|
-
/ The modal dialog container for the dialog which will ask the user
|
81
|
-
/ if they want to mark the letter as printed. We load this dialog via ajax.
|
82
|
-
/ See letters/completed_letters/new.html.slim for th dialog content.
|
83
|
-
/ See also
|
84
|
-
/ - letters/completed_letters/create.js.erb
|
85
|
-
/ - ./show.js.erb
|
86
|
-
/ - letters.js
|
87
|
-
/ for the complete works. Using ujs for these sort of dialog -> -> post -> page refresh
|
88
|
-
/ cycles is a bit complex and we could move to using something like stimulus
|
89
|
-
/ to keep thing a bit simpler
|
90
|
-
#letter-print-modal.reveal-modal.medium(data-reveal data-refresh-url=request.original_fullpath)
|
@@ -1,18 +0,0 @@
|
|
1
|
-
- relation = Renalware::Events::Biopsy.for_patient(mdm.patient).includes(:created_by)
|
2
|
-
- biopsies = relation.limit(6).ordered
|
3
|
-
- total_biopsies = relation.count
|
4
|
-
|
5
|
-
article.events
|
6
|
-
header
|
7
|
-
h2 Biopsies
|
8
|
-
.supplemental
|
9
|
-
span= "#{biopsies.length} of #{total_biopsies}"
|
10
|
-
span.noprint
|
11
|
-
= link_to "View All",
|
12
|
-
patient_events_path(mdm.patient),
|
13
|
-
class: "button secondary"
|
14
|
-
|
15
|
-
= render "renalware/events/events/table",
|
16
|
-
events: biopsies,
|
17
|
-
exclude_type_column: true,
|
18
|
-
toggle_prefix: "biopsy"
|