roqua-healthy 1.3.0 → 1.4.1

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: 9ff4a97efc58761feb58074e8f2397fdf1d230d9
4
- data.tar.gz: ef110661366ef0f971a9733dd612ebacec81c449
3
+ metadata.gz: 39f21c6bcae40ed59b803b401a701e3c723439aa
4
+ data.tar.gz: 9891fd9124f1a3cff3535b2087d00469bf8c145e
5
5
  SHA512:
6
- metadata.gz: b13861585d59cb28ac01296809add15975eff23b0debaad8f1552e1d9a8710e2fb6c6f7a17055ee810186ac340c4f98f7bf5b389d8a54409edb9ae87516f66eb
7
- data.tar.gz: baba4197d68428907f73fe29c0e98816f7a13d43162442853dbe06026ec723b53c466e85d5a4638d6db5a847f02f0f3c0ca14d6cb1e899c5f7f2dd666b6d21d3
6
+ metadata.gz: 57aa14a76998f9d476381c7ec25e3025b7b65c1bea4b422bf9a3a03a09da6cd656e41521b635dd06bfcced102d249b0673269ca63570823549cac20bd89b6dfe
7
+ data.tar.gz: 8e131bf0eb6ae620ccf41ea64473fa89601d45f5bfd5a6efc08debb43a4c9c4cad47d30136cef12485bce1f849fbacce2c513dbc57d2ca8cce9f14c22e91a7b1
data/.rubocop_todo.yml CHANGED
@@ -8,12 +8,12 @@
8
8
 
9
9
  # Offense count: 7
10
10
  Metrics/AbcSize:
11
- Max: 26
11
+ Max: 28
12
12
 
13
13
  # Offense count: 1
14
14
  # Configuration parameters: CountComments.
15
15
  Metrics/ClassLength:
16
- Max: 103
16
+ Max: 104
17
17
 
18
18
  # Offense count: 80
19
19
  # Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
@@ -17,6 +17,11 @@ module Roqua
17
17
  def lastname
18
18
  names[:legal].fetch('PID.5.1').fetch('PID.5.1.1')
19
19
  end
20
+
21
+ def nickname
22
+ return unless names[:nick]
23
+ names[:nick].fetch('PID.5.2')
24
+ end
20
25
  end
21
26
  end
22
27
  end
@@ -9,6 +9,11 @@ module Roqua
9
9
  def lastname
10
10
  names[:legal].fetch('PID.5.1').fetch('PID.5.1.1')
11
11
  end
12
+
13
+ def nickname
14
+ return unless names[:nick]
15
+ names[:nick].fetch('PID.5.2')
16
+ end
12
17
  end
13
18
  end
14
19
  end
@@ -28,6 +28,10 @@ module Roqua
28
28
  names[:display].fetch('PID.5.1')
29
29
  end
30
30
 
31
+ def nickname
32
+ firstname
33
+ end
34
+
31
35
  private
32
36
 
33
37
  def names
@@ -28,6 +28,7 @@ module Roqua
28
28
  initials: name.initials,
29
29
  lastname: name.lastname,
30
30
  display_name: name.display_name,
31
+ nickname: name.nickname,
31
32
  email: email,
32
33
  address_type: address.address_type,
33
34
  street: address.street,
@@ -93,16 +94,16 @@ module Roqua
93
94
  # this is a heuristic to pick likely dutch cell phone numbers
94
95
  # out of the hl7 messages we receive
95
96
  def phone_cell
96
- pid_13 = message.fetch('PID').fetch('PID.13')
97
+ pid13 = message.fetch('PID').fetch('PID.13')
97
98
 
98
99
  # prefer PRN (Primary Residence Number) that contains a cell phone number
99
- phone_cell_record = pid_13.find do |record|
100
+ phone_cell_record = pid13.find do |record|
100
101
  phone_cell_number?(record.fetch('PID.13.1', '') || '') &&
101
102
  record.fetch('PID.13.2', :unknown_type_of_phone_record) == 'PRN'
102
103
  end
103
104
 
104
105
  # otherwise choose the first occuring cell phone number
105
- phone_cell_record ||= pid_13.find do |record|
106
+ phone_cell_record ||= pid13.find do |record|
106
107
  phone_cell_number?(record.fetch('PID.13.1', '') || '')
107
108
  end
108
109
 
@@ -1,6 +1,6 @@
1
1
  module Roqua
2
2
  module Healthy
3
3
  # healthy version
4
- VERSION = "1.3.0".freeze
4
+ VERSION = "1.4.1".freeze
5
5
  end
6
6
  end
@@ -0,0 +1,480 @@
1
+ <?xml version="1.0"?>
2
+ <HL7Message>
3
+ <MSH>
4
+ <MSH.1>|</MSH.1>
5
+ <MSH.2>^~\&amp;</MSH.2>
6
+ <MSH.3>
7
+ <MSH.3.1>CDIS</MSH.3.1>
8
+ </MSH.3>
9
+ <MSH.4>
10
+ <MSH.4.1>UMCG</MSH.4.1>
11
+ </MSH.4>
12
+ <MSH.5>
13
+ <MSH.5.1>ROQUA</MSH.5.1>
14
+ </MSH.5>
15
+ <MSH.6>
16
+ <MSH.6.1>RGOC</MSH.6.1>
17
+ </MSH.6>
18
+ <MSH.7>
19
+ <MSH.7.1>20161011171812</MSH.7.1>
20
+ </MSH.7>
21
+ <MSH.8/>
22
+ <MSH.9>
23
+ <MSH.9.1>ADR</MSH.9.1>
24
+ <MSH.9.2>A19</MSH.9.2>
25
+ <MSH.9.3>ADR_A19</MSH.9.3>
26
+ </MSH.9>
27
+ <MSH.10>
28
+ <MSH.10.1>2079795</MSH.10.1>
29
+ </MSH.10>
30
+ <MSH.11>
31
+ <MSH.11.1>P</MSH.11.1>
32
+ </MSH.11>
33
+ <MSH.12>
34
+ <MSH.12.1>2.4</MSH.12.1>
35
+ </MSH.12>
36
+ <MSH.13/>
37
+ <MSH.14/>
38
+ <MSH.15>
39
+ <MSH.15.1>NE</MSH.15.1>
40
+ </MSH.15>
41
+ <MSH.16>
42
+ <MSH.16.1>NE</MSH.16.1>
43
+ </MSH.16>
44
+ </MSH>
45
+ <MSA>
46
+ <MSA.1>
47
+ <MSA.1.1>CA</MSA.1.1>
48
+ </MSA.1>
49
+ <MSA.2>
50
+ <MSA.2.1>02b688960d</MSA.2.1>
51
+ </MSA.2>
52
+ </MSA>
53
+ <QRD>
54
+ <QRD.1>
55
+ <QRD.1.1>20161011000000</QRD.1.1>
56
+ </QRD.1>
57
+ <QRD.2>
58
+ <QRD.2.1>R</QRD.2.1>
59
+ </QRD.2>
60
+ <QRD.3>
61
+ <QRD.3.1>I</QRD.3.1>
62
+ </QRD.3>
63
+ <QRD.4>
64
+ <QRD.4.1>02b688960d</QRD.4.1>
65
+ </QRD.4>
66
+ <QRD.5/>
67
+ <QRD.6/>
68
+ <QRD.7>
69
+ <QRD.7.1>1</QRD.7.1>
70
+ <QRD.7.2>RD</QRD.7.2>
71
+ </QRD.7>
72
+ <QRD.8>
73
+ <QRD.8.1>1234567</QRD.8.1>
74
+ </QRD.8>
75
+ <QRD.9>
76
+ <QRD.9.1>DEM</QRD.9.1>
77
+ </QRD.9>
78
+ </QRD>
79
+ <PID>
80
+ <PID.1>
81
+ <PID.1.1>1</PID.1.1>
82
+ </PID.1>
83
+ <PID.2/>
84
+ <PID.3>
85
+ <PID.3.1>1234567</PID.3.1>
86
+ <PID.3.2/>
87
+ <PID.3.3/>
88
+ <PID.3.4></PID.3.4>
89
+ <PID.3.5>PI</PID.3.5>
90
+ </PID.3>
91
+ <PID.3>
92
+ <PID.3.1>123456789</PID.3.1>
93
+ <PID.3.2/>
94
+ <PID.3.3/>
95
+ <PID.3.4></PID.3.4>
96
+ <PID.3.5>NNNLD</PID.3.5>
97
+ <PID.3.6/>
98
+ <PID.3.7></PID.3.7>
99
+ </PID.3>
100
+ <PID.3>
101
+ <PID.3.1>""</PID.3.1>
102
+ <PID.3.2/>
103
+ <PID.3.3/>
104
+ <PID.3.4/>
105
+ <PID.3.5>IBAN</PID.3.5>
106
+ </PID.3>
107
+ <PID.3>
108
+ <PID.3.1>""</PID.3.1>
109
+ <PID.3.2/>
110
+ <PID.3.3/>
111
+ <PID.3.4>GIRO</PID.3.4>
112
+ <PID.3.5>BA</PID.3.5>
113
+ </PID.3>
114
+ <PID.3>
115
+ <PID.3.1>""</PID.3.1>
116
+ <PID.3.2/>
117
+ <PID.3.3/>
118
+ <PID.3.4>BANK</PID.3.4>
119
+ <PID.3.5>BA</PID.3.5>
120
+ </PID.3>
121
+ <PID.4/>
122
+ <PID.5>
123
+ <PID.5.1>
124
+ <PID.5.1.1>Geit</PID.5.1.1>
125
+ <PID.5.1.2>""</PID.5.1.2>
126
+ <PID.5.1.3>Geit</PID.5.1.3>
127
+ <PID.5.1.4>""</PID.5.1.4>
128
+ <PID.5.1.5>""</PID.5.1.5>
129
+ </PID.5.1>
130
+ <PID.5.2>G</PID.5.2>
131
+ <PID.5.3>M</PID.5.3>
132
+ <PID.5.4/>
133
+ <PID.5.5/>
134
+ <PID.5.6/>
135
+ <PID.5.7>L</PID.5.7>
136
+ </PID.5>
137
+ <PID.5>
138
+ <PID.5.1>Geit</PID.5.1>
139
+ <PID.5.2/>
140
+ <PID.5.3/>
141
+ <PID.5.4/>
142
+ <PID.5.5/>
143
+ <PID.5.6/>
144
+ <PID.5.7>D</PID.5.7>
145
+ </PID.5>
146
+ <PID.5>
147
+ <PID.5.1/>
148
+ <PID.5.2>Gerda</PID.5.2>
149
+ <PID.5.3/>
150
+ <PID.5.4/>
151
+ <PID.5.5/>
152
+ <PID.5.6/>
153
+ <PID.5.7>N</PID.5.7>
154
+ </PID.5>
155
+ <PID.6/>
156
+ <PID.7>
157
+ <PID.7.1>19880101</PID.7.1>
158
+ </PID.7>
159
+ <PID.8>
160
+ <PID.8.1>F</PID.8.1>
161
+ </PID.8>
162
+ <PID.9/>
163
+ <PID.10/>
164
+ <PID.11/>
165
+ <PID.11>
166
+ <PID.11.1>
167
+ <PID.11.1.1>Wegweg 1</PID.11.1.1>
168
+ <PID.11.1.2>Wegweg</PID.11.1.2>
169
+ <PID.11.1.3>33</PID.11.1.3>
170
+ </PID.11.1>
171
+ <PID.11.2>""</PID.11.2>
172
+ <PID.11.3>Dorp</PID.11.3>
173
+ <PID.11.4/>
174
+ <PID.11.5>1234AB</PID.11.5>
175
+ <PID.11.6>6030</PID.11.6>
176
+ <PID.11.7>H</PID.11.7>
177
+ </PID.11>
178
+ <PID.11>
179
+ <PID.11.1>
180
+ <PID.11.1.1/>
181
+ <PID.11.1.2>""</PID.11.1.2>
182
+ <PID.11.1.3>""</PID.11.1.3>
183
+ </PID.11.1>
184
+ <PID.11.2>""</PID.11.2>
185
+ <PID.11.3>CITY</PID.11.3>
186
+ <PID.11.4/>
187
+ <PID.11.5>""</PID.11.5>
188
+ <PID.11.6>6030</PID.11.6>
189
+ <PID.11.7>N</PID.11.7>
190
+ </PID.11>
191
+ <PID.11>
192
+ <PID.11.1>
193
+ <PID.11.1.1/>
194
+ <PID.11.1.2>""</PID.11.1.2>
195
+ <PID.11.1.3>""</PID.11.1.3>
196
+ </PID.11.1>
197
+ <PID.11.2>""</PID.11.2>
198
+ <PID.11.3>""</PID.11.3>
199
+ <PID.11.4/>
200
+ <PID.11.5>""</PID.11.5>
201
+ <PID.11.6>""</PID.11.6>
202
+ <PID.11.7>C</PID.11.7>
203
+ </PID.11>
204
+ <PID.12/>
205
+ <PID.13>
206
+ <PID.13.1>06 1234 5678</PID.13.1>
207
+ <PID.13.2>PRN</PID.13.2>
208
+ <PID.13.3>PH</PID.13.3>
209
+ </PID.13>
210
+ <PID.13>
211
+ <PID.13.1>""</PID.13.1>
212
+ <PID.13.2>ORN</PID.13.2>
213
+ <PID.13.3>PH</PID.13.3>
214
+ </PID.13>
215
+ <PID.13>
216
+ <PID.13.1>""</PID.13.1>
217
+ <PID.13.2>ORN</PID.13.2>
218
+ <PID.13.3>FX</PID.13.3>
219
+ </PID.13>
220
+ <PID.13>
221
+ <PID.13.1>""</PID.13.1>
222
+ <PID.13.2>NET</PID.13.2>
223
+ <PID.13.3>Internet</PID.13.3>
224
+ </PID.13>
225
+ <PID.14/>
226
+ <PID.15/>
227
+ <PID.16/>
228
+ <PID.17/>
229
+ <PID.18/>
230
+ <PID.19/>
231
+ <PID.20/>
232
+ <PID.21/>
233
+ <PID.22/>
234
+ <PID.23/>
235
+ <PID.24/>
236
+ <PID.25/>
237
+ <PID.26>
238
+ <PID.26.1>""</PID.26.1>
239
+ </PID.26>
240
+ <PID.27/>
241
+ <PID.28/>
242
+ <PID.29>
243
+ <PID.29.1>""</PID.29.1>
244
+ </PID.29>
245
+ <PID.30>
246
+ <PID.30.1>N</PID.30.1>
247
+ </PID.30>
248
+ <PID.31>
249
+ <PID.31.1>N</PID.31.1>
250
+ </PID.31>
251
+ </PID>
252
+ <ROL>
253
+ <ROL.1/>
254
+ <ROL.2>
255
+ <ROL.2.1>UP</ROL.2.1>
256
+ </ROL.2>
257
+ <ROL.3>
258
+ <ROL.3.1>PP</ROL.3.1>
259
+ </ROL.3>
260
+ <ROL.4>
261
+ <ROL.4.1>APOTHEEK</ROL.4.1>
262
+ <ROL.4.2>
263
+ <ROL.4.2.1/>
264
+ <ROL.4.2.2/>
265
+ <ROL.4.2.3>Apotheek</ROL.4.2.3>
266
+ </ROL.4.2>
267
+ <ROL.4.3/>
268
+ <ROL.4.4/>
269
+ <ROL.4.5/>
270
+ <ROL.4.6/>
271
+ <ROL.4.7/>
272
+ <ROL.4.8>P</ROL.4.8>
273
+ <ROL.4.9>LOCAL</ROL.4.9>
274
+ </ROL.4>
275
+ <ROL.5/>
276
+ <ROL.6/>
277
+ <ROL.7/>
278
+ <ROL.8/>
279
+ <ROL.9>
280
+ <ROL.9.1>02</ROL.9.1>
281
+ <ROL.9.2/>
282
+ <ROL.9.3>VEKTIS</ROL.9.3>
283
+ </ROL.9>
284
+ </ROL>
285
+ <ROL>
286
+ <ROL.1/>
287
+ <ROL.2>
288
+ <ROL.2.1>UP</ROL.2.1>
289
+ </ROL.2>
290
+ <ROL.3>
291
+ <ROL.3.1>PP</ROL.3.1>
292
+ </ROL.3>
293
+ <ROL.4>
294
+ <ROL.4.1>ARTS</ROL.4.1>
295
+ <ROL.4.2>
296
+ <ROL.4.2.1/>
297
+ <ROL.4.2.2/>
298
+ <ROL.4.2.3>Arts</ROL.4.2.3>
299
+ </ROL.4.2>
300
+ <ROL.4.3>A</ROL.4.3>
301
+ <ROL.4.4>B C</ROL.4.4>
302
+ <ROL.4.5/>
303
+ <ROL.4.6/>
304
+ <ROL.4.7/>
305
+ <ROL.4.8>H</ROL.4.8>
306
+ <ROL.4.9>LOCAL</ROL.4.9>
307
+ </ROL.4>
308
+ <ROL.5/>
309
+ <ROL.6/>
310
+ <ROL.7/>
311
+ <ROL.8/>
312
+ <ROL.9>
313
+ <ROL.9.1>01</ROL.9.1>
314
+ <ROL.9.2/>
315
+ <ROL.9.3>VEKTIS</ROL.9.3>
316
+ </ROL.9>
317
+ </ROL>
318
+ <PV1>
319
+ <PV1.1/>
320
+ <PV1.2>
321
+ <PV1.2.1>I</PV1.2.1>
322
+ </PV1.2>
323
+ <PV1.3>
324
+ <PV1.3.1>1234</PV1.3.1>
325
+ <PV1.3.2>BLA 1</PV1.3.2>
326
+ <PV1.3.3>""</PV1.3.3>
327
+ <PV1.3.4>""</PV1.3.4>
328
+ </PV1.3>
329
+ <PV1.4>
330
+ <PV1.4.1>R</PV1.4.1>
331
+ </PV1.4>
332
+ <PV1.5/>
333
+ <PV1.6/>
334
+ <PV1.7/>
335
+ <PV1.8/>
336
+ <PV1.9/>
337
+ <PV1.10/>
338
+ <PV1.11/>
339
+ <PV1.12/>
340
+ <PV1.13/>
341
+ <PV1.14/>
342
+ <PV1.15/>
343
+ <PV1.16/>
344
+ <PV1.17/>
345
+ <PV1.18/>
346
+ <PV1.19>
347
+ <PV1.19.1>12345</PV1.19.1>
348
+ </PV1.19>
349
+ <PV1.20/>
350
+ <PV1.21/>
351
+ <PV1.22/>
352
+ <PV1.23/>
353
+ <PV1.24/>
354
+ <PV1.25/>
355
+ <PV1.26/>
356
+ <PV1.27/>
357
+ <PV1.28/>
358
+ <PV1.29/>
359
+ <PV1.30/>
360
+ <PV1.31/>
361
+ <PV1.32/>
362
+ <PV1.33/>
363
+ <PV1.34/>
364
+ <PV1.35/>
365
+ <PV1.36/>
366
+ <PV1.37/>
367
+ <PV1.38/>
368
+ <PV1.39/>
369
+ <PV1.40/>
370
+ <PV1.41/>
371
+ <PV1.42/>
372
+ <PV1.43/>
373
+ <PV1.44>
374
+ <PV1.44.1>201600101110000</PV1.44.1>
375
+ </PV1.44>
376
+ <PV1.45>
377
+ <PV1.45.1>""</PV1.45.1>
378
+ </PV1.45>
379
+ <PV1.46/>
380
+ <PV1.47/>
381
+ <PV1.48/>
382
+ <PV1.49/>
383
+ <PV1.50/>
384
+ <PV1.51>
385
+ <PV1.51.1>V</PV1.51.1>
386
+ </PV1.51>
387
+ </PV1>
388
+ <PV2>
389
+ <PV2.1/>
390
+ <PV2.2/>
391
+ <PV2.3/>
392
+ <PV2.4/>
393
+ <PV2.5/>
394
+ <PV2.6/>
395
+ <PV2.7/>
396
+ <PV2.8/>
397
+ <PV2.9/>
398
+ <PV2.10/>
399
+ <PV2.11/>
400
+ <PV2.12/>
401
+ <PV2.13/>
402
+ <PV2.14/>
403
+ <PV2.15/>
404
+ <PV2.16/>
405
+ <PV2.17/>
406
+ <PV2.18/>
407
+ <PV2.19/>
408
+ <PV2.20/>
409
+ <PV2.21/>
410
+ <PV2.22/>
411
+ <PV2.23/>
412
+ <PV2.24/>
413
+ <PV2.25/>
414
+ <PV2.26/>
415
+ <PV2.27/>
416
+ <PV2.28/>
417
+ <PV2.29/>
418
+ <PV2.30/>
419
+ <PV2.31/>
420
+ <PV2.32/>
421
+ <PV2.33>
422
+ <PV2.33.1>""</PV2.33.1>
423
+ </PV2.33>
424
+ </PV2>
425
+ <IN1>
426
+ <IN1.1>
427
+ <IN1.1.1>1</IN1.1.1>
428
+ </IN1.1>
429
+ <IN1.2>
430
+ <IN1.2.1>""</IN1.2.1>
431
+ </IN1.2>
432
+ <IN1.3>
433
+ <IN1.3.1>ABC</IN1.3.1>
434
+ <IN1.3.2/>
435
+ <IN1.3.3/>
436
+ <IN1.3.4>LOCAL</IN1.3.4>
437
+ </IN1.3>
438
+ <IN1.4>
439
+ <IN1.4.1>Stichting Ziekenfonds ABC</IN1.4.1>
440
+ </IN1.4>
441
+ <IN1.5/>
442
+ <IN1.6/>
443
+ <IN1.7/>
444
+ <IN1.8/>
445
+ <IN1.9/>
446
+ <IN1.10/>
447
+ <IN1.11/>
448
+ <IN1.12>
449
+ <IN1.12.1>20060101</IN1.12.1>
450
+ </IN1.12>
451
+ <IN1.13>
452
+ <IN1.13.1>""</IN1.13.1>
453
+ </IN1.13>
454
+ <IN1.14/>
455
+ <IN1.15/>
456
+ <IN1.16/>
457
+ <IN1.17/>
458
+ <IN1.18/>
459
+ <IN1.19/>
460
+ <IN1.20/>
461
+ <IN1.21/>
462
+ <IN1.22/>
463
+ <IN1.23/>
464
+ <IN1.24/>
465
+ <IN1.25/>
466
+ <IN1.26/>
467
+ <IN1.27/>
468
+ <IN1.28/>
469
+ <IN1.29/>
470
+ <IN1.30/>
471
+ <IN1.31/>
472
+ <IN1.32/>
473
+ <IN1.33/>
474
+ <IN1.34/>
475
+ <IN1.35/>
476
+ <IN1.36>
477
+ <IN1.36.1>1234567890</IN1.36.1>
478
+ </IN1.36>
479
+ </IN1>
480
+ </HL7Message>
@@ -13,6 +13,7 @@ describe 'Fetching A19 from CDIS' do
13
13
  it { expect(subject[:initials]).to eq('J.A.B.C.') }
14
14
  it { expect(subject[:lastname]).to eq('Fictief') }
15
15
  it { expect(subject[:display_name]).to be_nil }
16
+ it { expect(subject[:nickname]).to be_nil }
16
17
  it { expect(subject[:email]).to be_nil }
17
18
  it { expect(subject[:address_type]).to eq('M') }
18
19
  it { expect(subject[:street]).to eq('-Hanzepleinfout 1') }
@@ -36,6 +37,7 @@ describe 'Fetching A19 from CDIS' do
36
37
  it { expect(subject[:initials]).to eq('P.X.X.X.') }
37
38
  it { expect(subject[:lastname]).to eq('Fictief') }
38
39
  it { expect(subject[:display_name]).to be_nil }
40
+ it { expect(subject[:nickname]).to be_nil }
39
41
  it { expect(subject[:email]).to be_nil }
40
42
  it { expect(subject[:address_type]).to eq('M') }
41
43
  it { expect(subject[:street]).to eq('Ziekenhuisplein 1') }
@@ -59,6 +61,7 @@ describe 'Fetching A19 from CDIS' do
59
61
  it { expect(subject[:initials]).to eq('G.') }
60
62
  it { expect(subject[:lastname]).to eq('Geit') }
61
63
  it { expect(subject[:display_name]).to be_nil }
64
+ it { expect(subject[:nickname]).to be_nil }
62
65
  it { expect(subject[:email]).to be_nil }
63
66
  it { expect(subject[:address_type]).to eq('M') }
64
67
  it { expect(subject[:street]).to eq('-Oostersnglfout') }
@@ -82,6 +85,7 @@ describe 'Fetching A19 from CDIS' do
82
85
  it { expect(subject[:initials]).to eq('T.') }
83
86
  it { expect(subject[:lastname]).to eq('Tester') }
84
87
  it { expect(subject[:display_name]).to eq(nil) }
88
+ it { expect(subject[:nickname]).to be_nil }
85
89
  it { expect(subject[:email]).to eq(nil) }
86
90
  it { expect(subject[:address_type]).to eq('M') }
87
91
  it { expect(subject[:street]).to eq(nil) }
@@ -16,6 +16,7 @@ describe 'Fetching A19 from Comez' do
16
16
  it { expect(subject[:initials]).to eq('A') }
17
17
  it { expect(subject[:lastname]).to eq('Achternaam') }
18
18
  it { expect(subject[:display_name]).to be_nil }
19
+ it { expect(subject[:nickname]).to eq('Voornaam') }
19
20
  it { expect(subject[:email]).to be_nil }
20
21
  it { expect(subject[:address_type]).to eq('M') }
21
22
  it { expect(subject[:street]).to eq('Postadresstraat 42') }
@@ -0,0 +1,32 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'Fetching A19 from GGZWNB' do
4
+ describe 'a patient' do
5
+ before { load_fixture 'ggzwnb_patient', '1234567' }
6
+ subject { Roqua::Healthy::A19.fetch("1234567") }
7
+
8
+ it { expect(subject[:status]).to eq('SUCCESS') }
9
+ it { expect(subject[:error]).to be_nil }
10
+ it { expect(subject[:source]).to eq('UMCG') }
11
+ it do
12
+ expect(subject[:identities]).to eq([{ident: '1234567', authority: 'PI'},
13
+ {ident: '123456789', authority: 'NNNLD'}])
14
+ end
15
+ it { expect(subject[:firstname]).to eq('G') }
16
+ it { expect(subject[:initials]).to eq('M') }
17
+ it { expect(subject[:lastname]).to eq('Geit') }
18
+ it { expect(subject[:display_name]).to eq('Geit') }
19
+ it { expect(subject[:nickname]).to eq('Gerda') }
20
+ it { expect(subject[:email]).to be_blank }
21
+ it { expect(subject[:address_type]).to eq('H') }
22
+ it { expect(subject[:street]).to eq('Wegweg 1') }
23
+ it { expect(subject[:city]).to eq('Dorp') }
24
+ it { expect(subject[:zipcode]).to eq('1234AB') }
25
+ it { expect(subject[:country]).to eq('6030') }
26
+ it { expect(subject[:birthdate]).to eq('19880101') }
27
+ it { expect(subject[:gender]).to eq('F') }
28
+ # phone cells with letters are rejected, because it usually means they can not be used as a client's own
29
+ # cell phone number
30
+ it { expect(subject[:phone_cell]).to eq('0612345678') }
31
+ end
32
+ end
@@ -18,6 +18,7 @@ describe 'Fetching A19 from Medoq' do
18
18
  it { expect(subject[:initials]).to eq('J.') }
19
19
  it { expect(subject[:lastname]).to eq('Fictief') }
20
20
  it { expect(subject[:display_name]).to be_nil }
21
+ it { expect(subject[:nickname]).to eq('Jan') }
21
22
  it { expect(subject[:email]).to eq('j.fictief@roqua.nl') }
22
23
  it { expect(subject[:address_type]).to eq('H') }
23
24
  it { expect(subject[:street]).to eq('Thuisstraat 42') }
@@ -13,6 +13,7 @@ describe 'Fetching A19 from USER' do
13
13
  it { expect(subject[:initials]).to eq('E. T.') }
14
14
  it { expect(subject[:lastname]).to eq('de Achternaam') }
15
15
  it { expect(subject[:display_name]).to be_nil }
16
+ it { expect(subject[:nickname]).to eq('Eerste') }
16
17
  it { expect(subject[:email]).to be_nil }
17
18
  it { expect(subject[:address_type]).to eq('L') }
18
19
  it { expect(subject[:street]).to eq('Van Straatstraat 8') }
@@ -36,6 +37,7 @@ describe 'Fetching A19 from USER' do
36
37
  it { expect(subject[:initials]).to eq('D.') }
37
38
  it { expect(subject[:lastname]).to eq('Meisjesnaam-Getrouwdenaam') }
38
39
  it { expect(subject[:display_name]).to be_nil }
40
+ it { expect(subject[:nickname]).to be_nil }
39
41
  it { expect(subject[:email]).to be_nil }
40
42
  it { expect(subject[:address_type]).to eq('L') }
41
43
  it { expect(subject[:street]).to eq('Wegweg 2') }
@@ -59,6 +61,7 @@ describe 'Fetching A19 from USER' do
59
61
  it { expect(subject[:initials]).to eq('V. R.S.') }
60
62
  it { expect(subject[:lastname]).to eq("Achternaam") }
61
63
  it { expect(subject[:display_name]).to be_nil }
64
+ it { expect(subject[:nickname]).to eq('Voornaam') }
62
65
  it { expect(subject[:email]).to eq('test@roqua.nl') }
63
66
  it { expect(subject[:address_type]).to eq('L') }
64
67
  it { expect(subject[:street]).to eq('Straatstraat 9') }
@@ -16,6 +16,7 @@ describe 'Fetching A19 from XMcare' do
16
16
  it { expect(subject[:initials]).to eq('A B') }
17
17
  it { expect(subject[:lastname]).to eq('Achternaam') }
18
18
  it { expect(subject[:display_name]).to eq('Achternaam') }
19
+ it { expect(subject[:nickname]).to eq('Babette') }
19
20
  it { expect(subject[:email]).to eq('') }
20
21
  it { expect(subject[:address_type]).to eq('H') }
21
22
  it { expect(subject[:street]).to eq('Straatnaam 37') }
@@ -42,6 +43,7 @@ describe 'Fetching A19 from XMcare' do
42
43
  it { expect(subject[:initials]).to eq('A B') }
43
44
  it { expect(subject[:lastname]).to eq('Achternaam') }
44
45
  it { expect(subject[:display_name]).to eq('Meisjesnaam - Achternaam') }
46
+ it { expect(subject[:nickname]).to eq('Babette') }
45
47
  it { expect(subject[:email]).to eq('email@example.com') }
46
48
  it { expect(subject[:address_type]).to eq('H') }
47
49
  it { expect(subject[:street]).to eq('Straatnaam 37') }
@@ -68,6 +70,7 @@ describe 'Fetching A19 from XMcare' do
68
70
  it { expect(subject[:initials]).to eq('A B') }
69
71
  it { expect(subject[:lastname]).to eq('Achternaam') }
70
72
  it { expect(subject[:display_name]).to eq('Achternaam') }
73
+ it { expect(subject[:nickname]).to eq('Babette') }
71
74
  it { expect(subject[:email]).to eq('') }
72
75
  it { expect(subject[:address_type]).to eq('H') }
73
76
  it { expect(subject[:street]).to eq('Straatnaam 37') }
@@ -94,6 +97,7 @@ describe 'Fetching A19 from XMcare' do
94
97
  it { expect(subject[:initials]).to eq('A B') }
95
98
  it { expect(subject[:lastname]).to eq('Achternaam') }
96
99
  it { expect(subject[:display_name]).to eq('Achternaam') }
100
+ it { expect(subject[:nickname]).to eq('Babette') }
97
101
  it { expect(subject[:email]).to eq('email@example.com') }
98
102
  it { expect(subject[:address_type]).to eq('H') }
99
103
  it { expect(subject[:street]).to eq('Straatnaam 37') }
@@ -120,6 +124,7 @@ describe 'Fetching A19 from XMcare' do
120
124
  it { expect(subject[:initials]).to eq('B C') }
121
125
  it { expect(subject[:lastname]).to eq('Achternaam') }
122
126
  it { expect(subject[:display_name]).to eq('Achternaam') }
127
+ it { expect(subject[:nickname]).to eq('') }
123
128
  it { expect(subject[:email]).to eq('') }
124
129
  it { expect(subject[:address_type]).to eq('H') }
125
130
  it { expect(subject[:street]).to eq('Straatnaam 37 h-42') }
@@ -146,6 +151,7 @@ describe 'Fetching A19 from XMcare' do
146
151
  it { expect(subject[:initials]).to eq('V') }
147
152
  it { expect(subject[:lastname]).to eq('Achternom') }
148
153
  it { expect(subject[:display_name]).to eq('Achternom') }
154
+ it { expect(subject[:nickname]).to eq('Voorname') }
149
155
  it { expect(subject[:email]).to eq('support@roqua.nl') }
150
156
  it { expect(subject[:address_type]).to eq('H') }
151
157
  it { expect(subject[:street]).to eq('Straat 8') }
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.3.0
4
+ version: 1.4.1
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: 2016-06-30 00:00:00.000000000 Z
14
+ date: 2016-10-17 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport
@@ -275,6 +275,7 @@ files:
275
275
  - spec/fixtures/cdis_missing_address.xml
276
276
  - spec/fixtures/cdis_piet_fictief.xml
277
277
  - spec/fixtures/comez_patient.xml
278
+ - spec/fixtures/ggzwnb_patient.xml
278
279
  - spec/fixtures/medoq_patient.xml
279
280
  - spec/fixtures/oru-requests/spsy1218j.hl7
280
281
  - spec/fixtures/oru-requests/spsy1218o.hl7
@@ -302,6 +303,7 @@ files:
302
303
  - spec/healthy_spec.rb
303
304
  - spec/integration/cdis_spec.rb
304
305
  - spec/integration/comez_spec.rb
306
+ - spec/integration/ggzwnb_spec.rb
305
307
  - spec/integration/medo_spec.rb
306
308
  - spec/integration/mirth_spec.rb
307
309
  - spec/integration/user_spec.rb
@@ -334,7 +336,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
334
336
  version: '0'
335
337
  requirements: []
336
338
  rubyforge_project:
337
- rubygems_version: 2.4.8
339
+ rubygems_version: 2.6.6
338
340
  signing_key:
339
341
  specification_version: 4
340
342
  summary: Arranges communication between Mirth and RoQua
@@ -344,6 +346,7 @@ test_files:
344
346
  - spec/fixtures/cdis_missing_address.xml
345
347
  - spec/fixtures/cdis_piet_fictief.xml
346
348
  - spec/fixtures/comez_patient.xml
349
+ - spec/fixtures/ggzwnb_patient.xml
347
350
  - spec/fixtures/medoq_patient.xml
348
351
  - spec/fixtures/oru-requests/spsy1218j.hl7
349
352
  - spec/fixtures/oru-requests/spsy1218o.hl7
@@ -371,6 +374,7 @@ test_files:
371
374
  - spec/healthy_spec.rb
372
375
  - spec/integration/cdis_spec.rb
373
376
  - spec/integration/comez_spec.rb
377
+ - spec/integration/ggzwnb_spec.rb
374
378
  - spec/integration/medo_spec.rb
375
379
  - spec/integration/mirth_spec.rb
376
380
  - spec/integration/user_spec.rb
@@ -383,4 +387,3 @@ test_files:
383
387
  - spec/unit/a19_spec.rb
384
388
  - spec/unit/client_spec.rb
385
389
  - spec/unit/message_cleaner_spec.rb
386
- has_rdoc: