renalware-core 2.0.128 → 2.0.129
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/renalware/low_clearance/profiles_controller.rb +1 -1
- data/app/documents/renalware/low_clearance/profile_document.rb +2 -0
- data/app/models/renalware/low_clearance/profile.rb +1 -0
- data/app/models/renalware/low_clearance/referrer.rb +17 -0
- data/app/models/renalware/pathology/observations_grouped_by_date_query.rb +15 -2
- data/app/views/renalware/hd/sessions/_row.html.slim +1 -1
- data/app/views/renalware/hd/sessions/_thead.html.slim +1 -1
- data/app/views/renalware/low_clearance/profiles/_summary.html.slim +2 -0
- data/app/views/renalware/low_clearance/profiles/edit.html.slim +8 -0
- data/config/locales/renalware/low_clearance/profile.en.yml +4 -2
- data/db/migrate/20191213094611_create_low_clearance_referrers.rb +21 -0
- data/lib/renalware/version.rb +1 -1
- data/spec/support/pages/low_clearance/profile_page.rb +70 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 156b1e1ab54f4596ebc2b14b72f0f82c1476191b8b0efbe035615136120ad49e
|
4
|
+
data.tar.gz: 05cc53cd4907c8545db2566f8ab8e33744821f50274b259212765b108a92c929
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c8b74079f3b0dcb8e7cc78ca57f01b8d81a5ca789c3f76f60c8bedac26cab9b5e78d57d2c41ac072c2acdf2adf528c1af653787ecf7548ded3abb4b8b90741c
|
7
|
+
data.tar.gz: c2e35bc6f3bf69085582d1905353b07a3e6d0f8fa20c6c180ea3d48d8d3910a125a71868302aee08ffcfe74c65fafc89dce41df30e217a7cdd486a061ce434da
|
@@ -11,6 +11,8 @@ module Renalware
|
|
11
11
|
attribute :dialysis_planned_on, Date
|
12
12
|
attribute :predicted_esrf_date, Date
|
13
13
|
attribute :referral_creatinine, Integer
|
14
|
+
# Note that referred_by is now used as 'Referred by notes' as we have a new referrer relation
|
15
|
+
# on the profile itself. We need to keep the document version around, so using for notes.
|
14
16
|
attribute :referred_by, String
|
15
17
|
attribute :education_status, Document::Enum
|
16
18
|
attribute :referral_egfr, Decimal
|
@@ -10,6 +10,7 @@ module Renalware
|
|
10
10
|
include Document::Base
|
11
11
|
validates :patient, presence: true
|
12
12
|
belongs_to :patient, touch: true
|
13
|
+
belongs_to :referrer
|
13
14
|
has_document class_name: "Renalware::LowClearance::ProfileDocument"
|
14
15
|
has_paper_trail class_name: "Renalware::LowClearance::Version",
|
15
16
|
on: [:create, :update, :destroy]
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_dependency "renalware/low_clearance"
|
4
|
+
require "document/base"
|
5
|
+
|
6
|
+
module Renalware
|
7
|
+
module LowClearance
|
8
|
+
class Referrer < ApplicationRecord
|
9
|
+
validates :name, presence: true, uniqueness: true
|
10
|
+
scope :ordered, -> { order(name: :asc) }
|
11
|
+
|
12
|
+
def to_s
|
13
|
+
name
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -30,7 +30,6 @@ module Renalware
|
|
30
30
|
# 1 2016-03-15 {"NA": "137", "TP": "74", "ALB": "48", "ALP": "71", ...
|
31
31
|
# 1 2016-02-29 {"NA": "136", "TP": "78", "ALB": "47", "ALP": "71", ...
|
32
32
|
#
|
33
|
-
#
|
34
33
|
class ObservationsGroupedByDateQuery
|
35
34
|
attr_reader :patient, :observation_descriptions, :page, :limit
|
36
35
|
alias current_page page
|
@@ -66,10 +65,24 @@ module Renalware
|
|
66
65
|
Pathology::Observation.none
|
67
66
|
end
|
68
67
|
|
68
|
+
# Returns path results grouped by day, and on each day, a hash results keyed by OBX code
|
69
|
+
# containing an array of [result, comment]. The array and data structure is designed to
|
70
|
+
# save space over the wire and in memory - we could have retuned an array of hashes with
|
71
|
+
# code, result, comment keys etc.
|
72
|
+
# Note in jsonb_object_agg the final ORDER BY is by ASC when you would think it would be
|
73
|
+
# by DESC seeing as how we want to the latest result. However ASC works and DESC does not
|
74
|
+
# and I am not not sure why yet.
|
75
|
+
#
|
76
|
+
# Example output:
|
77
|
+
#
|
78
|
+
# 2016-12-06, "{""NA"": [""139"", """"], ""EGFR"": [""83"", ""adjusted original: 77""]}"
|
79
|
+
# 2016-10-20, "{""FOL"": [""6.4"", """"]}"
|
80
|
+
# 2016-09-04, "{""TSH"": [""0.36"", """"]}"
|
81
|
+
# ...
|
69
82
|
def to_sql
|
70
83
|
<<-SQL.squish
|
71
84
|
select obs_req.patient_id, cast(observed_at as date) as observed_on,
|
72
|
-
jsonb_object_agg(obs_desc.code, ARRAY[obs.result, obs.comment]) results
|
85
|
+
jsonb_object_agg(obs_desc.code, ARRAY[obs.result, obs.comment] order by observed_at asc) results
|
73
86
|
from pathology_observations obs
|
74
87
|
inner join pathology_observation_requests obs_req on obs.request_id = obs_req.id
|
75
88
|
inner join pathology_observation_descriptions obs_desc on obs.description_id = obs_desc.id
|
@@ -37,7 +37,7 @@ tbody.hd-session-row(class=[session.state, stripe_class])
|
|
37
37
|
td.nowrap= session.after_measurement_for(:bm_stix)
|
38
38
|
td.nowrap= session.after_measurement_for(:blood_pressure)
|
39
39
|
td.print-only= session.signed_off_by
|
40
|
-
tr
|
40
|
+
tr.noprint
|
41
41
|
td(colspan=20)
|
42
42
|
.quick-preview
|
43
43
|
= definition_list_for(session, size: :large) do |list|
|
@@ -13,6 +13,7 @@
|
|
13
13
|
method: :put,
|
14
14
|
wrapper: "horizontal_form" do |f|
|
15
15
|
|
16
|
+
|
16
17
|
= f.simple_fields_for :document, profile.document do |flc|
|
17
18
|
= flc.input :first_seen_on, as: :date_picker, wrapper: :horizontal_datepicker
|
18
19
|
= flc.input :dialysis_plan, wrapper: :horizontal_medium
|
@@ -20,6 +21,13 @@
|
|
20
21
|
= flc.input :predicted_esrf_date, as: :date_picker, wrapper: :horizontal_datepicker
|
21
22
|
= flc.input :referral_creatinine, wrapper: :horizontal_tiny
|
22
23
|
= flc.input :referral_egfr, wrapper: :horizontal_tiny
|
24
|
+
|
25
|
+
= f.input :referrer_id,
|
26
|
+
wrapper: :horizontal_medium,
|
27
|
+
collection: Renalware::LowClearance::Referrer.ordered,
|
28
|
+
label: "Referred by"
|
29
|
+
|
30
|
+
= f.simple_fields_for :document, profile.document do |flc|
|
23
31
|
= flc.input :referred_by, wrapper: :horizontal_medium
|
24
32
|
= flc.input :education_status, wrapper: :horizontal_tiny
|
25
33
|
= flc.input :education_type, wrapper: :horizontal_tiny
|
@@ -9,7 +9,9 @@ en:
|
|
9
9
|
dialysis_planned_on: Dialysis plan date
|
10
10
|
predicted_esrf_date: Predicted ESRF date
|
11
11
|
referral_creatinine: Referral CRE
|
12
|
-
|
12
|
+
referrer: Referred by
|
13
|
+
referrer_id: Referred by
|
14
|
+
referred_by: Referred by notes
|
13
15
|
education_status: Education status
|
14
16
|
referral_egfr: Referral eGFR
|
15
17
|
education_type: Education type
|
@@ -30,7 +32,7 @@ en:
|
|
30
32
|
predicted_esrf_date: Predicted ESRF date
|
31
33
|
referral_creatinine: Referral CRE
|
32
34
|
referral_egfr: Referral eGFR
|
33
|
-
referred_by: Referred by
|
35
|
+
referred_by: Referred by notes
|
34
36
|
education_status: Education status
|
35
37
|
education_type: Education type
|
36
38
|
attended_on: Date attended educ.
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class CreateLowClearanceReferrers < ActiveRecord::Migration[5.2]
|
2
|
+
def change
|
3
|
+
within_renalware_schema do
|
4
|
+
create_table :low_clearance_referrers do |t|
|
5
|
+
t.string :name, null: false, index: { unique: true }
|
6
|
+
t.boolean :hidden, null: false, default: false
|
7
|
+
t.timestamps null: false
|
8
|
+
end
|
9
|
+
|
10
|
+
add_reference(
|
11
|
+
:low_clearance_profiles,
|
12
|
+
:referrer,
|
13
|
+
references: :low_clearance_referrers,
|
14
|
+
index: true,
|
15
|
+
null: true
|
16
|
+
)
|
17
|
+
|
18
|
+
add_foreign_key :low_clearance_profiles, :low_clearance_referrers, column: :referrer_id
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/lib/renalware/version.rb
CHANGED
@@ -0,0 +1,70 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../page_object"
|
4
|
+
|
5
|
+
module Pages
|
6
|
+
module LowClearance
|
7
|
+
class ProfilePage < Pages::PageObject
|
8
|
+
pattr_initialize :patient
|
9
|
+
|
10
|
+
def add_or_edit
|
11
|
+
visit patient_low_clearance_dashboard_path(patient)
|
12
|
+
|
13
|
+
within ".page-actions" do
|
14
|
+
click_on "Add"
|
15
|
+
click_on "Profile"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def save
|
20
|
+
within ".form-actions" do
|
21
|
+
find('input[name="commit"]').click
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def referred_by=(value)
|
26
|
+
select value, from: "Referred by"
|
27
|
+
end
|
28
|
+
|
29
|
+
def referred_by_notes=(value)
|
30
|
+
fill_in "Referred by notes", with: value
|
31
|
+
end
|
32
|
+
|
33
|
+
def date_first_seen=(value)
|
34
|
+
fill_in "Date first seen", with: value
|
35
|
+
end
|
36
|
+
|
37
|
+
def dialysis_plan=(value)
|
38
|
+
select value, from: "Dialysis plan"
|
39
|
+
end
|
40
|
+
|
41
|
+
def dialysis_plan_date=(value)
|
42
|
+
fill_in "Dialysis plan date", with: value
|
43
|
+
end
|
44
|
+
|
45
|
+
def predicted_esrf_date=(value)
|
46
|
+
fill_in "Predicted ESRF date", with: value
|
47
|
+
end
|
48
|
+
|
49
|
+
def referral_cre=(value)
|
50
|
+
fill_in "Referral CRE", with: value
|
51
|
+
end
|
52
|
+
|
53
|
+
def referral_efgr=(value)
|
54
|
+
fill_in "Referral eGFR", with: value
|
55
|
+
end
|
56
|
+
|
57
|
+
def education_status=(value)
|
58
|
+
select value, from: "Education status"
|
59
|
+
end
|
60
|
+
|
61
|
+
def education_type=(value)
|
62
|
+
select value, from: "Education type"
|
63
|
+
end
|
64
|
+
|
65
|
+
def date_attending=(value)
|
66
|
+
fill_in "Date attended educ.", with: value
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
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.129
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Airslie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-12-
|
11
|
+
date: 2019-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview-component
|
@@ -1658,6 +1658,7 @@ files:
|
|
1658
1658
|
- app/models/renalware/low_clearance/modality_description.rb
|
1659
1659
|
- app/models/renalware/low_clearance/patient.rb
|
1660
1660
|
- app/models/renalware/low_clearance/profile.rb
|
1661
|
+
- app/models/renalware/low_clearance/referrer.rb
|
1661
1662
|
- app/models/renalware/low_clearance/version.rb
|
1662
1663
|
- app/models/renalware/medications.rb
|
1663
1664
|
- app/models/renalware/medications/dose_unit.rb
|
@@ -3723,6 +3724,7 @@ files:
|
|
3723
3724
|
- db/migrate/20191205185835_update_survey_views.rb
|
3724
3725
|
- db/migrate/20191209160151_add_patient_question_text_to_survey_responses.rb
|
3725
3726
|
- db/migrate/20191209163151_update_survey_views_to_allow_free_text.rb
|
3727
|
+
- db/migrate/20191213094611_create_low_clearance_referrers.rb
|
3726
3728
|
- db/seeds.rb
|
3727
3729
|
- db/seeds/default/accesses/access_pd_catheter_insertion_techniques.csv
|
3728
3730
|
- db/seeds/default/accesses/access_pd_catheter_insertion_techniques.rb
|
@@ -4087,6 +4089,7 @@ files:
|
|
4087
4089
|
- spec/support/pages/clinical/profile_page.rb
|
4088
4090
|
- spec/support/pages/letters/form.rb
|
4089
4091
|
- spec/support/pages/letters/patient_letters.rb
|
4092
|
+
- spec/support/pages/low_clearance/profile_page.rb
|
4090
4093
|
- spec/support/pages/medications/prescription_fom.rb
|
4091
4094
|
- spec/support/pages/page_object.rb
|
4092
4095
|
- spec/support/pathology_spec_helper.rb
|