renalware-core 2.0.1 → 2.0.2
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/models/renalware/letters/letter.rb +1 -1
- data/app/models/renalware/letters/recipient.rb +11 -4
- data/app/models/renalware/patients/primary_care_physician.rb +7 -1
- data/app/presenters/renalware/letters/letter_form_presenter.rb +4 -2
- data/app/views/renalware/letters/completed_letters/new.html.slim +0 -1
- data/app/views/renalware/letters/letters/_main_recipient.html.slim +6 -5
- data/app/views/renalware/letters/lists/show.html.slim +1 -1
- 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: 8f579d475315f2250e3bd086f651bcb9fc0c38838f74b649fb9f439fdb21b4db
|
4
|
+
data.tar.gz: 7ab7db9d4572a88eef14a8a0dd3ce0ed47c741c07f1838cb24cb856177aac239
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc57a5702a16893bdd206b58ec3b124b947d0c0694a45fb1dd63069de8521e8900f3b2496cb055ec75defcbad3935f8bbb93d9ef382f8859a826efa8b738524b
|
7
|
+
data.tar.gz: f01dbf8296ec8c9e1df88862270393dd0a19de91db300a1c30483d906ff6a60d7de24808a7089806b86f124bd09126e1673853d0edf0b39402dfb03c1b4ad4e0
|
@@ -32,11 +32,10 @@ module Renalware
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def current_address
|
35
|
-
|
36
|
-
when patient?
|
35
|
+
if patient?
|
37
36
|
letter.patient.current_address
|
38
|
-
|
39
|
-
|
37
|
+
elsif primary_care_physician?
|
38
|
+
address_for_primary_care_physician
|
40
39
|
else
|
41
40
|
addressee.address
|
42
41
|
end
|
@@ -49,6 +48,14 @@ module Renalware
|
|
49
48
|
|
50
49
|
private
|
51
50
|
|
51
|
+
def address_for_primary_care_physician
|
52
|
+
address = letter.patient&.practice&.address
|
53
|
+
if address.present? && letter.primary_care_physician.present?
|
54
|
+
address.name = letter.primary_care_physician.salutation
|
55
|
+
end
|
56
|
+
address
|
57
|
+
end
|
58
|
+
|
52
59
|
def patient_or_primary_care_physician?
|
53
60
|
patient? || primary_care_physician?
|
54
61
|
end
|
@@ -46,8 +46,14 @@ module Renalware
|
|
46
46
|
[title, name].join(" ")
|
47
47
|
end
|
48
48
|
|
49
|
+
class PrimaryCarePhysicianAddressAccessError < StandardError; end
|
49
50
|
def current_address
|
50
|
-
|
51
|
+
raise PrimaryCarePhysicianAddressAccessError,
|
52
|
+
"primary_care_physician#current_address should not be called: "\
|
53
|
+
"we always use the patient.practice.address when contacting the GP. "\
|
54
|
+
"In a sense the practice is more important that the GP, as the GP may have "\
|
55
|
+
"moved on"
|
56
|
+
# address || practice_address
|
51
57
|
end
|
52
58
|
|
53
59
|
def practice_address
|
@@ -7,7 +7,9 @@ module Renalware
|
|
7
7
|
class LetterFormPresenter < DumbDelegator
|
8
8
|
def person_roles
|
9
9
|
[].tap do |collection|
|
10
|
-
|
10
|
+
if patient.primary_care_physician.present? && patient.practice.present?
|
11
|
+
collection << primary_care_physician_role
|
12
|
+
end
|
11
13
|
collection << patient_role
|
12
14
|
collection << other_role
|
13
15
|
end
|
@@ -38,7 +40,7 @@ module Renalware
|
|
38
40
|
|
39
41
|
def primary_care_physician_role
|
40
42
|
label = "Primary Care Physician <address>#{primary_care_physician.name}, " \
|
41
|
-
"#{
|
43
|
+
"#{patient.practice&.address}</address>".html_safe
|
42
44
|
[label, "primary_care_physician", primary_care_physician.salutation]
|
43
45
|
end
|
44
46
|
|
@@ -5,10 +5,12 @@ article
|
|
5
5
|
= f.simple_fields_for :main_recipient do |fmr|
|
6
6
|
|
7
7
|
.radio_buttons.row.optional.letter_main_recipient_person_role.field_with_hint
|
8
|
-
.columns.small-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
.columns.small-12
|
9
|
+
.hint
|
10
|
+
- if patient.primary_care_physician.nil? || patient.practice.nil?
|
11
|
+
| No option to send to GP as patient has no Practice and/or GP
|
12
|
+
br
|
13
|
+
=f.object.patient_cc_hint
|
12
14
|
= fmr.collection_radio_buttons(:person_role,
|
13
15
|
f.object.person_roles,
|
14
16
|
:second,
|
@@ -21,7 +23,6 @@ article
|
|
21
23
|
class: "radio_buttons recipient-person-role-picker has_salutation") \
|
22
24
|
+ b.text \
|
23
25
|
}
|
24
|
-
.hint=f.object.patient_cc_hint
|
25
26
|
|
26
27
|
= fmr.input :id, as: :hidden
|
27
28
|
|
@@ -34,4 +34,4 @@
|
|
34
34
|
/ for the complete works. Using ujs for these sort of dialog -> -> post -> page refresh
|
35
35
|
/ cycles is a bit complex and we could move to using something like stimulus
|
36
36
|
/ to keep thing a bit simpler
|
37
|
-
#letter-print-modal.reveal-modal.
|
37
|
+
#letter-print-modal.reveal-modal.medium(data-reveal data-refresh-url=request.original_fullpath)
|
data/lib/renalware/version.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.2
|
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-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|