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,251 @@
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>USER</MSH.3.1>
8
+ </MSH.3>
9
+ <MSH.4>
10
+ <MSH.4.1>IMPULSE</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>201312061332</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>
26
+ <MSH.10>
27
+ <MSH.10.1>00000000000000213459</MSH.10.1>
28
+ </MSH.10>
29
+ <MSH.11>
30
+ <MSH.11.1>P</MSH.11.1>
31
+ </MSH.11>
32
+ <MSH.12>
33
+ <MSH.12.1>2.4</MSH.12.1>
34
+ </MSH.12>
35
+ <MSH.13/>
36
+ <MSH.14/>
37
+ <MSH.15>
38
+ <MSH.15.1>NE</MSH.15.1>
39
+ </MSH.15>
40
+ <MSH.16>
41
+ <MSH.16.1>NE</MSH.16.1>
42
+ </MSH.16>
43
+ <MSH.17>
44
+ <MSH.17.1>NLD</MSH.17.1>
45
+ </MSH.17>
46
+ <MSH.18>
47
+ <MSH.18.1>UNICODE</MSH.18.1>
48
+ </MSH.18>
49
+ <MSH.19/>
50
+ <MSH.20/>
51
+ <MSH.21/>
52
+ <MSH.22/>
53
+ </MSH>
54
+ <MSA>
55
+ <MSA.1>
56
+ <MSA.1.1>CA</MSA.1.1>
57
+ </MSA.1>
58
+ <MSA.2>
59
+ <MSA.2.1>6609749924</MSA.2.1>
60
+ </MSA.2>
61
+ <MSA.3/>
62
+ <MSA.4/>
63
+ <MSA.5/>
64
+ <MSA.6/>
65
+ <MSA.7/>
66
+ </MSA>
67
+ <QAK>
68
+ <QAK.1/>
69
+ <QAK.2>
70
+ <QAK.2.1>OK</QAK.2.1>
71
+ </QAK.2>
72
+ <QAK.3/>
73
+ <QAK.4/>
74
+ <QAK.5/>
75
+ <QAK.6/>
76
+ <QAK.7/>
77
+ </QAK>
78
+ <QRD>
79
+ <QRD.1>
80
+ <QRD.1.1>201312060000</QRD.1.1>
81
+ </QRD.1>
82
+ <QRD.2>
83
+ <QRD.2.1>R</QRD.2.1>
84
+ </QRD.2>
85
+ <QRD.3>
86
+ <QRD.3.1>I</QRD.3.1>
87
+ </QRD.3>
88
+ <QRD.4>
89
+ <QRD.4.1>6609749924</QRD.4.1>
90
+ </QRD.4>
91
+ <QRD.5/>
92
+ <QRD.6/>
93
+ <QRD.7>
94
+ <QRD.7.1>1</QRD.7.1>
95
+ <QRD.7.2>RD</QRD.7.2>
96
+ </QRD.7>
97
+ <QRD.8>
98
+ <QRD.8.1>00000123</QRD.8.1>
99
+ <QRD.8.2>
100
+ <QRD.8.2.1/>
101
+ <QRD.8.2.2/>
102
+ <QRD.8.2.3/>
103
+ <QRD.8.2.4/>
104
+ <QRD.8.2.5/>
105
+ </QRD.8.2>
106
+ <QRD.8.3/>
107
+ <QRD.8.4/>
108
+ <QRD.8.5/>
109
+ <QRD.8.6/>
110
+ <QRD.8.7/>
111
+ <QRD.8.8/>
112
+ <QRD.8.9/>
113
+ <QRD.8.10/>
114
+ <QRD.8.11/>
115
+ <QRD.8.12/>
116
+ <QRD.8.13/>
117
+ <QRD.8.14/>
118
+ <QRD.8.15/>
119
+ <QRD.8.16/>
120
+ <QRD.8.17/>
121
+ <QRD.8.18/>
122
+ </QRD.8>
123
+ <QRD.9>
124
+ <QRD.9.1>DEM</QRD.9.1>
125
+ </QRD.9>
126
+ <QRD.10/>
127
+ <QRD.11/>
128
+ <QRD.12/>
129
+ <QRD.13/>
130
+ </QRD>
131
+ <PID>
132
+ <PID.1>
133
+ <PID.1.1>1</PID.1.1>
134
+ </PID.1>
135
+ <PID.2/>
136
+ <PID.3>
137
+ <PID.3.1>00000123</PID.3.1>
138
+ <PID.3.2/>
139
+ <PID.3.3/>
140
+ <PID.3.4/>
141
+ <PID.3.5>PI</PID.3.5>
142
+ <PID.3.6/>
143
+ <PID.3.7/>
144
+ <PID.3.8/>
145
+ </PID.3>
146
+ <PID.4/>
147
+ <PID.5>
148
+ <PID.5.1>
149
+ <PID.5.1.1>Meisjes-naam-Achternaam</PID.5.1.1>
150
+ <PID.5.1.2/>
151
+ <PID.5.1.3>Achternaam</PID.5.1.3>
152
+ <PID.5.1.4/>
153
+ <PID.5.1.5>Meisjes-naam</PID.5.1.5>
154
+ </PID.5.1>
155
+ <PID.5.2>Babette</PID.5.2>
156
+ <PID.5.3>A.B.C.</PID.5.3>
157
+ <PID.5.4/>
158
+ <PID.5.5/>
159
+ <PID.5.6/>
160
+ <PID.5.7>L</PID.5.7>
161
+ <PID.5.8/>
162
+ <PID.5.9/>
163
+ <PID.5.10/>
164
+ <PID.5.11/>
165
+ </PID.5>
166
+ <PID.5>
167
+ <PID.5.1>
168
+ <PID.5.1.1/>
169
+ <PID.5.1.2/>
170
+ <PID.5.1.3/>
171
+ <PID.5.1.4/>
172
+ <PID.5.1.5/>
173
+ </PID.5.1>
174
+ <PID.5.2>Babette</PID.5.2>
175
+ <PID.5.3/>
176
+ <PID.5.4/>
177
+ <PID.5.5/>
178
+ <PID.5.6/>
179
+ <PID.5.7>N</PID.5.7>
180
+ <PID.5.8/>
181
+ <PID.5.9/>
182
+ <PID.5.10/>
183
+ <PID.5.11/>
184
+ </PID.5>
185
+ <PID.6/>
186
+ <PID.7>
187
+ <PID.7.1>17070415</PID.7.1>
188
+ </PID.7>
189
+ <PID.8>
190
+ <PID.8.1>F</PID.8.1>
191
+ </PID.8>
192
+ <PID.9/>
193
+ <PID.10/>
194
+ <PID.11>
195
+ <PID.11.1>
196
+ <PID.11.1.1>Straatnaam 37</PID.11.1.1>
197
+ <PID.11.1.2>Straatnaam</PID.11.1.2>
198
+ <PID.11.1.3>37</PID.11.1.3>
199
+ </PID.11.1>
200
+ <PID.11.2/>
201
+ <PID.11.3>PLAATSNAAM</PID.11.3>
202
+ <PID.11.4/>
203
+ <PID.11.5>1234 AB</PID.11.5>
204
+ <PID.11.6>6030</PID.11.6>
205
+ <PID.11.7>L</PID.11.7>
206
+ <PID.11.8/>
207
+ <PID.11.9/>
208
+ <PID.11.10/>
209
+ <PID.11.11/>
210
+ <PID.11.12/>
211
+ </PID.11>
212
+ <PID.12/>
213
+ <PID.13/>
214
+ <PID.14/>
215
+ <PID.15/>
216
+ <PID.16/>
217
+ <PID.17/>
218
+ <PID.18/>
219
+ <PID.19/>
220
+ <PID.20/>
221
+ <PID.21/>
222
+ <PID.22/>
223
+ <PID.23/>
224
+ <PID.24/>
225
+ <PID.25/>
226
+ <PID.26/>
227
+ <PID.27/>
228
+ <PID.28/>
229
+ <PID.29/>
230
+ <PID.30/>
231
+ <PID.31>
232
+ <PID.31.1>Y</PID.31.1>
233
+ </PID.31>
234
+ <PID.32>
235
+ <PID.32.1>US</PID.32.1>
236
+ </PID.32>
237
+ <PID.32>
238
+ <PID.32.1>NNNLD</PID.32.1>
239
+ </PID.32>
240
+ <PID.32>
241
+ <PID.32.1>NNWID</PID.32.1>
242
+ </PID.32>
243
+ <PID.33/>
244
+ <PID.34/>
245
+ <PID.35/>
246
+ <PID.36/>
247
+ <PID.37/>
248
+ <PID.38/>
249
+ <PID.39/>
250
+ </PID>
251
+ </HL7Message>
@@ -0,0 +1,245 @@
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>20131031125814</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>1221010</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>431f8ded67</MSA.2.1>
51
+ </MSA.2>
52
+ </MSA>
53
+ <QRD>
54
+ <QRD.1>
55
+ <QRD.1.1>20131031000000</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>431f8ded67</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>CDIS</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>20091014</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>GIRO</PID.3.4>
105
+ <PID.3.5>BA</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>BANK</PID.3.4>
112
+ <PID.3.5>BA</PID.3.5>
113
+ </PID.3>
114
+ <PID.4/>
115
+ <PID.5>
116
+ <PID.5.1>
117
+ <PID.5.1.1>Achternaam</PID.5.1.1>
118
+ <PID.5.1.2>""</PID.5.1.2>
119
+ <PID.5.1.3>Achternaam</PID.5.1.3>
120
+ <PID.5.1.4>""</PID.5.1.4>
121
+ <PID.5.1.5>""</PID.5.1.5>
122
+ </PID.5.1>
123
+ <PID.5.2>A</PID.5.2>
124
+ <PID.5.3>B C</PID.5.3>
125
+ <PID.5.4/>
126
+ <PID.5.5/>
127
+ <PID.5.6/>
128
+ <PID.5.7>L</PID.5.7>
129
+ </PID.5>
130
+ <PID.5>
131
+ <PID.5.1>Achternaam</PID.5.1>
132
+ <PID.5.2/>
133
+ <PID.5.3/>
134
+ <PID.5.4/>
135
+ <PID.5.5/>
136
+ <PID.5.6/>
137
+ <PID.5.7>D</PID.5.7>
138
+ </PID.5>
139
+ <PID.5>
140
+ <PID.5.1/>
141
+ <PID.5.2>""</PID.5.2>
142
+ <PID.5.3/>
143
+ <PID.5.4/>
144
+ <PID.5.5/>
145
+ <PID.5.6/>
146
+ <PID.5.7>N</PID.5.7>
147
+ </PID.5>
148
+ <PID.6/>
149
+ <PID.7>
150
+ <PID.7.1>17070415</PID.7.1>
151
+ </PID.7>
152
+ <PID.8>
153
+ <PID.8.1>M</PID.8.1>
154
+ </PID.8>
155
+ <PID.9/>
156
+ <PID.10/>
157
+ <PID.11/>
158
+ <PID.11>
159
+ <PID.11.1>
160
+ <PID.11.1.1>Straatnaam 37 h-42</PID.11.1.1>
161
+ <PID.11.1.2>Staatnaam</PID.11.1.2>
162
+ <PID.11.1.3>37</PID.11.1.3>
163
+ </PID.11.1>
164
+ <PID.11.2>h-42</PID.11.2>
165
+ <PID.11.3>PLAATSNAAM</PID.11.3>
166
+ <PID.11.4/>
167
+ <PID.11.5>1234AB</PID.11.5>
168
+ <PID.11.6>NLD</PID.11.6>
169
+ <PID.11.7>H</PID.11.7>
170
+ </PID.11>
171
+ <PID.11>
172
+ <PID.11.1>
173
+ <PID.11.1.1/>
174
+ <PID.11.1.2>""</PID.11.1.2>
175
+ <PID.11.1.3>""</PID.11.1.3>
176
+ </PID.11.1>
177
+ <PID.11.2>""</PID.11.2>
178
+ <PID.11.3>ANDEREPLAATS</PID.11.3>
179
+ <PID.11.4/>
180
+ <PID.11.5>""</PID.11.5>
181
+ <PID.11.6>NLD</PID.11.6>
182
+ <PID.11.7>N</PID.11.7>
183
+ </PID.11>
184
+ <PID.11>
185
+ <PID.11.1>
186
+ <PID.11.1.1/>
187
+ <PID.11.1.2>""</PID.11.1.2>
188
+ <PID.11.1.3>""</PID.11.1.3>
189
+ </PID.11.1>
190
+ <PID.11.2>""</PID.11.2>
191
+ <PID.11.3>""</PID.11.3>
192
+ <PID.11.4/>
193
+ <PID.11.5>""</PID.11.5>
194
+ <PID.11.6>""</PID.11.6>
195
+ <PID.11.7>C</PID.11.7>
196
+ </PID.11>
197
+ <PID.12/>
198
+ <PID.13>
199
+ <PID.13.1>0123-456789</PID.13.1>
200
+ <PID.13.2>PRN</PID.13.2>
201
+ <PID.13.3>PH</PID.13.3>
202
+ </PID.13>
203
+ <PID.13>
204
+ <PID.13.1>06-12345678</PID.13.1>
205
+ <PID.13.2>ORN</PID.13.2>
206
+ <PID.13.3>PH</PID.13.3>
207
+ </PID.13>
208
+ <PID.13>
209
+ <PID.13.1>""</PID.13.1>
210
+ <PID.13.2>ORN</PID.13.2>
211
+ <PID.13.3>FX</PID.13.3>
212
+ </PID.13>
213
+ <PID.13>
214
+ <PID.13.1>""</PID.13.1>
215
+ <PID.13.2>NET</PID.13.2>
216
+ <PID.13.3>Internet</PID.13.3>
217
+ </PID.13>
218
+ <PID.14/>
219
+ <PID.15/>
220
+ <PID.16/>
221
+ <PID.17/>
222
+ <PID.18/>
223
+ <PID.19/>
224
+ <PID.20/>
225
+ <PID.21/>
226
+ <PID.22/>
227
+ <PID.23/>
228
+ <PID.24/>
229
+ <PID.25/>
230
+ <PID.26>
231
+ <PID.26.1>""</PID.26.1>
232
+ </PID.26>
233
+ <PID.27/>
234
+ <PID.28/>
235
+ <PID.29>
236
+ <PID.29.1>""</PID.29.1>
237
+ </PID.29>
238
+ <PID.30>
239
+ <PID.30.1>N</PID.30.1>
240
+ </PID.30>
241
+ <PID.31>
242
+ <PID.31.1>N</PID.31.1>
243
+ </PID.31>
244
+ </PID>
245
+ </HL7Message>