roqua-healthy 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +7 -0
  2. data/.document +3 -0
  3. data/.gitignore +8 -0
  4. data/.rspec +1 -0
  5. data/.rubocop.yml +31 -0
  6. data/.yardopts +1 -0
  7. data/ChangeLog.md +10 -0
  8. data/Gemfile +8 -0
  9. data/Guardfile +11 -0
  10. data/LICENSE.txt +20 -0
  11. data/README.md +31 -0
  12. data/Rakefile +33 -0
  13. data/bin/get +8 -0
  14. data/bin/get_old_mirth_processing_result +6 -0
  15. data/bin/get_xml_for_patient +6 -0
  16. data/bin/parse_local_xml +9 -0
  17. data/healthy.gemspec +42 -0
  18. data/lib/roqua/healthy/a19/address_parser.rb +46 -0
  19. data/lib/roqua/healthy/a19/cdis_name_parser.rb +23 -0
  20. data/lib/roqua/healthy/a19/correct_patient_check.rb +18 -0
  21. data/lib/roqua/healthy/a19/fetcher.rb +61 -0
  22. data/lib/roqua/healthy/a19/name_parser.rb +52 -0
  23. data/lib/roqua/healthy/a19/response_parser.rb +27 -0
  24. data/lib/roqua/healthy/a19/response_validator.rb +45 -0
  25. data/lib/roqua/healthy/a19/transformer.rb +102 -0
  26. data/lib/roqua/healthy/a19.rb +25 -0
  27. data/lib/roqua/healthy/errors.rb +16 -0
  28. data/lib/roqua/healthy/message_cleaner.rb +44 -0
  29. data/lib/roqua/healthy/version.rb +6 -0
  30. data/lib/roqua/healthy.rb +14 -0
  31. data/lib/roqua-healthy.rb +1 -0
  32. data/spec/fixtures/cdis_gerda_geit.xml +181 -0
  33. data/spec/fixtures/cdis_jan_fictief.xml +177 -0
  34. data/spec/fixtures/cdis_piet_fictief.xml +177 -0
  35. data/spec/fixtures/comez_patient.xml +259 -0
  36. data/spec/fixtures/medo_patient.xml +101 -0
  37. data/spec/fixtures/oru-requests/spsy1218j.hl7 +82 -0
  38. data/spec/fixtures/oru-requests/spsy1218o.hl7 +76 -0
  39. data/spec/fixtures/oru-requests/spsy1218o2.hl7 +77 -0
  40. data/spec/fixtures/oru-requests/spsy411o.hl7 +73 -0
  41. data/spec/fixtures/oru-requests/spsy411o2.hl7 +71 -0
  42. data/spec/fixtures/oru-requests/spsyl.hl7 +71 -0
  43. data/spec/fixtures/oru-responses/xmcare_nack.hl7 +5 -0
  44. data/spec/fixtures/user_patient.xml +251 -0
  45. data/spec/fixtures/user_patient_with_gsm_and_email.xml +281 -0
  46. data/spec/fixtures/user_patient_with_maiden_name.xml +251 -0
  47. data/spec/fixtures/xmcare_impersonating_cdis.xml +245 -0
  48. data/spec/fixtures/xmcare_patient.xml +252 -0
  49. data/spec/fixtures/xmcare_patient_email_in_field_number_four.xml +245 -0
  50. data/spec/fixtures/xmcare_patient_not_found.xml +93 -0
  51. data/spec/fixtures/xmcare_patient_with_maiden_name.xml +252 -0
  52. data/spec/fixtures/xmcare_patient_without_birthdate.xml +250 -0
  53. data/spec/fixtures/xmcare_timeout_waiting_for_ack.xml +4 -0
  54. data/spec/healthy_spec.rb +7 -0
  55. data/spec/integration/cdis_spec.rb +72 -0
  56. data/spec/integration/comez_spec.rb +26 -0
  57. data/spec/integration/medo_spec.rb +26 -0
  58. data/spec/integration/mirth_spec.rb +17 -0
  59. data/spec/integration/user_spec.rb +72 -0
  60. data/spec/integration/xmcare_spec.rb +127 -0
  61. data/spec/spec_helper.rb +29 -0
  62. data/spec/support/fixtures.rb +14 -0
  63. data/spec/unit/a19/address_parser_spec.rb +132 -0
  64. data/spec/unit/a19/correct_patient_check_spec.rb +22 -0
  65. data/spec/unit/a19/fetcher_spec.rb +54 -0
  66. data/spec/unit/a19_spec.rb +4 -0
  67. data/spec/unit/message_cleaner_spec.rb +47 -0
  68. metadata +361 -0
@@ -0,0 +1,252 @@
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>ZIS</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>20130924132007</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>23099201</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>2013092413200823</MSA.2.1>
51
+ </MSA.2>
52
+ </MSA>
53
+ <QRD>
54
+ <QRD.1>
55
+ <QRD.1.1>20130924132008</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>23</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>12345678901</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>12345678901</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>123456789</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>20120820</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>Meisjesnaam - Achternaam</PID.5.1.1>
125
+ <PID.5.1.2>""</PID.5.1.2>
126
+ <PID.5.1.3>Achternaam</PID.5.1.3>
127
+ <PID.5.1.4>""</PID.5.1.4>
128
+ <PID.5.1.5>Meisjesnaam</PID.5.1.5>
129
+ </PID.5.1>
130
+ <PID.5.2>A</PID.5.2>
131
+ <PID.5.3>B</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>Meisjesnaam - Achternaam</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>Babette</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>17070415</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>Straatnaam 37</PID.11.1.1>
168
+ <PID.11.1.2>Straatnaam</PID.11.1.2>
169
+ <PID.11.1.3>37</PID.11.1.3>
170
+ </PID.11.1>
171
+ <PID.11.2>""</PID.11.2>
172
+ <PID.11.3>PLAATSNAAM</PID.11.3>
173
+ <PID.11.4/>
174
+ <PID.11.5>1234AB</PID.11.5>
175
+ <PID.11.6>NL</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>PLAATSNAAM</PID.11.3>
186
+ <PID.11.4/>
187
+ <PID.11.5>""</PID.11.5>
188
+ <PID.11.6>NL</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>0123-456789</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>06-12345678</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>email@example.com</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
+ </HL7Message>
@@ -0,0 +1,250 @@
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>ZIS</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>20130924132007</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>23099201</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>2013092413200823</MSA.2.1>
51
+ </MSA.2>
52
+ </MSA>
53
+ <QRD>
54
+ <QRD.1>
55
+ <QRD.1.1>20130924132008</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>23</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>12345678901</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>12345678901</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>123456789</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>20120820</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>Achternaam</PID.5.1.1>
125
+ <PID.5.1.2>""</PID.5.1.2>
126
+ <PID.5.1.3>Achternaam</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>A</PID.5.2>
131
+ <PID.5.3>B</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>Achternaam</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>Babette</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.8>
158
+ <PID.8.1>F</PID.8.1>
159
+ </PID.8>
160
+ <PID.9/>
161
+ <PID.10/>
162
+ <PID.11/>
163
+ <PID.11>
164
+ <PID.11.1>
165
+ <PID.11.1.1>Straatnaam 37</PID.11.1.1>
166
+ <PID.11.1.2>Straatnaam</PID.11.1.2>
167
+ <PID.11.1.3>37</PID.11.1.3>
168
+ </PID.11.1>
169
+ <PID.11.2>""</PID.11.2>
170
+ <PID.11.3>PLAATSNAAM</PID.11.3>
171
+ <PID.11.4/>
172
+ <PID.11.5>1234AB</PID.11.5>
173
+ <PID.11.6>NL</PID.11.6>
174
+ <PID.11.7>H</PID.11.7>
175
+ </PID.11>
176
+ <PID.11>
177
+ <PID.11.1>
178
+ <PID.11.1.1/>
179
+ <PID.11.1.2>""</PID.11.1.2>
180
+ <PID.11.1.3>""</PID.11.1.3>
181
+ </PID.11.1>
182
+ <PID.11.2>""</PID.11.2>
183
+ <PID.11.3>PLAATSNAAM</PID.11.3>
184
+ <PID.11.4/>
185
+ <PID.11.5>""</PID.11.5>
186
+ <PID.11.6>NL</PID.11.6>
187
+ <PID.11.7>N</PID.11.7>
188
+ </PID.11>
189
+ <PID.11>
190
+ <PID.11.1>
191
+ <PID.11.1.1/>
192
+ <PID.11.1.2>""</PID.11.1.2>
193
+ <PID.11.1.3>""</PID.11.1.3>
194
+ </PID.11.1>
195
+ <PID.11.2>""</PID.11.2>
196
+ <PID.11.3>""</PID.11.3>
197
+ <PID.11.4/>
198
+ <PID.11.5>""</PID.11.5>
199
+ <PID.11.6>""</PID.11.6>
200
+ <PID.11.7>C</PID.11.7>
201
+ </PID.11>
202
+ <PID.12/>
203
+ <PID.13>
204
+ <PID.13.1>0123-456789</PID.13.1>
205
+ <PID.13.2>PRN</PID.13.2>
206
+ <PID.13.3>PH</PID.13.3>
207
+ </PID.13>
208
+ <PID.13>
209
+ <PID.13.1>06-12345678</PID.13.1>
210
+ <PID.13.2>ORN</PID.13.2>
211
+ <PID.13.3>PH</PID.13.3>
212
+ </PID.13>
213
+ <PID.13>
214
+ <PID.13.1>""</PID.13.1>
215
+ <PID.13.2>ORN</PID.13.2>
216
+ <PID.13.3>FX</PID.13.3>
217
+ </PID.13>
218
+ <PID.13>
219
+ <PID.13.1>""</PID.13.1>
220
+ <PID.13.2>NET</PID.13.2>
221
+ <PID.13.3>Internet</PID.13.3>
222
+ </PID.13>
223
+ <PID.14/>
224
+ <PID.15/>
225
+ <PID.16/>
226
+ <PID.17/>
227
+ <PID.18/>
228
+ <PID.19/>
229
+ <PID.20/>
230
+ <PID.21/>
231
+ <PID.22/>
232
+ <PID.23/>
233
+ <PID.24/>
234
+ <PID.25/>
235
+ <PID.26>
236
+ <PID.26.1>""</PID.26.1>
237
+ </PID.26>
238
+ <PID.27/>
239
+ <PID.28/>
240
+ <PID.29>
241
+ <PID.29.1>""</PID.29.1>
242
+ </PID.29>
243
+ <PID.30>
244
+ <PID.30.1>N</PID.30.1>
245
+ </PID.30>
246
+ <PID.31>
247
+ <PID.31.1>N</PID.31.1>
248
+ </PID.31>
249
+ </PID>
250
+ </HL7Message>
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0"?>
2
+ <failure>
3
+ <error>Timeout waiting for ACK</error>
4
+ </failure>
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ describe Roqua::Healthy do
4
+ it "should have a VERSION constant" do
5
+ expect(subject.const_get('VERSION')).not_to be_empty
6
+ end
7
+ end
@@ -0,0 +1,72 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'Fetching A19 from CDIS' do
4
+ describe 'the patient Jan Fictief' do
5
+ before { load_fixture 'cdis_jan_fictief', '7767853' }
6
+ subject { Roqua::Healthy::A19.fetch("7767853") }
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 { expect(subject[:identities]).to eq([{ident: '7767853', authority: 'PI'}]) }
12
+ it { expect(subject[:firstname]).to eq('Jan') }
13
+ it { expect(subject[:initials]).to eq('J.A.B.C.') }
14
+ it { expect(subject[:lastname]).to eq('Fictief') }
15
+ it { expect(subject[:display_name]).to be_nil }
16
+ it { expect(subject[:email]).to be_nil }
17
+ it { expect(subject[:address_type]).to eq('M') }
18
+ it { expect(subject[:street]).to eq('-Hanzepleinfout 1') }
19
+ it { expect(subject[:city]).to eq('Groningen') }
20
+ it { expect(subject[:zipcode]).to eq('42869') }
21
+ it { expect(subject[:country]).to eq('') }
22
+ it { expect(subject[:birthdate]).to eq('19800101') }
23
+ it { expect(subject[:gender]).to eq('M') }
24
+ it { expect(subject[:phone_cell]).to be_nil }
25
+ end
26
+
27
+ describe 'the patient Piet Fictief' do
28
+ before { load_fixture 'cdis_piet_fictief', '7718758' }
29
+ subject { Roqua::Healthy::A19.fetch("7718758") }
30
+
31
+ it { expect(subject[:status]).to eq('SUCCESS') }
32
+ it { expect(subject[:error]).to be_nil }
33
+ it { expect(subject[:source]).to eq('UMCG') }
34
+ it { expect(subject[:identities]).to eq([{ident: '7718758', authority: 'PI'}]) }
35
+ it { expect(subject[:firstname]).to eq('Piet') }
36
+ it { expect(subject[:initials]).to eq('P.X.X.X.') }
37
+ it { expect(subject[:lastname]).to eq('Fictief') }
38
+ it { expect(subject[:display_name]).to be_nil }
39
+ it { expect(subject[:email]).to be_nil }
40
+ it { expect(subject[:address_type]).to eq('M') }
41
+ it { expect(subject[:street]).to eq('Ziekenhuisplein 1') }
42
+ it { expect(subject[:city]).to eq('Assen') }
43
+ it { expect(subject[:zipcode]).to eq('9402XX') }
44
+ it { expect(subject[:country]).to eq('NL') }
45
+ it { expect(subject[:birthdate]).to eq('19121212') }
46
+ it { expect(subject[:gender]).to eq('M') }
47
+ it { expect(subject[:phone_cell]).to be_nil }
48
+ end
49
+
50
+ describe 'the patient Gerda Geit' do
51
+ before { load_fixture 'cdis_gerda_geit', '7078387' }
52
+ subject { Roqua::Healthy::A19.fetch("7078387") }
53
+
54
+ it { expect(subject[:status]).to eq('SUCCESS') }
55
+ it { expect(subject[:error]).to be_nil }
56
+ it { expect(subject[:source]).to eq('UMCG') }
57
+ it { expect(subject[:identities]).to eq([{ident: '7078387', authority: 'PI'}, {ident: '003704397', authority: 'NNNLD'}]) }
58
+ it { expect(subject[:firstname]).to eq('Gerda') }
59
+ it { expect(subject[:initials]).to eq('G.') }
60
+ it { expect(subject[:lastname]).to eq('Geit') }
61
+ it { expect(subject[:display_name]).to be_nil }
62
+ it { expect(subject[:email]).to be_nil }
63
+ it { expect(subject[:address_type]).to eq('M') }
64
+ it { expect(subject[:street]).to eq('-Oostersnglfout') }
65
+ it { expect(subject[:city]).to eq('Groningen') }
66
+ it { expect(subject[:zipcode]).to eq('9713EZ') }
67
+ it { expect(subject[:country]).to eq('NL') }
68
+ it { expect(subject[:birthdate]).to eq('19880101') }
69
+ it { expect(subject[:gender]).to eq('F') }
70
+ it { expect(subject[:phone_cell]).to be_nil }
71
+ end
72
+ end
@@ -0,0 +1,26 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'Fetching A19 from Comez' do
4
+ describe 'a patient' do
5
+ before { load_fixture 'comez_patient', '0000123456' }
6
+ subject { Roqua::Healthy::A19.fetch("0000123456") }
7
+
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 { expect(subject[:identities]).to eq([{ident: '0000123456', authority: 'PI'}, {ident: '123456789', authority: 'NNNLD'}]) }
12
+ it { expect(subject[:firstname]).to eq('Voornaam') }
13
+ it { expect(subject[:initials]).to eq('A') }
14
+ it { expect(subject[:lastname]).to eq('Achternaam') }
15
+ it { expect(subject[:display_name]).to be_nil }
16
+ it { expect(subject[:email]).to be_nil }
17
+ it { expect(subject[:address_type]).to eq('M') }
18
+ it { expect(subject[:street]).to eq('Postadresstraat 42') }
19
+ it { expect(subject[:city]).to eq('PLAATSNAAM') }
20
+ it { expect(subject[:zipcode]).to eq('1234AB') }
21
+ it { expect(subject[:country]).to eq('NL') }
22
+ it { expect(subject[:birthdate]).to eq('17070415') }
23
+ it { expect(subject[:gender]).to eq('F') }
24
+ it { expect(subject[:phone_cell]).to be_nil }
25
+ end
26
+ end
@@ -0,0 +1,26 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'Fetching A19 from Medo' do
4
+ describe 'a patient' do
5
+ before { load_fixture 'medo_patient', 'md-cdae5d100d8e0131d2623c075478eb56' }
6
+ subject { Roqua::Healthy::A19.fetch("md-cdae5d100d8e0131d2623c075478eb56") }
7
+
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 { expect(subject[:identities]).to eq([{ident: 'md-cdae5d100d8e0131d2623c075478eb56', authority: 'epd'}]) }
12
+ it { expect(subject[:firstname]).to eq('Jan') }
13
+ it { expect(subject[:initials]).to eq('J.') }
14
+ it { expect(subject[:lastname]).to eq('Fictief') }
15
+ it { expect(subject[:display_name]).to be_nil }
16
+ it { expect(subject[:email]).to eq('j.fictief@roqua.nl') }
17
+ it { expect(subject[:address_type]).to eq('H') }
18
+ it { expect(subject[:street]).to eq('Thuisstraat 42') }
19
+ it { expect(subject[:city]).to eq('GRUNN') }
20
+ it { expect(subject[:zipcode]).to eq('1234QQ') }
21
+ it { expect(subject[:country]).to eq('Nederland') }
22
+ it { expect(subject[:birthdate]).to eq('19800525') }
23
+ it { expect(subject[:gender]).to eq('M') }
24
+ it { expect(subject[:phone_cell]).to eq('0698765432') }
25
+ end
26
+ end
@@ -0,0 +1,17 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'Accounting for Mirth bugs' do
4
+ describe 'when the wrong patient is returned' do
5
+ # Mirth has an awful bug where it will sometimes return responses out of sync
6
+ # with the actual requests. Mirth support has been entirely unhelpful in
7
+ # working with us to resolve this bug. Hence the need to at least stop the
8
+ # badness on this level, make sure we don't pollute our caches with patient
9
+ # details that don't belong to the patient we requested.
10
+
11
+ before { load_fixture 'cdis_jan_fictief', '12345678' }
12
+
13
+ it 'raises an error' do
14
+ expect { Roqua::Healthy::A19.fetch("12345678") }.to raise_error(Roqua::Healthy::MirthErrors::WrongPatient)
15
+ end
16
+ end
17
+ end