renalware-core 2.0.116 → 2.0.117
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/feeds/hl7_test_messages_controller.rb +0 -1
- data/app/controllers/renalware/problems/notes_controller.rb +45 -18
- data/app/jobs/feed_job.rb +3 -4
- data/app/models/renalware/feeds.rb +0 -2
- data/app/models/renalware/feeds/message_processor.rb +4 -4
- data/app/models/renalware/problems/note.rb +4 -0
- data/app/views/renalware/problems/notes/_form.html.slim +1 -1
- data/app/views/renalware/problems/notes/_table.html.slim +9 -3
- data/app/views/renalware/problems/notes/form.js.erb +3 -1
- data/config/routes/patients.rb +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: 90a6805bb8cf3b390ced2cb486b99fcc5ffe4d422a191f93cd0db17d7ecd48d5
|
4
|
+
data.tar.gz: 8f1f5c571e429f2733916bc467bb4795c644bab6499c8d33827265847a3c06c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01a912fcb03003db4ab86ce2561dc66370548a0f37e00e90f97e2db932a66723f69d7db0d62c11ff1e2ef5cdd768dbd9d262894a7dcd7e504b13c271ea86e0e3
|
7
|
+
data.tar.gz: b3b0b0b66293404ff97e20c05bbc79598e999cdc5aa35ebc44eda9c902ba2adf465f76b20ea03932b4c392711b2aa4b82bf8bd69814c96884429f66184a169c6
|
@@ -3,51 +3,78 @@
|
|
3
3
|
module Renalware
|
4
4
|
module Problems
|
5
5
|
class NotesController < BaseController
|
6
|
-
before_action :load_patient
|
7
|
-
|
8
6
|
def index
|
9
|
-
load_problem
|
10
7
|
render_index
|
11
8
|
end
|
12
9
|
|
13
10
|
def new
|
14
|
-
|
15
|
-
note
|
16
|
-
render_form(
|
11
|
+
note = problem.notes.new
|
12
|
+
authorize(note)
|
13
|
+
render_form(
|
14
|
+
note,
|
15
|
+
url: patient_problem_notes_path(patient, problem)
|
16
|
+
)
|
17
17
|
end
|
18
18
|
|
19
19
|
def create
|
20
|
-
|
21
|
-
note
|
22
|
-
|
20
|
+
note = problem.notes.create(notes_params)
|
21
|
+
authorize(note)
|
23
22
|
if note.save
|
24
23
|
render_index
|
25
24
|
else
|
26
|
-
render_form(
|
25
|
+
render_form(
|
26
|
+
note,
|
27
|
+
url: patient_problem_notes_path(patient, problem)
|
28
|
+
)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def edit
|
33
|
+
authorize note
|
34
|
+
render_form(
|
35
|
+
note,
|
36
|
+
url: patient_problem_note_path(patient, problem, note)
|
37
|
+
)
|
38
|
+
end
|
39
|
+
|
40
|
+
def update
|
41
|
+
authorize note
|
42
|
+
if note.update_by(current_user, notes_params)
|
43
|
+
render_index
|
44
|
+
else
|
45
|
+
render_form(
|
46
|
+
note,
|
47
|
+
url: patient_problem_notes_path(patient, problem)
|
48
|
+
)
|
27
49
|
end
|
28
50
|
end
|
29
51
|
|
30
52
|
private
|
31
53
|
|
32
|
-
def
|
33
|
-
@problem
|
54
|
+
def problem
|
55
|
+
@problem ||= patient.problems.find(params[:problem_id])
|
56
|
+
end
|
57
|
+
|
58
|
+
def notes
|
59
|
+
@notes ||= problem.notes.includes(:updated_by).ordered
|
60
|
+
end
|
61
|
+
|
62
|
+
def note
|
63
|
+
notes.find(params[:id])
|
34
64
|
end
|
35
65
|
|
36
66
|
def render_index
|
37
|
-
|
67
|
+
authorize(notes)
|
68
|
+
render "index", locals: { problem: problem, notes: notes }
|
38
69
|
end
|
39
70
|
|
40
71
|
def render_form(note, url:)
|
41
|
-
render "form", locals: { problem:
|
72
|
+
render "form", locals: { problem: problem, note: note, url: url }
|
42
73
|
end
|
43
74
|
|
44
75
|
def notes_params
|
45
76
|
params.require(:problems_note).permit(:description).merge(by: current_user)
|
46
77
|
end
|
47
|
-
|
48
|
-
def notes
|
49
|
-
@notes ||= @problem.notes.ordered
|
50
|
-
end
|
51
78
|
end
|
52
79
|
end
|
53
80
|
end
|
data/app/jobs/feed_job.rb
CHANGED
@@ -17,7 +17,7 @@ FeedJob = Struct.new(:raw_message) do
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def max_attempts
|
20
|
-
|
20
|
+
2
|
21
21
|
end
|
22
22
|
|
23
23
|
def destroy_failed_jobs?
|
@@ -25,13 +25,12 @@ FeedJob = Struct.new(:raw_message) do
|
|
25
25
|
end
|
26
26
|
|
27
27
|
# Reschedule after an error. No point trying straight away, so try at these intervals:
|
28
|
-
# After attempt no.
|
28
|
+
# After attempt no. Wait for hours
|
29
29
|
# ---------------------------
|
30
30
|
# 1 2
|
31
31
|
# 2 17
|
32
|
-
# 3 82
|
33
32
|
# Then give up.
|
34
|
-
# Note e.g. attempts**4 == attempts to the power of 4
|
33
|
+
# Note e.g. attempts**4 == attempts to the power of 4
|
35
34
|
def reschedule_at(current_time, attempts)
|
36
35
|
current_time + ((attempts**4) + 1).hours
|
37
36
|
end
|
@@ -31,9 +31,9 @@ module Renalware
|
|
31
31
|
end
|
32
32
|
|
33
33
|
allow_listeners_to_post_process_the_message
|
34
|
-
rescue StandardError =>
|
35
|
-
notify_exception(
|
36
|
-
raise
|
34
|
+
rescue StandardError => e
|
35
|
+
notify_exception(e)
|
36
|
+
raise e
|
37
37
|
end
|
38
38
|
|
39
39
|
private
|
@@ -64,7 +64,7 @@ module Renalware
|
|
64
64
|
# current job to retry.
|
65
65
|
message_to_broadcast = "#{hl7_message.message_type.downcase}_message_processed"
|
66
66
|
broadcast(message_to_broadcast.to_sym, feed_message: feed_message)
|
67
|
-
rescue Feeds::
|
67
|
+
rescue Feeds::DuplicateMessageError => e
|
68
68
|
Rails.logger.warn("Rejected duplicate HL7 message: #{e.message}")
|
69
69
|
rescue StandardError => e
|
70
70
|
notify_exception(e)
|
@@ -2,7 +2,7 @@
|
|
2
2
|
= simple_form_for note, url: url,
|
3
3
|
wrapper: :horizontal_form, remote: true do |f|
|
4
4
|
|
5
|
-
= f.input :description, as: :text, input_html: { cols: 50, rows:
|
5
|
+
= f.input :description, as: :text, input_html: { cols: 50, rows: 2 }, autofocus: true
|
6
6
|
|
7
7
|
.row
|
8
8
|
.large-offset-3.large-7.columns
|
@@ -1,10 +1,12 @@
|
|
1
|
-
- if notes.
|
1
|
+
- if notes.blank?
|
2
2
|
#new-note-area
|
3
3
|
spam No notes
|
4
4
|
|
5
5
|
- else
|
6
6
|
table.auto-layout
|
7
7
|
thead
|
8
|
+
- unless problem.archived?
|
9
|
+
th.col-width-tiny
|
8
10
|
th Description
|
9
11
|
th.col-width-medium Recorded By
|
10
12
|
th.col-width-date-time Recorded On
|
@@ -12,8 +14,12 @@
|
|
12
14
|
tbody
|
13
15
|
- notes.each do |note|
|
14
16
|
tr
|
15
|
-
|
17
|
+
- unless problem.archived?
|
18
|
+
td= link_to "Edit",
|
19
|
+
edit_patient_problem_note_path(problem.patient, problem, note),
|
20
|
+
remote: true
|
21
|
+
td(class="problem-note-#{note.id}")= note.description
|
16
22
|
td= note.updated_by
|
17
|
-
td= l
|
23
|
+
td= l(note.updated_at)
|
18
24
|
|
19
25
|
#new-note-area
|
data/config/routes/patients.rb
CHANGED
@@ -36,7 +36,7 @@ resources :patients, except: [:destroy], controller: "patients/patients" do
|
|
36
36
|
# Problems
|
37
37
|
resources :problems, controller: "problems/problems" do
|
38
38
|
post :sort, on: :collection
|
39
|
-
resources :notes, only: [:index, :new, :create], controller: "problems/notes"
|
39
|
+
resources :notes, only: [:index, :new, :create, :edit, :update], controller: "problems/notes"
|
40
40
|
end
|
41
41
|
|
42
42
|
namespace :surveys do
|
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.117
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Airslie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview-component
|