roqua-healthy 1.5.12 → 1.5.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e402c30237a4c3eeeb578cb4c2a594eba83b6374ce8634259b5bac1c9cf1270b
4
- data.tar.gz: 344a609880ddf08da1cf0d60dc9e70a1ef2d312a3de887aa11bd71680b5a49bb
3
+ metadata.gz: 2b61faf958cac88da6cfa1aeb5e5399b304035cdf8b10504032db95a94d69bf3
4
+ data.tar.gz: 6ff72116dcf9d778ec6ca08c26f5b14c71efdb000d86813027c39d8f70d531dc
5
5
  SHA512:
6
- metadata.gz: 67ad548fab99cf59055a425891d0645afbd22598e4a6ce490f6adc26324289ec3c3c038f777b106c02e3746cdc26dcc8f92547c4661f2da71f7d3ac94932b41c
7
- data.tar.gz: 42c200b696af931d3666a9aa9e0bddfe0983a3f6180c771dae7cbc4f5983fbd3133bf1dc7dc0539e53b4be2bc58bd70fc2afb76dfc1e4ca594d0e4c03ee9ee44
6
+ metadata.gz: 980c9941379027fd03236735a1ec93ee41e3143e022ed54f76271f71658a69128f1389060ee90ed32286e4396c45d76971d6f3b3560cc096ca18c6eb7c175699
7
+ data.tar.gz: 22349d8f91cd0dd30d99aa36c28d6c4280ee61326f168bbc8dd659ea60f6f014a26eaccf0c5b057d1380d07083a2c6082cb2734010dd6578cb75c80bbf020263
@@ -1,4 +1,4 @@
1
- image: "registry.roqua.nl/roqua/docker-base-images:ruby-2.5"
1
+ image: "registry.roqua.nl/roqua/docker-base-images:ruby-2.6-builder"
2
2
 
3
3
  cache:
4
4
  paths:
@@ -4,7 +4,7 @@ AllCops:
4
4
  Exclude:
5
5
  - vendor/**/*
6
6
  - gemfiles/*
7
- TargetRubyVersion: 2.3
7
+ TargetRubyVersion: 2.6
8
8
 
9
9
  Documentation:
10
10
  Enabled: false
@@ -11,26 +11,33 @@ module Roqua
11
11
 
12
12
  # this is a heuristic to pick likely dutch cell phone numbers from hl7 messages
13
13
  def to_s
14
- pid13 = message.dig('PID', 'PID.13') || []
15
-
16
14
  # prefer PRN (Primary Residence Number) that contains a cell phone number
17
- phone_cell_record = pid13.find do |record|
18
- phone_cell_number?(record.fetch('PID.13.1', '') || '') &&
19
- record.fetch('PID.13.2', :unknown_type_of_phone_record) == 'PRN'
20
- end
21
-
22
15
  # otherwise choose the first occuring cell phone number
23
- phone_cell_record ||= pid13.find do |record|
24
- phone_cell_number?(record.fetch('PID.13.1', '') || '')
25
- end
26
-
27
16
  # any number for which phone_cell_number? returns false is ignored
17
+ phone_cell_record = first_matching_prn_record || first_matching_record
28
18
 
29
19
  strip_non_phone_number_characters(phone_cell_record.fetch('PID.13.1')) if phone_cell_record.present?
30
20
  end
31
21
 
32
22
  private
33
23
 
24
+ def pid13
25
+ @pid13 ||= message.dig('PID', 'PID.13') || []
26
+ end
27
+
28
+ def first_matching_prn_record
29
+ pid13.find do |record|
30
+ phone_cell_number?(record.fetch('PID.13.1', '') || '') &&
31
+ record.fetch('PID.13.2', :unknown_type_of_phone_record) == 'PRN'
32
+ end
33
+ end
34
+
35
+ def first_matching_record
36
+ pid13.find do |record|
37
+ phone_cell_number?(record.fetch('PID.13.1', '') || '')
38
+ end
39
+ end
40
+
34
41
  def strip_non_phone_number_characters(number)
35
42
  Roqua::Healthy::A19::PhoneValidator.strip_non_phone_number_characters number
36
43
  end
@@ -2,6 +2,6 @@
2
2
  module Roqua
3
3
  module Healthy
4
4
  # healthy version
5
- VERSION = "1.5.12"
5
+ VERSION = "1.5.13"
6
6
  end
7
7
  end
@@ -13,7 +13,7 @@ Gem::Specification.new do |gem|
13
13
  gem.email = "support@roqua.nl"
14
14
  gem.homepage = "https://github.com/roqua/healthy"
15
15
 
16
- gem.required_ruby_version = '~> 2.3'
16
+ gem.required_ruby_version = '>= 2.6'
17
17
 
18
18
  gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
19
19
  gem.executables = [] # executables in bin/ are helpers for use during development
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roqua-healthy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.12
4
+ version: 1.5.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marten Veldthuis
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2020-07-10 00:00:00.000000000 Z
14
+ date: 2021-01-27 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport
@@ -389,17 +389,16 @@ require_paths:
389
389
  - lib
390
390
  required_ruby_version: !ruby/object:Gem::Requirement
391
391
  requirements:
392
- - - "~>"
392
+ - - ">="
393
393
  - !ruby/object:Gem::Version
394
- version: '2.3'
394
+ version: '2.6'
395
395
  required_rubygems_version: !ruby/object:Gem::Requirement
396
396
  requirements:
397
397
  - - ">="
398
398
  - !ruby/object:Gem::Version
399
399
  version: '0'
400
400
  requirements: []
401
- rubyforge_project:
402
- rubygems_version: 2.7.6.2
401
+ rubygems_version: 3.0.3
403
402
  signing_key:
404
403
  specification_version: 4
405
404
  summary: Arranges communication between Mirth and RoQua