conceptql 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +53 -1
- data/Guardfile +52 -24
- data/conceptql.gemspec +5 -3
- data/doc/spec.md +2 -2
- data/lib/conceptql/behaviors/debuggable.rb +70 -0
- data/lib/conceptql/behaviors/dottable.rb +28 -14
- data/lib/conceptql/behaviors/metadatable.rb +97 -0
- data/lib/conceptql/behaviors/preppable.rb +20 -0
- data/lib/conceptql/cli.rb +31 -5
- data/lib/conceptql/converter.rb +65 -0
- data/lib/conceptql/debugger.rb +48 -0
- data/lib/conceptql/graph.rb +14 -13
- data/lib/conceptql/graph_nodifier.rb +49 -17
- data/lib/conceptql/nodifier.rb +31 -6
- data/lib/conceptql/operators/after.rb +25 -0
- data/lib/conceptql/operators/any_overlap.rb +15 -0
- data/lib/conceptql/operators/before.rb +21 -0
- data/lib/conceptql/{nodes/binary_operator_node.rb → operators/binary_operator_operator.rb} +12 -8
- data/lib/conceptql/{nodes/casting_node.rb → operators/casting_operator.rb} +8 -7
- data/lib/conceptql/{nodes → operators}/complement.rb +14 -11
- data/lib/conceptql/operators/concept.rb +70 -0
- data/lib/conceptql/{nodes → operators}/condition_type.rb +13 -5
- data/lib/conceptql/operators/contains.rb +17 -0
- data/lib/conceptql/operators/count.rb +26 -0
- data/lib/conceptql/operators/cpt.rb +25 -0
- data/lib/conceptql/{nodes → operators}/date_range.rb +11 -6
- data/lib/conceptql/operators/death.rb +23 -0
- data/lib/conceptql/operators/drug_type_concept.rb +21 -0
- data/lib/conceptql/{nodes → operators}/during.rb +9 -3
- data/lib/conceptql/operators/equal.rb +13 -0
- data/lib/conceptql/operators/except.rb +28 -0
- data/lib/conceptql/operators/filter.rb +21 -0
- data/lib/conceptql/{nodes → operators}/first.rb +7 -5
- data/lib/conceptql/{nodes → operators}/from.rb +2 -2
- data/lib/conceptql/operators/from_seer_visits.rb +23 -0
- data/lib/conceptql/{nodes → operators}/gender.rb +6 -6
- data/lib/conceptql/operators/hcpcs.rb +25 -0
- data/lib/conceptql/operators/icd10.rb +28 -0
- data/lib/conceptql/operators/icd9.rb +28 -0
- data/lib/conceptql/operators/icd9_procedure.rb +25 -0
- data/lib/conceptql/{nodes → operators}/intersect.rb +7 -3
- data/lib/conceptql/{nodes → operators}/last.rb +7 -5
- data/lib/conceptql/operators/loinc.rb +25 -0
- data/lib/conceptql/operators/medcode.rb +28 -0
- data/lib/conceptql/operators/medcode_procedure.rb +27 -0
- data/lib/conceptql/operators/ndc.rb +29 -0
- data/lib/conceptql/operators/numeric.rb +54 -0
- data/lib/conceptql/operators/observation_by_enttype.rb +29 -0
- data/lib/conceptql/operators/observation_period.rb +30 -0
- data/lib/conceptql/operators/occurrence.rb +70 -0
- data/lib/conceptql/operators/one_in_two_out.rb +62 -0
- data/lib/conceptql/{nodes/node.rb → operators/operator.rb} +84 -52
- data/lib/conceptql/operators/overlapped_by.rb +23 -0
- data/lib/conceptql/operators/overlaps.rb +19 -0
- data/lib/conceptql/operators/pass_thru.rb +11 -0
- data/lib/conceptql/{nodes → operators}/person.rb +8 -4
- data/lib/conceptql/operators/person_filter.rb +13 -0
- data/lib/conceptql/{nodes → operators}/place_of_service_code.rb +7 -7
- data/lib/conceptql/operators/procedure_occurrence.rb +25 -0
- data/lib/conceptql/operators/prodcode.rb +29 -0
- data/lib/conceptql/{nodes → operators}/race.rb +7 -7
- data/lib/conceptql/operators/recall.rb +38 -0
- data/lib/conceptql/operators/rxnorm.rb +24 -0
- data/lib/conceptql/operators/snomed.rb +24 -0
- data/lib/conceptql/operators/snomed_condition.rb +26 -0
- data/lib/conceptql/{nodes/source_vocabulary_node.rb → operators/source_vocabulary_operator.rb} +7 -4
- data/lib/conceptql/{nodes/standard_vocabulary_node.rb → operators/standard_vocabulary_operator.rb} +6 -4
- data/lib/conceptql/{nodes → operators}/started_by.rb +9 -3
- data/lib/conceptql/{nodes → operators}/sum.rb +9 -4
- data/lib/conceptql/{nodes/temporal_node.rb → operators/temporal_operator.rb} +7 -4
- data/lib/conceptql/{nodes → operators}/time_window.rb +19 -7
- data/lib/conceptql/operators/to_seer_visits.rb +24 -0
- data/lib/conceptql/operators/trim_date_end.rb +55 -0
- data/lib/conceptql/operators/trim_date_start.rb +56 -0
- data/lib/conceptql/{nodes → operators}/union.rb +6 -2
- data/lib/conceptql/operators/visit.rb +15 -0
- data/lib/conceptql/{nodes → operators}/visit_occurrence.rb +7 -3
- data/lib/conceptql/query.rb +19 -17
- data/lib/conceptql/scope.rb +69 -0
- data/lib/conceptql/tree.rb +33 -18
- data/lib/conceptql/utils/temp_table.rb +72 -0
- data/lib/conceptql/version.rb +1 -1
- data/spec/conceptql/behaviors/dottable_spec.rb +39 -51
- data/spec/conceptql/converter_spec.rb +51 -0
- data/spec/conceptql/date_adjuster_spec.rb +15 -15
- data/spec/conceptql/operators/after_spec.rb +16 -0
- data/spec/conceptql/operators/before_spec.rb +16 -0
- data/spec/conceptql/{nodes/casting_node_spec.rb → operators/casting_operator_spec.rb} +16 -20
- data/spec/conceptql/operators/complement_spec.rb +15 -0
- data/spec/conceptql/operators/concept_spec.rb +40 -0
- data/spec/conceptql/{nodes → operators}/condition_type_spec.rb +39 -24
- data/spec/conceptql/operators/contains_spec.rb +19 -0
- data/spec/conceptql/operators/cpt_spec.rb +29 -0
- data/spec/conceptql/operators/date_range_spec.rb +33 -0
- data/spec/conceptql/operators/death_spec.rb +10 -0
- data/spec/conceptql/operators/during_spec.rb +30 -0
- data/spec/conceptql/operators/except_spec.rb +15 -0
- data/spec/conceptql/operators/first_spec.rb +35 -0
- data/spec/conceptql/operators/from_spec.rb +13 -0
- data/spec/conceptql/operators/gender_spec.rb +27 -0
- data/spec/conceptql/operators/hcpcs_spec.rb +29 -0
- data/spec/conceptql/operators/icd10_spec.rb +34 -0
- data/spec/conceptql/operators/icd9_procedure_spec.rb +29 -0
- data/spec/conceptql/operators/icd9_spec.rb +34 -0
- data/spec/conceptql/operators/intersect_spec.rb +28 -0
- data/spec/conceptql/operators/last_spec.rb +36 -0
- data/spec/conceptql/operators/loinc_spec.rb +29 -0
- data/spec/conceptql/operators/medcode_procedure_spec.rb +34 -0
- data/spec/conceptql/operators/medcode_spec.rb +34 -0
- data/spec/conceptql/operators/observation_period_spec.rb +10 -0
- data/spec/conceptql/operators/occurrence_spec.rb +87 -0
- data/spec/conceptql/operators/overlapped_by_spec.rb +32 -0
- data/spec/conceptql/operators/overlaps_spec.rb +21 -0
- data/spec/conceptql/operators/person_filter_spec.rb +15 -0
- data/spec/conceptql/operators/person_spec.rb +10 -0
- data/spec/conceptql/{nodes → operators}/place_of_service_code_spec.rb +6 -8
- data/spec/conceptql/operators/procedure_occurrence_spec.rb +10 -0
- data/spec/conceptql/operators/prodcode_spec.rb +35 -0
- data/spec/conceptql/operators/query_double.rb +20 -0
- data/spec/conceptql/operators/query_double_spec.rb +7 -0
- data/spec/conceptql/operators/race_spec.rb +21 -0
- data/spec/conceptql/operators/rxnorm_spec.rb +29 -0
- data/spec/conceptql/operators/snomed_spec.rb +29 -0
- data/spec/conceptql/operators/source_vocabulary_operator_spec.rb +35 -0
- data/spec/conceptql/operators/standard_vocabulary_operator_spec.rb +35 -0
- data/spec/conceptql/operators/started_by_spec.rb +22 -0
- data/spec/conceptql/{nodes/temporal_node_spec.rb → operators/temporal_operator_spec.rb} +11 -17
- data/spec/conceptql/operators/time_window_spec.rb +77 -0
- data/spec/conceptql/operators/union_spec.rb +21 -0
- data/spec/conceptql/operators/visit_occurrence_spec.rb +10 -0
- data/spec/conceptql/query_spec.rb +10 -9
- data/spec/conceptql/tree_spec.rb +24 -28
- data/spec/doubles/stream_for_casting_double.rb +1 -1
- data/spec/doubles/stream_for_occurrence_double.rb +1 -1
- data/spec/doubles/stream_for_temporal_double.rb +1 -1
- data/spec/spec_helper.rb +74 -58
- metadata +202 -133
- data/lib/conceptql/nodes/after.rb +0 -12
- data/lib/conceptql/nodes/before.rb +0 -11
- data/lib/conceptql/nodes/concept.rb +0 -38
- data/lib/conceptql/nodes/count.rb +0 -23
- data/lib/conceptql/nodes/cpt.rb +0 -20
- data/lib/conceptql/nodes/death.rb +0 -19
- data/lib/conceptql/nodes/define.rb +0 -96
- data/lib/conceptql/nodes/drug_type_concept.rb +0 -18
- data/lib/conceptql/nodes/equal.rb +0 -11
- data/lib/conceptql/nodes/except.rb +0 -11
- data/lib/conceptql/nodes/hcpcs.rb +0 -20
- data/lib/conceptql/nodes/icd10.rb +0 -23
- data/lib/conceptql/nodes/icd9.rb +0 -23
- data/lib/conceptql/nodes/icd9_procedure.rb +0 -20
- data/lib/conceptql/nodes/loinc.rb +0 -20
- data/lib/conceptql/nodes/numeric.rb +0 -40
- data/lib/conceptql/nodes/occurrence.rb +0 -49
- data/lib/conceptql/nodes/pass_thru.rb +0 -11
- data/lib/conceptql/nodes/person_filter.rb +0 -12
- data/lib/conceptql/nodes/procedure_occurrence.rb +0 -21
- data/lib/conceptql/nodes/recall.rb +0 -50
- data/lib/conceptql/nodes/rxnorm.rb +0 -20
- data/lib/conceptql/nodes/snomed.rb +0 -19
- data/lib/conceptql/nodes/visit.rb +0 -11
- data/spec/conceptql/nodes/after_spec.rb +0 -18
- data/spec/conceptql/nodes/before_spec.rb +0 -18
- data/spec/conceptql/nodes/complement_spec.rb +0 -15
- data/spec/conceptql/nodes/concept_spec.rb +0 -34
- data/spec/conceptql/nodes/cpt_spec.rb +0 -31
- data/spec/conceptql/nodes/date_range_spec.rb +0 -35
- data/spec/conceptql/nodes/death_spec.rb +0 -12
- data/spec/conceptql/nodes/during_spec.rb +0 -32
- data/spec/conceptql/nodes/except_spec.rb +0 -18
- data/spec/conceptql/nodes/first_spec.rb +0 -37
- data/spec/conceptql/nodes/from_spec.rb +0 -15
- data/spec/conceptql/nodes/gender_spec.rb +0 -29
- data/spec/conceptql/nodes/hcpcs_spec.rb +0 -31
- data/spec/conceptql/nodes/icd10_spec.rb +0 -36
- data/spec/conceptql/nodes/icd9_procedure_spec.rb +0 -31
- data/spec/conceptql/nodes/icd9_spec.rb +0 -36
- data/spec/conceptql/nodes/intersect_spec.rb +0 -33
- data/spec/conceptql/nodes/last_spec.rb +0 -38
- data/spec/conceptql/nodes/loinc_spec.rb +0 -31
- data/spec/conceptql/nodes/occurrence_spec.rb +0 -89
- data/spec/conceptql/nodes/person_filter_spec.rb +0 -18
- data/spec/conceptql/nodes/person_spec.rb +0 -12
- data/spec/conceptql/nodes/procedure_occurrence_spec.rb +0 -12
- data/spec/conceptql/nodes/query_double.rb +0 -19
- data/spec/conceptql/nodes/race_spec.rb +0 -23
- data/spec/conceptql/nodes/rxnorm_spec.rb +0 -31
- data/spec/conceptql/nodes/snomed_spec.rb +0 -31
- data/spec/conceptql/nodes/source_vocabulary_node_spec.rb +0 -37
- data/spec/conceptql/nodes/standard_vocabulary_node_spec.rb +0 -40
- data/spec/conceptql/nodes/started_by_spec.rb +0 -25
- data/spec/conceptql/nodes/time_window_spec.rb +0 -85
- data/spec/conceptql/nodes/union_spec.rb +0 -25
- data/spec/conceptql/nodes/visit_occurrence_spec.rb +0 -12
data/spec/spec_helper.rb
CHANGED
@@ -1,70 +1,98 @@
|
|
1
1
|
require 'sequel'
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
shared_examples_for(:evaluator) do
|
4
|
+
let(:evaluator) { described_class.new }
|
5
|
+
it "should respond to evaluate" do
|
6
|
+
expect(evaluator.respond_to?(:evaluate)).to be true
|
7
|
+
end
|
5
8
|
|
6
|
-
|
7
|
-
|
8
|
-
@shared_examples[name]
|
9
|
+
it "should respond to query" do
|
10
|
+
expect(evaluator.respond_to?(:query)).to be true
|
9
11
|
end
|
10
12
|
|
11
|
-
|
12
|
-
|
13
|
-
@shared_examples[name] = block
|
13
|
+
it "shoudl respond to types" do
|
14
|
+
expect(evaluator.respond_to?(:types)).to be true
|
14
15
|
end
|
15
16
|
end
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
18
|
+
shared_examples_for(:source_vocabulary_operator) do
|
19
|
+
let(:source_vocabulary_operator) { described_class.new }
|
20
|
+
it_behaves_like :evaluator
|
20
21
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
subject.must_respond_to(:types)
|
25
|
-
end
|
22
|
+
it "should respond to #table" do
|
23
|
+
expect(source_vocabulary_operator.respond_to?(:table)).to be true
|
24
|
+
end
|
26
25
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
subject.must_respond_to(:concept_column)
|
31
|
-
subject.must_respond_to(:source_column)
|
32
|
-
subject.must_respond_to(:vocabulary_id)
|
33
|
-
end
|
26
|
+
it "should respond to #concept_column" do
|
27
|
+
expect(source_vocabulary_operator.respond_to?(:concept_column)).to be true
|
28
|
+
end
|
34
29
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
subject.must_respond_to(:concept_column)
|
39
|
-
subject.must_respond_to(:vocabulary_id)
|
40
|
-
end
|
30
|
+
it "should respond to #source_column" do
|
31
|
+
expect(source_vocabulary_operator.respond_to?(:source_column)).to be true
|
32
|
+
end
|
41
33
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
subject.must_respond_to(:children)
|
34
|
+
it "should respond to #vocabulary_id" do
|
35
|
+
expect(source_vocabulary_operator.respond_to?(:vocabulary_id)).to be true
|
36
|
+
end
|
46
37
|
end
|
47
38
|
|
48
|
-
shared_examples_for(:
|
49
|
-
|
50
|
-
|
39
|
+
shared_examples_for(:standard_vocabulary_operator) do
|
40
|
+
let(:standard_vocabulary_operator) { described_class.new }
|
41
|
+
|
42
|
+
it_behaves_like :evaluator
|
43
|
+
|
44
|
+
it "should respond to #table" do
|
45
|
+
expect(standard_vocabulary_operator.respond_to?(:table)).to be true
|
46
|
+
end
|
47
|
+
|
48
|
+
it "should respond to #concept_column" do
|
49
|
+
expect(standard_vocabulary_operator.respond_to?(:concept_column)).to be true
|
50
|
+
end
|
51
|
+
|
52
|
+
it "should respond to #vocabulary_id" do
|
53
|
+
expect(standard_vocabulary_operator.respond_to?(:vocabulary_id)).to be true
|
54
|
+
end
|
51
55
|
end
|
52
56
|
|
53
|
-
shared_examples_for(:
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
57
|
+
shared_examples_for(:operator) do
|
58
|
+
let(:operator) { described_class.new }
|
59
|
+
|
60
|
+
it "should respond to #values" do
|
61
|
+
expect(operator.respond_to?(:values)).to be true
|
62
|
+
end
|
63
|
+
|
64
|
+
it "should respond to #arguments" do
|
65
|
+
expect(operator.respond_to?(:arguments)).to be true
|
66
|
+
end
|
67
|
+
|
68
|
+
it "should respond to #upstreams" do
|
69
|
+
expect(operator.respond_to?(:upstreams)).to be true
|
70
|
+
end
|
58
71
|
end
|
59
72
|
|
60
|
-
|
61
|
-
|
62
|
-
|
73
|
+
shared_examples_for(:temporal_operator) do
|
74
|
+
let(:temporal_operator) { described_class.new }
|
75
|
+
|
76
|
+
it "should respond to #where_clause" do
|
77
|
+
expect(temporal_operator.respond_to?(:where_clause)).to be true
|
63
78
|
end
|
64
79
|
end
|
65
80
|
|
66
|
-
|
67
|
-
|
81
|
+
shared_examples_for(:casting_operator) do
|
82
|
+
let(:casting_operator) { described_class.new }
|
83
|
+
it_behaves_like(:evaluator)
|
84
|
+
|
85
|
+
it "should respond to #my_type" do
|
86
|
+
expect(casting_operator.respond_to?(:my_type)).to be true
|
87
|
+
end
|
88
|
+
|
89
|
+
it "should respond to #i_point_at" do
|
90
|
+
expect(casting_operator.respond_to?(:i_point_at)).to be true
|
91
|
+
end
|
92
|
+
|
93
|
+
it "should respond to #these_point_at_me" do
|
94
|
+
expect(casting_operator.respond_to?(:these_point_at_me)).to be true
|
95
|
+
end
|
68
96
|
end
|
69
97
|
|
70
98
|
def require_double(double_name)
|
@@ -72,15 +100,3 @@ def require_double(double_name)
|
|
72
100
|
p = p + 'spec' + 'doubles' + (double_name + '_double')
|
73
101
|
require(p.expand_path)
|
74
102
|
end
|
75
|
-
|
76
|
-
def stub_const(klass, const, replace, &block)
|
77
|
-
klass.send(:const_set, const, replace)
|
78
|
-
if block_given?
|
79
|
-
yield
|
80
|
-
remove_stubbed_const(klass, const)
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
def remove_stubbed_const(klass, const)
|
85
|
-
klass.send(:remove_const, const)
|
86
|
-
end
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: conceptql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Duryea
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: facets
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '3.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '3.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: sequelizer
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '1.2'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: csv2xlsx
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: bundler
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -109,33 +123,47 @@ dependencies:
|
|
109
123
|
- !ruby/object:Gem::Version
|
110
124
|
version: '10.3'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
126
|
+
name: rspec
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '3.2'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '3.2'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: guard-rspec
|
113
141
|
requirement: !ruby/object:Gem::Requirement
|
114
142
|
requirements:
|
115
143
|
- - "~>"
|
116
144
|
- !ruby/object:Gem::Version
|
117
|
-
version: '5
|
145
|
+
version: '4.5'
|
118
146
|
type: :development
|
119
147
|
prerelease: false
|
120
148
|
version_requirements: !ruby/object:Gem::Requirement
|
121
149
|
requirements:
|
122
150
|
- - "~>"
|
123
151
|
- !ruby/object:Gem::Version
|
124
|
-
version: '5
|
152
|
+
version: '4.5'
|
125
153
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
154
|
+
name: byebug
|
127
155
|
requirement: !ruby/object:Gem::Requirement
|
128
156
|
requirements:
|
129
157
|
- - "~>"
|
130
158
|
- !ruby/object:Gem::Version
|
131
|
-
version: '
|
159
|
+
version: '4.0'
|
132
160
|
type: :development
|
133
161
|
prerelease: false
|
134
162
|
version_requirements: !ruby/object:Gem::Requirement
|
135
163
|
requirements:
|
136
164
|
- - "~>"
|
137
165
|
- !ruby/object:Gem::Version
|
138
|
-
version: '
|
166
|
+
version: '4.0'
|
139
167
|
description: ConceptQL is a query language for specifying queries to be run OMOP CDMv4
|
140
168
|
structured data
|
141
169
|
email:
|
@@ -159,103 +187,135 @@ files:
|
|
159
187
|
- doc/implementation_notes.md
|
160
188
|
- doc/spec.md
|
161
189
|
- lib/conceptql.rb
|
190
|
+
- lib/conceptql/behaviors/debuggable.rb
|
162
191
|
- lib/conceptql/behaviors/dottable.rb
|
192
|
+
- lib/conceptql/behaviors/metadatable.rb
|
193
|
+
- lib/conceptql/behaviors/preppable.rb
|
163
194
|
- lib/conceptql/cli.rb
|
195
|
+
- lib/conceptql/converter.rb
|
164
196
|
- lib/conceptql/date_adjuster.rb
|
197
|
+
- lib/conceptql/debugger.rb
|
165
198
|
- lib/conceptql/fake_grapher.rb
|
166
199
|
- lib/conceptql/graph.rb
|
167
200
|
- lib/conceptql/graph_nodifier.rb
|
168
201
|
- lib/conceptql/logger.rb
|
169
|
-
- lib/conceptql/nodes/after.rb
|
170
|
-
- lib/conceptql/nodes/before.rb
|
171
|
-
- lib/conceptql/nodes/binary_operator_node.rb
|
172
|
-
- lib/conceptql/nodes/casting_node.rb
|
173
|
-
- lib/conceptql/nodes/complement.rb
|
174
|
-
- lib/conceptql/nodes/concept.rb
|
175
|
-
- lib/conceptql/nodes/condition_type.rb
|
176
|
-
- lib/conceptql/nodes/count.rb
|
177
|
-
- lib/conceptql/nodes/cpt.rb
|
178
|
-
- lib/conceptql/nodes/date_range.rb
|
179
|
-
- lib/conceptql/nodes/death.rb
|
180
|
-
- lib/conceptql/nodes/define.rb
|
181
|
-
- lib/conceptql/nodes/drug_type_concept.rb
|
182
|
-
- lib/conceptql/nodes/during.rb
|
183
|
-
- lib/conceptql/nodes/equal.rb
|
184
|
-
- lib/conceptql/nodes/except.rb
|
185
|
-
- lib/conceptql/nodes/first.rb
|
186
|
-
- lib/conceptql/nodes/from.rb
|
187
|
-
- lib/conceptql/nodes/gender.rb
|
188
|
-
- lib/conceptql/nodes/hcpcs.rb
|
189
|
-
- lib/conceptql/nodes/icd10.rb
|
190
|
-
- lib/conceptql/nodes/icd9.rb
|
191
|
-
- lib/conceptql/nodes/icd9_procedure.rb
|
192
|
-
- lib/conceptql/nodes/intersect.rb
|
193
|
-
- lib/conceptql/nodes/last.rb
|
194
|
-
- lib/conceptql/nodes/loinc.rb
|
195
|
-
- lib/conceptql/nodes/node.rb
|
196
|
-
- lib/conceptql/nodes/numeric.rb
|
197
|
-
- lib/conceptql/nodes/occurrence.rb
|
198
|
-
- lib/conceptql/nodes/pass_thru.rb
|
199
|
-
- lib/conceptql/nodes/person.rb
|
200
|
-
- lib/conceptql/nodes/person_filter.rb
|
201
|
-
- lib/conceptql/nodes/place_of_service_code.rb
|
202
|
-
- lib/conceptql/nodes/procedure_occurrence.rb
|
203
|
-
- lib/conceptql/nodes/race.rb
|
204
|
-
- lib/conceptql/nodes/recall.rb
|
205
|
-
- lib/conceptql/nodes/rxnorm.rb
|
206
|
-
- lib/conceptql/nodes/snomed.rb
|
207
|
-
- lib/conceptql/nodes/source_vocabulary_node.rb
|
208
|
-
- lib/conceptql/nodes/standard_vocabulary_node.rb
|
209
|
-
- lib/conceptql/nodes/started_by.rb
|
210
|
-
- lib/conceptql/nodes/sum.rb
|
211
|
-
- lib/conceptql/nodes/temporal_node.rb
|
212
|
-
- lib/conceptql/nodes/time_window.rb
|
213
|
-
- lib/conceptql/nodes/union.rb
|
214
|
-
- lib/conceptql/nodes/visit.rb
|
215
|
-
- lib/conceptql/nodes/visit_occurrence.rb
|
216
202
|
- lib/conceptql/nodifier.rb
|
203
|
+
- lib/conceptql/operators/after.rb
|
204
|
+
- lib/conceptql/operators/any_overlap.rb
|
205
|
+
- lib/conceptql/operators/before.rb
|
206
|
+
- lib/conceptql/operators/binary_operator_operator.rb
|
207
|
+
- lib/conceptql/operators/casting_operator.rb
|
208
|
+
- lib/conceptql/operators/complement.rb
|
209
|
+
- lib/conceptql/operators/concept.rb
|
210
|
+
- lib/conceptql/operators/condition_type.rb
|
211
|
+
- lib/conceptql/operators/contains.rb
|
212
|
+
- lib/conceptql/operators/count.rb
|
213
|
+
- lib/conceptql/operators/cpt.rb
|
214
|
+
- lib/conceptql/operators/date_range.rb
|
215
|
+
- lib/conceptql/operators/death.rb
|
216
|
+
- lib/conceptql/operators/drug_type_concept.rb
|
217
|
+
- lib/conceptql/operators/during.rb
|
218
|
+
- lib/conceptql/operators/equal.rb
|
219
|
+
- lib/conceptql/operators/except.rb
|
220
|
+
- lib/conceptql/operators/filter.rb
|
221
|
+
- lib/conceptql/operators/first.rb
|
222
|
+
- lib/conceptql/operators/from.rb
|
223
|
+
- lib/conceptql/operators/from_seer_visits.rb
|
224
|
+
- lib/conceptql/operators/gender.rb
|
225
|
+
- lib/conceptql/operators/hcpcs.rb
|
226
|
+
- lib/conceptql/operators/icd10.rb
|
227
|
+
- lib/conceptql/operators/icd9.rb
|
228
|
+
- lib/conceptql/operators/icd9_procedure.rb
|
229
|
+
- lib/conceptql/operators/intersect.rb
|
230
|
+
- lib/conceptql/operators/last.rb
|
231
|
+
- lib/conceptql/operators/loinc.rb
|
232
|
+
- lib/conceptql/operators/medcode.rb
|
233
|
+
- lib/conceptql/operators/medcode_procedure.rb
|
234
|
+
- lib/conceptql/operators/ndc.rb
|
235
|
+
- lib/conceptql/operators/numeric.rb
|
236
|
+
- lib/conceptql/operators/observation_by_enttype.rb
|
237
|
+
- lib/conceptql/operators/observation_period.rb
|
238
|
+
- lib/conceptql/operators/occurrence.rb
|
239
|
+
- lib/conceptql/operators/one_in_two_out.rb
|
240
|
+
- lib/conceptql/operators/operator.rb
|
241
|
+
- lib/conceptql/operators/overlapped_by.rb
|
242
|
+
- lib/conceptql/operators/overlaps.rb
|
243
|
+
- lib/conceptql/operators/pass_thru.rb
|
244
|
+
- lib/conceptql/operators/person.rb
|
245
|
+
- lib/conceptql/operators/person_filter.rb
|
246
|
+
- lib/conceptql/operators/place_of_service_code.rb
|
247
|
+
- lib/conceptql/operators/procedure_occurrence.rb
|
248
|
+
- lib/conceptql/operators/prodcode.rb
|
249
|
+
- lib/conceptql/operators/race.rb
|
250
|
+
- lib/conceptql/operators/recall.rb
|
251
|
+
- lib/conceptql/operators/rxnorm.rb
|
252
|
+
- lib/conceptql/operators/snomed.rb
|
253
|
+
- lib/conceptql/operators/snomed_condition.rb
|
254
|
+
- lib/conceptql/operators/source_vocabulary_operator.rb
|
255
|
+
- lib/conceptql/operators/standard_vocabulary_operator.rb
|
256
|
+
- lib/conceptql/operators/started_by.rb
|
257
|
+
- lib/conceptql/operators/sum.rb
|
258
|
+
- lib/conceptql/operators/temporal_operator.rb
|
259
|
+
- lib/conceptql/operators/time_window.rb
|
260
|
+
- lib/conceptql/operators/to_seer_visits.rb
|
261
|
+
- lib/conceptql/operators/trim_date_end.rb
|
262
|
+
- lib/conceptql/operators/trim_date_start.rb
|
263
|
+
- lib/conceptql/operators/union.rb
|
264
|
+
- lib/conceptql/operators/visit.rb
|
265
|
+
- lib/conceptql/operators/visit_occurrence.rb
|
217
266
|
- lib/conceptql/query.rb
|
267
|
+
- lib/conceptql/scope.rb
|
218
268
|
- lib/conceptql/tree.rb
|
269
|
+
- lib/conceptql/utils/temp_table.rb
|
219
270
|
- lib/conceptql/version.rb
|
220
271
|
- spec/conceptql/behaviors/dottable_spec.rb
|
272
|
+
- spec/conceptql/converter_spec.rb
|
221
273
|
- spec/conceptql/date_adjuster_spec.rb
|
222
|
-
- spec/conceptql/
|
223
|
-
- spec/conceptql/
|
224
|
-
- spec/conceptql/
|
225
|
-
- spec/conceptql/
|
226
|
-
- spec/conceptql/
|
227
|
-
- spec/conceptql/
|
228
|
-
- spec/conceptql/
|
229
|
-
- spec/conceptql/
|
230
|
-
- spec/conceptql/
|
231
|
-
- spec/conceptql/
|
232
|
-
- spec/conceptql/
|
233
|
-
- spec/conceptql/
|
234
|
-
- spec/conceptql/
|
235
|
-
- spec/conceptql/
|
236
|
-
- spec/conceptql/
|
237
|
-
- spec/conceptql/
|
238
|
-
- spec/conceptql/
|
239
|
-
- spec/conceptql/
|
240
|
-
- spec/conceptql/
|
241
|
-
- spec/conceptql/
|
242
|
-
- spec/conceptql/
|
243
|
-
- spec/conceptql/
|
244
|
-
- spec/conceptql/
|
245
|
-
- spec/conceptql/
|
246
|
-
- spec/conceptql/
|
247
|
-
- spec/conceptql/
|
248
|
-
- spec/conceptql/
|
249
|
-
- spec/conceptql/
|
250
|
-
- spec/conceptql/
|
251
|
-
- spec/conceptql/
|
252
|
-
- spec/conceptql/
|
253
|
-
- spec/conceptql/
|
254
|
-
- spec/conceptql/
|
255
|
-
- spec/conceptql/
|
256
|
-
- spec/conceptql/
|
257
|
-
- spec/conceptql/
|
258
|
-
- spec/conceptql/
|
274
|
+
- spec/conceptql/operators/after_spec.rb
|
275
|
+
- spec/conceptql/operators/before_spec.rb
|
276
|
+
- spec/conceptql/operators/casting_operator_spec.rb
|
277
|
+
- spec/conceptql/operators/complement_spec.rb
|
278
|
+
- spec/conceptql/operators/concept_spec.rb
|
279
|
+
- spec/conceptql/operators/condition_type_spec.rb
|
280
|
+
- spec/conceptql/operators/contains_spec.rb
|
281
|
+
- spec/conceptql/operators/cpt_spec.rb
|
282
|
+
- spec/conceptql/operators/date_range_spec.rb
|
283
|
+
- spec/conceptql/operators/death_spec.rb
|
284
|
+
- spec/conceptql/operators/during_spec.rb
|
285
|
+
- spec/conceptql/operators/except_spec.rb
|
286
|
+
- spec/conceptql/operators/first_spec.rb
|
287
|
+
- spec/conceptql/operators/from_spec.rb
|
288
|
+
- spec/conceptql/operators/gender_spec.rb
|
289
|
+
- spec/conceptql/operators/hcpcs_spec.rb
|
290
|
+
- spec/conceptql/operators/icd10_spec.rb
|
291
|
+
- spec/conceptql/operators/icd9_procedure_spec.rb
|
292
|
+
- spec/conceptql/operators/icd9_spec.rb
|
293
|
+
- spec/conceptql/operators/intersect_spec.rb
|
294
|
+
- spec/conceptql/operators/last_spec.rb
|
295
|
+
- spec/conceptql/operators/loinc_spec.rb
|
296
|
+
- spec/conceptql/operators/medcode_procedure_spec.rb
|
297
|
+
- spec/conceptql/operators/medcode_spec.rb
|
298
|
+
- spec/conceptql/operators/observation_period_spec.rb
|
299
|
+
- spec/conceptql/operators/occurrence_spec.rb
|
300
|
+
- spec/conceptql/operators/overlapped_by_spec.rb
|
301
|
+
- spec/conceptql/operators/overlaps_spec.rb
|
302
|
+
- spec/conceptql/operators/person_filter_spec.rb
|
303
|
+
- spec/conceptql/operators/person_spec.rb
|
304
|
+
- spec/conceptql/operators/place_of_service_code_spec.rb
|
305
|
+
- spec/conceptql/operators/procedure_occurrence_spec.rb
|
306
|
+
- spec/conceptql/operators/prodcode_spec.rb
|
307
|
+
- spec/conceptql/operators/query_double.rb
|
308
|
+
- spec/conceptql/operators/query_double_spec.rb
|
309
|
+
- spec/conceptql/operators/race_spec.rb
|
310
|
+
- spec/conceptql/operators/rxnorm_spec.rb
|
311
|
+
- spec/conceptql/operators/snomed_spec.rb
|
312
|
+
- spec/conceptql/operators/source_vocabulary_operator_spec.rb
|
313
|
+
- spec/conceptql/operators/standard_vocabulary_operator_spec.rb
|
314
|
+
- spec/conceptql/operators/started_by_spec.rb
|
315
|
+
- spec/conceptql/operators/temporal_operator_spec.rb
|
316
|
+
- spec/conceptql/operators/time_window_spec.rb
|
317
|
+
- spec/conceptql/operators/union_spec.rb
|
318
|
+
- spec/conceptql/operators/visit_occurrence_spec.rb
|
259
319
|
- spec/conceptql/query_spec.rb
|
260
320
|
- spec/conceptql/tree_spec.rb
|
261
321
|
- spec/doubles/stream_for_casting_double.rb
|
@@ -282,50 +342,59 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
282
342
|
version: '0'
|
283
343
|
requirements: []
|
284
344
|
rubyforge_project:
|
285
|
-
rubygems_version: 2.
|
345
|
+
rubygems_version: 2.4.5.1
|
286
346
|
signing_key:
|
287
347
|
specification_version: 4
|
288
348
|
summary: Generate OMOP CDMv4-compatible queries from a ConceptQL file
|
289
349
|
test_files:
|
290
350
|
- spec/conceptql/behaviors/dottable_spec.rb
|
351
|
+
- spec/conceptql/converter_spec.rb
|
291
352
|
- spec/conceptql/date_adjuster_spec.rb
|
292
|
-
- spec/conceptql/
|
293
|
-
- spec/conceptql/
|
294
|
-
- spec/conceptql/
|
295
|
-
- spec/conceptql/
|
296
|
-
- spec/conceptql/
|
297
|
-
- spec/conceptql/
|
298
|
-
- spec/conceptql/
|
299
|
-
- spec/conceptql/
|
300
|
-
- spec/conceptql/
|
301
|
-
- spec/conceptql/
|
302
|
-
- spec/conceptql/
|
303
|
-
- spec/conceptql/
|
304
|
-
- spec/conceptql/
|
305
|
-
- spec/conceptql/
|
306
|
-
- spec/conceptql/
|
307
|
-
- spec/conceptql/
|
308
|
-
- spec/conceptql/
|
309
|
-
- spec/conceptql/
|
310
|
-
- spec/conceptql/
|
311
|
-
- spec/conceptql/
|
312
|
-
- spec/conceptql/
|
313
|
-
- spec/conceptql/
|
314
|
-
- spec/conceptql/
|
315
|
-
- spec/conceptql/
|
316
|
-
- spec/conceptql/
|
317
|
-
- spec/conceptql/
|
318
|
-
- spec/conceptql/
|
319
|
-
- spec/conceptql/
|
320
|
-
- spec/conceptql/
|
321
|
-
- spec/conceptql/
|
322
|
-
- spec/conceptql/
|
323
|
-
- spec/conceptql/
|
324
|
-
- spec/conceptql/
|
325
|
-
- spec/conceptql/
|
326
|
-
- spec/conceptql/
|
327
|
-
- spec/conceptql/
|
328
|
-
- spec/conceptql/
|
353
|
+
- spec/conceptql/operators/after_spec.rb
|
354
|
+
- spec/conceptql/operators/before_spec.rb
|
355
|
+
- spec/conceptql/operators/casting_operator_spec.rb
|
356
|
+
- spec/conceptql/operators/complement_spec.rb
|
357
|
+
- spec/conceptql/operators/concept_spec.rb
|
358
|
+
- spec/conceptql/operators/condition_type_spec.rb
|
359
|
+
- spec/conceptql/operators/contains_spec.rb
|
360
|
+
- spec/conceptql/operators/cpt_spec.rb
|
361
|
+
- spec/conceptql/operators/date_range_spec.rb
|
362
|
+
- spec/conceptql/operators/death_spec.rb
|
363
|
+
- spec/conceptql/operators/during_spec.rb
|
364
|
+
- spec/conceptql/operators/except_spec.rb
|
365
|
+
- spec/conceptql/operators/first_spec.rb
|
366
|
+
- spec/conceptql/operators/from_spec.rb
|
367
|
+
- spec/conceptql/operators/gender_spec.rb
|
368
|
+
- spec/conceptql/operators/hcpcs_spec.rb
|
369
|
+
- spec/conceptql/operators/icd10_spec.rb
|
370
|
+
- spec/conceptql/operators/icd9_procedure_spec.rb
|
371
|
+
- spec/conceptql/operators/icd9_spec.rb
|
372
|
+
- spec/conceptql/operators/intersect_spec.rb
|
373
|
+
- spec/conceptql/operators/last_spec.rb
|
374
|
+
- spec/conceptql/operators/loinc_spec.rb
|
375
|
+
- spec/conceptql/operators/medcode_procedure_spec.rb
|
376
|
+
- spec/conceptql/operators/medcode_spec.rb
|
377
|
+
- spec/conceptql/operators/observation_period_spec.rb
|
378
|
+
- spec/conceptql/operators/occurrence_spec.rb
|
379
|
+
- spec/conceptql/operators/overlapped_by_spec.rb
|
380
|
+
- spec/conceptql/operators/overlaps_spec.rb
|
381
|
+
- spec/conceptql/operators/person_filter_spec.rb
|
382
|
+
- spec/conceptql/operators/person_spec.rb
|
383
|
+
- spec/conceptql/operators/place_of_service_code_spec.rb
|
384
|
+
- spec/conceptql/operators/procedure_occurrence_spec.rb
|
385
|
+
- spec/conceptql/operators/prodcode_spec.rb
|
386
|
+
- spec/conceptql/operators/query_double.rb
|
387
|
+
- spec/conceptql/operators/query_double_spec.rb
|
388
|
+
- spec/conceptql/operators/race_spec.rb
|
389
|
+
- spec/conceptql/operators/rxnorm_spec.rb
|
390
|
+
- spec/conceptql/operators/snomed_spec.rb
|
391
|
+
- spec/conceptql/operators/source_vocabulary_operator_spec.rb
|
392
|
+
- spec/conceptql/operators/standard_vocabulary_operator_spec.rb
|
393
|
+
- spec/conceptql/operators/started_by_spec.rb
|
394
|
+
- spec/conceptql/operators/temporal_operator_spec.rb
|
395
|
+
- spec/conceptql/operators/time_window_spec.rb
|
396
|
+
- spec/conceptql/operators/union_spec.rb
|
397
|
+
- spec/conceptql/operators/visit_occurrence_spec.rb
|
329
398
|
- spec/conceptql/query_spec.rb
|
330
399
|
- spec/conceptql/tree_spec.rb
|
331
400
|
- spec/doubles/stream_for_casting_double.rb
|
@@ -1,38 +0,0 @@
|
|
1
|
-
require_relative 'node'
|
2
|
-
require_relative '../tree'
|
3
|
-
|
4
|
-
module ConceptQL
|
5
|
-
module Nodes
|
6
|
-
class Concept < Node
|
7
|
-
attr :statement
|
8
|
-
def query(db)
|
9
|
-
set_statement(db)
|
10
|
-
stream.evaluate(db)
|
11
|
-
end
|
12
|
-
|
13
|
-
def children
|
14
|
-
@children ||= [ Tree.new.root(self) ]
|
15
|
-
end
|
16
|
-
|
17
|
-
def graph_prep(db)
|
18
|
-
set_statement(db)
|
19
|
-
@arguments = [description(db)]
|
20
|
-
end
|
21
|
-
|
22
|
-
private
|
23
|
-
def set_statement(db)
|
24
|
-
@statement ||= db[:concepts].where(concept_id: arguments.first).select_map(:statement).first.tap { |f| ConceptQL.logger.debug f.inspect }.to_hash
|
25
|
-
end
|
26
|
-
|
27
|
-
def description(db)
|
28
|
-
@description ||= db[:concepts].where(concept_id: arguments.first).select_map(:label).first
|
29
|
-
end
|
30
|
-
|
31
|
-
def db
|
32
|
-
tree.db
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
|