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 +4 -4
- data/.gitlab-ci.yml +1 -1
- data/.rubocop.yml +1 -1
- data/lib/roqua/healthy/a19/phone_parser.rb +18 -11
- data/lib/roqua/healthy/version.rb +1 -1
- data/roqua-healthy.gemspec +1 -1
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b61faf958cac88da6cfa1aeb5e5399b304035cdf8b10504032db95a94d69bf3
|
4
|
+
data.tar.gz: 6ff72116dcf9d778ec6ca08c26f5b14c71efdb000d86813027c39d8f70d531dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 980c9941379027fd03236735a1ec93ee41e3143e022ed54f76271f71658a69128f1389060ee90ed32286e4396c45d76971d6f3b3560cc096ca18c6eb7c175699
|
7
|
+
data.tar.gz: 22349d8f91cd0dd30d99aa36c28d6c4280ee61326f168bbc8dd659ea60f6f014a26eaccf0c5b057d1380d07083a2c6082cb2734010dd6578cb75c80bbf020263
|
data/.gitlab-ci.yml
CHANGED
data/.rubocop.yml
CHANGED
@@ -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
|
data/roqua-healthy.gemspec
CHANGED
@@ -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 = '
|
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.
|
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:
|
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.
|
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
|
-
|
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
|