conceptql 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +64 -0
  3. data/config/vocabularies.csv +87 -87
  4. data/doc/spec.md +1951 -0
  5. data/lib/conceptql/behaviors/utilizable.rb +0 -2
  6. data/lib/conceptql/cli.rb +1 -1
  7. data/lib/conceptql/data_model/base.rb +1 -167
  8. data/lib/conceptql/data_model.rb +20 -4
  9. data/lib/conceptql/database.rb +2 -0
  10. data/lib/conceptql/lexicon/lexicon_strategy.rb +23 -3
  11. data/lib/conceptql/lexicon.rb +9 -1
  12. data/lib/conceptql/operators/co_reported.rb +4 -31
  13. data/lib/conceptql/operators/hospice.rb +1 -2
  14. data/lib/conceptql/operators/hospitalization.rb +1 -2
  15. data/lib/conceptql/operators/information_periods.rb +1 -3
  16. data/lib/conceptql/operators/one_in_two_out.rb +1 -2
  17. data/lib/conceptql/operators/operator.rb +3 -11
  18. data/lib/conceptql/operators/provenance.rb +1 -2
  19. data/lib/conceptql/operators/race.rb +2 -6
  20. data/lib/conceptql/operators/read.rb +1 -100
  21. data/lib/conceptql/operators/snf.rb +1 -2
  22. data/lib/conceptql/operators/vocabulary.rb +15 -2
  23. data/lib/conceptql/paths.rb +6 -0
  24. data/lib/conceptql/query.rb +5 -2
  25. data/lib/conceptql/rdbms/duckdb.rb +0 -4
  26. data/lib/conceptql/rdbms/generic.rb +0 -4
  27. data/lib/conceptql/rdbms/postgres.rb +0 -4
  28. data/lib/conceptql/rdbms/spark.rb +0 -4
  29. data/lib/conceptql/utils.rb +0 -43
  30. data/lib/conceptql/version.rb +1 -1
  31. data/lib/conceptql/vocabularies/entry.rb +0 -20
  32. data/lib/conceptql/vocabularies/vocabulary_class_factory.rb +2 -15
  33. metadata +16 -13
  34. data/lib/conceptql/data_model/omopv4_plus.rb +0 -12
  35. data/lib/conceptql/query_modifiers/omopv4_plus/admission_date_query_modifier.rb +0 -45
  36. data/lib/conceptql/query_modifiers/omopv4_plus/drug_query_modifier.rb +0 -80
  37. data/lib/conceptql/query_modifiers/omopv4_plus/pos_query_modifier.rb +0 -47
  38. data/lib/conceptql/query_modifiers/omopv4_plus/provenance_query_modifier.rb +0 -45
  39. data/lib/conceptql/query_modifiers/omopv4_plus/provider_query_modifier.rb +0 -26
  40. data/lib/conceptql/sql_formatters/formatter.rb +0 -25
  41. data/lib/conceptql/sql_formatters.rb +0 -22
  42. data/lib/conceptql/vocabularies/behaviors/costish.rb +0 -24
  43. data/lib/conceptql/vocabularies/behaviors/omopish.rb +0 -32
  44. data/schemas/omopv4_plus.yml +0 -729
  45. data/schemas/omopv4_plus_more_ignorables.tsv +0 -13
@@ -1,729 +0,0 @@
1
- ---
2
- :location:
3
- :columns:
4
- :location_id:
5
- :type: Bignum
6
- :primary_key: true
7
- :address_1:
8
- :type: String
9
- :size: 50
10
- :address_2:
11
- :type: String
12
- :size: 50
13
- :city:
14
- :type: String
15
- :size: 50
16
- :state:
17
- :type: String
18
- :size: 2
19
- :fixed: true
20
- :zip:
21
- :type: String
22
- :size: 9
23
- :county:
24
- :type: String
25
- :size: 20
26
- :location_source_value:
27
- :type: String
28
- :size: 50
29
-
30
- :organization:
31
- :ignorable: true
32
- :columns:
33
- :organization_id:
34
- :type: Bignum
35
- :primary_key: true
36
- :place_of_service_concept_id:
37
- :type: Bignum
38
- :foreign_key: concept
39
- :place_of_service_source_vocabulary_id:
40
- :type: Bignum
41
- :foreign_key: vocabulary
42
- :location_id:
43
- :type: Bignum
44
- :foreign_key: location
45
- :organization_source_value:
46
- :type: String
47
- :size: 50
48
- :null: false
49
- :place_of_service_source_value:
50
- :type: String
51
- :size: 50
52
-
53
- :care_site:
54
- :ignorable: true
55
- :columns:
56
- :care_site_id:
57
- :type: Bignum
58
- :primary_key: true
59
- :null: false
60
- :location_id:
61
- :type: Bignum
62
- :foreign_key: location
63
- :null: false
64
- :organization_id:
65
- :type: Bignum
66
- :foreign_key: organization
67
- :null: false
68
- :place_of_service_concept_id:
69
- :type: Bignum
70
- :foreign_key: concept
71
- :place_of_service_source_vocabulary_id:
72
- :type: Bignum
73
- :foreign_key: vocabulary
74
- :care_site_source_value:
75
- :type: String
76
- :size: 50
77
- :place_of_service_source_value:
78
- :type: String
79
- :size: 50
80
- :null: false
81
-
82
- :provider:
83
- :columns:
84
- :provider_id:
85
- :type: Bignum
86
- :primary_key: true
87
- :npi:
88
- :type: String
89
- :size: 20
90
- :ignorable: true
91
- :dea:
92
- :type: String
93
- :size: 20
94
- :ignorable: true
95
- :specialty_concept_id:
96
- :type: Bignum
97
- :foreign_key: concept
98
- :specialty_source_vocabulary_id:
99
- :type: Bignum
100
- :foreign_key: vocabulary
101
- :ignorable: true
102
- :care_site_id:
103
- :type: Bignum
104
- :foreign_key: care_site
105
- :null: false
106
- :ignorable: true
107
- :provider_source_value:
108
- :type: String
109
- :size: 50
110
- :null: false
111
- :ignorable: true
112
- :specialty_source_value:
113
- :type: String
114
- :size: 50
115
- :ignorable: true
116
-
117
- :person:
118
- :columns:
119
- :person_id:
120
- :type: Bignum
121
- :primary_key: true
122
- :gender_concept_id:
123
- :type: Bignum
124
- :foreign_key: concept
125
- :null: false
126
- :gender_source_vocabulary_id:
127
- :type: Bignum
128
- :foreign_key: vocabulary
129
- :ignorable: true
130
- :year_of_birth:
131
- :type: Integer
132
- :null: false
133
- :month_of_birth:
134
- :type: Integer
135
- :day_of_birth:
136
- :type: Integer
137
- :race_concept_id:
138
- :type: Bignum
139
- :foreign_key: concept
140
- :race_source_vocabulary_id:
141
- :type: Bignum
142
- :foreign_key: vocabulary
143
- :ignorable: true
144
- :ethnicity_concept_id:
145
- :type: Bignum
146
- :foreign_key: concept
147
- :ethnicity_source_vocabulary_id:
148
- :type: Bignum
149
- :foreign_key: vocabulary
150
- :ignorable: true
151
- :location_id:
152
- :type: Bignum
153
- :foreign_key: location
154
- :provider_id:
155
- :type: Bignum
156
- :foreign_key: provider
157
- :care_site_id:
158
- :type: Bignum
159
- :foreign_key: care_site
160
- :ignorable: true
161
- :person_source_value:
162
- :type: String
163
- :size: 50
164
- :gender_source_value:
165
- :type: String
166
- :size: 50
167
- :ignorable: true
168
- :race_source_value:
169
- :type: String
170
- :size: 50
171
- :ignorable: true
172
- :ethnicity_source_value:
173
- :type: String
174
- :size: 50
175
- :ignorable: true
176
-
177
- :death:
178
- :columns:
179
- :person_id:
180
- :type: Bignum
181
- :primary_key: true
182
- :foreign_key: person
183
- :death_date:
184
- :type: Date
185
- :null: false
186
- :death_type_concept_id:
187
- :type: Bignum
188
- :foreign_key: concept
189
- :null: false
190
- :death_type_source_vocabulary_id:
191
- :type: Bignum
192
- :foreign_key: vocabulary
193
- :ignorable: true
194
- :cause_of_death_concept_id:
195
- :type: Bignum
196
- :foreign_key: concept
197
- :ignorable: true
198
- :cause_of_death_source_vocabulary_id:
199
- :type: Bignum
200
- :foreign_key: vocabulary
201
- :ignorable: true
202
- :cause_of_death_source_value:
203
- :type: String
204
- :size: 50
205
-
206
- :observation_period:
207
- :columns:
208
- :observation_period_id:
209
- :type: Bignum
210
- :primary_key: true
211
- :person_id:
212
- :type: Bignum
213
- :foreign_key: person
214
- :null: false
215
- :observation_period_start_date:
216
- :type: Date
217
- :null: false
218
- :observation_period_end_date:
219
- :type: Date
220
- :null: false
221
- :prev_ds_period_end_date:
222
- :type: Date
223
- :ignorable: true
224
-
225
- :payer_plan_period:
226
- :columns:
227
- :payer_plan_period_id:
228
- :type: Bignum
229
- :primary_key: true
230
- :person_id:
231
- :type: Bignum
232
- :foreign_key: person
233
- :null: false
234
- :payer_plan_period_start_date:
235
- :type: Date
236
- :null: false
237
- :payer_plan_period_end_date:
238
- :type: Date
239
- :null: false
240
- :payer_source_value:
241
- :type: String
242
- :size: 50
243
- :plan_source_value:
244
- :type: String
245
- :size: 50
246
- :family_source_value:
247
- :type: String
248
- :size: 50
249
- :ignorable: true
250
- :prev_ds_period_end_date:
251
- :type: Date
252
- :ignorable: true
253
-
254
- :visit_occurrence:
255
- :columns:
256
- :visit_occurrence_id:
257
- :type: Bignum
258
- :primary_key: true
259
- :person_id:
260
- :type: Bignum
261
- :foreign_key: person
262
- :null: false
263
- :visit_start_date:
264
- :type: Date
265
- :null: false
266
- :visit_end_date:
267
- :type: Date
268
- :null: false
269
- :place_of_service_concept_id:
270
- :type: Bignum
271
- :foreign_key: concept
272
- :null: false
273
- :care_site_id:
274
- :type: Bignum
275
- :foreign_key: care_ste
276
- :ignorable: true
277
- :place_of_service_source_value:
278
- :type: String
279
- :size: 50
280
- :visit_occurrence_type_id:
281
- :type: Bignum
282
- :foreign_key: concept
283
- :ignorable: true
284
- :visit_source_concept_id:
285
- :type: Bignum
286
- :foreign_key: concept
287
- :admitting_source_value:
288
- :type: String
289
- :size: 50
290
- :ignorable: true
291
-
292
- :condition_occurrence:
293
- :columns:
294
- :condition_occurrence_id:
295
- :type: Bignum
296
- :primary_key: true
297
- :person_id:
298
- :type: Bignum
299
- :foreign_key: person
300
- :null: false
301
- :condition_concept_id:
302
- :type: Bignum
303
- :foreign_key: concept
304
- :null: false
305
- :condition_source_vocabulary_id:
306
- :type: Bignum
307
- :foreign_key: vocabulary
308
- :condition_start_date:
309
- :type: Date
310
- :null: false
311
- :condition_end_date:
312
- :type: Date
313
- :condition_type_concept_id:
314
- :type: Bignum
315
- :foreign_key: concept
316
- :null: false
317
- :stop_reason:
318
- :type: String
319
- :size: 20
320
- :ignorable: true
321
- :associated_provider_id:
322
- :type: Bignum
323
- :foreign_key: provider
324
- :visit_occurrence_id:
325
- :type: Bignum
326
- :foreign_key: visit_occurrence
327
- :condition_source_value:
328
- :type: String
329
- :size: 50
330
-
331
- :drug_exposure:
332
- :columns:
333
- :drug_exposure_id:
334
- :type: Bignum
335
- :primary_key: true
336
- :person_id:
337
- :type: Bignum
338
- :foreign_key: person
339
- :null: false
340
- :drug_concept_id:
341
- :type: Bignum
342
- :foreign_key: concept
343
- :null: false
344
- :drug_source_vocabulary_id:
345
- :type: Bignum
346
- :foreign_key: vocabulary
347
- :drug_exposure_start_date:
348
- :type: Date
349
- :null: false
350
- :drug_exposure_end_date:
351
- :type: Date
352
- :drug_type_concept_id:
353
- :type: Bignum
354
- :foreign_key: concept
355
- :null: false
356
- :stop_reason:
357
- :type: String
358
- :size: 20
359
- :ignorable: true
360
- :refills:
361
- :type: Integer
362
- :ignorable: true
363
- :quantity:
364
- :type: Float
365
- :days_supply:
366
- :type: Integer
367
- :sig:
368
- :type: String
369
- :size: 500
370
- :ignorable: true
371
- :prescribing_provider_id:
372
- :type: Bignum
373
- :foreign_key: provider
374
- :visit_occurrence_id:
375
- :type: Bignum
376
- :foreign_key: visit_occurrence
377
- :relevant_condition_concept_id:
378
- :type: Bignum
379
- :foreign_key: concept
380
- :ignorable: true
381
- :drug_source_value:
382
- :type: String
383
- :size: 50
384
-
385
- :drug_cost:
386
- :ignorable: true
387
- :columns:
388
- :drug_cost_id:
389
- :type: Bignum
390
- :primary_key: true
391
- :drug_exposure_id:
392
- :type: Bignum
393
- :foreign_key: drug_exposure
394
- :null: false
395
- :paid_copay:
396
- :type: Float
397
- :ignorable: true
398
- :paid_coinsurance:
399
- :type: Float
400
- :ignorable: true
401
- :paid_toward_deductible:
402
- :type: Float
403
- :ignorable: true
404
- :paid_by_payer:
405
- :type: Float
406
- :ignorable: true
407
- :paid_by_coordination_benefits:
408
- :type: Float
409
- :ignorable: true
410
- :total_out_of_pocket:
411
- :type: Float
412
- :ignorable: true
413
- :total_paid:
414
- :type: Float
415
- :ignorable: true
416
- :ingredient_cost:
417
- :type: Float
418
- :ignorable: true
419
- :dispensing_fee:
420
- :type: Float
421
- :ignorable: true
422
- :average_wholesale_price:
423
- :type: Float
424
- :ignorable: true
425
- :payer_plan_period_id:
426
- :type: Bignum
427
- :foreign_key: payer_plan_period
428
- :ignorable: true
429
-
430
- :procedure_occurrence:
431
- :columns:
432
- :procedure_occurrence_id:
433
- :type: Bignum
434
- :primary_key: true
435
- :person_id:
436
- :type: Bignum
437
- :foreign_key: person
438
- :null: false
439
- :procedure_concept_id:
440
- :type: Bignum
441
- :foreign_key: concept
442
- :null: false
443
- :procedure_source_vocabulary_id:
444
- :type: Bignum
445
- :foreign_key: vocabulary
446
- :procedure_date:
447
- :type: Date
448
- :null: false
449
- :procedure_type_concept_id:
450
- :type: Bignum
451
- :foreign_key: concept
452
- :null: false
453
- :associated_provider_id:
454
- :type: Bignum
455
- :foreign_key: provider
456
- :visit_occurrence_id:
457
- :type: Bignum
458
- :foreign_key: visit_occurrence
459
- :relevant_condition_concept_id:
460
- :type: Bignum
461
- :foreign_key: concept
462
- :ignorable: true
463
- :procedure_source_value:
464
- :type: String
465
- :size: 50
466
-
467
- :procedure_cost:
468
- :columns:
469
- :procedure_cost_id:
470
- :type: Bignum
471
- :primary_key: true
472
- :procedure_occurrence_id:
473
- :type: Bignum
474
- :foreign_key: procedure_occurrence
475
- :null: false
476
- :paid_copay:
477
- :type: Float
478
- :ignorable: true
479
- :paid_coinsurance:
480
- :type: Float
481
- :ignorable: true
482
- :paid_toward_deductible:
483
- :type: Float
484
- :ignorable: true
485
- :paid_by_payer:
486
- :type: Float
487
- :ignorable: true
488
- :paid_by_coordination_benefits:
489
- :type: Float
490
- :ignorable: true
491
- :total_out_of_pocket:
492
- :type: Float
493
- :ignorable: true
494
- :total_paid:
495
- :type: Float
496
- :ignorable: true
497
- :disease_class_concept_id:
498
- :type: Bignum
499
- :foreign_key: concept
500
- :ignorable: true
501
- :revenue_code_concept_id:
502
- :type: Bignum
503
- :foreign_key: concept
504
- :ignorable: true
505
- :payer_plan_period_id:
506
- :type: Bignum
507
- :foreign_key: payer_plan_period
508
- :ignorable: true
509
- :disease_class_source_value:
510
- :type: String
511
- :size: 50
512
- :revenue_code_source_value:
513
- :type: String
514
- :size: 50
515
-
516
- :observation:
517
- :columns:
518
- :observation_id:
519
- :type: Bignum
520
- :primary_key: true
521
- :person_id:
522
- :type: Bignum
523
- :foreign_key: person
524
- :null: false
525
- :observation_concept_id:
526
- :type: Bignum
527
- :foreign_key: concept
528
- :null: false
529
- :observation_source_vocabulary_id:
530
- :type: Bignum
531
- :foreign_key: vocabulary
532
- :observation_date:
533
- :type: Date
534
- :null: false
535
- :observation_time:
536
- :type: Date
537
- :ignorable: true
538
- :value_as_number:
539
- :type: Float
540
- :value_as_string:
541
- :type: String
542
- :size: 60
543
- :value_as_concept_id:
544
- :type: Bignum
545
- :foreign_key: concept
546
- :unit_concept_id:
547
- :type: Bignum
548
- :foreign_key: concept
549
- :range_low:
550
- :type: Float
551
- :range_high:
552
- :type: Float
553
- :observation_type_concept_id:
554
- :type: Bignum
555
- :foreign_key: concept
556
- :null: false
557
- :associated_provider_id:
558
- :type: Bignum
559
- :foreign_key: provider
560
- :visit_occurrence_id:
561
- :type: Bignum
562
- :foreign_key: visit_occurrence
563
- :relevant_condition_concept_id:
564
- :type: Bignum
565
- :foreign_key: concept
566
- :ignorable: true
567
- :observation_source_value:
568
- :type: String
569
- :size: 50
570
- :unit_source_value:
571
- :type: String
572
- :size: 50
573
-
574
- :concept:
575
- :columns:
576
- :concept_id:
577
- :type: Bignum
578
- :primary_key: true
579
- :concept_name:
580
- :type: String
581
- :concept_level:
582
- :type: Integer
583
- :ignorable: true
584
- :concept_class:
585
- :type: String
586
- :ignorable: true
587
- :vocabulary_id:
588
- :type: Bignum
589
- :foreign_key: vocabulary
590
- :concept_code:
591
- :type: String
592
- :valid_start_date:
593
- :type: Date
594
- :ignorable: true
595
- :valid_end_date:
596
- :type: Date
597
- :ignorable: true
598
- :invalid_reason:
599
- :type: String
600
- :ignorable: true
601
-
602
- :vocabulary:
603
- :columns:
604
- :vocabulary_id:
605
- :type: Bignum
606
- :primary_key: true
607
- :vocabulary_name:
608
- :type: String
609
-
610
- :source_to_concept_map:
611
- :columns:
612
- :source_code:
613
- :type: String
614
- :source_vocabulary_id:
615
- :type: Bignum
616
- :foreign_key: vocabulary
617
- :source_code_description:
618
- :type: String
619
- :target_concept_id:
620
- :type: Bignum
621
- :foreign_key: concept
622
- :target_vocabulary_id:
623
- :type: Bignum
624
- :foreign_key: vocabulary
625
- :mapping_type:
626
- :type: String
627
- :primary_map:
628
- :type: String
629
- :valid_start_date:
630
- :type: Date
631
- :ignorable: true
632
- :valid_end_date:
633
- :type: Date
634
- :ignorable: true
635
- :invalid_reason:
636
- :type: String
637
- :ignorable: true
638
-
639
- :cohort:
640
- :ignorable: true
641
- :columns:
642
- :cohort_id:
643
- :type: Bignum
644
- :primary_key: true
645
- :cohort_concept_id:
646
- :type: Bignum
647
- :foreign_key: concept
648
- :null: false
649
- :cohort_start_date:
650
- :type: Date
651
- :null: false
652
- :cohort_end_date:
653
- :type: Date
654
- :subject_id:
655
- :type: Bignum
656
- :null: false
657
- :stop_reason:
658
- :type: String
659
- :size: 20
660
- :indexes:
661
- :coh_cohconid:
662
- :columns:
663
- - cohort_concept_id
664
- :coh_cohid:
665
- :columns:
666
- - cohort_id
667
- :coh_subid:
668
- :columns:
669
- - subject_id
670
-
671
- :condition_era:
672
- :ignorable: true
673
- :columns:
674
- :condition_era_id:
675
- :type: Bignum
676
- :primary_key: true
677
- :person_id:
678
- :type: Bignum
679
- :foreign_key: person
680
- :null: false
681
- :condition_concept_id:
682
- :type: Bignum
683
- :foreign_key: concept
684
- :null: false
685
- :condition_source_vocabulary_id:
686
- :type: Bignum
687
- :foreign_key: vocabulary
688
- :condition_era_start_date:
689
- :type: Date
690
- :null: false
691
- :condition_era_end_date:
692
- :type: Date
693
- :null: false
694
- :condition_type_concept_id:
695
- :type: Bignum
696
- :foreign_key: concept
697
- :null: false
698
- :condition_occurrence_count:
699
- :type: Integer
700
-
701
- :drug_era:
702
- :ignorable: true
703
- :columns:
704
- :drug_era_id:
705
- :type: Bignum
706
- :primary_key: true
707
- :person_id:
708
- :type: Bignum
709
- :foreign_key: person
710
- :null: false
711
- :drug_concept_id:
712
- :type: Bignum
713
- :foreign_key: concept
714
- :null: false
715
- :drug_source_vocabulary_id:
716
- :type: Bignum
717
- :foreign_key: vocabulary
718
- :drug_era_start_date:
719
- :type: Date
720
- :null: false
721
- :drug_era_end_date:
722
- :type: Date
723
- :null: false
724
- :drug_type_concept_id:
725
- :type: Bignum
726
- :foreign_key: concept
727
- :null: false
728
- :drug_exposure_count:
729
- :type: Integer
@@ -1,13 +0,0 @@
1
- condition_occurrence visit_detail_id
2
- condition_occurrence source
3
- condition_occurrence target_concept_id
4
- drug_exposure visit_detail_id
5
- drug_exposure source
6
- drug_exposure target_concept_id
7
- drug_strength box_size
8
- observation visit_detail_id
9
- observation source
10
- observation target_concept_id
11
- payer_plan_period rx
12
- payer_plan_period source
13
- person source