renalware-core 2.0.112 → 2.0.113

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: d5ca791105ad77524bc53a491d593ca9871363fdd5b3c3b874755f1a3898ca8c
4
- data.tar.gz: 770c7beab9d9369f637cf067ff7fe9a068a579805690aeb76ef77a080be3bf6d
3
+ metadata.gz: 687a7e98c92f0c23e54e6f9bc7ea2022f2684a0ab834120b229ded600238c379
4
+ data.tar.gz: ec3be7afa54d14dce47cc4adf4b90fe6abc0fb2e672fbaf84b1612affc505749
5
5
  SHA512:
6
- metadata.gz: a10238b66a41f3a73e924acf31ac1691194fefd2738764a52bc3bcef8a75872288f0dbb55835ceed2579a50f2357b214641c55cc5d37a89ffab289af065a8514
7
- data.tar.gz: 1f17f033bd3a78c003e385500b4505bb3eb1ec452adcc6c8850a210f79d0a2a5616065581a5eb2f891553dcbc9cbc409abfcf2f2f95be707ce59ff8843ac1fb0
6
+ metadata.gz: ae657bd523863a435852cb121d625f5880d34187a655dc3b6d3a7e277a72cd09a118413256ea9347dcdb5b56c1064d012e7e826fda467e2fac9002a499dcefc5
7
+ data.tar.gz: 04e868337e7b680ee1306e322e48405f44db5defba53fd92ebbaf215c5436f889d6941b9a1eafe8f447ab6ab2f8d1e8354824213f9869022dcbe41996417d7e8
@@ -28,6 +28,7 @@ module Renalware
28
28
 
29
29
  private
30
30
 
31
+ # Will return false if request_description.required_observation_description_id is nil
31
32
  def last_observation_too_recent?
32
33
  return false if last_observation.nil?
33
34
 
@@ -41,6 +42,8 @@ module Renalware
41
42
  expiration_days = @rule_set.request_description.expiration_days
42
43
  return false if expiration_days == 0
43
44
 
45
+ # This subtraction works because ActiveSupport::TimeWithZone works in days
46
+ # e.g. TimeWithZone1 - TimeWithZone2 = 3 days
44
47
  requested_days_ago = @date - last_request.requested_on
45
48
  requested_days_ago < expiration_days
46
49
  end
@@ -52,6 +55,7 @@ module Renalware
52
55
  .all?
53
56
  end
54
57
 
58
+ # NB request.requested_on == request.created_at
55
59
  def last_request_has_an_observation_result?
56
60
  last_observation.present? &&
57
61
  last_observation.observed_on > last_request.requested_on
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Renalware
4
- VERSION = "2.0.112"
4
+ VERSION = "2.0.113"
5
5
  end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ namespace :renalware do
4
+ desc "Install package.json dependencies with yarn for the renalware-core engine - "\
5
+ "without this <path to installed gem>/renalware-core/node_modules is not populated "\
6
+ "and assets:precompile in the host app will not work."
7
+ task :yarn_install do
8
+ puts "Installing renalware-core/package.json dependencies with yarn"
9
+ Dir.chdir(File.join(__dir__, "../..")) do
10
+ system "yarn install --no-progress --production"
11
+ end
12
+ end
13
+ end
14
+
15
+ def enhance_assets_precompile_with_engine_yarn_install
16
+ Rake::Task["assets:precompile"].enhance(["renalware:yarn_install"])
17
+ end
18
+
19
+ # When a host app runs rake assets:precompile, hook into this and enhance the
20
+ # task so it runs yarn install for (and relative to) the engine, wherever it is installed.
21
+ # Without that, assets:precompile will fail because the engine references various js and css files
22
+ # in ./node_modules, and these are not included in the source, but need to be installed with yarn
23
+ # at deploy time.
24
+ if Rake::Task.task_defined?("assets:precompile")
25
+ enhance_assets_precompile_with_engine_yarn_install
26
+ 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.112
4
+ version: 2.0.113
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-09 00:00:00.000000000 Z
11
+ date: 2019-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_type
@@ -3814,6 +3814,7 @@ files:
3814
3814
  - lib/tasks/ods.rake
3815
3815
  - lib/tasks/pathology.rake
3816
3816
  - lib/tasks/pd.rake
3817
+ - lib/tasks/renalware.rake
3817
3818
  - lib/tasks/reporting.rake
3818
3819
  - lib/tasks/ukrdc.rake
3819
3820
  - lib/templates/slim/scaffold/_form.html.slim