roqua-healthy 1.5.9 → 1.6.0
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 +11 -5
- data/.rspec +0 -0
- data/.rubocop.yml +7 -1
- data/.yardopts +0 -0
- data/Appraisals +7 -6
- data/ChangeLog.md +18 -0
- data/Guardfile +1 -1
- data/LICENSE.txt +0 -0
- data/Rakefile +0 -0
- data/circle.yml +0 -0
- data/gemfiles/rails52.gemfile +10 -0
- data/gemfiles/rails60.gemfile +9 -0
- data/gemfiles/rails61.gemfile +9 -0
- data/lib/roqua/healthy/a19.rb +0 -0
- data/lib/roqua/healthy/a19/address_parser.rb +10 -2
- data/lib/roqua/healthy/a19/correct_patient_check.rb +0 -0
- data/lib/roqua/healthy/a19/fetcher.rb +1 -2
- 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_parser.rb +18 -11
- data/lib/roqua/healthy/a19/phone_validator.rb +1 -1
- data/lib/roqua/healthy/a19/response_parser.rb +0 -0
- data/lib/roqua/healthy/a19/response_validator.rb +11 -13
- data/lib/roqua/healthy/a19/transformer.rb +19 -19
- data/lib/roqua/healthy/message_cleaner.rb +0 -0
- data/lib/roqua/healthy/oru/client.rb +0 -1
- data/lib/roqua/healthy/version.rb +1 -1
- data/lib/roqua_healthy.rb +0 -0
- data/roqua-healthy.gemspec +5 -6
- data/spec/fixtures/comez_patient.xml +0 -0
- data/spec/fixtures/ggzwnb_patient.xml +0 -0
- 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_house_number_addendum.xml +335 -0
- data/spec/fixtures/xmcare_missing_whole_pids.xml +162 -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/xmcare_spec.rb +18 -0
- data/spec/spec_helper.rb +0 -0
- data/spec/support/fixtures.rb +0 -0
- data/spec/unit/a19/address_parser_spec.rb +49 -0
- data/spec/unit/a19/correct_patient_check_spec.rb +0 -0
- data/spec/unit/a19/phone_parser_spec.rb +7 -0
- data/spec/unit/a19_spec.rb +0 -0
- data/spec/unit/message_cleaner_spec.rb +0 -0
- data/spec/unit/oru/client_spec.rb +2 -2
- metadata +31 -36
- data/gemfiles/rails41.gemfile +0 -8
- data/gemfiles/rails42.gemfile +0 -8
- data/gemfiles/rails50.gemfile +0 -8
- data/lib/roqua/errors.rb +0 -0
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
|
@@ -207,6 +207,24 @@ describe 'Fetching A19 from XMcare' do
|
|
207
207
|
end
|
208
208
|
end
|
209
209
|
|
210
|
+
describe 'a patient with an address suffix' do
|
211
|
+
before { load_fixture 'xmcare_house_number_addendum', '1234567890' }
|
212
|
+
subject { Roqua::Healthy::A19.fetch("1234567890") }
|
213
|
+
|
214
|
+
it 'returns the street with suffix appended' do
|
215
|
+
expect(subject[:street]).to eq("Straatnaam 123ab")
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
219
|
+
describe 'a patient with no PID.11 (address) or PID.13 (phone) at all' do
|
220
|
+
before { load_fixture 'xmcare_missing_whole_pids', '12345678901' }
|
221
|
+
subject { Roqua::Healthy::A19.fetch("12345678901") }
|
222
|
+
|
223
|
+
it 'loads the rest' do
|
224
|
+
expect(subject[:firstname]).to eq("Babette")
|
225
|
+
end
|
226
|
+
end
|
227
|
+
|
210
228
|
describe 'a patient that does not exist' do
|
211
229
|
before { load_fixture 'xmcare_patient_not_found', '12345678901' }
|
212
230
|
|
data/spec/spec_helper.rb
CHANGED
File without changes
|
data/spec/support/fixtures.rb
CHANGED
File without changes
|
@@ -8,6 +8,7 @@ describe Roqua::Healthy::A19::AddressParser do
|
|
8
8
|
if types.include?('M')
|
9
9
|
addresses << {'PID.11.7' => 'M',
|
10
10
|
'PID.11.1' => {'PID.11.1.1' => 'Mailstreet 1'},
|
11
|
+
'PID.11.2' => '',
|
11
12
|
'PID.11.3' => 'Mailcity',
|
12
13
|
'PID.11.5' => 'Mailzipcode',
|
13
14
|
'PID.11.6' => 'Mailcountry'}
|
@@ -53,6 +54,11 @@ describe Roqua::Healthy::A19::AddressParser do
|
|
53
54
|
parser = described_class.new(message)
|
54
55
|
expect(parser.address_type).to be_nil
|
55
56
|
end
|
57
|
+
|
58
|
+
it 'handles missing PID' do
|
59
|
+
parser = described_class.new('PID' => {})
|
60
|
+
expect(parser.address_type).to be_nil
|
61
|
+
end
|
56
62
|
end
|
57
63
|
|
58
64
|
describe '#street' do
|
@@ -73,6 +79,35 @@ describe Roqua::Healthy::A19::AddressParser do
|
|
73
79
|
parser = described_class.new(message)
|
74
80
|
expect(parser.street).to be_nil
|
75
81
|
end
|
82
|
+
|
83
|
+
it 'appends house number suffix' do
|
84
|
+
addresses = [{'PID.11.7' => 'M',
|
85
|
+
'PID.11.1' => {'PID.11.1.1' => 'Homestreet 1'},
|
86
|
+
'PID.11.2' => "ab",
|
87
|
+
'PID.11.3' => 'Homecity',
|
88
|
+
'PID.11.5' => 'Homezipcode',
|
89
|
+
'PID.11.6' => 'Homecountry'}]
|
90
|
+
message = {'PID' => {'PID.11' => addresses}}
|
91
|
+
parser = described_class.new(message)
|
92
|
+
expect(parser.street).to eq("Homestreet 1ab")
|
93
|
+
end
|
94
|
+
|
95
|
+
it 'does not append house number suffix if full field already ends in it' do
|
96
|
+
addresses = [{'PID.11.7' => 'M',
|
97
|
+
'PID.11.1' => {'PID.11.1.1' => 'Homestreet 1ab'},
|
98
|
+
'PID.11.2' => "ab",
|
99
|
+
'PID.11.3' => 'Homecity',
|
100
|
+
'PID.11.5' => 'Homezipcode',
|
101
|
+
'PID.11.6' => 'Homecountry'}]
|
102
|
+
message = {'PID' => {'PID.11' => addresses}}
|
103
|
+
parser = described_class.new(message)
|
104
|
+
expect(parser.street).to eq("Homestreet 1ab")
|
105
|
+
end
|
106
|
+
|
107
|
+
it 'handles missing PID' do
|
108
|
+
parser = described_class.new('PID' => {})
|
109
|
+
expect(parser.street).to be_nil
|
110
|
+
end
|
76
111
|
end
|
77
112
|
|
78
113
|
describe '#city' do
|
@@ -93,6 +128,11 @@ describe Roqua::Healthy::A19::AddressParser do
|
|
93
128
|
parser = described_class.new(message)
|
94
129
|
expect(parser.city).to be_nil
|
95
130
|
end
|
131
|
+
|
132
|
+
it 'handles missing PID' do
|
133
|
+
parser = described_class.new('PID' => {})
|
134
|
+
expect(parser.city).to be_nil
|
135
|
+
end
|
96
136
|
end
|
97
137
|
|
98
138
|
describe '#zipcode' do
|
@@ -113,6 +153,10 @@ describe Roqua::Healthy::A19::AddressParser do
|
|
113
153
|
parser = described_class.new(message)
|
114
154
|
expect(parser.zipcode).to be_nil
|
115
155
|
end
|
156
|
+
it 'handles missing PID' do
|
157
|
+
parser = described_class.new('PID' => {})
|
158
|
+
expect(parser.zipcode).to be_nil
|
159
|
+
end
|
116
160
|
end
|
117
161
|
|
118
162
|
describe '#country' do
|
@@ -133,6 +177,11 @@ describe Roqua::Healthy::A19::AddressParser do
|
|
133
177
|
parser = described_class.new(message)
|
134
178
|
expect(parser.country).to be_nil
|
135
179
|
end
|
180
|
+
|
181
|
+
it 'handles missing PID' do
|
182
|
+
parser = described_class.new('PID' => {})
|
183
|
+
expect(parser.country).to be_nil
|
184
|
+
end
|
136
185
|
end
|
137
186
|
# rubocop:enable Metrics/MethodLength
|
138
187
|
end
|
File without changes
|
@@ -31,6 +31,13 @@ RSpec.describe Roqua::Healthy::A19::PhoneParser do
|
|
31
31
|
it { should be_nil }
|
32
32
|
end
|
33
33
|
|
34
|
+
describe 'no phone number field at all' do
|
35
|
+
let(:message) do
|
36
|
+
{'PID' => {}}
|
37
|
+
end
|
38
|
+
it { should be_nil }
|
39
|
+
end
|
40
|
+
|
34
41
|
describe 'mobile type in PRN is preferred over other mobile numbers' do
|
35
42
|
let(:message) do
|
36
43
|
{'PID' => {'PID.13' => [{'PID.13.1' => '0612345678', 'PID.13.2' => 'CP'},
|
data/spec/unit/a19_spec.rb
CHANGED
File without changes
|
File without changes
|
@@ -10,7 +10,7 @@ RSpec.describe Roqua::Healthy::Oru::Client do
|
|
10
10
|
'hash%3E%0A++%3Coru+type%3D%22symbol%22%3Edata%3C%2Foru%3E%0A%3C%2Fhash%3E%0A',
|
11
11
|
headers: {
|
12
12
|
'Accept' => '*/*',
|
13
|
-
'Accept-Encoding' =>
|
13
|
+
'Accept-Encoding' => /gzip.*?deflate.*/,
|
14
14
|
'Content-Length' => '140',
|
15
15
|
'Content-Type' => 'text/xml'
|
16
16
|
}
|
@@ -30,7 +30,7 @@ RSpec.describe Roqua::Healthy::Oru::Client do
|
|
30
30
|
|
31
31
|
let(:subject) { Roqua::Healthy::Oru::Client }
|
32
32
|
let(:oru_url) { 'https://example.com' }
|
33
|
-
let(:timeout) { 5
|
33
|
+
let(:timeout) { 5 }
|
34
34
|
|
35
35
|
def execute_request
|
36
36
|
subject.execute(oru_url, {oru: :data}, timeout: timeout)
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roqua-healthy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marten Veldthuis
|
8
8
|
- Jorn van de Beek
|
9
9
|
- Samuel Esposito
|
10
10
|
- Henk van der Veen
|
11
|
-
autorequire:
|
11
|
+
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2021-04-07 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activesupport
|
@@ -19,20 +19,20 @@ dependencies:
|
|
19
19
|
requirements:
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '5.1'
|
23
23
|
- - "<"
|
24
24
|
- !ruby/object:Gem::Version
|
25
|
-
version: '6'
|
25
|
+
version: '6.2'
|
26
26
|
type: :runtime
|
27
27
|
prerelease: false
|
28
28
|
version_requirements: !ruby/object:Gem::Requirement
|
29
29
|
requirements:
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '5.1'
|
33
33
|
- - "<"
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: '6'
|
35
|
+
version: '6.2'
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: addressable
|
38
38
|
requirement: !ruby/object:Gem::Requirement
|
@@ -93,16 +93,22 @@ dependencies:
|
|
93
93
|
name: roqua-support
|
94
94
|
requirement: !ruby/object:Gem::Requirement
|
95
95
|
requirements:
|
96
|
-
- - "
|
96
|
+
- - ">="
|
97
97
|
- !ruby/object:Gem::Version
|
98
98
|
version: 0.3.0
|
99
|
+
- - "<"
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: 0.5.0
|
99
102
|
type: :runtime
|
100
103
|
prerelease: false
|
101
104
|
version_requirements: !ruby/object:Gem::Requirement
|
102
105
|
requirements:
|
103
|
-
- - "
|
106
|
+
- - ">="
|
104
107
|
- !ruby/object:Gem::Version
|
105
108
|
version: 0.3.0
|
109
|
+
- - "<"
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: 0.5.0
|
106
112
|
- !ruby/object:Gem::Dependency
|
107
113
|
name: appraisal
|
108
114
|
requirement: !ruby/object:Gem::Requirement
|
@@ -187,20 +193,6 @@ dependencies:
|
|
187
193
|
- - "~>"
|
188
194
|
- !ruby/object:Gem::Version
|
189
195
|
version: '3.2'
|
190
|
-
- !ruby/object:Gem::Dependency
|
191
|
-
name: fuubar
|
192
|
-
requirement: !ruby/object:Gem::Requirement
|
193
|
-
requirements:
|
194
|
-
- - ">="
|
195
|
-
- !ruby/object:Gem::Version
|
196
|
-
version: '0'
|
197
|
-
type: :development
|
198
|
-
prerelease: false
|
199
|
-
version_requirements: !ruby/object:Gem::Requirement
|
200
|
-
requirements:
|
201
|
-
- - ">="
|
202
|
-
- !ruby/object:Gem::Version
|
203
|
-
version: '0'
|
204
196
|
- !ruby/object:Gem::Dependency
|
205
197
|
name: guard
|
206
198
|
requirement: !ruby/object:Gem::Requirement
|
@@ -221,28 +213,28 @@ dependencies:
|
|
221
213
|
requirements:
|
222
214
|
- - "~>"
|
223
215
|
- !ruby/object:Gem::Version
|
224
|
-
version: 4.2
|
216
|
+
version: '4.2'
|
225
217
|
type: :development
|
226
218
|
prerelease: false
|
227
219
|
version_requirements: !ruby/object:Gem::Requirement
|
228
220
|
requirements:
|
229
221
|
- - "~>"
|
230
222
|
- !ruby/object:Gem::Version
|
231
|
-
version: 4.2
|
223
|
+
version: '4.2'
|
232
224
|
- !ruby/object:Gem::Dependency
|
233
225
|
name: guard-rubocop
|
234
226
|
requirement: !ruby/object:Gem::Requirement
|
235
227
|
requirements:
|
236
228
|
- - "~>"
|
237
229
|
- !ruby/object:Gem::Version
|
238
|
-
version: 1.2
|
230
|
+
version: '1.2'
|
239
231
|
type: :development
|
240
232
|
prerelease: false
|
241
233
|
version_requirements: !ruby/object:Gem::Requirement
|
242
234
|
requirements:
|
243
235
|
- - "~>"
|
244
236
|
- !ruby/object:Gem::Version
|
245
|
-
version: 1.2
|
237
|
+
version: '1.2'
|
246
238
|
- !ruby/object:Gem::Dependency
|
247
239
|
name: listen
|
248
240
|
requirement: !ruby/object:Gem::Requirement
|
@@ -311,10 +303,9 @@ files:
|
|
311
303
|
- bin/get_xml_for_patient
|
312
304
|
- bin/parse_local_xml
|
313
305
|
- circle.yml
|
314
|
-
- gemfiles/
|
315
|
-
- gemfiles/
|
316
|
-
- gemfiles/
|
317
|
-
- lib/roqua/errors.rb
|
306
|
+
- gemfiles/rails52.gemfile
|
307
|
+
- gemfiles/rails60.gemfile
|
308
|
+
- gemfiles/rails61.gemfile
|
318
309
|
- lib/roqua/healthy.rb
|
319
310
|
- lib/roqua/healthy/a19.rb
|
320
311
|
- lib/roqua/healthy/a19/address_parser.rb
|
@@ -356,7 +347,9 @@ files:
|
|
356
347
|
- spec/fixtures/user_patient_not_found.xml
|
357
348
|
- spec/fixtures/user_patient_with_gsm_and_email.xml
|
358
349
|
- spec/fixtures/user_patient_with_maiden_name.xml
|
350
|
+
- spec/fixtures/xmcare_house_number_addendum.xml
|
359
351
|
- spec/fixtures/xmcare_impersonating_cdis.xml
|
352
|
+
- spec/fixtures/xmcare_missing_whole_pids.xml
|
360
353
|
- spec/fixtures/xmcare_patient.xml
|
361
354
|
- spec/fixtures/xmcare_patient_email_in_field_number_four.xml
|
362
355
|
- spec/fixtures/xmcare_patient_not_found.xml
|
@@ -392,23 +385,23 @@ homepage: https://github.com/roqua/healthy
|
|
392
385
|
licenses:
|
393
386
|
- MIT
|
394
387
|
metadata: {}
|
395
|
-
post_install_message:
|
388
|
+
post_install_message:
|
396
389
|
rdoc_options: []
|
397
390
|
require_paths:
|
398
391
|
- lib
|
399
392
|
required_ruby_version: !ruby/object:Gem::Requirement
|
400
393
|
requirements:
|
401
|
-
- - "
|
394
|
+
- - ">="
|
402
395
|
- !ruby/object:Gem::Version
|
403
|
-
version: '2.
|
396
|
+
version: '2.6'
|
404
397
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
405
398
|
requirements:
|
406
399
|
- - ">="
|
407
400
|
- !ruby/object:Gem::Version
|
408
401
|
version: '0'
|
409
402
|
requirements: []
|
410
|
-
rubygems_version: 3.
|
411
|
-
signing_key:
|
403
|
+
rubygems_version: 3.1.4
|
404
|
+
signing_key:
|
412
405
|
specification_version: 4
|
413
406
|
summary: Arranges communication between Mirth and RoQua
|
414
407
|
test_files:
|
@@ -431,7 +424,9 @@ test_files:
|
|
431
424
|
- spec/fixtures/user_patient_not_found.xml
|
432
425
|
- spec/fixtures/user_patient_with_gsm_and_email.xml
|
433
426
|
- spec/fixtures/user_patient_with_maiden_name.xml
|
427
|
+
- spec/fixtures/xmcare_house_number_addendum.xml
|
434
428
|
- spec/fixtures/xmcare_impersonating_cdis.xml
|
429
|
+
- spec/fixtures/xmcare_missing_whole_pids.xml
|
435
430
|
- spec/fixtures/xmcare_patient.xml
|
436
431
|
- spec/fixtures/xmcare_patient_email_in_field_number_four.xml
|
437
432
|
- spec/fixtures/xmcare_patient_not_found.xml
|
data/gemfiles/rails41.gemfile
DELETED
data/gemfiles/rails42.gemfile
DELETED
data/gemfiles/rails50.gemfile
DELETED
data/lib/roqua/errors.rb
DELETED
File without changes
|