renalware-core 2.0.5 → 2.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/renalware/primary_care_physician_search.js +7 -3
- data/app/assets/stylesheets/renalware/modules/_letters.scss +5 -0
- data/app/assets/stylesheets/renalware/modules/_patients.scss +11 -0
- data/app/assets/stylesheets/renalware/modules/_snippets.scss +45 -1
- data/app/assets/stylesheets/renalware/partials/_errors.scss +1 -0
- data/app/assets/stylesheets/renalware/partials/_tables.scss +14 -0
- data/app/controllers/renalware/admissions/consults_controller.rb +5 -1
- data/app/controllers/renalware/clinics/clinic_visits_controller.rb +1 -1
- data/app/controllers/renalware/hd/current_profile_controller.rb +1 -1
- data/app/controllers/renalware/hd/preference_sets_controller.rb +1 -1
- data/app/controllers/renalware/medications/prescriptions_controller.rb +0 -1
- data/app/controllers/renalware/patients/practices_controller.rb +21 -1
- data/app/controllers/renalware/patients/worry_controller.rb +1 -1
- data/app/controllers/renalware/renal/aki_alerts_controller.rb +1 -1
- data/app/controllers/renalware/renal/profiles_controller.rb +1 -1
- data/app/controllers/renalware/transplants/donor_workups_controller.rb +1 -1
- data/app/controllers/renalware/transplants/recipient_workups_controller.rb +1 -1
- data/app/helpers/renalware/layout_helper.rb +2 -2
- data/app/models/concerns/renalware/patients_ransack_helper.rb +0 -1
- data/app/models/renalware/admissions/consult.rb +1 -1
- data/app/models/renalware/admissions/consult_query.rb +19 -3
- data/app/models/renalware/feeds/files/practices/convert_xml_to_csv.rb +6 -2
- data/app/models/renalware/letters/letter_factory.rb +3 -1
- data/app/models/renalware/letters/recipient.rb +34 -9
- data/app/models/renalware/patients/patient_hospital_identifiers.rb +4 -0
- data/app/models/renalware/patients/practice_search_query.rb +5 -2
- data/app/models/renalware/transplants/registration_status.rb +1 -1
- data/app/presenters/renalware/hd/session_presenter.rb +2 -1
- data/app/presenters/renalware/summary_part.rb +1 -1
- data/app/views/renalware/addresses/_address.html.slim +2 -2
- data/app/views/renalware/addresses/_form.html.slim +3 -3
- data/app/views/renalware/admissions/admissions/_form.html.slim +1 -1
- data/app/views/renalware/admissions/admissions/_table.html.slim +6 -7
- data/app/views/renalware/admissions/consults/_filters.html.slim +12 -9
- data/app/views/renalware/admissions/consults/_form.html.slim +2 -2
- data/app/views/renalware/admissions/consults/_table.html.slim +45 -25
- data/app/views/renalware/api/ukrdc/patients/_lab_orders.xml.builder +1 -1
- data/app/views/renalware/api/ukrdc/patients/_observations.xml.builder +1 -1
- data/app/views/renalware/directory/people/_address_form.html.slim +3 -3
- data/app/views/renalware/letters/contacts/_new.html.slim +10 -8
- data/app/views/renalware/letters/contacts/_new_person.html.slim +15 -19
- data/app/views/renalware/letters/contacts/_person_form.html.slim +48 -25
- data/app/views/renalware/letters/formatted_letters/_letter.html.slim +14 -3
- data/app/views/renalware/letters/letters/_cc_recipient_form.html.slim +1 -1
- data/app/views/renalware/letters/letters/_form.html.slim +1 -1
- data/app/views/renalware/letters/letters/_main_recipient.html.slim +5 -5
- data/app/views/renalware/letters/letters/contact_added.js.erb +4 -2
- data/app/views/renalware/patients/alerts/_list.html.slim +1 -1
- data/app/views/renalware/problems/problems/edit.html.slim +2 -3
- data/app/views/renalware/problems/problems/new.html.slim +2 -3
- data/app/views/renalware/snippets/snippets/_list.html.slim +3 -8
- data/app/views/renalware/snippets/snippets/_row.html.slim +5 -4
- data/app/views/renalware/snippets/snippets/_table.html.slim +24 -23
- data/app/views/renalware/snippets/snippets/edit.html.slim +2 -3
- data/app/views/renalware/snippets/snippets/index.html.slim +3 -2
- data/app/views/renalware/snippets/snippets/new.html.slim +2 -5
- data/lib/renalware/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35f1da96bf99bc1165eafb40df5d2061d5840831ef9d061373448bb6fc0d8dad
|
4
|
+
data.tar.gz: cf73511f92c66f3a6192b26daefd7ed7a1bd69265edee4a283fa17d6e138e38b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 571bf241c4d5c4249267c2a948b46d3e1455f6bdd453891f13df6e66b45774eae011971a37a96280b6c0a5e1a60e8faeef22e9342ca0770ea99427ff116d626d
|
7
|
+
data.tar.gz: f9700de2153b34d22684d45f79350bc4b996d5deb7b95faeb8d57adf0af85a24e6dd061cd423fd26f47aff4f6a2d13ba77351a6f89befc14e096fba68dd6a5d1
|
@@ -3,11 +3,15 @@ var Renalware = typeof Renalware === 'undefined' ? {} : Renalware;
|
|
3
3
|
Renalware.PrimaryCarePhysicianSearch = (function() {
|
4
4
|
|
5
5
|
var formatPractice = function(practice) {
|
6
|
-
|
6
|
+
if (practice.name != undefined) {
|
7
|
+
return "<b>" + practice.name + "</b> " + practice.address;
|
8
|
+
}
|
7
9
|
};
|
8
10
|
|
9
11
|
var formatPracticeSelection = function(practice) {
|
10
|
-
|
12
|
+
if (practice.name != undefined) {
|
13
|
+
return practice.name;
|
14
|
+
}
|
11
15
|
};
|
12
16
|
|
13
17
|
var initPracticeAutocomplete = function(){
|
@@ -41,7 +45,7 @@ Renalware.PrimaryCarePhysicianSearch = (function() {
|
|
41
45
|
}).select2('open');
|
42
46
|
|
43
47
|
// When a Practice is selected from the autocomplete list,
|
44
|
-
// Do an ajax replace on the <form> in this modal by
|
48
|
+
// Do an ajax replace on the <form> in this modal by sending a .js request
|
45
49
|
// to the url the modal was loaded from (this is in a data attribute on the pratice-search
|
46
50
|
// select). This will load in just the form under the practice-search select, bringing
|
47
51
|
// with it a list of pcps associated with this practice.
|
@@ -5,6 +5,7 @@
|
|
5
5
|
}
|
6
6
|
|
7
7
|
&.modal {
|
8
|
+
overflow-y: initial !important;
|
8
9
|
|
9
10
|
.modal-header {
|
10
11
|
border-bottom: solid 1px #ccc;
|
@@ -26,6 +27,12 @@
|
|
26
27
|
}
|
27
28
|
}
|
28
29
|
}
|
30
|
+
|
31
|
+
.scrollable {
|
32
|
+
height: 300px;
|
33
|
+
overflow-y: auto;
|
34
|
+
clear: both;
|
35
|
+
}
|
29
36
|
}
|
30
37
|
|
31
38
|
#snippet-search-form {
|
@@ -44,7 +51,11 @@
|
|
44
51
|
vertical-align: top;
|
45
52
|
|
46
53
|
&:first-child {
|
47
|
-
padding-top: 0;
|
54
|
+
//padding-top: 0;
|
55
|
+
}
|
56
|
+
|
57
|
+
&.title {
|
58
|
+
vertical-align: middle;
|
48
59
|
}
|
49
60
|
}
|
50
61
|
|
@@ -57,6 +68,39 @@
|
|
57
68
|
}
|
58
69
|
}
|
59
70
|
|
71
|
+
td.body {
|
72
|
+
position: relative;
|
73
|
+
height: 1rem;
|
74
|
+
|
75
|
+
&:after {
|
76
|
+
content: '';
|
77
|
+
width: 100%;
|
78
|
+
//height: 2rem;
|
79
|
+
position: absolute;
|
80
|
+
left: 0;
|
81
|
+
bottom: 0;
|
82
|
+
box-shadow: 0 0 .5em 0.5em #fff;
|
83
|
+
height: 0;
|
84
|
+
//background:linear-gradient(rgba(255,255,255,0) 0, white);
|
85
|
+
}
|
86
|
+
|
87
|
+
&.expanded {
|
88
|
+
height: 100%;
|
89
|
+
|
90
|
+
.body-content {
|
91
|
+
height: 100%;
|
92
|
+
}
|
93
|
+
|
94
|
+
&:after {
|
95
|
+
background: none;
|
96
|
+
}
|
97
|
+
}
|
98
|
+
|
99
|
+
.body-content {
|
100
|
+
height: 1rem;
|
101
|
+
}
|
102
|
+
}
|
103
|
+
|
60
104
|
@media #{$medium-up} {
|
61
105
|
td, th {
|
62
106
|
&.author {
|
@@ -4,9 +4,17 @@ table td.actions-dropdown {
|
|
4
4
|
padding-bottom: 0.3rem;
|
5
5
|
padding-right: 0;
|
6
6
|
|
7
|
+
> div {
|
8
|
+
display: inline-block;
|
9
|
+
}
|
10
|
+
|
7
11
|
.button.dropdown {
|
8
12
|
padding: .2rem 2.3rem .2rem .4rem;
|
9
13
|
margin: 0;
|
14
|
+
|
15
|
+
&:after {
|
16
|
+
right: 0.5rem;
|
17
|
+
}
|
10
18
|
}
|
11
19
|
|
12
20
|
.f-dropdown {
|
@@ -17,6 +25,12 @@ table td.actions-dropdown {
|
|
17
25
|
left: 160px;
|
18
26
|
}
|
19
27
|
}
|
28
|
+
|
29
|
+
&.going-right {
|
30
|
+
.f-dropdown {
|
31
|
+
margin-left: 0px;
|
32
|
+
}
|
33
|
+
}
|
20
34
|
}
|
21
35
|
|
22
36
|
table {
|
@@ -6,7 +6,9 @@ module Renalware
|
|
6
6
|
class ConsultsController < BaseController
|
7
7
|
include Renalware::Concerns::Pageable
|
8
8
|
|
9
|
+
# rubocop:disable Metrics/AbcSize
|
9
10
|
def index
|
11
|
+
session[:consults_results] = nil if params.key?(:reset)
|
10
12
|
query = ConsultQuery.new(params[:q])
|
11
13
|
consults = query.call.page(page).per(per_page)
|
12
14
|
authorize consults
|
@@ -15,6 +17,7 @@ module Renalware
|
|
15
17
|
query: query.search
|
16
18
|
}
|
17
19
|
end
|
20
|
+
# rubocop:enable Metrics/AbcSize
|
18
21
|
|
19
22
|
def new
|
20
23
|
consult = Consult.new(started_on: Time.zone.today)
|
@@ -40,7 +43,8 @@ module Renalware
|
|
40
43
|
def update
|
41
44
|
consult = find_and_authorize_consult
|
42
45
|
if consult.update_by(current_user, consult_params)
|
43
|
-
|
46
|
+
url = session[:consults_results] || admissions_consults_path
|
47
|
+
redirect_to url, notice: success_msg_for("consult")
|
44
48
|
else
|
45
49
|
render_edit(consult)
|
46
50
|
end
|
@@ -13,7 +13,7 @@ module Renalware
|
|
13
13
|
def update
|
14
14
|
preference_set = PreferenceSet.for_patient(patient).first_or_initialize
|
15
15
|
|
16
|
-
if preference_set.
|
16
|
+
if preference_set.update(preference_set_params)
|
17
17
|
redirect_to patient_hd_dashboard_path(patient),
|
18
18
|
notice: t(".success", model_name: "HD preferences")
|
19
19
|
else
|
@@ -16,7 +16,27 @@ module Renalware
|
|
16
16
|
private
|
17
17
|
|
18
18
|
def practices_matching_search_term
|
19
|
-
PracticeSearchQuery.new(search_term: params[:q])
|
19
|
+
PracticeSearchQuery.new(search_term: params[:q])
|
20
|
+
.call
|
21
|
+
.map { |practice| format_practice_into_hash_for_json(practice) }
|
22
|
+
end
|
23
|
+
|
24
|
+
def null_address
|
25
|
+
Address.new
|
26
|
+
end
|
27
|
+
|
28
|
+
def format_practice_into_hash_for_json(practice)
|
29
|
+
address = practice.address || null_address
|
30
|
+
{
|
31
|
+
id: practice.id,
|
32
|
+
name: practice.name,
|
33
|
+
address: [
|
34
|
+
address.street_1,
|
35
|
+
address.town,
|
36
|
+
address.county,
|
37
|
+
address.postcode
|
38
|
+
].reject(&:blank?).join(", ")
|
39
|
+
}
|
20
40
|
end
|
21
41
|
end
|
22
42
|
end
|
@@ -22,7 +22,7 @@ module Renalware
|
|
22
22
|
def update
|
23
23
|
workup = DonorWorkup.for_patient(patient).first_or_initialize
|
24
24
|
|
25
|
-
if workup.
|
25
|
+
if workup.update(workup_params)
|
26
26
|
redirect_to patient_transplants_donor_workup_path(patient),
|
27
27
|
notice: t(".success", model_name: "donor work up")
|
28
28
|
else
|
@@ -27,7 +27,7 @@ module Renalware
|
|
27
27
|
def update
|
28
28
|
workup = RecipientWorkup.for_patient(patient).first_or_initialize
|
29
29
|
|
30
|
-
if workup.
|
30
|
+
if workup.update workup_params
|
31
31
|
redirect_to patient_transplants_recipient_workup_path(patient),
|
32
32
|
notice: t(".success", model_name: "recipient work up")
|
33
33
|
else
|
@@ -63,11 +63,11 @@ module Renalware
|
|
63
63
|
#
|
64
64
|
# See http://stackoverflow.com/questions/339130/how-do-i-render-a-partial-of-a-\
|
65
65
|
# different-format-in-rails/3427634#3427634
|
66
|
-
def with_format(format
|
66
|
+
def with_format(format)
|
67
67
|
old_formats = formats
|
68
68
|
begin
|
69
69
|
self.formats = [format]
|
70
|
-
return
|
70
|
+
return yield
|
71
71
|
ensure
|
72
72
|
self.formats = old_formats
|
73
73
|
end
|
@@ -5,6 +5,7 @@ module Renalware
|
|
5
5
|
class Consult < ApplicationRecord
|
6
6
|
include Accountable
|
7
7
|
extend Enumerize
|
8
|
+
include PatientsRansackHelper
|
8
9
|
validates :patient_id, presence: true
|
9
10
|
validates :started_on, presence: true
|
10
11
|
validates :description, presence: true
|
@@ -22,7 +23,6 @@ module Renalware
|
|
22
23
|
enumerize :aki_risk, in: %i(yes no unknown)
|
23
24
|
|
24
25
|
scope :active, ->{ where(ended_on: nil) }
|
25
|
-
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
@@ -5,16 +5,32 @@ module Renalware
|
|
5
5
|
class ConsultQuery
|
6
6
|
attr_reader :query
|
7
7
|
|
8
|
-
def initialize(query =
|
9
|
-
@query = query
|
8
|
+
def initialize(query = nil)
|
9
|
+
@query = query || {}
|
10
|
+
@query[:ended_on_null] ||= true
|
10
11
|
end
|
11
12
|
|
12
13
|
def call
|
13
14
|
search.result
|
14
15
|
end
|
15
16
|
|
17
|
+
# Note we *MUST* join onto patients for PatientsRansackHelper.identity_match to work.
|
18
|
+
# It might be better to refactor PatientsRansackHelper so we can include where required
|
19
|
+
# eg below using .extending(PatientsRansackHelper) rather than relying on it being in
|
20
|
+
# included in the model file.
|
16
21
|
def search
|
17
|
-
@search ||=
|
22
|
+
@search ||= begin
|
23
|
+
Consult
|
24
|
+
.joins(:patient)
|
25
|
+
.includes(
|
26
|
+
:created_by,
|
27
|
+
:consult_site,
|
28
|
+
:hospital_ward,
|
29
|
+
patient: { current_modality: :description }
|
30
|
+
)
|
31
|
+
.order(created_at: :desc)
|
32
|
+
.ransack(query)
|
33
|
+
end
|
18
34
|
end
|
19
35
|
end
|
20
36
|
end
|
@@ -5,6 +5,8 @@ module Renalware
|
|
5
5
|
module Files
|
6
6
|
module Practices
|
7
7
|
class ConvertXmlToCsv
|
8
|
+
PRACTICE_ROLES = %w(RO177 RO76).freeze
|
9
|
+
|
8
10
|
def self.call(xml_path)
|
9
11
|
new.call(xml_path)
|
10
12
|
end
|
@@ -100,10 +102,12 @@ module Renalware
|
|
100
102
|
for_element "PostCode" do org.postcode = inner_xml end
|
101
103
|
for_element "Country" do
|
102
104
|
country_name = inner_xml
|
105
|
+
|
103
106
|
CountryMap.new.map(country_name).tap do |mapped|
|
104
107
|
org.region = mapped.region
|
105
108
|
found_country = countries.find_by(name: mapped.country)
|
106
109
|
if found_country.blank?
|
110
|
+
Rails.logger.warn("#{country_name} not mapped")
|
107
111
|
org.skip = true
|
108
112
|
org.region = country_name
|
109
113
|
# raise(CountryNotFoundError, country_name)
|
@@ -119,12 +123,12 @@ module Renalware
|
|
119
123
|
end
|
120
124
|
end
|
121
125
|
|
122
|
-
if org.roles.
|
126
|
+
if (PRACTICE_ROLES & org.roles).any?
|
123
127
|
fail unless org.code&.length == 6
|
124
128
|
practices_count += 1
|
125
129
|
if org.skip
|
126
130
|
Rails.logger.warn(
|
127
|
-
"Not importing practice, probably because country
|
131
|
+
"Not importing practice, probably because country country_name not found. "\
|
128
132
|
"#{org}"
|
129
133
|
)
|
130
134
|
else
|