renalware-core 2.0.23 → 2.0.24

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3ac09f0c3708048edefc8c1040650e7efee4de9209837d547e97bdf06e30ae38
4
- data.tar.gz: 1029728c82c3f5cfe5c782fcebae7247fb5401815c2e2afbe8fb9ab35c230b15
3
+ metadata.gz: 144398e98d896ad11911bf67c7d3c41532a7e7d599d8e753f3ea07fa5cdd1335
4
+ data.tar.gz: 36f8a5016b94cfa5c67c2b79e3043e97515fb996bfb1ddacb6d960b0aac35bc5
5
5
  SHA512:
6
- metadata.gz: 48522cd5f0e8569574ea14b1933169821b1768c548b139cf14935a8c26839dd476a397cc2ba397291ba049091f9118e12f4ad32310741089da6a4a942eed8de7
7
- data.tar.gz: fdff52784eba369df4e5dc806e9c083302372bdb327ba4c9df3adf057cee64396421e962d217a7b9593947a56f80ac8c1f3148c6de4cec2d46017a24f42ba0bc
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 pratice-search
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 pcps associated with this practice.
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.update(primary_care_physician: selected_pyhsician,
30
- practice_id: patient_params[:practice_id],
31
- by: current_user)
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
@@ -7,7 +7,7 @@
7
7
 
8
8
  = f.input :primary_care_physician_id,
9
9
  collection: available_primary_care_physicians,
10
- prompt: "Select a GP",
10
+ include_blank: false,
11
11
  label: "Now choose a GP",
12
12
  input_html: { class: "searchable_select", required: :required, tabindex: 2001 }
13
13
  br
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Renalware
4
- VERSION = "2.0.23"
4
+ VERSION = "2.0.24"
5
5
  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.23
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-03 00:00:00.000000000 Z
11
+ date: 2018-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_type