Class: ODDB::AnalysisParse::TestExtendedListParser
- Inherits:
-
Test::Unit::TestCase
- Object
- Test::Unit::TestCase
- ODDB::AnalysisParse::TestExtendedListParser
- Defined in:
- ext/analysisparse/test/test_extended_list_parser.rb
Instance Method Summary collapse
- #setup ⇒ Object
- #test_fr_parse_footnotes__1 ⇒ Object
- #test_fr_parse_footnotes__2 ⇒ Object
- #test_fr_parse_footnotes__3 ⇒ Object
- #test_fr_parse_line__1 ⇒ Object
- #test_fr_parse_page__1 ⇒ Object
- #test_fr_update_footnotes__1 ⇒ Object
- #test_parse_footnotes__1 ⇒ Object
- #test_parse_footnotes__2 ⇒ Object
- #test_parse_footnotes__3 ⇒ Object
- #test_parse_line__1 ⇒ Object
- #test_parse_line__2 ⇒ Object
- #test_parse_line__3 ⇒ Object
- #test_parse_line__4 ⇒ Object
- #test_parse_line__5 ⇒ Object
- #test_parse_line__6 ⇒ Object
- #test_parse_line__7 ⇒ Object
- #test_parse_page__1 ⇒ Object
- #test_parse_page__2 ⇒ Object
- #test_parse_page__3 ⇒ Object
- #test_parse_page__4 ⇒ Object
- #test_update_footnotes__1 ⇒ Object
Instance Method Details
#setup ⇒ Object
12 13 14 |
# File 'ext/analysisparse/test/test_extended_list_parser.rb', line 12 def setup @parser = ExtendedListParser.new end |
#test_fr_parse_footnotes__1 ⇒ Object
437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 |
# File 'ext/analysisparse/test/test_extended_list_parser.rb', line 437 def test_fr_parse_footnotes__1 src = <<-EOS * position anonyme 1 seulement pour hôpitaux 2 seulement pour les personnes médicales autorisées, dans le cadre de traitements de substitution ou de sevrage de leurs propres patients 3 seulement pour hôpitaux et pneumologues 4 seulement pour hôpitaux, pneumologues et hématologues EOS begin result = @parser.parse_footnotes(src) end expected = { '*' => 'position anonyme', '1' => 'seulement pour hôpitaux', '2' => 'seulement pour les personnes médicales autorisées, dans le cadre de traitements de substitution ou de sevrage de leurs propres patients', '3' => 'seulement pour hôpitaux et pneumologues', '4' => 'seulement pour hôpitaux, pneumologues et hématologues', } assert_equal(expected, result) end |
#test_fr_parse_footnotes__2 ⇒ Object
459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 |
# File 'ext/analysisparse/test/test_extended_list_parser.rb', line 459 def test_fr_parse_footnotes__2 src = <<-EOS _______________________________________________________________ * position anonyme 1 ta mère EOS begin result = @parser.parse_footnotes(src) end expected = { '*' => 'position anonyme', '1' => 'ta mère', } assert_equal(expected, result) end |
#test_fr_parse_footnotes__3 ⇒ Object
474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 |
# File 'ext/analysisparse/test/test_extended_list_parser.rb', line 474 def test_fr_parse_footnotes__3 src = <<-EOS 1_____________________________________________________________________________________ seulement pour enfants jusqu~Rà 6 ans * position anonyme EOS begin result = @parser.parse_footnotes(src) end expected = { '*' => 'position anonyme', '1' => 'seulement pour enfants jusqu\'à 6 ans', } assert_equal(expected, result) end |
#test_fr_parse_line__1 ⇒ Object
410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 |
# File 'ext/analysisparse/test/test_extended_list_parser.rb', line 410 def test_fr_parse_line__1 src = <<-EOS C 8210.00 6 Érythrocytes, numération, détermination manuelle, cumulable avec 8273.00 hématocrite, 8275.00 hémoglobine, 8406.00 leucocytes (numération) et 8560.00 thrombocytes (numération), jusqu'à un total de max. 15 points (hémogramme II) Limitation: pas avec la méthode QBC EOS begin result = @parser.parse_line(src) end expected = { :code => '8210.00', :group => '8210', :position => '00', :description => 'Érythrocytes, numération, détermination manuelle, cumulable avec 8273.00 hématocrite, 8275.00 hémoglobine, 8406.00 leucocytes (numération) et 8560.00 thrombocytes (numération), jusqu\'à un total de max. 15 points (hémogramme II)', :analysis_revision => 'C', :taxpoints => 6, :list_title => nil, :permission => nil, :taxpoint_type => nil, :limitation => 'pas avec la méthode QBC', } assert_equal(expected, result) end |
#test_fr_parse_page__1 ⇒ Object
490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 |
# File 'ext/analysisparse/test/test_extended_list_parser.rb', line 490 def test_fr_parse_page__1 src = <<-EOS Oncologie médicale Pour le moment comme hématologie Pédiatrie Rév. No pos. A TP Dénomination (liste pédiatrie) 8543.00 1 40 Théophylline (sang) 1____________________________________________________________________ seulement pour enfants jusqu'à 6 ans * position anonyme EOS begin result = @parser.parse_page(src, 121) end expected = [ { :code => '8543.00', :group => '8543', :position => '00', :taxpoints => 40, :description => 'Théophylline (sang)', :restriction => '1', :list_title => nil, :taxpoint_type => nil, :permission => nil, } ] assert_equal(expected, result) end |
#test_fr_update_footnotes__1 ⇒ Object
519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 |
# File 'ext/analysisparse/test/test_extended_list_parser.rb', line 519 def test_fr_update_footnotes__1 data = [ { :group => '8317', :position => '00', :description => 'Immunoglobuline IgE totale, qn', :footnote => '1', } ] footnotes = { '1' => 'seulement pour enfants jusqu\'à 6 ans', } begin result = @parser.update_footnotes(data, footnotes) end expected = [ { :group => '8317', :position => '00', :description => 'Immunoglobuline IgE totale, qn', :footnote => 'seulement pour enfants jusqu\'à 6 ans', } ] assert_equal(expected, result) end |
#test_parse_footnotes__1 ⇒ Object
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 |
# File 'ext/analysisparse/test/test_extended_list_parser.rb', line 181 def test_parse_footnotes__1 src = <<-EOS 1____________________________________________________________________________ Nur bei Kindern bis zu 6 Jahren * anonyme Position EOS begin result = @parser.parse_footnotes(src) end expected = { '1' => 'Nur bei Kindern bis zu 6 Jahren', '*' => 'anonyme Position', } assert_equal(expected, result) end |
#test_parse_footnotes__2 ⇒ Object
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
# File 'ext/analysisparse/test/test_extended_list_parser.rb', line 196 def test_parse_footnotes__2 src = <<-EOS *Anonyme Position 1 Nur für Spitäler 2 Nur für autorisierte Medizinalpersonen in Substitutions- oder Entzugsbehandlungen 3 Nur für Spitäler und Pneumologen 4 Nur für Spitäler, Pneumologen und Hämatologen EOS begin result = @parser.parse_footnotes(src) end expected = { '*' => 'Anonyme Position', '1' => 'Nur für Spitäler', '2' => 'Nur für autorisierte Medizinalpersonen in Substitutions- oder Entzugsbehandlungen', '3' => 'Nur für Spitäler und Pneumologen', '4' => 'Nur für Spitäler, Pneumologen und Hämatologen', } assert_equal(expected, result) end |
#test_parse_footnotes__3 ⇒ Object
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
# File 'ext/analysisparse/test/test_extended_list_parser.rb', line 216 def test_parse_footnotes__3 src = <<-EOS ___________________________ *anonyme Position 1 Whatever! EOS begin result = @parser.parse_footnotes(src) end expected = { '*' => 'anonyme Position', '1' => 'Whatever!', } assert_equal(expected, result) end |
#test_parse_line__1 ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'ext/analysisparse/test/test_extended_list_parser.rb', line 15 def test_parse_line__1 src = <<-EOS 8317.00 35 Immunglobulin IgE total, qn EOS begin result = @parser.parse_line(src) rescue AmbigousParseException => e puts e.inspect end expected = { :group => '8317', :code => '8317.00', :position => '00', :taxpoints => 35, :description => 'Immunglobulin IgE total, qn', :taxpoint_type => nil, :list_title => nil, :permission => nil, } assert_equal(expected, result) end |
#test_parse_line__2 ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'ext/analysisparse/test/test_extended_list_parser.rb', line 36 def test_parse_line__2 src = <<-EOS C 8272.00 30 Hämatogramm V (automatisiert): wie Hämatogramm IV, flowzytometrische Differenzierung der Leukozyten Limitation: nicht mit QBC-Methode EOS begin result = @parser.parse_line(src) rescue AmbigousParseException => e puts e.inspect end expected = { :code => '8272.00', :group => '8272', :position => '00', :analysis_revision => 'C', :taxpoints => 30, :description => 'Hämatogramm V (automatisiert): wie Hämatogramm IV, flowzytometrische Differenzierung der Leukozyten', :limitation => 'nicht mit QBC-Methode', :list_title => nil, :permission => nil, :taxpoint_type => nil, } assert_equal(expected, result) end |
#test_parse_line__3 ⇒ Object
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'ext/analysisparse/test/test_extended_list_parser.rb', line 62 def test_parse_line__3 src = <<-EOS 8317.01 25(1) Immunglobulin IgE - multispezifischer oder gruppenspezifischer Atopie-Screeningtest, ql/sq, ohne Unterscheidung einzelner spez. IgE (1) analog abgestuftem Blocktarif gemäss Punkt 5.7 der Vorbemerkungen, je nach Anzahl Allergene im verwendeten Testsystem EOS begin result = @parser.parse_line(src) rescue AmbigousParseException => e puts e.inspect end expected = { :code => '8317.01', :group => '8317', :position => '01', :taxpoints => 25, :description => 'Immunglobulin IgE - multispezifischer oder gruppenspezifischer Atopie-Screeningtest, ql/sq, ohne Unterscheidung einzelner spez. IgE', :taxnumber => '1', :taxnote => 'analog abgestuftem Blocktarif gemäss Punkt 5.7 der Vorbemerkungen, je nach Anzahl Allergene im verwendeten Testsystem', :list_title => nil, :permission => nil, :taxpoint_type => nil, } assert_equal(expected, result) end |
#test_parse_line__4 ⇒ Object
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'ext/analysisparse/test/test_extended_list_parser.rb', line 86 def test_parse_line__4 src = <<-EOS 8317.02 45(1) Immunglobulin IgE - monospezifischer Multi- Screeningtest, mindestens sq, mit Unterscheidung einzelner spez. IgE (nicht kumulierbar mit 8317.04) (1) analog abgestuftem Blocktarif gemäss Punkt 5.7 der Vorbemerkungen, je nach Anzahl Allergene im verwendeten Testsystem EOS begin result = @parser.parse_line(src) rescue AmbigousParseException => e puts e.inspect end expected = { :code => '8317.02', :group => '8317', :position => '02', :taxpoints => 45, :taxnumber => '1', :description => 'Immunglobulin IgE - monospezifischer Multi-Screeningtest, mindestens sq, mit Unterscheidung einzelner spez. IgE (nicht kumulierbar mit 8317.04)', :taxnote => 'analog abgestuftem Blocktarif gemäss Punkt 5.7 der Vorbemerkungen, je nach Anzahl Allergene im verwendeten Testsystem', :list_title => nil, :permission => nil, :taxpoint_type => nil, } assert_equal(expected, result) end |
#test_parse_line__5 ⇒ Object
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
# File 'ext/analysisparse/test/test_extended_list_parser.rb', line 115 def test_parse_line__5 src = " 8572.00 9 Triglyceride\n" begin result = @parser.parse_line(src) rescue AmbigousParseException => e puts e.inspect end expected = { :code => '8572.00', :description =>"Triglyceride", :position =>"00", :taxpoints =>9, :group =>"8572", :list_title => nil, :permission => nil, :taxpoint_type => nil, } assert_equal(expected, result) end |
#test_parse_line__6 ⇒ Object
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
# File 'ext/analysisparse/test/test_extended_list_parser.rb', line 134 def test_parse_line__6 src = <<-EOS 9356.30 * 25 Spezielle Mikroskopie (Acridineorange, Ziehl-Neelsen, Auramin Phasenkontrast etc., KOH, Pilze) EOS begin result = @parser.parse_line(src) end expected = { :code => '9356.30', :group => '9356', :anonymous => true, :position => '30', :taxpoints => 25, :description => 'Spezielle Mikroskopie (Acridineorange, Ziehl-Neelsen, Auramin Phasenkontrast etc., KOH, Pilze)', :list_title => nil, :permission => nil, :taxpoint_type => nil, } assert_equal(expected, result) end |
#test_parse_line__7 ⇒ Object
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
# File 'ext/analysisparse/test/test_extended_list_parser.rb', line 155 def test_parse_line__7 src = <<-EOS S 9710.00 8 Blutentnahme, Kapillarblut oder Venenpunktion, nur anwendbar durch ärztliches Praxislaboratorium im Rahmen der Präsenzdiagnostik nach Artikel 54 Absatz 1 Buchstabe a KVV und Kapitel 5.1.2 der Analysenliste Limitation: gültig ab 1.5.2004 bis 31.12.2005 EOS begin result = @parser.parse_line(src) end expected = { :code => '9710.00', :group => '9710', :position => '00', :taxpoints => 8, :analysis_revision => 'S', :description => 'Blutentnahme, Kapillarblut oder Venenpunktion, nur anwendbar durch ärztliches Praxislaboratorium im Rahmen der Präsenzdiagnostik nach Artikel 54 Absatz 1 Buchstabe a KVV und Kapitel 5.1.2 der Analysenliste', :limitation => 'gültig ab 1.5.2004 bis 31.12.2005', :list_title => nil, :permission => nil, :taxpoint_type => nil, } assert_equal(expected, result) end |
#test_parse_page__1 ⇒ Object
231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 |
# File 'ext/analysisparse/test/test_extended_list_parser.rb', line 231 def test_parse_page__1 src = <<-EOS Physikalische Medizin und Rehabilitation Rev. Pos.-Nr. A TP Bezeichnung (Liste physik. Medizin und Rehabilitation) 8388.00 20 Kristallnachweis mit polarisiertem Licht 8600.00 25 Zellzählung, sowie Differenzierung nach Anreicherung und Färbung von Körper- flüssigkeiten EOS begin result = @parser.parse_page(src, 95) end expected = [ { :code => '8388.00', :group => '8388', :position => '00', :taxpoints => 20, :description => 'Kristallnachweis mit polarisiertem Licht', :list_title => nil, :permission => nil, :taxpoint_type => nil, }, { :code => '8600.00', :group => '8600', :position => '00', :taxpoints => 25, :description => 'Zellzählung, sowie Differenzierung nach Anreicherung und Färbung von Körperflüssigkeiten', :list_title => nil, :permission => nil, :taxpoint_type => nil, } ] assert_equal(expected, result) end |
#test_parse_page__2 ⇒ Object
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 |
# File 'ext/analysisparse/test/test_extended_list_parser.rb', line 265 def test_parse_page__2 src = <<-EOS 8543.00 1 40 Theophyllin (Blut) 1_________________________________________________________________________ Nur bei Kindern bis zu 6 Jahren * anonyme Position EOS begin result = @parser.parse_page(src, 11) end expected = [ { :code => '8543.00', :group => '8543', :position => '00', :taxpoints => 40, :description => 'Theophyllin (Blut)', :restriction => '1', :list_title => nil, :taxpoint_type => nil, :permission => nil, } ] assert_equal(expected, result) end |
#test_parse_page__3 ⇒ Object
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 |
# File 'ext/analysisparse/test/test_extended_list_parser.rb', line 290 def test_parse_page__3 src = <<-EOS Kinder- und Jugendmedizin Rev. Pos.-Nr. A TP Bezeichnung (Liste Kinder- und Jugendmedizin) 1 8317.01 * 25(1) Immunglobulin IgE - multispezifischer oder gruppenspezifischer Atopie-Screeningtest, ql/sq, ohne Unterscheidung einzelner spez. IgE (1) analog abgestuftem Blocktarif gemäss Punkt 5.7 der Vorbemerkungen, je nach Anzahl Allergene im Verwendeten Testsystem 8543.00 1 40 Theophyllin (Blut) 1____________________________________________________________________________ Nur bei Kindern bis zu 6 Jahren * anonyme Position 1 EOS begin result = @parser.parse_page(src, 1) end expected = [ { :code => '8317.01', :group => '8317', :position => '01', :taxpoints => 25, :anonymous => true, :description => 'Immunglobulin IgE - multispezifischer oder gruppenspezifischer Atopie-Screeningtest, ql/sq, ohne Unterscheidung einzelner spez. IgE', :taxnumber => '1', :taxnote => 'analog abgestuftem Blocktarif gemäss Punkt 5.7 der Vorbemerkungen, je nach Anzahl Allergene im Verwendeten Testsystem', :list_title => nil, :permission => nil, :taxpoint_type => nil, }, { :code => '8543.00', :group => '8543', :position => '00', :taxpoints => 40, :description => 'Theophyllin (Blut)', :restriction => '1', :list_title => nil, :permission => nil, :taxpoint_type => nil, } ] assert_equal(expected, result) end |
#test_parse_page__4 ⇒ Object
334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 |
# File 'ext/analysisparse/test/test_extended_list_parser.rb', line 334 def test_parse_page__4 src = <<-EOS 8249.00 9 Gamma-Glutamyltranspeptidase (GGT) 8265.00 1 30 Glykiertes Hämoglobin (HbA1c) C 8268.00 12 Hämatogramm I (automatisiert) ___________________ *anonyme Position 1 Nur für mich 12 EOS begin result = @parser.parse_page(src, 12) end expected = [ { :code => '8249.00', :group => '8249', :position => '00', :taxpoints => 9, :description => 'Gamma-Glutamyltranspeptidase (GGT)', :list_title => nil, :permission => nil, :taxpoint_type => nil, }, { :code => '8265.00', :group => '8265', :position => '00', :taxpoints => 30, :description => 'Glykiertes Hämoglobin (HbA1c)', :restriction => '1', :list_title => nil, :permission => nil, :taxpoint_type => nil, }, { :code => '8268.00', :group => '8268', :position => '00', :analysis_revision => 'C', :taxpoints => 12, :description => 'Hämatogramm I (automatisiert)', :list_title => nil, :permission => nil, :taxpoint_type => nil, } ] assert_equal(expected, result) end |
#test_update_footnotes__1 ⇒ Object
385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 |
# File 'ext/analysisparse/test/test_extended_list_parser.rb', line 385 def test_update_footnotes__1 data = [ { :group => '8317', :position => '00', :description => 'Immunglobulin IgE', :footnote => '1', } ] footnotes = { '1' => 'analog wie etwas anderes', } begin result = @parser.update_footnotes(data, footnotes) end expected = [ { :group => '8317', :position => '00', :description => 'Immunglobulin IgE', :footnote => 'analog wie etwas anderes', } ] assert_equal(expected, result) end |