renalware-core 2.0.11 → 2.0.12
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/stylesheets/renalware/modules/_admissions.scss +8 -0
- data/app/assets/stylesheets/renalware/modules/_clinical.scss +8 -0
- data/app/assets/stylesheets/renalware/modules/_pathology.scss +1 -0
- data/app/assets/stylesheets/renalware/modules/_patients.scss +13 -0
- data/app/assets/stylesheets/renalware/partials/_button.scss +4 -0
- data/app/assets/stylesheets/renalware/partials/_forms.scss +3 -0
- data/app/assets/stylesheets/renalware/partials/_navigation.scss +4 -0
- data/app/assets/stylesheets/renalware/partials/_tables.scss +10 -0
- data/app/controllers/renalware/admissions/consults_controller.rb +5 -1
- data/app/controllers/renalware/api/token_authenticated_api_controller.rb +2 -0
- data/app/controllers/renalware/api/ukrdc/patients_controller.rb +2 -0
- data/app/controllers/renalware/medications/drug_types/prescriptions_controller.rb +1 -0
- data/app/controllers/renalware/messaging/internal/receipts_controller.rb +20 -5
- data/app/models/renalware/hd/sessions/auditable_session_collection.rb +1 -0
- data/app/models/renalware/hd/sessions/save_session.rb +1 -1
- data/app/models/renalware/letters/part/recent_pathology_results.rb +45 -27
- data/app/models/renalware/letters/pathology_layout.rb +22 -0
- data/app/presenters/renalware/address_presenter/block.rb +3 -1
- data/app/presenters/renalware/admissions/consult_presenter.rb +1 -1
- data/app/presenters/renalware/mdm_presenter.rb +1 -7
- data/app/views/renalware/admissions/consults/_filters.html.slim +7 -2
- data/app/views/renalware/admissions/consults/_form.html.slim +1 -0
- data/app/views/renalware/admissions/consults/_table.html.slim +22 -18
- data/app/views/renalware/admissions/consults/index.html.slim +2 -0
- data/app/views/renalware/clinical/profiles/show.html.slim +1 -1
- data/app/views/renalware/letters/formatted_letters/_letter.html.slim +4 -0
- data/app/views/renalware/medications/drug_types/prescriptions/_filters.html.slim +21 -10
- data/app/views/renalware/medications/drug_types/prescriptions/_table.html.slim +32 -31
- data/app/views/renalware/messaging/internal/receipts/_receipt.html.slim +1 -2
- data/app/views/renalware/pathology/current_observation_results/index.html.slim +7 -8
- data/config/locales/renalware/admissions/consults.en.yml +1 -0
- data/config/locales/renalware/medications/drug_types/esa_prescriptions.en.yml +1 -1
- data/config/locales/renalware/transplants/recipient_operation.yml +1 -1
- data/db/migrate/20180323150241_update_path_obs_descs_for_letter_groupings.rb +27 -0
- data/db/migrate/20180327100423_add_constraints_to_recipient_operations.rb +5 -0
- data/db/migrate/20180328210434_add_rrt_to_admission_consults.rb +5 -0
- data/lib/renalware/version.rb +1 -1
- data/lib/tasks/db.rake +11 -0
- data/spec/support/devise_spec_helper.rb +1 -1
- data/spec/support/travel.rb +1 -1
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7c6d5676c20af6cae4347f70aab29e6f156d4280ab6d650c6e13633178cb128
|
4
|
+
data.tar.gz: ffaebb9b45c7820ae5a711ab2e203093a05d179268ca7240c50605db69fc96e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58f4bda8f4695d56e1c63be933ee5c7a0fa9cb70a177ea539ae6d6256a6191482687a18303eee0c85cf56eb44e688ed3ff1e45e43c4ae7d7b409eac8fe1933f4
|
7
|
+
data.tar.gz: 121933949b237cdbfc7b3c3b9ea4e9f516f8d55394353d15a8e119a3202189b9c4130e4cb9e086b69628b109c43afe7fcb20c3c0b95ed4e636610a1f696fc9a5
|
@@ -54,6 +54,10 @@ article.clinical-allergies {
|
|
54
54
|
background-color: $table-border-colour;
|
55
55
|
padding: 0em .2em .2em .6em;
|
56
56
|
|
57
|
+
@media print {
|
58
|
+
display: none;
|
59
|
+
}
|
60
|
+
|
57
61
|
&.lozenge {
|
58
62
|
background-color: $white;
|
59
63
|
padding: 0 .3rem .2em .3rem;
|
@@ -133,6 +137,10 @@ article.clinical-allergies {
|
|
133
137
|
}
|
134
138
|
|
135
139
|
.patient-alerts {
|
140
|
+
@media pring {
|
141
|
+
display: none;
|
142
|
+
}
|
143
|
+
|
136
144
|
&.lozenge {
|
137
145
|
ul {
|
138
146
|
margin: 0;
|
@@ -1,5 +1,9 @@
|
|
1
1
|
// Patient summary contains renal mini profile and allergy summary
|
2
2
|
.patient-summary {
|
3
|
+
@media print {
|
4
|
+
display: none;
|
5
|
+
}
|
6
|
+
|
3
7
|
background-color: $mini-profile-backgound-colour;
|
4
8
|
font-size: 0.9rem;
|
5
9
|
margin: 0;
|
@@ -131,6 +135,11 @@ ul.provider {
|
|
131
135
|
}
|
132
136
|
|
133
137
|
.patient-header {
|
138
|
+
@media print {
|
139
|
+
font-weight: bold;
|
140
|
+
margin-bottom: 1rem;
|
141
|
+
}
|
142
|
+
|
134
143
|
background-color: $nhs-blue;
|
135
144
|
dl {
|
136
145
|
font-size: 1.1rem;
|
@@ -187,6 +196,10 @@ ul.provider {
|
|
187
196
|
font-size: 0.9em;
|
188
197
|
font-weight: normal;
|
189
198
|
color: lighten($nhs-blue, 35%);
|
199
|
+
|
200
|
+
@media print {
|
201
|
+
display: none;
|
202
|
+
}
|
190
203
|
}
|
191
204
|
}
|
192
205
|
}
|
@@ -78,9 +78,13 @@ module Renalware
|
|
78
78
|
:consult_site_id, :hospital_ward_id, :patient_id, :q, :other_site_or_ward,
|
79
79
|
:decided_on, :transferred_on, :started_on, :ended_on, :decided_on,
|
80
80
|
:aki_risk, :transfer_priority, :seen_by_id, :consult_type,
|
81
|
-
:requires_aki_nurse, :description, :contact_number
|
81
|
+
:requires_aki_nurse, :description, :contact_number, :rrt
|
82
82
|
)
|
83
83
|
end
|
84
|
+
|
85
|
+
def per_page
|
86
|
+
params[:per_page] || 30
|
87
|
+
end
|
84
88
|
end
|
85
89
|
end
|
86
90
|
end
|
@@ -11,14 +11,15 @@ module Renalware
|
|
11
11
|
|
12
12
|
# GET aka inbox
|
13
13
|
def unread
|
14
|
-
render_receipts(
|
14
|
+
render_receipts(unread_receipts)
|
15
15
|
end
|
16
16
|
|
17
17
|
# GET all read messages
|
18
18
|
def read
|
19
|
-
render_receipts(
|
19
|
+
render_receipts(read_receipts)
|
20
20
|
end
|
21
21
|
|
22
|
+
# GET all sent messages
|
22
23
|
def sent
|
23
24
|
render_receipts(sent_receipts)
|
24
25
|
end
|
@@ -35,9 +36,11 @@ module Renalware
|
|
35
36
|
private
|
36
37
|
|
37
38
|
def render_receipts(receipts)
|
38
|
-
patient_filter = Patients::SearchFilter.new(search_term, request)
|
39
39
|
receipts = receipts.joins(message: [:patient])
|
40
|
-
|
40
|
+
if search_term.present?
|
41
|
+
receipts = patient_filter.call(receipts)
|
42
|
+
end
|
43
|
+
receipts = receipts.page(page).per(per_page)
|
41
44
|
authorize receipts
|
42
45
|
|
43
46
|
render locals: {
|
@@ -65,8 +68,20 @@ module Renalware
|
|
65
68
|
params.fetch(:patient_search, {}).fetch(:term, nil)
|
66
69
|
end
|
67
70
|
|
71
|
+
def unread_receipts
|
72
|
+
receipts.unread.order("messaging_messages.sent_at asc")
|
73
|
+
end
|
74
|
+
|
68
75
|
def sent_receipts
|
69
|
-
Receipt.sent_by(current_user.id)
|
76
|
+
Receipt.sent_by(current_user.id).ordered
|
77
|
+
end
|
78
|
+
|
79
|
+
def read_receipts
|
80
|
+
receipts.read.ordered
|
81
|
+
end
|
82
|
+
|
83
|
+
def patient_filter
|
84
|
+
@patient_filter ||= Patients::SearchFilter.new(search_term, request)
|
70
85
|
end
|
71
86
|
end
|
72
87
|
end
|
@@ -84,7 +84,7 @@ module Renalware
|
|
84
84
|
end
|
85
85
|
|
86
86
|
def lookup_access_type_abbreviation(session)
|
87
|
-
return unless session.document
|
87
|
+
return unless session.document&.respond_to?(:info)
|
88
88
|
access_type = Accesses::Type.find_by(name: session.document.info.access_type)
|
89
89
|
return unless access_type
|
90
90
|
session.document.info.access_type_abbreviation = access_type.abbreviation
|
@@ -15,49 +15,67 @@ module Renalware
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def results
|
18
|
-
@
|
19
|
-
snapshot = letter.pathology_snapshot
|
18
|
+
@results ||= begin
|
19
|
+
snapshot = letter.pathology_snapshot.dup
|
20
20
|
return if snapshot.blank?
|
21
|
-
group_snapshot_by_code_and_date(snapshot)
|
21
|
+
groups = group_snapshot_by_code_and_date(snapshot)
|
22
|
+
format_groups_into_string(groups)
|
22
23
|
end
|
23
24
|
end
|
24
25
|
|
25
26
|
private
|
26
27
|
|
28
|
+
# Note that observation#letter_group determines the group each code falls into,
|
29
|
+
# and #letter_order the order codes are displayed within that group., h.g. HGB WBC and PLT
|
30
|
+
# are grouped together because they share letter group (1) and within that group the order
|
31
|
+
# is determined by letter_order (HGB=1 WBC=2 PLT=3).
|
32
|
+
# Results (OBX results) within a groups normally share an observed_at date - ie there is a
|
33
|
+
# 1 to 1 relationship between a group and d date output on the letter; most of the time
|
34
|
+
# they will arrive in the HL7 feed as part of the same OBR and therefore have the same date.
|
35
|
+
# However if, within a group, a code has come in separately with another date, we trigger
|
36
|
+
# a new sub group so it gets its own date.
|
27
37
|
def group_snapshot_by_code_and_date(snapshot)
|
28
|
-
|
29
|
-
|
30
|
-
|
38
|
+
groups = []
|
39
|
+
PathologyLayout.new.each_group do |_group_number, obs_desc_group|
|
40
|
+
groups << build_hash_of_snapshot_results_keyed_by_date(obs_desc_group, snapshot)
|
41
|
+
end
|
42
|
+
groups
|
31
43
|
end
|
32
44
|
|
33
|
-
def
|
34
|
-
|
35
|
-
|
45
|
+
def build_hash_of_snapshot_results_keyed_by_date(obs_desc_group, snapshot)
|
46
|
+
obs_desc_group.each_with_object({}) do |obs_desc, dates|
|
47
|
+
match = snapshot[obs_desc.code.to_sym]
|
48
|
+
next if match.nil?
|
49
|
+
next if match[:observed_at].nil?
|
50
|
+
date = I18n.l(Date.parse(match[:observed_at]))
|
51
|
+
dates[date] ||= {}
|
52
|
+
dates[date][obs_desc.code] = match[:result]
|
36
53
|
end
|
37
54
|
end
|
38
55
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
date
|
45
|
-
|
46
|
-
if date != current_date
|
47
|
-
current_date = date
|
48
|
-
h[date] = []
|
56
|
+
# {"07-Jun-2017"=>{"HGB"=>"10.4", "WBC"=>"3.40", "PLT"=>"435"}
|
57
|
+
# rubocop:disable Rails/OutputSafety
|
58
|
+
def format_groups_into_string(groups)
|
59
|
+
str = ""
|
60
|
+
groups.each do |group|
|
61
|
+
group.each do |date, observations|
|
62
|
+
str += " <span>#{date}</span>: #{observations_as_string(observations)};"
|
49
63
|
end
|
50
|
-
|
51
|
-
h[date] << "#{code} #{obs[:result]}"
|
64
|
+
str = str.strip
|
52
65
|
end
|
66
|
+
str.html_safe
|
53
67
|
end
|
68
|
+
# rubocop:enable Rails/OutputSafety
|
54
69
|
|
55
|
-
def
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
70
|
+
def observations_as_string(observations)
|
71
|
+
observations.map do |code, result|
|
72
|
+
format_code_and_result_string(code, result)
|
73
|
+
end.join(", ")
|
74
|
+
end
|
75
|
+
|
76
|
+
def format_code_and_result_string(code, result)
|
77
|
+
return "(#{code} #{result})" if code.casecmp?("EGFR")
|
78
|
+
"#{code} #{result}"
|
61
79
|
end
|
62
80
|
end
|
63
81
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require_dependency "renalware/letters"
|
2
|
+
|
3
|
+
module Renalware
|
4
|
+
module Letters
|
5
|
+
class PathologyLayout
|
6
|
+
# This method helps us iterate over the pathology required in a letter.
|
7
|
+
# Path in letters should be grouped and ordered within that group.
|
8
|
+
# We might display a date only once a group for instance.
|
9
|
+
def each_group
|
10
|
+
Pathology::ObservationDescription
|
11
|
+
.select(:id, :code, :letter_group, :letter_order)
|
12
|
+
.where("letter_group is not null")
|
13
|
+
.order("letter_group asc, letter_order asc")
|
14
|
+
.group_by(&:letter_group)
|
15
|
+
.each do |group_number, descriptions|
|
16
|
+
|
17
|
+
yield(group_number, descriptions) if block_given?
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -50,14 +50,9 @@ module Renalware
|
|
50
50
|
@historical_prescriptions ||= execute_prescriptions_query(patient.prescriptions)
|
51
51
|
end
|
52
52
|
|
53
|
-
# Note we sort prescriptions by prescribed_on desc here manually because the
|
54
|
-
# prescriptions query is currently too complex to add another sql sort into (defaults)
|
55
|
-
# to sorting by drug name
|
56
53
|
def current_prescriptions
|
57
54
|
@current_prescriptions ||= begin
|
58
|
-
# TODO: maybe use #sort_by(:prescribed_on) here
|
59
55
|
execute_prescriptions_query(patient.prescriptions.current)
|
60
|
-
.sort{ |presc1, presc2| presc2.prescribed_on <=> presc1.prescribed_on }
|
61
56
|
end
|
62
57
|
end
|
63
58
|
|
@@ -82,10 +77,9 @@ module Renalware
|
|
82
77
|
# to sorting by drug name
|
83
78
|
def esa_prescriptions
|
84
79
|
@esa_prescriptions ||= begin
|
85
|
-
# TODO: maybe use #sort_by(:prescribed_on) here
|
86
80
|
execute_prescriptions_query(
|
87
81
|
patient.prescriptions.having_drug_of_type("esa")
|
88
|
-
).
|
82
|
+
).sort_by(&:prescribed_on).reverse!
|
89
83
|
end
|
90
84
|
end
|
91
85
|
|
@@ -4,8 +4,8 @@
|
|
4
4
|
url: admissions_consults_path,
|
5
5
|
method: :get do |f|
|
6
6
|
.row
|
7
|
-
.columns.medium-
|
8
|
-
= f.input :identity_match, label: "Hosp/NHS no
|
7
|
+
.columns.medium-2.large-2
|
8
|
+
= f.input :identity_match, label: "Hosp/NHS no or name"
|
9
9
|
|
10
10
|
.columns.medium-2.large-2
|
11
11
|
= f.input :consult_site_id_eq,
|
@@ -30,6 +30,11 @@
|
|
30
30
|
include_blank: true,
|
31
31
|
collection: [["Yes", true], ["No", false]],
|
32
32
|
label: "Active"
|
33
|
+
.columns.medium-1.large-1
|
34
|
+
= f.input :rrt_eq,
|
35
|
+
include_blank: true,
|
36
|
+
collection: [["Yes", true], ["No", false]],
|
37
|
+
label: "RRT"
|
33
38
|
.columns.medium-2.large-2.actions.end
|
34
39
|
= f.submit "Filter", class: "button"
|
35
40
|
span= " or "
|
@@ -45,6 +45,7 @@
|
|
45
45
|
|
46
46
|
= f.input :aki_risk, include_blank: "Please select", wrapper: :horizontal_small
|
47
47
|
= f.input :requires_aki_nurse, as: :inline_radio_buttons, wrapper: :horizontal_small
|
48
|
+
= f.input :rrt, as: :inline_radio_buttons, wrapper: :horizontal_small
|
48
49
|
= f.input :description, wrapper: :horizontal_large, input_html: { rows: 10 }
|
49
50
|
|
50
51
|
= f.submit class: :button
|
@@ -2,22 +2,24 @@
|
|
2
2
|
table
|
3
3
|
thead
|
4
4
|
tr
|
5
|
-
th.col-width-medium
|
5
|
+
th.col-width-medium.noprint
|
6
|
+
th.col-width-large
|
7
|
+
= sort_link(query, :patient, ["patient_family_name", "patient_given_name asc"], "Patient")
|
8
|
+
th.col-width-nhs-no.noprint NHS No.
|
9
|
+
th.col-width-reference-no Hosp Nos.
|
6
10
|
th.col-width-medium= sort_link(query,
|
7
11
|
:location,
|
8
12
|
[:consult_site_name, :hospital_ward_name],
|
9
13
|
"Location")
|
10
|
-
th.col-width-
|
11
|
-
|
12
|
-
th.col-width-nhs-no NHS No.
|
13
|
-
th.col-width-reference-no Hosp Nos.
|
14
|
-
th.col-width-date= sort_link(query, :started_on, "Started")
|
15
|
-
th.col-width-date= sort_link(query, :ended_on, "Ended")
|
14
|
+
th.col-width-date.noprint= sort_link(query, :started_on, "Started")
|
15
|
+
th.col-width-date.noprint= sort_link(query, :ended_on, "Ended")
|
16
16
|
th.col-width-small.show-for-large-up Modality
|
17
17
|
th.col-width-tiny.show-for-large-up Sex
|
18
|
-
th.col-width-
|
19
|
-
th.col-width-tiny
|
20
|
-
th.col-width-tiny
|
18
|
+
th.col-width-date.show-for-large-up= sort_link(query, :patient_born_on, "DOB")
|
19
|
+
th.col-width-tiny.show-for-large-up.noprint Age
|
20
|
+
th.col-width-tiny RRT?
|
21
|
+
th.col-width-tiny.noprint= sort_link(query, :aki_risk, "AKI Risk")
|
22
|
+
th.col-width-tiny.noprint= sort_link(query, :requires_aki_nurse, " AKI Nurse?")
|
21
23
|
/th.show-for-large-up Author
|
22
24
|
/th.col-width-medium.show-for-xlarge-up Description
|
23
25
|
|
@@ -25,7 +27,7 @@
|
|
25
27
|
- consults.each do |consult|
|
26
28
|
- uid = "consult-#{consult.id}"
|
27
29
|
tr
|
28
|
-
td.actions-dropdown.going-right
|
30
|
+
td.actions-dropdown.going-right.noprint
|
29
31
|
/ As we have lots of possible actions, group them in a button group.
|
30
32
|
/ A wrapping div is required for now in order for the button group display correctly
|
31
33
|
/ (though we could style the td like a div I guess).
|
@@ -57,17 +59,19 @@
|
|
57
59
|
= link_to("Toggle",
|
58
60
|
"#consult-quick-preview-#{consult.id}",
|
59
61
|
data: { behaviour: "toggler" })
|
60
|
-
td= consult.location
|
61
62
|
td= default_patient_link(consult.patient)
|
62
|
-
td= consult.patient_nhs_number
|
63
|
+
td.noprint= consult.patient_nhs_number
|
63
64
|
td= consult.patient_hospital_identifiers&.to_s_multiline
|
64
|
-
td=
|
65
|
-
td= l(consult.
|
65
|
+
td= consult.location
|
66
|
+
td.noprint= l(consult.started_on)
|
67
|
+
td.noprint= l(consult.ended_on)
|
66
68
|
td.show-for-large-up= consult.patient_current_modality
|
67
69
|
td.show-for-large-up= consult.patient_sex
|
68
|
-
td.show-for-large-up= consult.
|
69
|
-
td= consult.
|
70
|
-
td= yes_no(consult.
|
70
|
+
td.show-for-large-up= l(consult.patient.born_on)
|
71
|
+
td.show-for-large-up.noprint= consult.patient_age
|
72
|
+
td= yes_no(consult.rrt)
|
73
|
+
td.noprint= consult.aki_risk&.text
|
74
|
+
td.noprint= yes_no(consult.requires_aki_nurse)
|
71
75
|
/td.show-for-xlarge-up.consult-author.col-width-medium-with-ellipsis(title=consult.created_by)= consult.created_by
|
72
76
|
/td.col-width-medium-with-ellipsis(title=consult.description)= consult.description
|
73
77
|
= content_tag(:tr, id: "consult-quick-preview-#{consult.id}", style: "display: none")
|
@@ -4,13 +4,24 @@
|
|
4
4
|
/ Note also we should really extend this so it searches all local_patient_ids
|
5
5
|
- search_scope = :patient_given_name_or_patient_family_name_or_drug_name_or_patient_local_patient_id_cont
|
6
6
|
- searching = search.send(search_scope).present?
|
7
|
-
.filters
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
7
|
+
.search-form.filters
|
8
|
+
= simple_form_for search,
|
9
|
+
url: medications_esa_prescriptions_path,
|
10
|
+
method: :get do |f|
|
11
|
+
/= search_form_for(search, url: medications_esa_prescriptions_path) do |f|
|
12
|
+
.small-6.columns
|
13
|
+
/= f.search_field search_scope, placeholder: t(".search_prompt")
|
14
|
+
= f.input :patient_given_name_or_patient_family_name_or_drug_name_or_patient_local_patient_id_cont,
|
15
|
+
label: t(".search_prompt")
|
16
|
+
.small-3.columns
|
17
|
+
= f.input :provider_eq,
|
18
|
+
include_blank: true,
|
19
|
+
collection: Renalware::Medications::Provider.codes.each_with_index.map{ |x, i| [x.to_s.humanize, i] },
|
20
|
+
label: "Provider"
|
21
|
+
.small-3.columns.actions.end
|
22
|
+
= f.submit "Search", class: "button"
|
23
|
+
|
|
24
|
+
span or
|
25
|
+
|
|
26
|
+
= link_to "Reset", medications_esa_prescriptions_path
|
27
|
+
/class: "cancel-link #{'disabled' unless searching}"
|
@@ -1,33 +1,34 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
th.hosp_no= sort_link([:renalware, search], :patient_local_patient_id, t(".patient_local_patient_id"))
|
5
|
-
th.patient_name= sort_link([:renalware, search], "patient_family_name", t(".patient_name"))
|
6
|
-
th.patient_age= sort_link([:renalware, search], "patient_born_on", t(".patient_age"))
|
7
|
-
th.patient_sex= t(".patient_sex")
|
8
|
-
th.modality= t(".modality")
|
9
|
-
th.col-width-date= sort_link([:renalware, search], "prescribed_on", t(".prescribed_on"))
|
10
|
-
th.col-width-date.hide-for-small-only
|
11
|
-
= sort_link([:renalware, search], "terminated_on", t(".terminated_on"))
|
12
|
-
th.drug_name= sort_link([:renalware, search], "drug_name", t(".drug_name"))
|
13
|
-
th.dose= t(".dose")
|
14
|
-
th.route_code= t(".route_code")
|
15
|
-
th.frequency= t(".frequency")
|
16
|
-
th.weekly_units= t(".weekly_units")
|
17
|
-
tbody
|
18
|
-
- prescriptions.each do |prescription|
|
1
|
+
div
|
2
|
+
table#drug-type-prescriptions
|
3
|
+
thead
|
19
4
|
tr
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
5
|
+
th.hosp_no= sort_link([:renalware, search], :patient_local_patient_id, t(".patient_local_patient_id"))
|
6
|
+
th.col-width-medium= sort_link([:renalware, search], "patient_family_name", t(".patient_name"))
|
7
|
+
th.patient_age= sort_link([:renalware, search], "patient_born_on", t(".patient_age"))
|
8
|
+
th.patient_sex= t(".patient_sex")
|
9
|
+
th.col-width-medium= t(".modality")
|
10
|
+
th.col-width-date= sort_link([:renalware, search], "prescribed_on", t(".prescribed_on"))
|
11
|
+
th.col-width-date.hide-for-small-only
|
12
|
+
= sort_link([:renalware, search], "terminated_on", t(".terminated_on"))
|
13
|
+
th.drug_name= sort_link([:renalware, search], "drug_name", t(".drug_name"))
|
14
|
+
th.col-width-small= t(".dose")
|
15
|
+
th.col-width-tiny= t(".route_code")
|
16
|
+
th.frequency= t(".frequency")
|
17
|
+
th.col-width-tiny= t(".weekly_units")
|
18
|
+
tbody
|
19
|
+
- prescriptions.each do |prescription|
|
20
|
+
tr
|
21
|
+
td= prescription.patient_local_patient_id
|
22
|
+
td= default_patient_link(prescription.patient)
|
23
|
+
td= prescription.patient_age
|
24
|
+
td= prescription.patient_sex
|
25
|
+
td= prescription.patient_current_modality_name
|
26
|
+
td= l(prescription.prescribed_on)
|
27
|
+
td= prescription.terminated_on && l(prescription.terminated_on)
|
28
|
+
td= prescription.drug_name
|
29
|
+
td= prescription.dose
|
30
|
+
td= prescription.route_code
|
31
|
+
td= prescription.frequency
|
32
|
+
td=
|
32
33
|
|
33
|
-
= paginate prescriptions
|
34
|
+
= paginate prescriptions
|
@@ -2,8 +2,7 @@
|
|
2
2
|
- patient = Renalware::PatientPresenter.new(message.patient)
|
3
3
|
|
4
4
|
tr(class="#{ "urgent" if message.urgent?}" id=message.html_identifier)
|
5
|
-
td
|
6
|
-
= pluralize(message.age_in_days, "day")
|
5
|
+
td= "#{message.age_in_days} #{'day'.pluralize(message.age_in_days)}"
|
7
6
|
td= message.author
|
8
7
|
td= l(message.sent_at)
|
9
8
|
td= l(receipt.read_at)
|
@@ -1,11 +1,10 @@
|
|
1
1
|
= within_patient_layout title: "Current Pathology Results",
|
2
2
|
navigation_partial: "renalware/pathology/navigation" do
|
3
3
|
- observation_set.each_display_group do |observations, group_number|
|
4
|
-
.
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
td= l(observation.observed_at&.to_date)
|
4
|
+
table.current-observations.auto-layout
|
5
|
+
tbody
|
6
|
+
- observations.each do |observation|
|
7
|
+
tr
|
8
|
+
th= observation.description
|
9
|
+
td= observation.result
|
10
|
+
td= l(observation.observed_at&.to_date)
|
@@ -135,7 +135,7 @@ en:
|
|
135
135
|
liver_failure: "Liver failure (not self-poisoning)"
|
136
136
|
meningitis: "Meningitis"
|
137
137
|
multi_organ_failure: "Multi-organ failure"
|
138
|
-
|
138
|
+
myocardial_infarction: "Myocardial infarction"
|
139
139
|
other: "Other, please specify"
|
140
140
|
other_drug_overdose: "Other drug overdose, please specify"
|
141
141
|
other_trauma_accident: "Other trauma - accident"
|
@@ -0,0 +1,27 @@
|
|
1
|
+
class UpdatePathObsDescsForLetterGroupings < ActiveRecord::Migration[5.1]
|
2
|
+
def change
|
3
|
+
sql = <<-SQL.squish
|
4
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group = NULL, letter_order = NULL;
|
5
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=1, letter_order=1 where code = 'HGB';
|
6
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=1, letter_order=2 where code = 'WBC';
|
7
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=1, letter_order=3 where code = 'PLT';
|
8
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=2, letter_order=1 where code = 'URE';
|
9
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=3, letter_order=1 where code = 'CRE';
|
10
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=3, letter_order=2 where code = 'EGFR';
|
11
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=4, letter_order=1 where code = 'NA';
|
12
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=4, letter_order=2 where code = 'POT';
|
13
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=5, letter_order=1 where code = 'BIC';
|
14
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=6, letter_order=1 where code = 'CCA';
|
15
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=6, letter_order=2 where code = 'PHOS';
|
16
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=7, letter_order=1 where code = 'PTHI';
|
17
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=8, letter_order=1 where code = 'ALB';
|
18
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=9, letter_order=1 where code = 'BIL';
|
19
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=9, letter_order=2 where code = 'AST';
|
20
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=9, letter_order=3 where code = 'ALP';
|
21
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=9, letter_order=4 where code = 'GGT';
|
22
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=10, letter_order=1 where code = 'HBA';
|
23
|
+
UPDATE renalware.pathology_observation_descriptions set letter_group=11, letter_order=1 where code = 'CHOL';
|
24
|
+
SQL
|
25
|
+
connection.execute(sql)
|
26
|
+
end
|
27
|
+
end
|
data/lib/renalware/version.rb
CHANGED
data/lib/tasks/db.rake
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
require "benchmark"
|
2
|
+
|
3
|
+
namespace :db do
|
4
|
+
desc "Refreshes all materialized views e.g. audits. May take a while so only run overnight."
|
5
|
+
task refresh_all_materialized_views: :environment do
|
6
|
+
ms = Benchmark.ms do
|
7
|
+
ActiveRecord::Base.connection.execute("SELECT refresh_all_matierialized_views();")
|
8
|
+
end
|
9
|
+
puts "Refreshing materialized views took #{ms}"
|
10
|
+
end
|
11
|
+
end
|
data/spec/support/travel.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: renalware-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Airslie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -1480,6 +1480,7 @@ files:
|
|
1480
1480
|
- app/models/renalware/letters/part/prescriptions.rb
|
1481
1481
|
- app/models/renalware/letters/part/problems.rb
|
1482
1482
|
- app/models/renalware/letters/part/recent_pathology_results.rb
|
1483
|
+
- app/models/renalware/letters/pathology_layout.rb
|
1483
1484
|
- app/models/renalware/letters/patient.rb
|
1484
1485
|
- app/models/renalware/letters/patient_listener.rb
|
1485
1486
|
- app/models/renalware/letters/pdf_letter_cache.rb
|
@@ -3200,6 +3201,9 @@ files:
|
|
3200
3201
|
- db/migrate/20180313114927_remove_deleted_at_from_admission_consults.rb
|
3201
3202
|
- db/migrate/20180313124819_remove_tx_operation_constraints.rb
|
3202
3203
|
- db/migrate/20180319191942_create_function_to_sort_without_failing_on_nonnumerics.rb
|
3204
|
+
- db/migrate/20180323150241_update_path_obs_descs_for_letter_groupings.rb
|
3205
|
+
- db/migrate/20180327100423_add_constraints_to_recipient_operations.rb
|
3206
|
+
- db/migrate/20180328210434_add_rrt_to_admission_consults.rb
|
3203
3207
|
- db/seeds.rb
|
3204
3208
|
- db/seeds/default/accesses/access_pd_catheter_insertion_techniques.csv
|
3205
3209
|
- db/seeds/default/accesses/access_pd_catheter_insertion_techniques.rb
|
@@ -3350,6 +3354,7 @@ files:
|
|
3350
3354
|
- lib/tasks/bundler_audit.rake
|
3351
3355
|
- lib/tasks/cucumber.rake
|
3352
3356
|
- lib/tasks/cucumber_web.rake
|
3357
|
+
- lib/tasks/db.rake
|
3353
3358
|
- lib/tasks/feeds/files.rake
|
3354
3359
|
- lib/tasks/ukrdc.rake
|
3355
3360
|
- lib/templates/slim/scaffold/_form.html.slim
|