roqua-healthy 1.5.3 → 1.5.4

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
  SHA1:
3
- metadata.gz: ccd4dc01c0792957e4a17ef4ffa69b4ffbdbc95b
4
- data.tar.gz: 3c2e6f19aeec8ee2eaf36ad82c97bb65a00b8376
3
+ metadata.gz: cb0dd22a8a5f693541a7ebfa39210bdfe3df8e19
4
+ data.tar.gz: a06d6e42809e99705bb458d9912030b52083a26d
5
5
  SHA512:
6
- metadata.gz: 0ba26e105e2ca2d90c2bbec3d4d008072729013a14bb14d8e381b946e8de2bf784b1ea55501edf8c326d6548a6d180c5582c28fd275d1fbdb940ece0839141cd
7
- data.tar.gz: 1675add8d6649f2904c3fb5f164aa304f0b489de09935982b26efac2a6443bdf4c873329177ca72d873699b0ec33bbc1137e6035d92725871ab7928355f1bbf3
6
+ metadata.gz: 869a5c07c41a79f4b543dd31efed8ca198bfcdae0cdb2ef00679032460876d58f9dc00164e9a3b45366e8918d42481357396e2f24b28482e8c11fdcd701efdd9
7
+ data.tar.gz: 3143b6944b2a2a12635d0fc6edd8d1b200284e3c868d38c2ab6f5c01b9926ffa08d6f7df4257f0843b12a84e7a1fda85f5925055e5e7ca094c07ccad1958ad93
data/ChangeLog.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 1.5.4
2
+
3
+ * Treat missing PID information as a ::Roqua::Healthy::PatientNotFound error
4
+
1
5
  ### 1.5.3
2
6
 
3
7
  * Support address type P (permanent)
@@ -12,12 +12,12 @@ module Roqua
12
12
  attr_reader :message
13
13
 
14
14
  def initialize(message)
15
- @message = message
16
- @message['PID']['PID.3'] = [@message.fetch('PID').fetch('PID.3')].flatten.compact
17
- @message['PID']['PID.5'] = [@message.fetch('PID').fetch('PID.5')].flatten.compact
18
- @message['PID']['PID.11'] = [@message.fetch('PID').fetch('PID.11')].flatten.compact
19
- @message['PID']['PID.13'] = [@message.fetch('PID').fetch('PID.13')].flatten.compact
20
- @message = MessageCleaner.new(@message).message
15
+ raise ::Roqua::Healthy::PatientNotFound unless message['PID'].present?
16
+ message['PID']['PID.3'] = [message.fetch('PID').fetch('PID.3')].flatten.compact
17
+ message['PID']['PID.5'] = [message.fetch('PID').fetch('PID.5')].flatten.compact
18
+ message['PID']['PID.11'] = [message.fetch('PID').fetch('PID.11')].flatten.compact
19
+ message['PID']['PID.13'] = [message.fetch('PID').fetch('PID.13')].flatten.compact
20
+ @message = MessageCleaner.new(message).message
21
21
  end
22
22
 
23
23
  def to_patient
@@ -4,18 +4,14 @@ module Roqua
4
4
  class Client
5
5
  include ::Roqua::Support::Instrumentation
6
6
 
7
- attr_accessor :a19_endpoint, :a19_username, :a19_password
7
+ attr_reader :a19_endpoint, :a19_username, :a19_password
8
8
 
9
9
  def initialize(options = {})
10
- @a19_endpoint = options[:a19_endpoint]
10
+ @a19_endpoint = options[:a19_endpoint] || Roqua::Healthy.a19_endpoint
11
11
  @a19_username = options[:a19_username]
12
12
  @a19_password = options[:a19_password]
13
13
  end
14
14
 
15
- def a19_endpoint
16
- @a19_endpoint || Roqua::Healthy.a19_endpoint
17
- end
18
-
19
15
  def use_basic_auth?
20
16
  @a19_username.present? || @a19_password.present?
21
17
  end
@@ -2,6 +2,6 @@
2
2
  module Roqua
3
3
  module Healthy
4
4
  # healthy version
5
- VERSION = "1.5.3"
5
+ VERSION = "1.5.4"
6
6
  end
7
7
  end
@@ -22,27 +22,27 @@ Gem::Specification.new do |gem|
22
22
 
23
23
  gem.add_dependency 'activesupport', '>= 3.2', '< 6'
24
24
  gem.add_dependency 'addressable', '~> 2.3'
25
- gem.add_dependency 'roqua-support', '~> 0.1.22'
26
25
  gem.add_dependency 'builder'
27
26
  gem.add_dependency 'rest-client', '>= 2.0.2'
27
+ gem.add_dependency 'roqua-support', '~> 0.1.22'
28
28
 
29
+ gem.add_development_dependency 'appraisal'
29
30
  gem.add_development_dependency 'bundler', '~> 1.0'
30
31
  gem.add_development_dependency 'rake', '~> 10.0'
31
32
  gem.add_development_dependency 'rspec', '~> 3.3.0'
32
33
  gem.add_development_dependency 'yard', '~> 0.8'
33
- gem.add_development_dependency 'appraisal'
34
34
 
35
35
  # Required for the tests
36
36
  gem.add_development_dependency 'webmock', '~> 1.13'
37
37
 
38
38
  # Workflow and tools
39
+ gem.add_development_dependency 'fuubar'
39
40
  gem.add_development_dependency 'guard', '~> 2.1'
40
41
  gem.add_development_dependency 'guard-rspec', '~> 4.2.4'
41
- gem.add_development_dependency 'listen', '~> 2.1'
42
42
  gem.add_development_dependency 'guard-rubocop', '~> 1.2.0'
43
+ gem.add_development_dependency 'listen', '~> 2.1'
43
44
  gem.add_development_dependency 'rubocop', '~> 0.40'
44
45
  gem.add_development_dependency 'simplecov'
45
- gem.add_development_dependency 'fuubar'
46
46
 
47
47
  # Documentation generation
48
48
  gem.add_development_dependency 'kramdown', '1.2'
@@ -0,0 +1,80 @@
1
+ <HL7Message>
2
+ <MSH>
3
+ <MSH.1>|</MSH.1>
4
+ <MSH.2>^~\&amp;</MSH.2>
5
+ <MSH.3>
6
+ <MSH.3.1>CLOVDMZ</MSH.3.1>
7
+ </MSH.3>
8
+ <MSH.4>
9
+ <MSH.4.1>CLOVDMZP</MSH.4.1>
10
+ </MSH.4>
11
+ <MSH.5>
12
+ <MSH.5.1>ROQUA</MSH.5.1>
13
+ </MSH.5>
14
+ <MSH.6>
15
+ <MSH.6.1>RGOC</MSH.6.1>
16
+ </MSH.6>
17
+ <MSH.7>
18
+ <MSH.7.1>20171127164823</MSH.7.1>
19
+ </MSH.7>
20
+ <MSH.8/>
21
+ <MSH.9>
22
+ <MSH.9.1>ADR</MSH.9.1>
23
+ <MSH.9.2>A19</MSH.9.2>
24
+ </MSH.9>
25
+ <MSH.10>
26
+ <MSH.10.1>2e2216a7cf</MSH.10.1>
27
+ </MSH.10>
28
+ <MSH.11>
29
+ <MSH.11.1>P</MSH.11.1>
30
+ </MSH.11>
31
+ <MSH.12>
32
+ <MSH.12.1>2.4</MSH.12.1>
33
+ </MSH.12>
34
+ <MSH.13/>
35
+ <MSH.14/>
36
+ <MSH.15/>
37
+ <MSH.16/>
38
+ <MSH.17/>
39
+ </MSH>
40
+ <MSA>
41
+ <MSA.1>
42
+ <MSA.1.1>CA</MSA.1.1>
43
+ </MSA.1>
44
+ <MSA.2>
45
+ <MSA.2.1>2e2216a7cf</MSA.2.1>
46
+ </MSA.2>
47
+ <MSA.3>
48
+ <MSA.3.1>Patient niet gevonden</MSA.3.1>
49
+ </MSA.3>
50
+ <MSA.4/>
51
+ <MSA.5/>
52
+ <MSA.6/>
53
+ </MSA>
54
+ <QRD>
55
+ <QRD.1>
56
+ <QRD.1.1>20171127</QRD.1.1>
57
+ </QRD.1>
58
+ <QRD.2>
59
+ <QRD.2.1>R</QRD.2.1>
60
+ </QRD.2>
61
+ <QRD.3>
62
+ <QRD.3.1>I</QRD.3.1>
63
+ </QRD.3>
64
+ <QRD.4>
65
+ <QRD.4.1>2e2216a7cf</QRD.4.1>
66
+ </QRD.4>
67
+ <QRD.5/>
68
+ <QRD.6/>
69
+ <QRD.7>
70
+ <QRD.7.1>1</QRD.7.1>
71
+ <QRD.7.2>RD</QRD.7.2>
72
+ </QRD.7>
73
+ <QRD.8>
74
+ <QRD.8.1>1234unknown</QRD.8.1>
75
+ </QRD.8>
76
+ <QRD.9>
77
+ <QRD.9.1>DEM</QRD.9.1>
78
+ </QRD.9>
79
+ </QRD>
80
+ </HL7Message>
@@ -25,4 +25,13 @@ describe 'Fetching A19 from EPIC' do
25
25
  it { expect(subject[:gender]).to eq('M') }
26
26
  it { expect(subject[:phone_cell]).to eq('0667895432') }
27
27
  end
28
+
29
+ describe 'patient not found' do
30
+ before { load_fixture 'epic_not_found', '1234unknown' }
31
+ subject { Roqua::Healthy::A19.fetch("1234unknown") }
32
+
33
+ it 'raises PatientNotFound' do
34
+ expect { subject }.to raise_error(Roqua::Healthy::PatientNotFound)
35
+ end
36
+ end
28
37
  end
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.3
4
+ version: 1.5.4
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: 2017-11-14 00:00:00.000000000 Z
14
+ date: 2017-12-01 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport
@@ -48,47 +48,61 @@ dependencies:
48
48
  - !ruby/object:Gem::Version
49
49
  version: '2.3'
50
50
  - !ruby/object:Gem::Dependency
51
- name: roqua-support
51
+ name: builder
52
52
  requirement: !ruby/object:Gem::Requirement
53
53
  requirements:
54
- - - "~>"
54
+ - - ">="
55
55
  - !ruby/object:Gem::Version
56
- version: 0.1.22
56
+ version: '0'
57
57
  type: :runtime
58
58
  prerelease: false
59
59
  version_requirements: !ruby/object:Gem::Requirement
60
60
  requirements:
61
- - - "~>"
61
+ - - ">="
62
62
  - !ruby/object:Gem::Version
63
- version: 0.1.22
63
+ version: '0'
64
64
  - !ruby/object:Gem::Dependency
65
- name: builder
65
+ name: rest-client
66
66
  requirement: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - ">="
69
69
  - !ruby/object:Gem::Version
70
- version: '0'
70
+ version: 2.0.2
71
71
  type: :runtime
72
72
  prerelease: false
73
73
  version_requirements: !ruby/object:Gem::Requirement
74
74
  requirements:
75
75
  - - ">="
76
76
  - !ruby/object:Gem::Version
77
- version: '0'
77
+ version: 2.0.2
78
78
  - !ruby/object:Gem::Dependency
79
- name: rest-client
79
+ name: roqua-support
80
80
  requirement: !ruby/object:Gem::Requirement
81
81
  requirements:
82
- - - ">="
82
+ - - "~>"
83
83
  - !ruby/object:Gem::Version
84
- version: 2.0.2
84
+ version: 0.1.22
85
85
  type: :runtime
86
86
  prerelease: false
87
87
  version_requirements: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - "~>"
90
+ - !ruby/object:Gem::Version
91
+ version: 0.1.22
92
+ - !ruby/object:Gem::Dependency
93
+ name: appraisal
94
+ requirement: !ruby/object:Gem::Requirement
88
95
  requirements:
89
96
  - - ">="
90
97
  - !ruby/object:Gem::Version
91
- version: 2.0.2
98
+ version: '0'
99
+ type: :development
100
+ prerelease: false
101
+ version_requirements: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ version: '0'
92
106
  - !ruby/object:Gem::Dependency
93
107
  name: bundler
94
108
  requirement: !ruby/object:Gem::Requirement
@@ -146,33 +160,33 @@ dependencies:
146
160
  - !ruby/object:Gem::Version
147
161
  version: '0.8'
148
162
  - !ruby/object:Gem::Dependency
149
- name: appraisal
163
+ name: webmock
150
164
  requirement: !ruby/object:Gem::Requirement
151
165
  requirements:
152
- - - ">="
166
+ - - "~>"
153
167
  - !ruby/object:Gem::Version
154
- version: '0'
168
+ version: '1.13'
155
169
  type: :development
156
170
  prerelease: false
157
171
  version_requirements: !ruby/object:Gem::Requirement
158
172
  requirements:
159
- - - ">="
173
+ - - "~>"
160
174
  - !ruby/object:Gem::Version
161
- version: '0'
175
+ version: '1.13'
162
176
  - !ruby/object:Gem::Dependency
163
- name: webmock
177
+ name: fuubar
164
178
  requirement: !ruby/object:Gem::Requirement
165
179
  requirements:
166
- - - "~>"
180
+ - - ">="
167
181
  - !ruby/object:Gem::Version
168
- version: '1.13'
182
+ version: '0'
169
183
  type: :development
170
184
  prerelease: false
171
185
  version_requirements: !ruby/object:Gem::Requirement
172
186
  requirements:
173
- - - "~>"
187
+ - - ">="
174
188
  - !ruby/object:Gem::Version
175
- version: '1.13'
189
+ version: '0'
176
190
  - !ruby/object:Gem::Dependency
177
191
  name: guard
178
192
  requirement: !ruby/object:Gem::Requirement
@@ -202,33 +216,33 @@ dependencies:
202
216
  - !ruby/object:Gem::Version
203
217
  version: 4.2.4
204
218
  - !ruby/object:Gem::Dependency
205
- name: listen
219
+ name: guard-rubocop
206
220
  requirement: !ruby/object:Gem::Requirement
207
221
  requirements:
208
222
  - - "~>"
209
223
  - !ruby/object:Gem::Version
210
- version: '2.1'
224
+ version: 1.2.0
211
225
  type: :development
212
226
  prerelease: false
213
227
  version_requirements: !ruby/object:Gem::Requirement
214
228
  requirements:
215
229
  - - "~>"
216
230
  - !ruby/object:Gem::Version
217
- version: '2.1'
231
+ version: 1.2.0
218
232
  - !ruby/object:Gem::Dependency
219
- name: guard-rubocop
233
+ name: listen
220
234
  requirement: !ruby/object:Gem::Requirement
221
235
  requirements:
222
236
  - - "~>"
223
237
  - !ruby/object:Gem::Version
224
- version: 1.2.0
238
+ version: '2.1'
225
239
  type: :development
226
240
  prerelease: false
227
241
  version_requirements: !ruby/object:Gem::Requirement
228
242
  requirements:
229
243
  - - "~>"
230
244
  - !ruby/object:Gem::Version
231
- version: 1.2.0
245
+ version: '2.1'
232
246
  - !ruby/object:Gem::Dependency
233
247
  name: rubocop
234
248
  requirement: !ruby/object:Gem::Requirement
@@ -257,20 +271,6 @@ dependencies:
257
271
  - - ">="
258
272
  - !ruby/object:Gem::Version
259
273
  version: '0'
260
- - !ruby/object:Gem::Dependency
261
- name: fuubar
262
- requirement: !ruby/object:Gem::Requirement
263
- requirements:
264
- - - ">="
265
- - !ruby/object:Gem::Version
266
- version: '0'
267
- type: :development
268
- prerelease: false
269
- version_requirements: !ruby/object:Gem::Requirement
270
- requirements:
271
- - - ">="
272
- - !ruby/object:Gem::Version
273
- version: '0'
274
274
  - !ruby/object:Gem::Dependency
275
275
  name: kramdown
276
276
  requirement: !ruby/object:Gem::Requirement
@@ -340,6 +340,7 @@ files:
340
340
  - spec/fixtures/cdis_piet_fictief.xml
341
341
  - spec/fixtures/comez_patient.xml
342
342
  - spec/fixtures/epic_no_gender.xml
343
+ - spec/fixtures/epic_not_found.xml
343
344
  - spec/fixtures/epic_test_client.xml
344
345
  - spec/fixtures/ggzwnb_patient.xml
345
346
  - spec/fixtures/medoq_patient.xml
@@ -416,6 +417,7 @@ test_files:
416
417
  - spec/fixtures/cdis_piet_fictief.xml
417
418
  - spec/fixtures/comez_patient.xml
418
419
  - spec/fixtures/epic_no_gender.xml
420
+ - spec/fixtures/epic_not_found.xml
419
421
  - spec/fixtures/epic_test_client.xml
420
422
  - spec/fixtures/ggzwnb_patient.xml
421
423
  - spec/fixtures/medoq_patient.xml