quality-measure-engine 0.1.2 → 0.2.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.
- data/Gemfile +9 -9
- data/README.md +39 -2
- data/Rakefile +25 -44
- data/js/map-reduce-utils.js +174 -0
- data/js/underscore-min.js +24 -0
- data/lib/qme/importer/code_system_helper.rb +26 -0
- data/lib/qme/importer/entry.rb +89 -0
- data/lib/qme/importer/generic_importer.rb +71 -0
- data/lib/qme/importer/hl7_helper.rb +27 -0
- data/lib/qme/importer/patient_importer.rb +150 -0
- data/lib/qme/importer/property_matcher.rb +103 -0
- data/lib/qme/importer/section_importer.rb +82 -0
- data/lib/qme/map/map_reduce_builder.rb +77 -147
- data/lib/qme/map/map_reduce_executor.rb +97 -13
- data/lib/qme/measure/database_loader.rb +90 -0
- data/lib/qme/measure/measure_loader.rb +141 -0
- data/lib/qme/mongo_helpers.rb +15 -0
- data/lib/qme/randomizer/patient_randomizer.rb +95 -0
- data/lib/qme_test.rb +13 -0
- data/lib/quality-measure-engine.rb +20 -4
- data/lib/tasks/measure.rake +76 -0
- data/lib/tasks/mongo.rake +74 -0
- data/lib/tasks/patient_random.rake +46 -0
- metadata +110 -156
- data/.gitignore +0 -6
- data/Gemfile.lock +0 -44
- data/fixtures/complex_measure.json +0 -36
- data/fixtures/result_example.json +0 -6
- data/lib/patches/v8.rb +0 -20
- data/lib/qme/query/json_document_builder.rb +0 -130
- data/lib/qme/query/json_query_executor.rb +0 -44
- data/measures/0032/0032_NQF_Cervical_Cancer_Screening.json +0 -171
- data/measures/0032/patients/denominator1.json +0 -10
- data/measures/0032/patients/denominator2.json +0 -10
- data/measures/0032/patients/numerator1.json +0 -11
- data/measures/0032/patients/population1.json +0 -9
- data/measures/0032/patients/population2.json +0 -11
- data/measures/0032/result/result.json +0 -6
- data/measures/0043/0043_NQF_PneumoniaVaccinationStatusForOlderAdults.json +0 -71
- data/measures/0043/patients/denominator.json +0 -11
- data/measures/0043/patients/numerator.json +0 -11
- data/measures/0043/patients/population.json +0 -10
- data/measures/0043/result/result.json +0 -6
- data/quality-measure-engine.gemspec +0 -97
- data/schema/result.json +0 -28
- data/schema/schema.json +0 -143
- data/spec/qme/map/map_reduce_builder_spec.rb +0 -64
- data/spec/qme/measures_spec.rb +0 -50
- data/spec/qme/query/json_document_builder_spec.rb +0 -56
- data/spec/schema_spec.rb +0 -21
- data/spec/spec_helper.rb +0 -7
- data/spec/validate_measures_spec.rb +0 -21
@@ -1,10 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"first": "Bert", // personal data
|
3
|
-
"last": "Bloggs",
|
4
|
-
"birthdate": -290390400, // Time.gm(1960, 10, 19).to_i
|
5
|
-
"measures": { // bag of measures, one entry per measure
|
6
|
-
"0032": {
|
7
|
-
"encounter_outpatient": 1277856000 // Time.gm(2010, 6, 30).to_i
|
8
|
-
}
|
9
|
-
}
|
10
|
-
}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"first": "Bert", // personal data
|
3
|
-
"last": "Bloggs",
|
4
|
-
"birthdate": -290390400, // Time.gm(1960, 10, 19).to_i
|
5
|
-
"measures": { // bag of measures, one entry per measure
|
6
|
-
"0032": {
|
7
|
-
"encounter_obgyn": 1277856000, // Time.gm(2010, 6, 30).to_i
|
8
|
-
"pap_test": 1214784000 // Time.gm(2008, 6, 30).to_i
|
9
|
-
}
|
10
|
-
}
|
11
|
-
}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"first": "Bert", // personal data
|
3
|
-
"last": "Bloggs",
|
4
|
-
"birthdate": -290390400, // Time.gm(1960, 10, 19).to_i
|
5
|
-
"measures": { // bag of measures, one entry per measure
|
6
|
-
"0032": {
|
7
|
-
"encounter_obgyn": 1277856000, // Time.gm(2010, 6, 30).to_i
|
8
|
-
"hysterectomy": 1277856000
|
9
|
-
}
|
10
|
-
}
|
11
|
-
}
|
@@ -1,71 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"id": "0043",
|
3
|
-
"name": "Pneumonia Vaccination Status for Older Adults",
|
4
|
-
"steward": "NCQA",
|
5
|
-
"parameters": {
|
6
|
-
"effective_date": {
|
7
|
-
"name": "Effective end date for measure",
|
8
|
-
"type": "long"
|
9
|
-
}
|
10
|
-
},
|
11
|
-
"properties": {
|
12
|
-
"birthdate": {
|
13
|
-
"name": "Date of birth",
|
14
|
-
"type": "long",
|
15
|
-
"codes": [
|
16
|
-
{
|
17
|
-
"set": "HL7",
|
18
|
-
"version": "3.0",
|
19
|
-
"values": ["00110"]
|
20
|
-
}
|
21
|
-
]
|
22
|
-
},
|
23
|
-
"encounter": {
|
24
|
-
"name": "Date of encounter",
|
25
|
-
"type": "long",
|
26
|
-
"codes": [
|
27
|
-
{
|
28
|
-
"set": "CPT",
|
29
|
-
"version": "06/2009",
|
30
|
-
"values": ["99201", "99202", "99203", "99204", "99205", "99211", "99212", "99213", "99214", "99215", "99217", "99218", "99219", "99220", "99241", "99242", "99243", "99244", "99245", "99341", "99342", "99343", "99344", "99345", "99347-99350", "99384", "99385", "99386", "99387", "99394", "99395", "99396", "99397", "99401", "99402", "99403", "99404", "99411", "99412", "99420", "99429", "99455", "99456"]
|
31
|
-
},
|
32
|
-
{
|
33
|
-
"set": "ICD-9-CM",
|
34
|
-
"version": "06/2009",
|
35
|
-
"values": ["V70.0", "V70.3", "V70.5", "V70.6", "V70.8", "V70.9"]
|
36
|
-
}
|
37
|
-
]
|
38
|
-
},
|
39
|
-
"vaccination": {
|
40
|
-
"name": "Pneumococcal vaccination",
|
41
|
-
"type": "boolean",
|
42
|
-
"codes": [
|
43
|
-
{
|
44
|
-
"set": "RxNorm",
|
45
|
-
"version": "07/2009",
|
46
|
-
"values": ["854931", "854933", "854935", "854937", "854939", "854941", "854943", "854945", "854947", "854949", "854951", "854953", "854955", "854957", "854959", "854961", "854963", "854965", "854967", "854969", "854971", "854973", "854975", "854977"]
|
47
|
-
}
|
48
|
-
]
|
49
|
-
}
|
50
|
-
},
|
51
|
-
"calculated_dates": {
|
52
|
-
"earliest_birthdate": "effective_date - 65*year",
|
53
|
-
"earliest_encounter": "effective_date - year"
|
54
|
-
},
|
55
|
-
"population": {
|
56
|
-
"category": "Patient Characteristics",
|
57
|
-
"title": "Age >= 64 before measure period",
|
58
|
-
"query": {"birthdate": {"_lte": "@earliest_birthdate"}}
|
59
|
-
},
|
60
|
-
"denominator": {
|
61
|
-
"category": "Outpatient Encounter",
|
62
|
-
"title": "Outpatient encounter within the measurement period",
|
63
|
-
"query": {"encounter": {"_gte": "@earliest_encounter"}}
|
64
|
-
},
|
65
|
-
"numerator": {
|
66
|
-
"category": "Medication Administered",
|
67
|
-
"title": "Pneumococcal vaccination",
|
68
|
-
"query": {"vaccination": true}
|
69
|
-
},
|
70
|
-
"exception": {}
|
71
|
-
}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"first": "Bert", // personal data
|
3
|
-
"last": "Bloggs",
|
4
|
-
"birthdate": -921542400, // Time.gm(1940, 10, 19).to_i
|
5
|
-
"measures": { // bag of measures, one entry per measure
|
6
|
-
"0043": {
|
7
|
-
"encounter": 1284854400, // Time.gm(2010, 9, 19)
|
8
|
-
"vaccination": false
|
9
|
-
}
|
10
|
-
}
|
11
|
-
}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"first": "Fred", // personal data
|
3
|
-
"last": "Bloggs",
|
4
|
-
"birthdate": -921542400, // Time.gm(1940, 10, 19).to_i
|
5
|
-
"measures": { // bag of measures, one entry per measure
|
6
|
-
"0043": {
|
7
|
-
"encounter": 1284854400, // Time.gm(2010, 9, 19)
|
8
|
-
"vaccination": true
|
9
|
-
}
|
10
|
-
}
|
11
|
-
}
|
@@ -1,97 +0,0 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
-
# -*- encoding: utf-8 -*-
|
5
|
-
|
6
|
-
Gem::Specification.new do |s|
|
7
|
-
s.name = %q{quality-measure-engine}
|
8
|
-
s.version = "0.1.2"
|
9
|
-
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["Marc Hadley", "Andy Gregorowicz"]
|
12
|
-
s.date = %q{2010-11-01}
|
13
|
-
s.description = %q{A library for extracting quality measure information from HITSP C32's and ASTM CCR's}
|
14
|
-
s.email = %q{talk@projectpophealth.org}
|
15
|
-
s.extra_rdoc_files = [
|
16
|
-
"README.md"
|
17
|
-
]
|
18
|
-
s.files = [
|
19
|
-
".gitignore",
|
20
|
-
"Gemfile",
|
21
|
-
"Gemfile.lock",
|
22
|
-
"README.md",
|
23
|
-
"Rakefile",
|
24
|
-
"VERSION",
|
25
|
-
"fixtures/complex_measure.json",
|
26
|
-
"fixtures/result_example.json",
|
27
|
-
"lib/patches/v8.rb",
|
28
|
-
"lib/qme/map/map_reduce_builder.rb",
|
29
|
-
"lib/qme/map/map_reduce_executor.rb",
|
30
|
-
"lib/qme/query/json_document_builder.rb",
|
31
|
-
"lib/qme/query/json_query_executor.rb",
|
32
|
-
"lib/quality-measure-engine.rb",
|
33
|
-
"measures/0032/0032_NQF_Cervical_Cancer_Screening.json",
|
34
|
-
"measures/0032/patients/denominator1.json",
|
35
|
-
"measures/0032/patients/denominator2.json",
|
36
|
-
"measures/0032/patients/numerator1.json",
|
37
|
-
"measures/0032/patients/population1.json",
|
38
|
-
"measures/0032/patients/population2.json",
|
39
|
-
"measures/0032/result/result.json",
|
40
|
-
"measures/0043/0043_NQF_PneumoniaVaccinationStatusForOlderAdults.json",
|
41
|
-
"measures/0043/patients/denominator.json",
|
42
|
-
"measures/0043/patients/numerator.json",
|
43
|
-
"measures/0043/patients/population.json",
|
44
|
-
"measures/0043/result/result.json",
|
45
|
-
"quality-measure-engine.gemspec",
|
46
|
-
"schema/result.json",
|
47
|
-
"schema/schema.json",
|
48
|
-
"spec/qme/map/map_reduce_builder_spec.rb",
|
49
|
-
"spec/qme/measures_spec.rb",
|
50
|
-
"spec/qme/query/json_document_builder_spec.rb",
|
51
|
-
"spec/schema_spec.rb",
|
52
|
-
"spec/spec_helper.rb",
|
53
|
-
"spec/validate_measures_spec.rb"
|
54
|
-
]
|
55
|
-
s.homepage = %q{http://github.com/pophealth/quality-measure-engine}
|
56
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
57
|
-
s.require_paths = ["lib"]
|
58
|
-
s.rubygems_version = %q{1.3.7}
|
59
|
-
s.summary = %q{A library for extracting quality measure information from HITSP C32's and ASTM CCR's}
|
60
|
-
s.test_files = [
|
61
|
-
"spec/qme/map/map_reduce_builder_spec.rb",
|
62
|
-
"spec/qme/measures_spec.rb",
|
63
|
-
"spec/qme/query/json_document_builder_spec.rb",
|
64
|
-
"spec/schema_spec.rb",
|
65
|
-
"spec/spec_helper.rb",
|
66
|
-
"spec/validate_measures_spec.rb"
|
67
|
-
]
|
68
|
-
|
69
|
-
if s.respond_to? :specification_version then
|
70
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
71
|
-
s.specification_version = 3
|
72
|
-
|
73
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
74
|
-
s.add_runtime_dependency(%q<mongo>, ["~> 1.1"])
|
75
|
-
s.add_runtime_dependency(%q<therubyracer>, ["~> 0.7.5"])
|
76
|
-
s.add_development_dependency(%q<jsonschema>, ["~> 2.0.0"])
|
77
|
-
s.add_development_dependency(%q<rspec>, ["~> 2.0.0"])
|
78
|
-
s.add_development_dependency(%q<awesome_print>, ["~> 0.2.1"])
|
79
|
-
s.add_development_dependency(%q<jeweler>, ["~> 1.4.0"])
|
80
|
-
else
|
81
|
-
s.add_dependency(%q<mongo>, ["~> 1.1"])
|
82
|
-
s.add_dependency(%q<therubyracer>, ["~> 0.7.5"])
|
83
|
-
s.add_dependency(%q<jsonschema>, ["~> 2.0.0"])
|
84
|
-
s.add_dependency(%q<rspec>, ["~> 2.0.0"])
|
85
|
-
s.add_dependency(%q<awesome_print>, ["~> 0.2.1"])
|
86
|
-
s.add_dependency(%q<jeweler>, ["~> 1.4.0"])
|
87
|
-
end
|
88
|
-
else
|
89
|
-
s.add_dependency(%q<mongo>, ["~> 1.1"])
|
90
|
-
s.add_dependency(%q<therubyracer>, ["~> 0.7.5"])
|
91
|
-
s.add_dependency(%q<jsonschema>, ["~> 2.0.0"])
|
92
|
-
s.add_dependency(%q<rspec>, ["~> 2.0.0"])
|
93
|
-
s.add_dependency(%q<awesome_print>, ["~> 0.2.1"])
|
94
|
-
s.add_dependency(%q<jeweler>, ["~> 1.4.0"])
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
data/schema/result.json
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "Result",
|
3
|
-
"properties": {
|
4
|
-
"initialPopulation": {
|
5
|
-
"type": "integer",
|
6
|
-
"description": "Individuals for whom the measure is intended."
|
7
|
-
},
|
8
|
-
"denominator": {
|
9
|
-
"type": "integer",
|
10
|
-
"description": "Individuals who should meet the measure. Sometimes equivalent to the initial population."
|
11
|
-
},
|
12
|
-
"numerator": {
|
13
|
-
"type": "array",
|
14
|
-
"description": "Individuals who do meet the measure.",
|
15
|
-
"items": {
|
16
|
-
"type": "integer"
|
17
|
-
}
|
18
|
-
},
|
19
|
-
"exclusions": {
|
20
|
-
"type": "array",
|
21
|
-
"description": "Individuals that should be in the denominator but have characteristics that make them inappropriate for the measure.",
|
22
|
-
"optional": true,
|
23
|
-
"items": {
|
24
|
-
"type": "integer"
|
25
|
-
}
|
26
|
-
}
|
27
|
-
}
|
28
|
-
}
|
data/schema/schema.json
DELETED
@@ -1,143 +0,0 @@
|
|
1
|
-
{"description":"This is the JSON Schema for JSON Schemas.",
|
2
|
-
"type":["object","array"],
|
3
|
-
"items":{
|
4
|
-
"type":"object",
|
5
|
-
"properties":{"$ref":"$.properties"},
|
6
|
-
"description":"When the schema is an array, it indicates that it is enforcing tuple typing. Each item in the instance array must correspond to the item in the schema array"},
|
7
|
-
"properties":{
|
8
|
-
"type":{
|
9
|
-
"type":["string","array"],
|
10
|
-
"items":{"$ref":"$.properties.type"},
|
11
|
-
"description":"This is a type definition value. This can be a simple type, or a union type",
|
12
|
-
"enum":["string","object","array","boolean","number","integer","null","any"],
|
13
|
-
"unconstrained":true,
|
14
|
-
"optional":true,
|
15
|
-
"default":"any"},
|
16
|
-
"optional":{
|
17
|
-
"type":"boolean",
|
18
|
-
"description":"This indicates that the instance property in the instance object is not required.",
|
19
|
-
"optional":true,
|
20
|
-
"default":false},
|
21
|
-
"properties":{
|
22
|
-
"type":"object",
|
23
|
-
"additionalProperties":{"$ref":"$"},
|
24
|
-
"description":"This is a definition for the properties of an object value",
|
25
|
-
"optional":true,
|
26
|
-
"default":{}
|
27
|
-
},
|
28
|
-
"items":{
|
29
|
-
"type":"object",
|
30
|
-
"properties":{"$ref":"$.properties"},
|
31
|
-
"description":"When the value is an array, this indicates the schema to use to validate each item in an array",
|
32
|
-
"optional":true,
|
33
|
-
"default":{}},
|
34
|
-
"additionalProperties":{
|
35
|
-
"type":["boolean","object"],
|
36
|
-
"properties":{"$ref":"$.properties"},
|
37
|
-
"description":"This provides a default property definition for all properties that are not explicitly defined in an object type definition.",
|
38
|
-
"optional":true,
|
39
|
-
"default":{}},
|
40
|
-
"specificity":{
|
41
|
-
"type":"number",
|
42
|
-
"description":"This indicates an order of specificity of properties. If an instance defines another property with a higher specificity than this one, than this instance property is required.",
|
43
|
-
"optional":true,
|
44
|
-
"default":false},
|
45
|
-
"unique":{
|
46
|
-
"type":"boolean",
|
47
|
-
"description":"This indicates that the instance property should have unique values. No other property with the same name in the instance object tree should have the same value.",
|
48
|
-
"optional":true,
|
49
|
-
"default":false},
|
50
|
-
"minimum":{
|
51
|
-
"type":"number",
|
52
|
-
"optional":true,
|
53
|
-
"description":"This indicates the minimum value for the instance property when the type of the instance value is a number, or it indicates the minimum number of values in an array when an array is the instance value."},
|
54
|
-
"maximum":{
|
55
|
-
"type":"number",
|
56
|
-
"optional":true,
|
57
|
-
"description":"This indicates the maximum value for the instance property when the type of the instance value is a number, or it indicates the maximum number of values in an array when an array is the instance value."},
|
58
|
-
"pattern":{
|
59
|
-
"type":"string",
|
60
|
-
"format":"regex",
|
61
|
-
"description":"When the instance value is a string, this provides a regular expression that a instance string value should match in order to be valid.",
|
62
|
-
"optional":true,
|
63
|
-
"default":".*"},
|
64
|
-
"maxLength" :{
|
65
|
-
"type":"number",
|
66
|
-
"optional":true,
|
67
|
-
"description":"When the instance value is a string, this indicates maximum length of the string."},
|
68
|
-
"minLength" :{
|
69
|
-
"type":"number",
|
70
|
-
"optional":true,
|
71
|
-
"description":"When the instance value is a string, this indicates minimum length of the string."},
|
72
|
-
"maxItems" :{
|
73
|
-
"type":"number",
|
74
|
-
"optional":true,
|
75
|
-
"description":"When the instance value is an array, this indicates maximum number of items."},
|
76
|
-
"minItems" :{
|
77
|
-
"type":"number",
|
78
|
-
"optional":true,
|
79
|
-
"description":"When the instance value is an array, this indicates minimum number of items."},
|
80
|
-
"enum" : {
|
81
|
-
"type":"array",
|
82
|
-
"optional":true,
|
83
|
-
"description":"This provides an enumeration of possible values that are valid for the instance property."},
|
84
|
-
"options" : {
|
85
|
-
"type":"array",
|
86
|
-
"items":{
|
87
|
-
"properties":{
|
88
|
-
"label":{
|
89
|
-
"type":"string",
|
90
|
-
"description":"This is the label for this option",
|
91
|
-
"optional":true
|
92
|
-
},
|
93
|
-
"value":{
|
94
|
-
"description":"This is the value for this option"
|
95
|
-
}
|
96
|
-
},
|
97
|
-
"description":"This is an option for list of possible values"
|
98
|
-
},
|
99
|
-
"optional":true,
|
100
|
-
"description":"This provides a list of suggested options for the instance property."},
|
101
|
-
"readonly":{
|
102
|
-
"type":"boolean",
|
103
|
-
"description":"This indicates that the instance property should not be changed (this is only for interaction, it has no effect for standalone validation).",
|
104
|
-
"optional":true,
|
105
|
-
"default":false},
|
106
|
-
"description":{
|
107
|
-
"type":"string",
|
108
|
-
"optional":true,
|
109
|
-
"description":"This provides a description of the purpose the instance property. The value can be a string or it can be an object with properties corresponding to various different instance languages (with an optional default property indicating the default description)."},
|
110
|
-
"format":{
|
111
|
-
"type":"string",
|
112
|
-
"optional":true,
|
113
|
-
"description":"This indicates what format the data is among some predefined formats which may include:\n\ndate - a string following the ISO format \naddress \nschema - a schema definition object \nperson \npage \nhtml - a string representing HTML"},
|
114
|
-
"default":{
|
115
|
-
"type":"any",
|
116
|
-
"optional":true,
|
117
|
-
"description":"This indicates the default for the instance property."},
|
118
|
-
"transient":{
|
119
|
-
"type":"boolean",
|
120
|
-
"optional":true,
|
121
|
-
"description":"This indicates that the property will be used for transient/volatile values that should not be persisted.",
|
122
|
-
"default":false},
|
123
|
-
"maxDecimal":{
|
124
|
-
"type":"integer",
|
125
|
-
"optional":true,
|
126
|
-
"description":"This indicates the maximum number of decimal places in a floating point number."},
|
127
|
-
"hidden":{
|
128
|
-
"type":"boolean",
|
129
|
-
"optional":true,
|
130
|
-
"description":"This indicates whether the property should be hidden in user interfaces."},
|
131
|
-
"extends":{
|
132
|
-
"type":"object",
|
133
|
-
"properties":{"$ref":"$.properties"},
|
134
|
-
"description":"This indicates the schema extends the given schema. All instances of this schema must be valid to by the extended schema also.",
|
135
|
-
"optional":true,
|
136
|
-
"default":{}},
|
137
|
-
"id":{
|
138
|
-
"type":["string","number"],
|
139
|
-
"optional":true,
|
140
|
-
"format":"url",
|
141
|
-
"unique":true}
|
142
|
-
}
|
143
|
-
}
|