roqua-healthy 1.2.1 → 1.3.0

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: dc744ebcaa5350b012790082bce06fbfdcee8b50
4
- data.tar.gz: cfe48aa98ec98439b7778fbea68005136fc35b90
3
+ metadata.gz: 9ff4a97efc58761feb58074e8f2397fdf1d230d9
4
+ data.tar.gz: ef110661366ef0f971a9733dd612ebacec81c449
5
5
  SHA512:
6
- metadata.gz: c151b7bad6d9070c4975376e79cdc0fd5400f103f9b3b5db795e9060b0c42641f08abf707b9f1de124be947ee371e2e29fcd385f824e5b0c77f52802f56c896a
7
- data.tar.gz: 1e877165f35a47a7140f7f35a40133ce1b7b24ed6673acad7c8ab09c76214e214bd1b1fe7b21090e312572479a718b440e138189c17c1de80dbee7efb2c58052
6
+ metadata.gz: b13861585d59cb28ac01296809add15975eff23b0debaad8f1552e1d9a8710e2fb6c6f7a17055ee810186ac340c4f98f7bf5b389d8a54409edb9ae87516f66eb
7
+ data.tar.gz: baba4197d68428907f73fe29c0e98816f7a13d43162442853dbe06026ec723b53c466e85d5a4638d6db5a847f02f0f3c0ca14d6cb1e899c5f7f2dd666b6d21d3
data/.rubocop_todo.yml CHANGED
@@ -13,7 +13,7 @@ Metrics/AbcSize:
13
13
  # Offense count: 1
14
14
  # Configuration parameters: CountComments.
15
15
  Metrics/ClassLength:
16
- Max: 102
16
+ Max: 103
17
17
 
18
18
  # Offense count: 80
19
19
  # Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
data/ChangeLog.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 1.3.0
2
+
3
+ * Prefer cell phone numbers in PRN fields over cell phone in ORN fields. All phone numbers not starting with 06, +316 or 00316 after rudimentary sanitation are rejected as cell phone numbers.
4
+
1
5
  ### 1.2.1
2
6
 
3
7
  * Improved heuristic to pick cell phone numbers out of commonly used hl7 messages
@@ -91,29 +91,24 @@ module Roqua
91
91
  end
92
92
 
93
93
  # this is a heuristic to pick likely dutch cell phone numbers
94
- # out of the peculiar hl7 messages we receive
94
+ # out of the hl7 messages we receive
95
95
  def phone_cell
96
96
  pid_13 = message.fetch('PID').fetch('PID.13')
97
97
 
98
- # prefer ORN (Other Residence Number, usually used for cell phone) that contains '06'
98
+ # prefer PRN (Primary Residence Number) that contains a cell phone number
99
99
  phone_cell_record = pid_13.find do |record|
100
- phone_number = record.fetch('PID.13.1', '') || ''
101
- phone_number.start_with?('06') &&
102
- record.fetch('PID.13.2', :unknown_type_of_phone_record) == 'ORN'
100
+ phone_cell_number?(record.fetch('PID.13.1', '') || '') &&
101
+ record.fetch('PID.13.2', :unknown_type_of_phone_record) == 'PRN'
103
102
  end
104
103
 
105
- # otherwise choose the first occuring '06' number
104
+ # otherwise choose the first occuring cell phone number
106
105
  phone_cell_record ||= pid_13.find do |record|
107
- phone_number = record.fetch('PID.13.1', '') || ''
108
- phone_number.start_with?('06')
106
+ phone_cell_number?(record.fetch('PID.13.1', '') || '')
109
107
  end
110
108
 
111
- # in the last case (possibly a +316 number), just choose the ORN number
112
- phone_cell_record ||= pid_13.find do |record|
113
- record.fetch('PID.13.2', :unknown_type_of_phone_record) == 'ORN'
114
- end
109
+ # any number for which phone_cell_number? returns false is ignored
115
110
 
116
- phone_cell_record.try(:fetch, 'PID.13.1', '')
111
+ strip_non_phone_number_characters(phone_cell_record.fetch('PID.13.1')) if phone_cell_record.present?
117
112
  end
118
113
 
119
114
  def gender
@@ -122,6 +117,17 @@ module Roqua
122
117
 
123
118
  private
124
119
 
120
+ # we only strip characters that we can be sure to not matter
121
+ # letters are not stripped since they may be part of a comment, which usually means the
122
+ # phone number is not useable for the purpose of a client's cell phone number
123
+ def strip_non_phone_number_characters(number)
124
+ number.gsub(/[-\s\.]/, '')
125
+ end
126
+
127
+ def phone_cell_number?(number)
128
+ strip_non_phone_number_characters(number) =~ /\A(\+31|0|0031)6\d{8}\z/
129
+ end
130
+
125
131
  def name
126
132
  case source
127
133
  when "UMCG"
@@ -1,6 +1,6 @@
1
1
  module Roqua
2
2
  module Healthy
3
3
  # healthy version
4
- VERSION = "1.2.1".freeze
4
+ VERSION = "1.3.0".freeze
5
5
  end
6
6
  end
@@ -0,0 +1,314 @@
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>XMCARE</MSH.3.1>
8
+ </MSH.3>
9
+ <MSH.4>
10
+ <MSH.4.1>XMCARE</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>20160621111111</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>8000000</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>f00bf00b00</MSA.2.1>
51
+ </MSA.2>
52
+ </MSA>
53
+ <QRD>
54
+ <QRD.1>
55
+ <QRD.1.1>20160621000000</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>f00bf00b00</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>88888888888</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>88888888888</PID.3.1>
86
+ <PID.3.2/>
87
+ <PID.3.3/>
88
+ <PID.3.4>XMCARE</PID.3.4>
89
+ <PID.3.5>PI</PID.3.5>
90
+ </PID.3>
91
+ <PID.3>
92
+ <PID.3.1>222222222</PID.3.1>
93
+ <PID.3.2/>
94
+ <PID.3.3/>
95
+ <PID.3.4>NLMINBIZA</PID.3.4>
96
+ <PID.3.5>NNNLD</PID.3.5>
97
+ <PID.3.6/>
98
+ <PID.3.7>20160101</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>Achternom</PID.5.1.1>
125
+ <PID.5.1.2>""</PID.5.1.2>
126
+ <PID.5.1.3>Achternom</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>V</PID.5.2>
131
+ <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>Achternom</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>Voorname</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>19900101</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>Straat 8</PID.11.1.1>
168
+ <PID.11.1.2>Straat</PID.11.1.2>
169
+ <PID.11.1.3>8</PID.11.1.3>
170
+ </PID.11.1>
171
+ <PID.11.2>""</PID.11.2>
172
+ <PID.11.3>GRONINGEN</PID.11.3>
173
+ <PID.11.4/>
174
+ <PID.11.5>9711CR</PID.11.5>
175
+ <PID.11.6>NED</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>GRONINGEN</PID.11.3>
186
+ <PID.11.4/>
187
+ <PID.11.5>""</PID.11.5>
188
+ <PID.11.6>NED</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>0501234567</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/>
222
+ <PID.13.2>NET</PID.13.2>
223
+ <PID.13.3>Internet</PID.13.3>
224
+ <PID.13.4>support@roqua.nl</PID.13.4>
225
+ </PID.13>
226
+ <PID.14/>
227
+ <PID.15/>
228
+ <PID.16/>
229
+ <PID.17/>
230
+ <PID.18/>
231
+ <PID.19/>
232
+ <PID.20/>
233
+ <PID.21/>
234
+ <PID.22/>
235
+ <PID.23/>
236
+ <PID.24/>
237
+ <PID.25/>
238
+ <PID.26>
239
+ <PID.26.1>""</PID.26.1>
240
+ </PID.26>
241
+ <PID.27/>
242
+ <PID.28/>
243
+ <PID.29>
244
+ <PID.29.1>""</PID.29.1>
245
+ </PID.29>
246
+ <PID.30>
247
+ <PID.30.1>N</PID.30.1>
248
+ </PID.30>
249
+ <PID.31>
250
+ <PID.31.1>N</PID.31.1>
251
+ </PID.31>
252
+ </PID>
253
+ <PV1>
254
+ <PV1.1/>
255
+ <PV1.2>
256
+ <PV1.2.1>O</PV1.2.1>
257
+ </PV1.2>
258
+ </PV1>
259
+ <IN1>
260
+ <IN1.1>
261
+ <IN1.1.1>1</IN1.1.1>
262
+ </IN1.1>
263
+ <IN1.2>
264
+ <IN1.2.1>""</IN1.2.1>
265
+ </IN1.2>
266
+ <IN1.3>
267
+ <IN1.3.1>VERZEKER CODE</IN1.3.1>
268
+ <IN1.3.2/>
269
+ <IN1.3.3/>
270
+ <IN1.3.4>LOCAL</IN1.3.4>
271
+ </IN1.3>
272
+ <IN1.4>
273
+ <IN1.4.1>Verzekeraar Zorgverz</IN1.4.1>
274
+ </IN1.4>
275
+ <IN1.5/>
276
+ <IN1.6/>
277
+ <IN1.7/>
278
+ <IN1.8/>
279
+ <IN1.9/>
280
+ <IN1.10/>
281
+ <IN1.11/>
282
+ <IN1.12>
283
+ <IN1.12.1>20140101</IN1.12.1>
284
+ </IN1.12>
285
+ <IN1.13>
286
+ <IN1.13.1>""</IN1.13.1>
287
+ </IN1.13>
288
+ <IN1.14/>
289
+ <IN1.15/>
290
+ <IN1.16/>
291
+ <IN1.17/>
292
+ <IN1.18/>
293
+ <IN1.19/>
294
+ <IN1.20/>
295
+ <IN1.21/>
296
+ <IN1.22/>
297
+ <IN1.23/>
298
+ <IN1.24/>
299
+ <IN1.25/>
300
+ <IN1.26/>
301
+ <IN1.27/>
302
+ <IN1.28/>
303
+ <IN1.29/>
304
+ <IN1.30/>
305
+ <IN1.31/>
306
+ <IN1.32/>
307
+ <IN1.33/>
308
+ <IN1.34/>
309
+ <IN1.35/>
310
+ <IN1.36>
311
+ <IN1.36.1>111111111</IN1.36.1>
312
+ </IN1.36>
313
+ </IN1>
314
+ </HL7Message>
@@ -0,0 +1,314 @@
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>XMCARE</MSH.3.1>
8
+ </MSH.3>
9
+ <MSH.4>
10
+ <MSH.4.1>XMCARE</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>20160621111111</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>8000000</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>f00bf00b00</MSA.2.1>
51
+ </MSA.2>
52
+ </MSA>
53
+ <QRD>
54
+ <QRD.1>
55
+ <QRD.1.1>20160621000000</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>f00bf00b00</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>88888888888</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>88888888888</PID.3.1>
86
+ <PID.3.2/>
87
+ <PID.3.3/>
88
+ <PID.3.4>XMCARE</PID.3.4>
89
+ <PID.3.5>PI</PID.3.5>
90
+ </PID.3>
91
+ <PID.3>
92
+ <PID.3.1>222222222</PID.3.1>
93
+ <PID.3.2/>
94
+ <PID.3.3/>
95
+ <PID.3.4>NLMINBIZA</PID.3.4>
96
+ <PID.3.5>NNNLD</PID.3.5>
97
+ <PID.3.6/>
98
+ <PID.3.7>20160101</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>Achternom</PID.5.1.1>
125
+ <PID.5.1.2>""</PID.5.1.2>
126
+ <PID.5.1.3>Achternom</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>V</PID.5.2>
131
+ <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>Achternom</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>Voorname</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>19900101</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>Straat 8</PID.11.1.1>
168
+ <PID.11.1.2>Straat</PID.11.1.2>
169
+ <PID.11.1.3>8</PID.11.1.3>
170
+ </PID.11.1>
171
+ <PID.11.2>""</PID.11.2>
172
+ <PID.11.3>GRONINGEN</PID.11.3>
173
+ <PID.11.4/>
174
+ <PID.11.5>9711CR</PID.11.5>
175
+ <PID.11.6>NED</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>GRONINGEN</PID.11.3>
186
+ <PID.11.4/>
187
+ <PID.11.5>""</PID.11.5>
188
+ <PID.11.6>NED</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>""</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>0031612345678</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/>
222
+ <PID.13.2>NET</PID.13.2>
223
+ <PID.13.3>Internet</PID.13.3>
224
+ <PID.13.4>support@roqua.nl</PID.13.4>
225
+ </PID.13>
226
+ <PID.14/>
227
+ <PID.15/>
228
+ <PID.16/>
229
+ <PID.17/>
230
+ <PID.18/>
231
+ <PID.19/>
232
+ <PID.20/>
233
+ <PID.21/>
234
+ <PID.22/>
235
+ <PID.23/>
236
+ <PID.24/>
237
+ <PID.25/>
238
+ <PID.26>
239
+ <PID.26.1>""</PID.26.1>
240
+ </PID.26>
241
+ <PID.27/>
242
+ <PID.28/>
243
+ <PID.29>
244
+ <PID.29.1>""</PID.29.1>
245
+ </PID.29>
246
+ <PID.30>
247
+ <PID.30.1>N</PID.30.1>
248
+ </PID.30>
249
+ <PID.31>
250
+ <PID.31.1>N</PID.31.1>
251
+ </PID.31>
252
+ </PID>
253
+ <PV1>
254
+ <PV1.1/>
255
+ <PV1.2>
256
+ <PV1.2.1>O</PV1.2.1>
257
+ </PV1.2>
258
+ </PV1>
259
+ <IN1>
260
+ <IN1.1>
261
+ <IN1.1.1>1</IN1.1.1>
262
+ </IN1.1>
263
+ <IN1.2>
264
+ <IN1.2.1>""</IN1.2.1>
265
+ </IN1.2>
266
+ <IN1.3>
267
+ <IN1.3.1>VERZEKER CODE</IN1.3.1>
268
+ <IN1.3.2/>
269
+ <IN1.3.3/>
270
+ <IN1.3.4>LOCAL</IN1.3.4>
271
+ </IN1.3>
272
+ <IN1.4>
273
+ <IN1.4.1>Verzekeraar Zorgverz</IN1.4.1>
274
+ </IN1.4>
275
+ <IN1.5/>
276
+ <IN1.6/>
277
+ <IN1.7/>
278
+ <IN1.8/>
279
+ <IN1.9/>
280
+ <IN1.10/>
281
+ <IN1.11/>
282
+ <IN1.12>
283
+ <IN1.12.1>20140101</IN1.12.1>
284
+ </IN1.12>
285
+ <IN1.13>
286
+ <IN1.13.1>""</IN1.13.1>
287
+ </IN1.13>
288
+ <IN1.14/>
289
+ <IN1.15/>
290
+ <IN1.16/>
291
+ <IN1.17/>
292
+ <IN1.18/>
293
+ <IN1.19/>
294
+ <IN1.20/>
295
+ <IN1.21/>
296
+ <IN1.22/>
297
+ <IN1.23/>
298
+ <IN1.24/>
299
+ <IN1.25/>
300
+ <IN1.26/>
301
+ <IN1.27/>
302
+ <IN1.28/>
303
+ <IN1.29/>
304
+ <IN1.30/>
305
+ <IN1.31/>
306
+ <IN1.32/>
307
+ <IN1.33/>
308
+ <IN1.34/>
309
+ <IN1.35/>
310
+ <IN1.36>
311
+ <IN1.36.1>111111111</IN1.36.1>
312
+ </IN1.36>
313
+ </IN1>
314
+ </HL7Message>
@@ -21,7 +21,7 @@ describe 'Fetching A19 from CDIS' do
21
21
  it { expect(subject[:country]).to eq('') }
22
22
  it { expect(subject[:birthdate]).to eq('19800101') }
23
23
  it { expect(subject[:gender]).to eq('M') }
24
- it { expect(subject[:phone_cell]).to eq('06-12345678') }
24
+ it { expect(subject[:phone_cell]).to eq('0612345678') } # - stripped
25
25
  end
26
26
 
27
27
  describe 'the patient Piet Fictief' do
@@ -24,6 +24,8 @@ describe 'Fetching A19 from Comez' do
24
24
  it { expect(subject[:country]).to eq('NL') }
25
25
  it { expect(subject[:birthdate]).to eq('17070415') }
26
26
  it { expect(subject[:gender]).to eq('F') }
27
- it { expect(subject[:phone_cell]).to eq('0612345678mdr') }
27
+ # phone cells with letters are rejected, because it usually means they can not be used as a client's own
28
+ # cell phone number
29
+ it { expect(subject[:phone_cell]).to eq(nil) }
28
30
  end
29
31
  end
@@ -24,7 +24,7 @@ describe 'Fetching A19 from XMcare' do
24
24
  it { expect(subject[:country]).to eq('NL') }
25
25
  it { expect(subject[:birthdate]).to eq('17070415') }
26
26
  it { expect(subject[:gender]).to eq('F') }
27
- it { expect(subject[:phone_cell]).to eq('06-12345678') }
27
+ it { expect(subject[:phone_cell]).to eq('0612345678') } # - stripped
28
28
  end
29
29
 
30
30
  describe 'a patient with a maiden name' do
@@ -50,7 +50,7 @@ describe 'Fetching A19 from XMcare' do
50
50
  it { expect(subject[:country]).to eq('NL') }
51
51
  it { expect(subject[:birthdate]).to eq('17070415') }
52
52
  it { expect(subject[:gender]).to eq('F') }
53
- it { expect(subject[:phone_cell]).to eq('06-12345678') }
53
+ it { expect(subject[:phone_cell]).to eq('0612345678') } # - stripped
54
54
  end
55
55
 
56
56
  describe 'a patient without a known birthdate' do
@@ -76,7 +76,7 @@ describe 'Fetching A19 from XMcare' do
76
76
  it { expect(subject[:country]).to eq('NL') }
77
77
  it { expect(subject[:birthdate]).to be_nil }
78
78
  it { expect(subject[:gender]).to eq('F') }
79
- it { expect(subject[:phone_cell]).to eq('06-12345678') }
79
+ it { expect(subject[:phone_cell]).to eq('0612345678') } # - stripped
80
80
  end
81
81
 
82
82
  describe 'a patient with an email in an alternate place' do
@@ -102,7 +102,7 @@ describe 'Fetching A19 from XMcare' do
102
102
  it { expect(subject[:country]).to eq('NL') }
103
103
  it { expect(subject[:birthdate]).to eq('17070415') }
104
104
  it { expect(subject[:gender]).to eq('F') }
105
- it { expect(subject[:phone_cell]).to eq('06 12 34 56 78') }
105
+ it { expect(subject[:phone_cell]).to eq('0612345678') } # spaces stripped
106
106
  end
107
107
 
108
108
  describe 'a patient from an xmcare instance impersonating cdis' do
@@ -128,10 +128,10 @@ describe 'Fetching A19 from XMcare' do
128
128
  it { expect(subject[:country]).to eq('NLD') }
129
129
  it { expect(subject[:birthdate]).to eq('17070415') }
130
130
  it { expect(subject[:gender]).to eq('M') }
131
- it { expect(subject[:phone_cell]).to eq('06-12345678') }
131
+ it { expect(subject[:phone_cell]).to eq('0612345678') } # - stripped
132
132
  end
133
133
 
134
- describe 'a patient with a 06 cell phone number only in the primary residence number field' do
134
+ describe 'a patient with a cell phone number only in the primary residence number field' do
135
135
  before { load_fixture 'xmcare_phone_cell_in_prn', '88888888888' }
136
136
  subject { Roqua::Healthy::A19.fetch("88888888888") }
137
137
 
@@ -157,12 +157,12 @@ describe 'Fetching A19 from XMcare' do
157
157
  it { expect(subject[:phone_cell]).to eq('0612345678') }
158
158
  end
159
159
 
160
- describe 'a patient with a 06 cell phone number in the both residence number fields' do
160
+ describe 'a patient with a cell phone number in the both residence number fields' do
161
161
  before { load_fixture 'xmcare_phone_cell_in_prn_orn', '88888888888' }
162
162
  subject { Roqua::Healthy::A19.fetch("88888888888") }
163
163
 
164
- it 'prefers the orn cell phone number over the prn' do
165
- expect(subject[:phone_cell]).to eq('0612345678')
164
+ it 'prefers the prn cell phone number over the orn' do
165
+ expect(subject[:phone_cell]).to eq('0612345600')
166
166
  end
167
167
  end
168
168
 
@@ -170,11 +170,29 @@ describe 'Fetching A19 from XMcare' do
170
170
  before { load_fixture 'xmcare_unconventional_phone_cell_in_orn', '88888888888' }
171
171
  subject { Roqua::Healthy::A19.fetch("88888888888") }
172
172
 
173
- it 'returns the orn number' do
173
+ it 'returns that number' do
174
174
  expect(subject[:phone_cell]).to eq('+31612345678')
175
175
  end
176
176
  end
177
177
 
178
+ describe 'a patient with another unconventional cell phone number in the other residence number field' do
179
+ before { load_fixture 'xmcare_unconventional_phone_cell_in_orn2', '88888888888' }
180
+ subject { Roqua::Healthy::A19.fetch("88888888888") }
181
+
182
+ it 'returns that number' do
183
+ expect(subject[:phone_cell]).to eq('0031612345678')
184
+ end
185
+ end
186
+
187
+ describe 'a patient with a home phone number in the primary residence number field' do
188
+ before { load_fixture 'xmcare_phone_home_in_prn', '88888888888' }
189
+ subject { Roqua::Healthy::A19.fetch("88888888888") }
190
+
191
+ it 'returns nil' do
192
+ expect(subject[:phone_cell]).to be_nil
193
+ end
194
+ end
195
+
178
196
  describe 'a patient that does not exist' do
179
197
  before { load_fixture 'xmcare_patient_not_found', '12345678901' }
180
198
 
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.2.1
4
+ version: 1.3.0
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-24 00:00:00.000000000 Z
14
+ date: 2016-06-30 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport
@@ -295,8 +295,10 @@ files:
295
295
  - spec/fixtures/xmcare_patient_without_birthdate.xml
296
296
  - spec/fixtures/xmcare_phone_cell_in_prn.xml
297
297
  - spec/fixtures/xmcare_phone_cell_in_prn_orn.xml
298
+ - spec/fixtures/xmcare_phone_home_in_prn.xml
298
299
  - spec/fixtures/xmcare_timeout_waiting_for_ack.xml
299
300
  - spec/fixtures/xmcare_unconventional_phone_cell_in_orn.xml
301
+ - spec/fixtures/xmcare_unconventional_phone_cell_in_orn2.xml
300
302
  - spec/healthy_spec.rb
301
303
  - spec/integration/cdis_spec.rb
302
304
  - spec/integration/comez_spec.rb
@@ -362,8 +364,10 @@ test_files:
362
364
  - spec/fixtures/xmcare_patient_without_birthdate.xml
363
365
  - spec/fixtures/xmcare_phone_cell_in_prn.xml
364
366
  - spec/fixtures/xmcare_phone_cell_in_prn_orn.xml
367
+ - spec/fixtures/xmcare_phone_home_in_prn.xml
365
368
  - spec/fixtures/xmcare_timeout_waiting_for_ack.xml
366
369
  - spec/fixtures/xmcare_unconventional_phone_cell_in_orn.xml
370
+ - spec/fixtures/xmcare_unconventional_phone_cell_in_orn2.xml
367
371
  - spec/healthy_spec.rb
368
372
  - spec/integration/cdis_spec.rb
369
373
  - spec/integration/comez_spec.rb