roqua-healthy 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -11
- data/.rubocop_todo.yml +22 -0
- data/ChangeLog.md +4 -0
- data/Gemfile +1 -1
- data/Guardfile +2 -2
- data/README.md +5 -3
- data/Rakefile +5 -5
- data/bin/get +1 -1
- data/bin/get_xml_for_patient +1 -1
- data/circle.yml +5 -0
- data/lib/roqua/healthy/a19/address_parser.rb +1 -1
- data/lib/roqua/healthy/a19/fetcher.rb +2 -4
- data/lib/roqua/healthy/a19/name_parser.rb +1 -2
- data/lib/roqua/healthy/a19/response_parser.rb +1 -1
- data/lib/roqua/healthy/a19/transformer.rb +18 -6
- data/lib/roqua/healthy/a19.rb +1 -1
- data/lib/roqua/healthy/message_cleaner.rb +1 -1
- data/lib/roqua/healthy/version.rb +1 -1
- data/lib/roqua/healthy.rb +1 -1
- data/lib/roqua-healthy.rb +1 -0
- data/roqua-healthy.gemspec +6 -6
- data/spec/fixtures/xmcare_phone_cell_in_prn.xml +314 -0
- data/spec/fixtures/xmcare_phone_cell_in_prn_orn.xml +314 -0
- data/spec/fixtures/xmcare_unconventional_phone_cell_in_orn.xml +314 -0
- data/spec/integration/comez_spec.rb +8 -5
- data/spec/integration/medo_spec.rb +9 -8
- data/spec/integration/mirth_spec.rb +1 -1
- data/spec/integration/xmcare_spec.rb +80 -22
- data/spec/spec_helper.rb +1 -1
- data/spec/support/fixtures.rb +1 -1
- data/spec/unit/a19/address_parser_spec.rb +4 -7
- data/spec/unit/a19/correct_patient_check_spec.rb +1 -1
- data/spec/unit/client_spec.rb +0 -2
- data/spec/unit/message_cleaner_spec.rb +1 -1
- metadata +19 -9
@@ -5,10 +5,13 @@ describe 'Fetching A19 from Comez' do
|
|
5
5
|
before { load_fixture 'comez_patient', '0000123456' }
|
6
6
|
subject { Roqua::Healthy::A19.fetch("0000123456") }
|
7
7
|
|
8
|
-
it { expect(subject[:status]).to
|
9
|
-
it { expect(subject[:error]).to
|
10
|
-
it { expect(subject[:source]).to
|
11
|
-
it
|
8
|
+
it { expect(subject[:status]).to eq('SUCCESS') }
|
9
|
+
it { expect(subject[:error]).to be_nil }
|
10
|
+
it { expect(subject[:source]).to eq('CS') }
|
11
|
+
it do
|
12
|
+
expect(subject[:identities]).to eq([{ident: '0000123456', authority: 'PI'},
|
13
|
+
{ident: '123456789', authority: 'NNNLD'}])
|
14
|
+
end
|
12
15
|
it { expect(subject[:firstname]).to eq('Voornaam') }
|
13
16
|
it { expect(subject[:initials]).to eq('A') }
|
14
17
|
it { expect(subject[:lastname]).to eq('Achternaam') }
|
@@ -23,4 +26,4 @@ describe 'Fetching A19 from Comez' do
|
|
23
26
|
it { expect(subject[:gender]).to eq('F') }
|
24
27
|
it { expect(subject[:phone_cell]).to eq('0612345678mdr') }
|
25
28
|
end
|
26
|
-
end
|
29
|
+
end
|
@@ -1,18 +1,19 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
# rubocop:disable Blocks,BlockAlignment
|
4
3
|
describe 'Fetching A19 from Medoq' do
|
5
4
|
describe 'a patient' do
|
6
5
|
before { load_fixture 'medoq_patient', 'md-cdae5d100d8e0131d2623c075478eb56' }
|
7
6
|
subject { Roqua::Healthy::A19.fetch("md-cdae5d100d8e0131d2623c075478eb56") }
|
8
7
|
|
9
|
-
it { expect(subject[:status]).to
|
10
|
-
it { expect(subject[:error]).to
|
11
|
-
it { expect(subject[:source]).to
|
12
|
-
it
|
13
|
-
|
14
|
-
|
15
|
-
|
8
|
+
it { expect(subject[:status]).to eq('SUCCESS') }
|
9
|
+
it { expect(subject[:error]).to be_nil }
|
10
|
+
it { expect(subject[:source]).to eq('RGOC') }
|
11
|
+
it do
|
12
|
+
expect(subject[:identities]).to eq([{ident: "md-cdae5d100d8e0131d2623c075478eb56",
|
13
|
+
research_number: "research-id-123",
|
14
|
+
metadata: {"test" => "12"},
|
15
|
+
authority: 'MEDOQ'}])
|
16
|
+
end
|
16
17
|
it { expect(subject[:firstname]).to eq('Jan') }
|
17
18
|
it { expect(subject[:initials]).to eq('J.') }
|
18
19
|
it { expect(subject[:lastname]).to eq('Fictief') }
|
@@ -5,10 +5,13 @@ describe 'Fetching A19 from XMcare' do
|
|
5
5
|
before { load_fixture 'xmcare_patient', '12345678901' }
|
6
6
|
subject { Roqua::Healthy::A19.fetch("12345678901") }
|
7
7
|
|
8
|
-
it { expect(subject[:status]).to
|
9
|
-
it { expect(subject[:error]).to
|
10
|
-
it { expect(subject[:source]).to
|
11
|
-
it
|
8
|
+
it { expect(subject[:status]).to eq('SUCCESS') }
|
9
|
+
it { expect(subject[:error]).to be_nil }
|
10
|
+
it { expect(subject[:source]).to eq('ZIS') }
|
11
|
+
it do
|
12
|
+
expect(subject[:identities]).to eq([{ident: '12345678901', authority: 'PI'},
|
13
|
+
{ident: '123456789', authority: 'NNNLD'}])
|
14
|
+
end
|
12
15
|
it { expect(subject[:firstname]).to eq('Babette') }
|
13
16
|
it { expect(subject[:initials]).to eq('A B') }
|
14
17
|
it { expect(subject[:lastname]).to eq('Achternaam') }
|
@@ -28,10 +31,13 @@ describe 'Fetching A19 from XMcare' do
|
|
28
31
|
before { load_fixture 'xmcare_patient_with_maiden_name', '12345678901' }
|
29
32
|
subject { Roqua::Healthy::A19.fetch("12345678901") }
|
30
33
|
|
31
|
-
it { expect(subject[:status]).to
|
32
|
-
it { expect(subject[:error]).to
|
33
|
-
it { expect(subject[:source]).to
|
34
|
-
it
|
34
|
+
it { expect(subject[:status]).to eq('SUCCESS') }
|
35
|
+
it { expect(subject[:error]).to be_nil }
|
36
|
+
it { expect(subject[:source]).to eq('ZIS') }
|
37
|
+
it do
|
38
|
+
expect(subject[:identities]).to eq([{ident: '12345678901', authority: 'PI'},
|
39
|
+
{ident: '123456789', authority: 'NNNLD'}])
|
40
|
+
end
|
35
41
|
it { expect(subject[:firstname]).to eq('Babette') }
|
36
42
|
it { expect(subject[:initials]).to eq('A B') }
|
37
43
|
it { expect(subject[:lastname]).to eq('Achternaam') }
|
@@ -51,10 +57,13 @@ describe 'Fetching A19 from XMcare' do
|
|
51
57
|
before { load_fixture 'xmcare_patient_without_birthdate', '12345678901' }
|
52
58
|
subject { Roqua::Healthy::A19.fetch("12345678901") }
|
53
59
|
|
54
|
-
it { expect(subject[:status]).to
|
55
|
-
it { expect(subject[:error]).to
|
56
|
-
it { expect(subject[:source]).to
|
57
|
-
it
|
60
|
+
it { expect(subject[:status]).to eq('SUCCESS') }
|
61
|
+
it { expect(subject[:error]).to be_nil }
|
62
|
+
it { expect(subject[:source]).to eq('ZIS') }
|
63
|
+
it do
|
64
|
+
expect(subject[:identities]).to eq([{ident: '12345678901', authority: 'PI'},
|
65
|
+
{ident: '123456789', authority: 'NNNLD'}])
|
66
|
+
end
|
58
67
|
it { expect(subject[:firstname]).to eq('Babette') }
|
59
68
|
it { expect(subject[:initials]).to eq('A B') }
|
60
69
|
it { expect(subject[:lastname]).to eq('Achternaam') }
|
@@ -74,10 +83,13 @@ describe 'Fetching A19 from XMcare' do
|
|
74
83
|
before { load_fixture 'xmcare_patient_email_in_field_number_four', '12345678901' }
|
75
84
|
subject { Roqua::Healthy::A19.fetch("12345678901") }
|
76
85
|
|
77
|
-
it { expect(subject[:status]).to
|
78
|
-
it { expect(subject[:error]).to
|
79
|
-
it { expect(subject[:source]).to
|
80
|
-
it
|
86
|
+
it { expect(subject[:status]).to eq('SUCCESS') }
|
87
|
+
it { expect(subject[:error]).to be_nil }
|
88
|
+
it { expect(subject[:source]).to eq('ZIS') }
|
89
|
+
it do
|
90
|
+
expect(subject[:identities]).to eq([{ident: '12345678901', authority: 'PI'},
|
91
|
+
{ident: '123456789', authority: 'NNNLD'}])
|
92
|
+
end
|
81
93
|
it { expect(subject[:firstname]).to eq('Babette') }
|
82
94
|
it { expect(subject[:initials]).to eq('A B') }
|
83
95
|
it { expect(subject[:lastname]).to eq('Achternaam') }
|
@@ -91,17 +103,19 @@ describe 'Fetching A19 from XMcare' do
|
|
91
103
|
it { expect(subject[:birthdate]).to eq('17070415') }
|
92
104
|
it { expect(subject[:gender]).to eq('F') }
|
93
105
|
it { expect(subject[:phone_cell]).to eq('06 12 34 56 78') }
|
94
|
-
|
95
106
|
end
|
96
107
|
|
97
108
|
describe 'a patient from an xmcare instance impersonating cdis' do
|
98
109
|
before { load_fixture 'xmcare_impersonating_cdis', '12345678901' }
|
99
110
|
subject { Roqua::Healthy::A19.fetch("12345678901") }
|
100
111
|
|
101
|
-
it { expect(subject[:status]).to
|
102
|
-
it { expect(subject[:error]).to
|
103
|
-
it { expect(subject[:source]).to
|
104
|
-
it
|
112
|
+
it { expect(subject[:status]).to eq('SUCCESS') }
|
113
|
+
it { expect(subject[:error]).to be_nil }
|
114
|
+
it { expect(subject[:source]).to eq('UMCG') }
|
115
|
+
it do
|
116
|
+
expect(subject[:identities]).to eq([{ident: '12345678901', authority: 'PI'},
|
117
|
+
{ident: '123456789', authority: 'NNNLD'}])
|
118
|
+
end
|
105
119
|
it { expect(subject[:firstname]).to eq('A') }
|
106
120
|
it { expect(subject[:initials]).to eq('B C') }
|
107
121
|
it { expect(subject[:lastname]).to eq('Achternaam') }
|
@@ -117,6 +131,50 @@ describe 'Fetching A19 from XMcare' do
|
|
117
131
|
it { expect(subject[:phone_cell]).to eq('06-12345678') }
|
118
132
|
end
|
119
133
|
|
134
|
+
describe 'a patient with a 06 cell phone number only in the primary residence number field' do
|
135
|
+
before { load_fixture 'xmcare_phone_cell_in_prn', '88888888888' }
|
136
|
+
subject { Roqua::Healthy::A19.fetch("88888888888") }
|
137
|
+
|
138
|
+
it { expect(subject[:status]).to eq('SUCCESS') }
|
139
|
+
it { expect(subject[:error]).to be_nil }
|
140
|
+
it { expect(subject[:source]).to eq('XMCARE') }
|
141
|
+
it do
|
142
|
+
expect(subject[:identities]).to eq([{ident: '88888888888', authority: 'PI'},
|
143
|
+
{ident: '222222222', authority: 'NNNLD'}])
|
144
|
+
end
|
145
|
+
it { expect(subject[:firstname]).to eq('Voorname') }
|
146
|
+
it { expect(subject[:initials]).to eq('V') }
|
147
|
+
it { expect(subject[:lastname]).to eq('Achternom') }
|
148
|
+
it { expect(subject[:display_name]).to eq('Achternom') }
|
149
|
+
it { expect(subject[:email]).to eq('support@roqua.nl') }
|
150
|
+
it { expect(subject[:address_type]).to eq('H') }
|
151
|
+
it { expect(subject[:street]).to eq('Straat 8') }
|
152
|
+
it { expect(subject[:city]).to eq('GRONINGEN') }
|
153
|
+
it { expect(subject[:zipcode]).to eq('9711CR') }
|
154
|
+
it { expect(subject[:country]).to eq('NED') }
|
155
|
+
it { expect(subject[:birthdate]).to eq('19900101') }
|
156
|
+
it { expect(subject[:gender]).to eq('F') }
|
157
|
+
it { expect(subject[:phone_cell]).to eq('0612345678') }
|
158
|
+
end
|
159
|
+
|
160
|
+
describe 'a patient with a 06 cell phone number in the both residence number fields' do
|
161
|
+
before { load_fixture 'xmcare_phone_cell_in_prn_orn', '88888888888' }
|
162
|
+
subject { Roqua::Healthy::A19.fetch("88888888888") }
|
163
|
+
|
164
|
+
it 'prefers the orn cell phone number over the prn' do
|
165
|
+
expect(subject[:phone_cell]).to eq('0612345678')
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
describe 'a patient with an unconventional cell phone number in the other residence number field' do
|
170
|
+
before { load_fixture 'xmcare_unconventional_phone_cell_in_orn', '88888888888' }
|
171
|
+
subject { Roqua::Healthy::A19.fetch("88888888888") }
|
172
|
+
|
173
|
+
it 'returns the orn number' do
|
174
|
+
expect(subject[:phone_cell]).to eq('+31612345678')
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|
120
178
|
describe 'a patient that does not exist' do
|
121
179
|
before { load_fixture 'xmcare_patient_not_found', '12345678901' }
|
122
180
|
|
@@ -124,4 +182,4 @@ describe 'Fetching A19 from XMcare' do
|
|
124
182
|
expect { Roqua::Healthy::A19.fetch("12345678901") }.to raise_error(Roqua::Healthy::PatientNotFound)
|
125
183
|
end
|
126
184
|
end
|
127
|
-
end
|
185
|
+
end
|
data/spec/spec_helper.rb
CHANGED
data/spec/support/fixtures.rb
CHANGED
@@ -7,20 +7,17 @@ describe Roqua::Healthy::A19::AddressParser do
|
|
7
7
|
'PID.11.1' => {'PID.11.1.1' => 'Mailstreet 1'},
|
8
8
|
'PID.11.3' => 'Mailcity',
|
9
9
|
'PID.11.5' => 'Mailzipcode',
|
10
|
-
'PID.11.6' => 'Mailcountry'
|
11
|
-
} if types.include?('M')
|
10
|
+
'PID.11.6' => 'Mailcountry'} if types.include?('M')
|
12
11
|
addresses << {'PID.11.7' => 'H',
|
13
12
|
'PID.11.1' => {'PID.11.1.1' => 'Homestreet 1'},
|
14
13
|
'PID.11.3' => 'Homecity',
|
15
14
|
'PID.11.5' => 'Homezipcode',
|
16
|
-
'PID.11.6' => 'Homecountry'
|
17
|
-
} if types.include?('H')
|
15
|
+
'PID.11.6' => 'Homecountry'} if types.include?('H')
|
18
16
|
addresses << {'PID.11.7' => '?',
|
19
17
|
'PID.11.1' => {'PID.11.1.1' => '????street 1'},
|
20
18
|
'PID.11.3' => '????city',
|
21
19
|
'PID.11.5' => '????zipcode',
|
22
|
-
'PID.11.6' => '????country'
|
23
|
-
} if types.include?('?')
|
20
|
+
'PID.11.6' => '????country'} if types.include?('?')
|
24
21
|
{'PID' => {'PID.11' => addresses}}
|
25
22
|
end
|
26
23
|
|
@@ -129,4 +126,4 @@ describe Roqua::Healthy::A19::AddressParser do
|
|
129
126
|
expect(parser.country).to be_nil
|
130
127
|
end
|
131
128
|
end
|
132
|
-
end
|
129
|
+
end
|
data/spec/unit/client_spec.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roqua-healthy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marten Veldthuis
|
8
8
|
- Jorn van de Beek
|
9
|
+
- Samuel Esposito
|
10
|
+
- Henk van der Veen
|
9
11
|
autorequire:
|
10
12
|
bindir: bin
|
11
13
|
cert_chain: []
|
12
|
-
date: 2016-
|
14
|
+
date: 2016-06-24 00:00:00.000000000 Z
|
13
15
|
dependencies:
|
14
16
|
- !ruby/object:Gem::Dependency
|
15
17
|
name: activesupport
|
@@ -177,28 +179,28 @@ dependencies:
|
|
177
179
|
requirements:
|
178
180
|
- - "~>"
|
179
181
|
- !ruby/object:Gem::Version
|
180
|
-
version: 1.0
|
182
|
+
version: 1.2.0
|
181
183
|
type: :development
|
182
184
|
prerelease: false
|
183
185
|
version_requirements: !ruby/object:Gem::Requirement
|
184
186
|
requirements:
|
185
187
|
- - "~>"
|
186
188
|
- !ruby/object:Gem::Version
|
187
|
-
version: 1.0
|
189
|
+
version: 1.2.0
|
188
190
|
- !ruby/object:Gem::Dependency
|
189
191
|
name: rubocop
|
190
192
|
requirement: !ruby/object:Gem::Requirement
|
191
193
|
requirements:
|
192
|
-
- -
|
194
|
+
- - "~>"
|
193
195
|
- !ruby/object:Gem::Version
|
194
|
-
version: 0.
|
196
|
+
version: '0.40'
|
195
197
|
type: :development
|
196
198
|
prerelease: false
|
197
199
|
version_requirements: !ruby/object:Gem::Requirement
|
198
200
|
requirements:
|
199
|
-
- -
|
201
|
+
- - "~>"
|
200
202
|
- !ruby/object:Gem::Version
|
201
|
-
version: 0.
|
203
|
+
version: '0.40'
|
202
204
|
- !ruby/object:Gem::Dependency
|
203
205
|
name: fuubar
|
204
206
|
requirement: !ruby/object:Gem::Requirement
|
@@ -238,6 +240,7 @@ files:
|
|
238
240
|
- ".gitignore"
|
239
241
|
- ".rspec"
|
240
242
|
- ".rubocop.yml"
|
243
|
+
- ".rubocop_todo.yml"
|
241
244
|
- ".yardopts"
|
242
245
|
- ChangeLog.md
|
243
246
|
- Gemfile
|
@@ -249,6 +252,7 @@ files:
|
|
249
252
|
- bin/get_old_mirth_processing_result
|
250
253
|
- bin/get_xml_for_patient
|
251
254
|
- bin/parse_local_xml
|
255
|
+
- circle.yml
|
252
256
|
- lib/roqua-healthy.rb
|
253
257
|
- lib/roqua/healthy.rb
|
254
258
|
- lib/roqua/healthy/a19.rb
|
@@ -289,7 +293,10 @@ files:
|
|
289
293
|
- spec/fixtures/xmcare_patient_not_found.xml
|
290
294
|
- spec/fixtures/xmcare_patient_with_maiden_name.xml
|
291
295
|
- spec/fixtures/xmcare_patient_without_birthdate.xml
|
296
|
+
- spec/fixtures/xmcare_phone_cell_in_prn.xml
|
297
|
+
- spec/fixtures/xmcare_phone_cell_in_prn_orn.xml
|
292
298
|
- spec/fixtures/xmcare_timeout_waiting_for_ack.xml
|
299
|
+
- spec/fixtures/xmcare_unconventional_phone_cell_in_orn.xml
|
293
300
|
- spec/healthy_spec.rb
|
294
301
|
- spec/integration/cdis_spec.rb
|
295
302
|
- spec/integration/comez_spec.rb
|
@@ -325,7 +332,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
325
332
|
version: '0'
|
326
333
|
requirements: []
|
327
334
|
rubyforge_project:
|
328
|
-
rubygems_version: 2.
|
335
|
+
rubygems_version: 2.4.8
|
329
336
|
signing_key:
|
330
337
|
specification_version: 4
|
331
338
|
summary: Arranges communication between Mirth and RoQua
|
@@ -353,7 +360,10 @@ test_files:
|
|
353
360
|
- spec/fixtures/xmcare_patient_not_found.xml
|
354
361
|
- spec/fixtures/xmcare_patient_with_maiden_name.xml
|
355
362
|
- spec/fixtures/xmcare_patient_without_birthdate.xml
|
363
|
+
- spec/fixtures/xmcare_phone_cell_in_prn.xml
|
364
|
+
- spec/fixtures/xmcare_phone_cell_in_prn_orn.xml
|
356
365
|
- spec/fixtures/xmcare_timeout_waiting_for_ack.xml
|
366
|
+
- spec/fixtures/xmcare_unconventional_phone_cell_in_orn.xml
|
357
367
|
- spec/healthy_spec.rb
|
358
368
|
- spec/integration/cdis_spec.rb
|
359
369
|
- spec/integration/comez_spec.rb
|