roqua-healthy 1.5.4 → 1.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.document +0 -0
- data/.gitlab-ci.yml +7 -3
- data/.rspec +0 -0
- data/.rubocop_todo.yml +0 -0
- data/.yardopts +0 -0
- data/Gemfile +1 -0
- data/Guardfile +0 -0
- data/LICENSE.txt +0 -0
- data/Rakefile +0 -0
- data/circle.yml +0 -0
- data/gemfiles/rails41.gemfile +0 -0
- data/gemfiles/rails42.gemfile +0 -0
- data/gemfiles/rails50.gemfile +0 -0
- data/lib/roqua/healthy/a19.rb +0 -0
- data/lib/roqua/healthy/a19/cdis_name_parser.rb +0 -0
- data/lib/roqua/healthy/a19/correct_patient_check.rb +0 -0
- data/lib/roqua/healthy/a19/impulse_name_parser.rb +0 -0
- data/lib/roqua/healthy/a19/name_parser.rb +0 -0
- data/lib/roqua/healthy/a19/phone_validator.rb +36 -0
- data/lib/roqua/healthy/a19/response_parser.rb +0 -0
- data/lib/roqua/healthy/a19/transformer.rb +4 -2
- data/lib/roqua/healthy/message_cleaner.rb +0 -0
- data/lib/roqua/healthy/version.rb +1 -1
- data/lib/roqua_healthy.rb +0 -0
- data/roqua-healthy.gemspec +1 -1
- data/spec/fixtures/cdis_gerda_geit.xml +0 -0
- data/spec/fixtures/cdis_jan_fictief.xml +0 -0
- data/spec/fixtures/cdis_missing_address.xml +0 -0
- data/spec/fixtures/cdis_piet_fictief.xml +0 -0
- data/spec/fixtures/comez_patient.xml +0 -0
- data/spec/fixtures/epic_no_gender.xml +0 -0
- data/spec/fixtures/epic_test_client.xml +4 -4
- data/spec/fixtures/ggzwnb_patient.xml +0 -0
- data/spec/fixtures/medoq_patient.xml +1 -1
- data/spec/fixtures/oru-requests/spsy1218j.hl7 +0 -0
- data/spec/fixtures/oru-requests/spsy1218o.hl7 +0 -0
- data/spec/fixtures/oru-requests/spsy1218o2.hl7 +0 -0
- data/spec/fixtures/oru-requests/spsy411o.hl7 +0 -0
- data/spec/fixtures/oru-requests/spsy411o2.hl7 +0 -0
- data/spec/fixtures/oru-requests/spsyl.hl7 +0 -0
- data/spec/fixtures/oru-responses/xmcare_nack.hl7 +0 -0
- data/spec/fixtures/user_patient.xml +0 -0
- data/spec/fixtures/user_patient_not_found.xml +0 -0
- data/spec/fixtures/user_patient_with_gsm_and_email.xml +0 -0
- data/spec/fixtures/user_patient_with_maiden_name.xml +0 -0
- data/spec/fixtures/xmcare_impersonating_cdis.xml +0 -0
- data/spec/fixtures/xmcare_patient.xml +0 -0
- data/spec/fixtures/xmcare_patient_email_in_field_number_four.xml +0 -0
- data/spec/fixtures/xmcare_patient_not_found.xml +0 -0
- data/spec/fixtures/xmcare_patient_with_maiden_name.xml +0 -0
- data/spec/fixtures/xmcare_patient_without_birthdate.xml +0 -0
- data/spec/fixtures/xmcare_phone_cell_in_prn.xml +0 -0
- data/spec/fixtures/xmcare_phone_cell_in_prn_orn.xml +0 -0
- data/spec/fixtures/xmcare_phone_home_in_prn.xml +0 -0
- data/spec/fixtures/xmcare_timeout_waiting_for_ack.xml +0 -0
- data/spec/fixtures/xmcare_unconventional_phone_cell_in_orn.xml +0 -0
- data/spec/fixtures/xmcare_unconventional_phone_cell_in_orn2.xml +0 -0
- data/spec/healthy_spec.rb +0 -0
- data/spec/integration/cdis_spec.rb +0 -0
- data/spec/integration/comez_spec.rb +0 -0
- data/spec/integration/epic_spec.rb +1 -1
- data/spec/integration/ggzwnb_spec.rb +0 -0
- data/spec/integration/medo_spec.rb +1 -1
- data/spec/integration/mirth_spec.rb +0 -0
- data/spec/integration/user_spec.rb +0 -0
- data/spec/integration/xmcare_spec.rb +0 -0
- data/spec/spec_helper.rb +0 -0
- data/spec/support/fixtures.rb +0 -0
- data/spec/unit/a19/address_parser_spec.rb +1 -0
- data/spec/unit/a19/correct_patient_check_spec.rb +0 -0
- data/spec/unit/a19/phone_validator_spec.rb +41 -0
- data/spec/unit/a19_spec.rb +0 -0
- data/spec/unit/message_cleaner_spec.rb +0 -0
- metadata +20 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e5499960a9c38757e49f6f943eba03deae4db03
|
4
|
+
data.tar.gz: 67d16e02512c7e3671d4c6e7cecf540b571b11b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b5b506f6cb23b787eefd0bd517dd9c4ed856ed83ec4078d0b44681d565d7a845b23a794bd0c3c54713ceb2f77ae8ef94db919bcba777478c7e9d67354fb32b9
|
7
|
+
data.tar.gz: 1fd29af6071da287741fe6977e22069edad113f50d146afd786b35f8b7b19dae961f72586de10b3f68f041a1da6ffbb8f48f5df2086e390173f0d553ad74388c
|
data/.document
CHANGED
File without changes
|
data/.gitlab-ci.yml
CHANGED
@@ -1,8 +1,12 @@
|
|
1
|
-
image: "roqua/roqua-build-images:ruby-2.3
|
1
|
+
image: "registry.roqua.nl/roqua/roqua-build-images:ruby-2.3-rails-base-test"
|
2
|
+
|
3
|
+
cache:
|
4
|
+
paths:
|
5
|
+
- .gems
|
2
6
|
|
3
7
|
before_script:
|
4
|
-
-
|
5
|
-
- bundle
|
8
|
+
- export BUNDLE_PATH=$CI_PROJECT_DIR/.gems
|
9
|
+
- bundle --jobs 2 --retry 3
|
6
10
|
- gem install appraisal
|
7
11
|
- bundle exec appraisal
|
8
12
|
|
data/.rspec
CHANGED
File without changes
|
data/.rubocop_todo.yml
CHANGED
File without changes
|
data/.yardopts
CHANGED
File without changes
|
data/Gemfile
CHANGED
@@ -7,3 +7,4 @@ gemspec
|
|
7
7
|
# Normal development dependencies should go in the gemspec. People shouldn't
|
8
8
|
# need to use bundler to develop on our gem.
|
9
9
|
gem "codeclimate-test-reporter", "~> 1.0.0", group: :test, require: nil
|
10
|
+
gem 'roqua_styleguide', git: 'https://gitlab.roqua.nl/roqua/styleguide.git'
|
data/Guardfile
CHANGED
File without changes
|
data/LICENSE.txt
CHANGED
File without changes
|
data/Rakefile
CHANGED
File without changes
|
data/circle.yml
CHANGED
File without changes
|
data/gemfiles/rails41.gemfile
CHANGED
File without changes
|
data/gemfiles/rails42.gemfile
CHANGED
File without changes
|
data/gemfiles/rails50.gemfile
CHANGED
File without changes
|
data/lib/roqua/healthy/a19.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'phonelib'
|
4
|
+
|
5
|
+
module Roqua
|
6
|
+
module Healthy
|
7
|
+
module A19
|
8
|
+
module PhoneValidator
|
9
|
+
EU_COUNTRY_CODES = Set.new(
|
10
|
+
%w[AT BE BG CY CZ DE DK EE EL ES FI FR HR HU IE IT LT LU LV MT NL PL PT RO SE SI SK UK]
|
11
|
+
)
|
12
|
+
|
13
|
+
def self.phone_cell_number?(number)
|
14
|
+
stripped_number = strip_non_phone_number_characters(number)
|
15
|
+
|
16
|
+
phone_cell_number_in_european_country?(stripped_number) &&
|
17
|
+
contains_only_phone_number_characters?(stripped_number)
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.phone_cell_number_in_european_country?(number)
|
21
|
+
phone = Phonelib.parse(number, 'NL')
|
22
|
+
|
23
|
+
phone.type == :mobile && EU_COUNTRY_CODES.include?(phone.country)
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.contains_only_phone_number_characters?(number)
|
27
|
+
/^\+?\d+$/.match(number).present?
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.strip_non_phone_number_characters(number)
|
31
|
+
number.gsub(/[-\s\.]/, '')
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
File without changes
|
@@ -1,8 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require 'roqua/healthy/a19/name_parser'
|
3
4
|
require 'roqua/healthy/a19/cdis_name_parser'
|
4
5
|
require 'roqua/healthy/a19/impulse_name_parser'
|
5
6
|
require 'roqua/healthy/a19/address_parser'
|
7
|
+
require 'roqua/healthy/a19/phone_validator'
|
6
8
|
require 'active_support/core_ext/hash'
|
7
9
|
|
8
10
|
module Roqua
|
@@ -123,11 +125,11 @@ module Roqua
|
|
123
125
|
# letters are not stripped since they may be part of a comment, which usually means the
|
124
126
|
# phone number is not useable for the purpose of a client's cell phone number
|
125
127
|
def strip_non_phone_number_characters(number)
|
126
|
-
|
128
|
+
Roqua::Healthy::A19::PhoneValidator.strip_non_phone_number_characters number
|
127
129
|
end
|
128
130
|
|
129
131
|
def phone_cell_number?(number)
|
130
|
-
|
132
|
+
Roqua::Healthy::A19::PhoneValidator.phone_cell_number? number
|
131
133
|
end
|
132
134
|
|
133
135
|
def name
|
File without changes
|
data/lib/roqua_healthy.rb
CHANGED
File without changes
|
data/roqua-healthy.gemspec
CHANGED
@@ -23,6 +23,7 @@ Gem::Specification.new do |gem|
|
|
23
23
|
gem.add_dependency 'activesupport', '>= 3.2', '< 6'
|
24
24
|
gem.add_dependency 'addressable', '~> 2.3'
|
25
25
|
gem.add_dependency 'builder'
|
26
|
+
gem.add_dependency 'phonelib', '~> 0.6'
|
26
27
|
gem.add_dependency 'rest-client', '>= 2.0.2'
|
27
28
|
gem.add_dependency 'roqua-support', '~> 0.1.22'
|
28
29
|
|
@@ -41,7 +42,6 @@ Gem::Specification.new do |gem|
|
|
41
42
|
gem.add_development_dependency 'guard-rspec', '~> 4.2.4'
|
42
43
|
gem.add_development_dependency 'guard-rubocop', '~> 1.2.0'
|
43
44
|
gem.add_development_dependency 'listen', '~> 2.1'
|
44
|
-
gem.add_development_dependency 'rubocop', '~> 0.40'
|
45
45
|
gem.add_development_dependency 'simplecov'
|
46
46
|
|
47
47
|
# Documentation generation
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -164,20 +164,20 @@
|
|
164
164
|
</PID.11>
|
165
165
|
<PID.12/>
|
166
166
|
<PID.13>
|
167
|
-
<PID.13.1>06
|
167
|
+
<PID.13.1>06 12 34 56 78</PID.13.1>
|
168
168
|
<PID.13.2>ORN</PID.13.2>
|
169
169
|
<PID.13.3>PH</PID.13.3>
|
170
170
|
<PID.13.4/>
|
171
171
|
<PID.13.5>31</PID.13.5>
|
172
|
-
<PID.13.6>
|
172
|
+
<PID.13.6>0612345678</PID.13.6>
|
173
173
|
</PID.13>
|
174
174
|
<PID.13>
|
175
|
-
<PID.13.1>06
|
175
|
+
<PID.13.1>06 12 34 56 79</PID.13.1>
|
176
176
|
<PID.13.2>PRN</PID.13.2>
|
177
177
|
<PID.13.3>CP</PID.13.3>
|
178
178
|
<PID.13.4/>
|
179
179
|
<PID.13.5>31</PID.13.5>
|
180
|
-
<PID.13.6>
|
180
|
+
<PID.13.6>0612345679</PID.13.6>
|
181
181
|
</PID.13>
|
182
182
|
<PID.14/>
|
183
183
|
<PID.15/>
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/spec/healthy_spec.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
@@ -23,7 +23,7 @@ describe 'Fetching A19 from EPIC' do
|
|
23
23
|
it { expect(subject[:country]).to eq('NLD') }
|
24
24
|
it { expect(subject[:birthdate]).to eq('19800101') }
|
25
25
|
it { expect(subject[:gender]).to eq('M') }
|
26
|
-
it { expect(subject[:phone_cell]).to eq('
|
26
|
+
it { expect(subject[:phone_cell]).to eq('0612345679') }
|
27
27
|
end
|
28
28
|
|
29
29
|
describe 'patient not found' do
|
File without changes
|
@@ -28,7 +28,7 @@ describe 'Fetching A19 from Medoq' do
|
|
28
28
|
it { expect(subject[:country]).to eq('Nederland') }
|
29
29
|
it { expect(subject[:birthdate]).to eq('19800525') }
|
30
30
|
it { expect(subject[:gender]).to eq('M') }
|
31
|
-
it { expect(subject[:phone_cell]).to eq('
|
31
|
+
it { expect(subject[:phone_cell]).to eq('0612345678') }
|
32
32
|
end
|
33
33
|
|
34
34
|
describe 'authentication failure' do
|
File without changes
|
File without changes
|
File without changes
|
data/spec/spec_helper.rb
CHANGED
File without changes
|
data/spec/support/fixtures.rb
CHANGED
File without changes
|
File without changes
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe Roqua::Healthy::A19::PhoneValidator do
|
6
|
+
subject { described_class }
|
7
|
+
|
8
|
+
describe '#phone_cell_number?' do
|
9
|
+
it 'detects a Dutch mobile number' do
|
10
|
+
expect(subject.phone_cell_number?('+31612345678')).to be_truthy
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'rejects a phone number that consists of something other than numbers' do
|
14
|
+
expect(subject.phone_cell_number?('0612345678mdr')).to be_falsey
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'detects a Dutch mobile number without a country code' do
|
18
|
+
expect(subject.phone_cell_number?('0612345678')).to be_truthy
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'rejects a normal Dutch phone number' do
|
22
|
+
expect(subject.phone_cell_number?('+31592123456')).to be_falsey
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'detects a mobile number from Austria' do
|
26
|
+
expect(subject.phone_cell_number?('+4365012345678')).to be_truthy
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'rejects a normal phone number from Austria' do
|
30
|
+
expect(subject.phone_cell_number?('+431123456')).to be_falsey
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'rejects a mobile number from China' do
|
34
|
+
expect(subject.phone_cell_number?('+8613312345678')).to be_falsey
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'rejects a normal phone number from China' do
|
38
|
+
expect(subject.phone_cell_number?('+86312123456')).to be_falsey
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
data/spec/unit/a19_spec.rb
CHANGED
File without changes
|
File without changes
|
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.5
|
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: 2018-03-27 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activesupport
|
@@ -61,6 +61,20 @@ dependencies:
|
|
61
61
|
- - ">="
|
62
62
|
- !ruby/object:Gem::Version
|
63
63
|
version: '0'
|
64
|
+
- !ruby/object:Gem::Dependency
|
65
|
+
name: phonelib
|
66
|
+
requirement: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - "~>"
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0.6'
|
71
|
+
type: :runtime
|
72
|
+
prerelease: false
|
73
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - "~>"
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0.6'
|
64
78
|
- !ruby/object:Gem::Dependency
|
65
79
|
name: rest-client
|
66
80
|
requirement: !ruby/object:Gem::Requirement
|
@@ -243,20 +257,6 @@ dependencies:
|
|
243
257
|
- - "~>"
|
244
258
|
- !ruby/object:Gem::Version
|
245
259
|
version: '2.1'
|
246
|
-
- !ruby/object:Gem::Dependency
|
247
|
-
name: rubocop
|
248
|
-
requirement: !ruby/object:Gem::Requirement
|
249
|
-
requirements:
|
250
|
-
- - "~>"
|
251
|
-
- !ruby/object:Gem::Version
|
252
|
-
version: '0.40'
|
253
|
-
type: :development
|
254
|
-
prerelease: false
|
255
|
-
version_requirements: !ruby/object:Gem::Requirement
|
256
|
-
requirements:
|
257
|
-
- - "~>"
|
258
|
-
- !ruby/object:Gem::Version
|
259
|
-
version: '0.40'
|
260
260
|
- !ruby/object:Gem::Dependency
|
261
261
|
name: simplecov
|
262
262
|
requirement: !ruby/object:Gem::Requirement
|
@@ -323,6 +323,7 @@ files:
|
|
323
323
|
- lib/roqua/healthy/a19/fetcher.rb
|
324
324
|
- lib/roqua/healthy/a19/impulse_name_parser.rb
|
325
325
|
- lib/roqua/healthy/a19/name_parser.rb
|
326
|
+
- lib/roqua/healthy/a19/phone_validator.rb
|
326
327
|
- lib/roqua/healthy/a19/response_parser.rb
|
327
328
|
- lib/roqua/healthy/a19/response_validator.rb
|
328
329
|
- lib/roqua/healthy/a19/transformer.rb
|
@@ -381,6 +382,7 @@ files:
|
|
381
382
|
- spec/unit/a19/address_parser_spec.rb
|
382
383
|
- spec/unit/a19/correct_patient_check_spec.rb
|
383
384
|
- spec/unit/a19/fetcher_spec.rb
|
385
|
+
- spec/unit/a19/phone_validator_spec.rb
|
384
386
|
- spec/unit/a19/response_validator_spec.rb
|
385
387
|
- spec/unit/a19_spec.rb
|
386
388
|
- spec/unit/client_spec.rb
|
@@ -406,7 +408,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
406
408
|
version: '0'
|
407
409
|
requirements: []
|
408
410
|
rubyforge_project:
|
409
|
-
rubygems_version: 2.5.
|
411
|
+
rubygems_version: 2.5.2.2
|
410
412
|
signing_key:
|
411
413
|
specification_version: 4
|
412
414
|
summary: Arranges communication between Mirth and RoQua
|
@@ -458,6 +460,7 @@ test_files:
|
|
458
460
|
- spec/unit/a19/address_parser_spec.rb
|
459
461
|
- spec/unit/a19/correct_patient_check_spec.rb
|
460
462
|
- spec/unit/a19/fetcher_spec.rb
|
463
|
+
- spec/unit/a19/phone_validator_spec.rb
|
461
464
|
- spec/unit/a19/response_validator_spec.rb
|
462
465
|
- spec/unit/a19_spec.rb
|
463
466
|
- spec/unit/client_spec.rb
|