renalware-core 2.0.23 → 2.0.24
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 +3 -3
- data/app/controllers/renalware/api/token_authenticated_api_controller.rb +3 -1
- data/app/controllers/renalware/patients/primary_care_physician_controller.rb +15 -3
- data/app/views/renalware/patients/primary_care_physician/_form.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: 144398e98d896ad11911bf67c7d3c41532a7e7d599d8e753f3ea07fa5cdd1335
|
4
|
+
data.tar.gz: 36f8a5016b94cfa5c67c2b79e3043e97515fb996bfb1ddacb6d960b0aac35bc5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29eb437d433f724352b58695f23453d273270c5aa4e0a3309f6509e39c76ca0589d52000fff1d417787375f353798e658c37f6fb61deb4399b995034389e948b
|
7
|
+
data.tar.gz: 7efd9963d89407778f3ce6d20541824a45845aaf494a3e8c43f0d89392429cb4cb42212599dc12e5acb33e46db9008e8815cf7b8a191022643042bfa04ed8c37
|
@@ -46,9 +46,9 @@ Renalware.PrimaryCarePhysicianSearch = (function() {
|
|
46
46
|
|
47
47
|
// When a Practice is selected from the autocomplete list,
|
48
48
|
// Do an ajax replace on the <form> in this modal by sending a .js request
|
49
|
-
// to the url the modal was loaded from (this is in a data attribute on the
|
49
|
+
// to the url the modal was loaded from (this is in a data attribute on the practice-search
|
50
50
|
// select). This will load in just the form under the practice-search select, bringing
|
51
|
-
// with it a list of
|
51
|
+
// with it a list of PCPs associated with this practice.
|
52
52
|
$(practiceDropDown).on("select2:select", function(e) {
|
53
53
|
var selectedPracticeOption = $("option:selected", this);
|
54
54
|
var praticeId = $(selectedPracticeOption).val();
|
@@ -61,7 +61,7 @@ Renalware.PrimaryCarePhysicianSearch = (function() {
|
|
61
61
|
practice_id: praticeId
|
62
62
|
},
|
63
63
|
error: function(jqXHR, textStatus, errorThrown) {
|
64
|
-
console.log(errorThrown, textStatus ,jqXHR)
|
64
|
+
// console.log(errorThrown, textStatus ,jqXHR)
|
65
65
|
},
|
66
66
|
success: function(data, textStatus, jqXHR) {
|
67
67
|
// console.log("OK!")
|
@@ -3,6 +3,8 @@
|
|
3
3
|
#
|
4
4
|
# From https://gist.github.com/josevalim/fb706b1e933ef01e4fb6
|
5
5
|
#
|
6
|
+
require "devise"
|
7
|
+
|
6
8
|
module Renalware
|
7
9
|
module API
|
8
10
|
class TokenAuthenticatedApiController < ApplicationController
|
@@ -18,7 +20,7 @@ module Renalware
|
|
18
20
|
# Notice how we use Devise.secure_compare to compare the token
|
19
21
|
# in the database with the token given in the params, mitigating
|
20
22
|
# timing attacks.
|
21
|
-
if user && Devise.secure_compare(user.authentication_token, params[:token])
|
23
|
+
if user && ::Devise.secure_compare(user.authentication_token, params[:token])
|
22
24
|
sign_in user, store: false
|
23
25
|
end
|
24
26
|
end
|
@@ -7,6 +7,10 @@ require_dependency "renalware/patients"
|
|
7
7
|
module Renalware
|
8
8
|
module Patients
|
9
9
|
class PrimaryCarePhysicianController < BaseController
|
10
|
+
# We come in here when
|
11
|
+
# 1. We render the Add GP modal form the first time (html)
|
12
|
+
# 2. After a practice has been selected and we refresh the modal form so it has
|
13
|
+
# the correct list of GPs in it (js)
|
10
14
|
def edit
|
11
15
|
authorize patient
|
12
16
|
render_form
|
@@ -24,11 +28,19 @@ module Renalware
|
|
24
28
|
|
25
29
|
private
|
26
30
|
|
31
|
+
# There maybe times (for instance after migration from a previous system) where the
|
32
|
+
# patient is not `valid` (going into Demographics and just saving them would produce a
|
33
|
+
# validation error) because for instance they have no Sex option selected. In these instances
|
34
|
+
# if we tried to update the Practice and GP here using an `update` call, it would fail.
|
35
|
+
# So to allow the Practice and GP to be assigned to such a patient we have to skip validation
|
36
|
+
# callbacks by using update_columns.
|
27
37
|
def update_patient
|
28
38
|
return false unless selected_pyhsician
|
29
|
-
patient.
|
30
|
-
|
31
|
-
|
39
|
+
patient.update_columns(
|
40
|
+
primary_care_physician_id: selected_pyhsician.id,
|
41
|
+
practice_id: patient_params[:practice_id],
|
42
|
+
updated_by_id: current_user.id
|
43
|
+
)
|
32
44
|
end
|
33
45
|
|
34
46
|
def render_form
|
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.24
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Airslie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_type
|