hqmf2js 1.3.0 → 1.4.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 (40) hide show
  1. checksums.yaml +5 -13
  2. data/.travis.yml +1 -1
  3. data/Gemfile +1 -25
  4. data/Gemfile.lock +170 -146
  5. data/app/assets/javascripts/crosswalk.js.coffee +17 -19
  6. data/app/assets/javascripts/custom_calculations.js.coffee +44 -17
  7. data/app/assets/javascripts/hqmf_util.js.coffee +559 -161
  8. data/app/assets/javascripts/logging_utils.js.coffee +6 -4
  9. data/app/assets/javascripts/patient_api_extension.js.coffee +41 -9
  10. data/app/assets/javascripts/specifics.js.coffee +163 -69
  11. data/hqmf2js.gemspec +7 -12
  12. data/lib/assets/javascripts/libraries/map_reduce_utils.js +151 -64
  13. data/lib/generator/characteristic.js.erb +23 -12
  14. data/lib/generator/codes_to_json.rb +1 -1
  15. data/lib/generator/data_criteria.js.erb +15 -3
  16. data/lib/generator/derived_data.js.erb +5 -0
  17. data/lib/generator/execution.rb +41 -11
  18. data/lib/generator/js.rb +74 -41
  19. data/lib/generator/patient_data.js.erb +1 -1
  20. data/lib/hqmf2js.rb +0 -1
  21. data/lib/hquery/engine.rb +3 -1
  22. data/lib/tasks/convert.rake +20 -12
  23. data/test/fixtures/NQF59New.json +1423 -0
  24. data/test/fixtures/fulfills.xml +917 -0
  25. data/test/fixtures/patients/larry_vanderman.json +573 -654
  26. data/test/{simplecov.rb → simplecov_init.rb} +0 -0
  27. data/test/test_helper.rb +2 -3
  28. data/test/unit/cmd_test.rb +145 -19
  29. data/test/unit/codes_to_json_test.rb +12 -12
  30. data/test/unit/custom_calculations_test.rb +2 -6
  31. data/test/unit/effective_date_test.rb +3 -4
  32. data/test/unit/erb_context_test.rb +12 -12
  33. data/test/unit/filter_by_reference_test.rb +39 -0
  34. data/test/unit/hqmf_from_json_javascript_test.rb +2 -1
  35. data/test/unit/hqmf_javascript_test.rb +12 -13
  36. data/test/unit/js_object_test.rb +2 -2
  37. data/test/unit/library_function_test.rb +210 -42
  38. data/test/unit/specifics_test.rb +402 -321
  39. metadata +57 -15
  40. data/config/warble.rb +0 -144
@@ -1,62 +1,71 @@
1
1
  module HQMF2JS
2
2
  module Generator
3
-
3
+
4
4
  def self.render_template(name, params)
5
5
  template_path = File.expand_path(File.join('..', "#{name}.js.erb"), __FILE__)
6
6
  template_str = File.read(template_path)
7
7
  template = ERB.new(template_str, nil, '-', "_templ#{TemplateCounter.instance.new_id}")
8
8
  context = ErbContext.new(params)
9
- template.result(context.get_binding)
9
+ template.result(context.get_binding)
10
10
  end
11
-
11
+
12
12
  # Utility class used to supply a binding to Erb. Contains utility functions used
13
13
  # by the erb templates that are used to generate code.
14
14
  class ErbContext < OpenStruct
15
-
15
+
16
16
  # Create a new context
17
17
  # @param [Hash] vars a hash of parameter names (String) and values (Object).
18
18
  # Each entry is added as an accessor of the new Context
19
19
  def initialize(vars)
20
20
  super(vars)
21
21
  end
22
-
22
+
23
23
  # Get a binding that contains all the instance variables
24
24
  # @return [Binding]
25
25
  def get_binding
26
26
  binding
27
27
  end
28
-
28
+
29
29
  def js_for_measure_period(measure_period)
30
30
  HQMF2JS::Generator.render_template('measure_period', {'measure_period' => measure_period})
31
31
  end
32
-
32
+
33
33
  def js_for_characteristic(criteria)
34
34
  HQMF2JS::Generator.render_template('characteristic', {'criteria' => criteria})
35
35
  end
36
-
36
+
37
37
  def js_for_patient_data(criteria)
38
38
  HQMF2JS::Generator.render_template('patient_data', {'criteria' => criteria})
39
39
  end
40
-
40
+
41
41
  def js_for_derived_data(criteria)
42
42
  HQMF2JS::Generator.render_template('derived_data', {'criteria' => criteria})
43
43
  end
44
-
44
+
45
45
  def field_method(field_name)
46
46
  HQMF::DataCriteria::FIELDS[field_name][:coded_entry_method].to_s.camelize(:lower)
47
47
  end
48
-
49
- def field_library_method(field_name)
48
+
49
+ def field_library_method(field_name, value=nil)
50
50
  field_type = HQMF::DataCriteria::FIELDS[field_name][:field_type]
51
51
  if field_type == :value
52
52
  'filterEventsByField'
53
+ elsif field_type == :timestamp && !value.nil? && value.type == 'IVL_TS' # Handles static date comparisons
54
+ 'filterEventsByField'
53
55
  elsif field_type == :timestamp
54
56
  'adjustBoundsForField'
55
57
  elsif field_type == :nested_timestamp
56
58
  'denormalizeEventsByLocation'
59
+ elsif field_type == :reference
60
+ 'filterEventsByReference'
57
61
  end
58
62
  end
59
-
63
+
64
+ def is_result_criteria(criteria)
65
+ settings = HQMF::DataCriteria.get_settings_for_definition(criteria.definition, criteria.status)
66
+ settings && settings['sub_category'] == 'result'
67
+ end
68
+
60
69
  def js_for_value(value)
61
70
  if value
62
71
  if value.respond_to?(:derived?) && value.derived?
@@ -74,6 +83,8 @@ module HQMF2JS
74
83
  else
75
84
  "new PQ(#{value.value}, null, #{value.inclusive?})"
76
85
  end
86
+ elsif value.type=='TS'
87
+ "new TS(\"#{value.value}\", #{value.inclusive?})"
77
88
  elsif value.type=='ANYNonNull'
78
89
  "new #{value.type}()"
79
90
  elsif value.respond_to?(:unit) && value.unit != nil
@@ -91,12 +102,15 @@ module HQMF2JS
91
102
 
92
103
  def js_for_bounds(bounds)
93
104
  if (bounds.respond_to?(:low) && bounds.respond_to?(:high))
94
- "new IVL_PQ(#{js_for_value(bounds.low)}, #{js_for_value(bounds.high)})"
105
+ type = bounds.type || 'IVL_PQ'
106
+ "new #{type}(#{js_for_value(bounds.low)}, #{js_for_value(bounds.high)})"
107
+ elsif bounds.respond_to?(:reference)
108
+ "hqmfjs.#{bounds.reference.gsub(/\W/, '_')}(patient,initialSpecificContext)"
95
109
  else
96
110
  "#{js_for_value(bounds)}"
97
111
  end
98
112
  end
99
-
113
+
100
114
  def js_for_date_bound(criteria)
101
115
  bound = nil
102
116
  if criteria.effective_time
@@ -119,14 +133,14 @@ module HQMF2JS
119
133
  end
120
134
  end
121
135
  end
122
-
136
+
123
137
  if bound
124
138
  "#{js_for_value(bound)}.asDate()"
125
139
  else
126
140
  'MeasurePeriod.high.asDate()'
127
141
  end
128
142
  end
129
-
143
+
130
144
  def js_for_code_list(criteria)
131
145
  if criteria.inline_code_list
132
146
  criteria.inline_code_list.to_json
@@ -136,20 +150,20 @@ module HQMF2JS
136
150
  "getCodes(\"#{criteria.code_list_id}\")"
137
151
  end
138
152
  end
139
-
153
+
140
154
  # Returns the JavaScript generated for a HQMF::Precondition
141
155
  def js_for_precondition(precondition, indent, context=false)
142
156
  HQMF2JS::Generator.render_template('precondition', {'doc' => doc, 'precondition' => precondition, 'indent' => indent, 'context' => context})
143
157
  end
144
-
158
+
145
159
  def patient_api_method(criteria)
146
160
  criteria.patient_api_function
147
161
  end
148
-
162
+
149
163
  def conjunction_code_for(precondition)
150
164
  precondition.conjunction_code_with_negation
151
165
  end
152
-
166
+
153
167
  # Returns a Javascript compatable name based on an entity's identifier
154
168
  def js_name(entity)
155
169
  if !entity.id
@@ -157,11 +171,11 @@ module HQMF2JS
157
171
  end
158
172
  entity.id.gsub(/\W/, '_')
159
173
  end
160
-
174
+
161
175
  end
162
176
 
163
177
  class JS
164
-
178
+
165
179
  # Entry point to JavaScript generator
166
180
  def initialize(doc)
167
181
  @doc = doc
@@ -170,20 +184,21 @@ module HQMF2JS
170
184
  def self.map_reduce_utils
171
185
  File.read(File.expand_path(File.join('..', '..', "assets",'javascripts','libraries','map_reduce_utils.js'), __FILE__))
172
186
  end
173
-
187
+
174
188
  def to_js(population_index=0, codes=nil, force_sources=nil)
175
189
  population_index ||= 0
176
190
  population = @doc.populations[population_index]
177
-
191
+
178
192
  if codes
179
193
  oid_dictionary = HQMF2JS::Generator::CodesToJson.hash_to_js(codes)
180
194
  else
181
195
  oid_dictionary = "<%= oid_dictionary %>"
182
196
  end
183
-
197
+
184
198
  sub_ids = ('a'..'zz').to_a
185
199
  sub_id = @doc.populations.size > 1 ? "'#{sub_ids[population_index]}'" : "null";
186
200
 
201
+ stratified = !population[HQMF::PopulationCriteria::STRAT].nil?
187
202
 
188
203
  "
189
204
  // #########################
@@ -196,29 +211,35 @@ module HQMF2JS
196
211
  if (typeof(test_id) == 'undefined') hqmfjs.test_id = null;
197
212
 
198
213
  OidDictionary = #{oid_dictionary};
199
-
214
+
200
215
  #{js_for_data_criteria(force_sources)}
201
216
 
202
217
  // #########################
203
218
  // ##### MEASURE LOGIC #####
204
219
  // #########################
205
-
220
+
206
221
  #{js_initialize_specifics(@doc.source_data_criteria)}
207
222
 
208
223
  // INITIAL PATIENT POPULATION
209
224
  #{js_for(population[HQMF::PopulationCriteria::IPP], HQMF::PopulationCriteria::IPP)}
225
+ // STRATIFICATION
226
+ #{(stratified ? js_for(population[HQMF::PopulationCriteria::STRAT], HQMF::PopulationCriteria::STRAT, true) : 'hqmfjs.'+HQMF::PopulationCriteria::STRAT+'=null;')}
210
227
  // DENOMINATOR
211
228
  #{js_for(population[HQMF::PopulationCriteria::DENOM], HQMF::PopulationCriteria::DENOM, true)}
212
229
  // NUMERATOR
213
230
  #{js_for(population[HQMF::PopulationCriteria::NUMER], HQMF::PopulationCriteria::NUMER)}
231
+ #{js_for(population[HQMF::PopulationCriteria::NUMEX], HQMF::PopulationCriteria::NUMEX)}
214
232
  #{js_for(population[HQMF::PopulationCriteria::DENEX], HQMF::PopulationCriteria::DENEX)}
215
233
  #{js_for(population[HQMF::PopulationCriteria::DENEXCEP], HQMF::PopulationCriteria::DENEXCEP)}
216
234
  // CV
217
- #{js_for(population[HQMF::PopulationCriteria::MSRPOPL], HQMF::PopulationCriteria::MSRPOPL)}
235
+ #{js_for(population[HQMF::PopulationCriteria::MSRPOPL], HQMF::PopulationCriteria::MSRPOPL, true)}
236
+ #{js_for(population[HQMF::PopulationCriteria::MSRPOPLEX], HQMF::PopulationCriteria::MSRPOPLEX)}
218
237
  #{js_for(population[HQMF::PopulationCriteria::OBSERV], HQMF::PopulationCriteria::OBSERV)}
238
+ // VARIABLES
239
+ #{js_for_variables()}
219
240
  "
220
241
  end
221
-
242
+
222
243
  def js_initialize_specifics(data_criteria)
223
244
  specific_occurrences = []
224
245
  data_criteria.each do |criteria|
@@ -231,7 +252,7 @@ module HQMF2JS
231
252
  specifics_list = ",#{specifics_list}" unless specifics_list.empty?
232
253
  "hqmfjs.initializeSpecifics = function(patient_api, hqmfjs) { hqmf.SpecificsManager.initialize(patient_api,hqmfjs#{specifics_list}) }"
233
254
  end
234
-
255
+
235
256
  # Generate JS for a HQMF2::PopulationCriteria
236
257
  def js_for(criteria_code, type=nil, when_not_found=false)
237
258
  # for multiple populations, criteria code will be something like IPP_1 and type will be IPP
@@ -247,17 +268,29 @@ module HQMF2JS
247
268
  "hqmfjs.#{type} = function(patient) { return new Boolean(#{when_not_found}); }"
248
269
  end
249
270
  end
250
-
271
+
251
272
  # Generate JS for a HQMF2::DataCriteria
252
273
  def js_for_data_criteria(force_sources=nil)
253
274
  HQMF2JS::Generator.render_template('data_criteria', {'all_criteria' => @doc.specific_occurrence_source_data_criteria(force_sources).concat(@doc.all_data_criteria), 'measure_period' => @doc.measure_period})
254
275
  end
255
-
276
+
277
+ def js_for_variables()
278
+ variables_js = ""
279
+ variables_js += "hqmfjs.VARIABLES = function(patient, initialSpecificContext) {\n"
280
+ @doc.source_data_criteria.each do |criteria|
281
+ if criteria.variable && !criteria.specific_occurrence
282
+ variables_js += "hqmfjs." + criteria.id + "(patient, initialSpecificContext);\n"
283
+ end
284
+ end
285
+ variables_js += "return false;\n}"
286
+ variables_js
287
+ end
288
+
256
289
  def self.library_functions(check_crosswalk=false, include_underscore=true)
257
290
  ctx = Sprockets::Environment.new(File.expand_path("../../..", __FILE__))
258
- Tilt::CoffeeScriptTemplate.default_bare = true
291
+ Tilt::CoffeeScriptTemplate.default_bare = true
259
292
  ctx.append_path "app/assets/javascripts"
260
-
293
+
261
294
  libraries = []
262
295
 
263
296
  if include_underscore
@@ -270,7 +303,7 @@ module HQMF2JS
270
303
  "// #########################\n// ## SPECIFIC OCCURRENCES ##\n// #########################\n",
271
304
  ctx.find_asset('specifics').to_s,
272
305
  "// #########################\n// ### LIBRARY FUNCTIONS ####\n// #########################\n",
273
- ctx.find_asset('hqmf_util').to_s,
306
+ ctx.find_asset('hqmf_util').to_s,
274
307
  "// #########################\n// ### PATIENT EXTENSION ####\n// #########################\n",
275
308
  ctx.find_asset('patient_api_extension').to_s,
276
309
  "// #########################\n// ## CUSTOM CALCULATIONS ###\n// #########################\n",
@@ -287,7 +320,7 @@ module HQMF2JS
287
320
  libraries.join("\n")
288
321
 
289
322
  end
290
-
323
+
291
324
  # Allow crosswalk functionality to be loaded separately from main JS libraries
292
325
  def self.crosswalk_functions
293
326
  ctx = Sprockets::Environment.new(File.expand_path("../../..", __FILE__))
@@ -296,23 +329,23 @@ module HQMF2JS
296
329
  ctx.find_asset('crosswalk').to_s
297
330
  end
298
331
  end
299
-
332
+
300
333
  # Simple class to issue monotonically increasing integer identifiers
301
334
  class Counter
302
335
  def initialize
303
336
  @count = 0
304
337
  end
305
-
338
+
306
339
  def new_id
307
340
  @count+=1
308
341
  end
309
342
  end
310
-
343
+
311
344
  # Singleton to keep a count of function identifiers
312
345
  class FunctionCounter < Counter
313
346
  include Singleton
314
347
  end
315
-
348
+
316
349
  # Singleton to keep a count of template identifiers
317
350
  class TemplateCounter < Counter
318
351
  include Singleton
@@ -14,7 +14,7 @@
14
14
  <%- end -%>
15
15
  var eventCriteria = {"type": "<%= eventType %>"<%- -%>
16
16
  <%= ", \"statuses\": #{statuses}" if statuses %> <%- -%>
17
- <%= ", \"includeEventsWithoutStatus\": #{includeEventsWithoutStatus}" if includeEventsWithoutStatus %> <%- -%>
17
+ <%= ", \"includeEventsWithoutStatus\": #{includeEventsWithoutStatus}" unless includeEventsWithoutStatus.nil? %> <%- -%>
18
18
  <%= ", \"negated\": #{criteria.negation}" if criteria.negation %> <%- -%>
19
19
  <%= ", \"negationValueSetId\": \"#{negationValueSetId}\"" if criteria.negation && negationValueSetId %> <%- -%>
20
20
  <%= ", \"valueSetId\": \"#{valueSetId}\"" if valueSetId %> <%- -%>
@@ -12,7 +12,6 @@ require 'nokogiri'
12
12
 
13
13
  require 'hqmf-parser'
14
14
 
15
-
16
15
  require_relative 'generator/js'
17
16
  require_relative 'generator/codes_to_json'
18
17
  require_relative 'generator/converter'
@@ -1,4 +1,6 @@
1
+ require 'rails/engine'
2
+
1
3
  module HQMF2JS
2
4
  class Engine < Rails::Engine
3
5
  end
4
- end
6
+ end
@@ -4,36 +4,43 @@ require 'fileutils'
4
4
  namespace :hqmf do
5
5
  desc 'Convert a HQMF file to JavaScript'
6
6
  task :convert, [:hqmf,:hqmf_version] do |t, args|
7
-
7
+
8
8
  raise "The path to the the hqmf xml must be specified" unless args.hqmf
9
-
9
+
10
10
  FileUtils.mkdir_p File.join(".","tmp",'js')
11
11
  file = File.expand_path(args.hqmf)
12
12
  version = args.hqmf_version || HQMF::Parser::HQMF_VERSION_1
13
+
13
14
  filename = Pathname.new(file).basename
14
- doc = HQMF::Parser.parse(File.open(file).read, version)
15
-
15
+ if (version == HQMF::Parser::HQMF_VERSION_1)
16
+ doc = HQMF::Parser::V1Parser.new.parse(File.open(file).read, version)
17
+ else
18
+ doc = HQMF::Parser::V2Parser.new.parse(File.open(file).read, version)
19
+ end
20
+
16
21
  gen = HQMF2JS::Generator::JS.new(doc)
17
22
 
18
23
  out_file = File.join(".","tmp",'js',"#{filename}.js")
19
-
20
- File.open(out_file, 'w') do |f|
24
+
25
+ File.open(out_file, 'w') do |f|
21
26
 
22
27
  f.write("// #########################\n")
23
28
  f.write("// ##### DATA CRITERIA #####\n")
24
29
  f.write("// #########################\n\n")
25
- f.write(gen.js_for_data_criteria())
26
-
30
+ f.write(gen.js_for_data_criteria())
31
+
27
32
  f.write("// #########################\n")
28
33
  f.write("// ##### POPULATION CRITERIA #####\n")
29
34
  f.write("// #########################\n\n")
30
-
35
+
31
36
  f.write("// INITIAL PATIENT POPULATION\n")
32
37
  f.write(gen.js_for(HQMF::PopulationCriteria::IPP))
33
38
  f.write("\n// DENOMINATOR\n")
34
39
  f.write(gen.js_for(HQMF::PopulationCriteria::DENOM))
35
40
  f.write("\n// NUMERATOR\n")
36
41
  f.write(gen.js_for(HQMF::PopulationCriteria::NUMER))
42
+ f.write("\n// NUMERATOR EXCLUSIONS\n")
43
+ f.write(gen.js_for(HQMF::PopulationCriteria::NUMEX))
37
44
  f.write("\n// EXCLUSIONS\n")
38
45
  f.write(gen.js_for(HQMF::PopulationCriteria::DENEX))
39
46
  f.write("\n// DENOMINATOR EXCEPTIONS\n")
@@ -42,10 +49,11 @@ namespace :hqmf do
42
49
  f.write(gen.js_for(HQMF::PopulationCriteria::MSRPOPL))
43
50
  f.write("\n// OBSERV\n")
44
51
  f.write(gen.js_for(HQMF::PopulationCriteria::OBSERV))
52
+ f.write("\n// MSRPOPLEX\n")
53
+ f.write(gen.js_for(HQMF::PopulationCriteria::MSRPOPLEX))
45
54
  end
46
-
55
+
47
56
  puts "wrote javascript to: #{out_file}"
48
-
57
+
49
58
  end
50
59
  end
51
-
@@ -0,0 +1,1423 @@
1
+ {
2
+ "id": "foo",
3
+ "hqmf_id": "foo",
4
+ "hqmf_version_number": 1,
5
+ "title": "Sample Quality Measure Document",
6
+ "description": "This is the measure description.",
7
+ "population_criteria": {
8
+ "IPP": {
9
+ "conjunction?": true,
10
+ "type": "IPP",
11
+ "title": "Initial Patient Population",
12
+ "hqmf_id": "IPP",
13
+ "preconditions": [
14
+ {
15
+ "id": null,
16
+ "reference": "ageBetween17and64"
17
+ }
18
+ ]
19
+ },
20
+ "DENOM": {
21
+ "conjunction?": true,
22
+ "type": "DENOM",
23
+ "title": "Denominator",
24
+ "hqmf_id": "DENOM",
25
+ "preconditions": [
26
+ {
27
+ "id": null,
28
+ "reference": null,
29
+ "preconditions": [
30
+ {
31
+ "id": null,
32
+ "reference": null,
33
+ "preconditions": [
34
+ {
35
+ "id": null,
36
+ "reference": "HasDiabetes"
37
+ },
38
+ {
39
+ "id": null,
40
+ "reference": null,
41
+ "preconditions": [
42
+ {
43
+ "id": null,
44
+ "reference": "EDorInpatientEncounter"
45
+ },
46
+ {
47
+ "id": null,
48
+ "reference": "AmbulatoryEncounter"
49
+ }
50
+ ],
51
+ "conjunction_code": "atLeastOneTrue"
52
+ }
53
+ ],
54
+ "conjunction_code": "allTrue"
55
+ },
56
+ {
57
+ "id": null,
58
+ "reference": "DiabetesMedAdministered"
59
+ },
60
+ {
61
+ "id": null,
62
+ "reference": "DiabetesMedIntended"
63
+ },
64
+ {
65
+ "id": null,
66
+ "reference": "DiabetesMedSupplied"
67
+ },
68
+ {
69
+ "id": null,
70
+ "reference": "DiabetesMedOrdered"
71
+ }
72
+ ],
73
+ "conjunction_code": "atLeastOneTrue"
74
+ }
75
+ ]
76
+ },
77
+ "NUMER": {
78
+ "conjunction?": true,
79
+ "type": "NUMER",
80
+ "title": "Numerator",
81
+ "hqmf_id": "NUMER",
82
+ "preconditions": [
83
+ {
84
+ "id": null,
85
+ "reference": "HbA1C"
86
+ }
87
+ ]
88
+ },
89
+ "DENEXCEP": {
90
+ "conjunction?": true,
91
+ "type": "DENEXCEP",
92
+ "title": "Denominator exception",
93
+ "hqmf_id": "DENEXCEP",
94
+ "preconditions": [
95
+ {
96
+ "id": null,
97
+ "reference": null,
98
+ "preconditions": [
99
+ {
100
+ "id": null,
101
+ "reference": "HasPolycysticOvaries"
102
+ },
103
+ {
104
+ "id": null,
105
+ "reference": "HasDiabetes"
106
+ }
107
+ ],
108
+ "conjunction_code": "allTrue"
109
+ },
110
+ {
111
+ "id": null,
112
+ "reference": "HasSteroidInducedDiabetes"
113
+ },
114
+ {
115
+ "id": null,
116
+ "reference": "HasGestationalDiabetes"
117
+ }
118
+ ]
119
+ }
120
+ },
121
+ "data_criteria": {
122
+ "birthdateThirtyYearsBeforeMeasurementPeriod": {
123
+ "title": "Birthdate",
124
+ "standard_category": "individual_characteristic",
125
+ "qds_data_type": "individual_characteristic",
126
+ "children_criteria": [
127
+
128
+ ],
129
+ "property": "birthtime",
130
+ "type": "characteristic",
131
+ "definition": "patient_characteristic_birthdate",
132
+ "hard_status": false,
133
+ "negation": false,
134
+ "source_data_criteria": "birthdateThirtyYearsBeforeMeasurementPeriod",
135
+ "field_values": {
136
+ },
137
+ "inline_code_list": {
138
+ "LOINC": [
139
+ "21112-8"
140
+ ]
141
+ },
142
+ "temporal_references": [
143
+ {
144
+ "type": "SBS",
145
+ "reference": "MeasurePeriod",
146
+ "range": {
147
+ "type": "IVL_PQ",
148
+ "low": {
149
+ "type": "PQ",
150
+ "unit": "a",
151
+ "value": "30",
152
+ "inclusive?": true,
153
+ "derived?": false
154
+ }
155
+ }
156
+ }
157
+ ]
158
+ },
159
+ "birthdateFiftyYearsBeforeMeasurementPeriod": {
160
+ "title": "Birthdate",
161
+ "standard_category": "individual_characteristic",
162
+ "qds_data_type": "individual_characteristic",
163
+ "children_criteria": [
164
+
165
+ ],
166
+ "property": "birthtime",
167
+ "type": "characteristic",
168
+ "definition": "patient_characteristic_birthdate",
169
+ "hard_status": false,
170
+ "negation": false,
171
+ "source_data_criteria": "birthdateFiftyYearsBeforeMeasurementPeriod",
172
+ "field_values": {
173
+ },
174
+ "inline_code_list": {
175
+ "LOINC": [
176
+ "21112-8"
177
+ ]
178
+ },
179
+ "temporal_references": [
180
+ {
181
+ "type": "SBS",
182
+ "reference": "MeasurePeriod",
183
+ "range": {
184
+ "type": "IVL_PQ",
185
+ "low": {
186
+ "type": "PQ",
187
+ "unit": "a",
188
+ "value": "50",
189
+ "inclusive?": true,
190
+ "derived?": false
191
+ }
192
+ }
193
+ }
194
+ ]
195
+ },
196
+ "ageFiftyBeforeMeasurementPeriod": {
197
+ "title": "Age",
198
+ "standard_category": "individual_characteristic",
199
+ "qds_data_type": "individual_characteristic",
200
+ "children_criteria": [
201
+
202
+ ],
203
+ "property": "age",
204
+ "type": "characteristic",
205
+ "definition": "patient_characteristic_age",
206
+ "hard_status": false,
207
+ "negation": false,
208
+ "source_data_criteria": "ageFiftyBeforeMeasurementPeriod",
209
+ "value": {
210
+ "type": "IVL_PQ",
211
+ "low": {
212
+ "type": "PQ",
213
+ "unit": "a",
214
+ "value": "50",
215
+ "inclusive?": true,
216
+ "derived?": false
217
+ }
218
+ },
219
+ "field_values": {
220
+ },
221
+ "inline_code_list": {
222
+ "SNOMED-CT": [
223
+ "424144002"
224
+ ]
225
+ },
226
+ "temporal_references": [
227
+ {
228
+ "type": "SBS",
229
+ "reference": "MeasurePeriod"
230
+ }
231
+ ]
232
+ },
233
+ "ageBetween17and64": {
234
+ "title": "ageBetween17and64",
235
+ "standard_category": "individual_characteristic",
236
+ "qds_data_type": "individual_characteristic",
237
+ "children_criteria": [
238
+
239
+ ],
240
+ "property": "age",
241
+ "type": "characteristic",
242
+ "definition": "patient_characteristic_age",
243
+ "hard_status": false,
244
+ "negation": false,
245
+ "source_data_criteria": "ageBetween17and64",
246
+ "value": {
247
+ "type": "IVL_PQ",
248
+ "low": {
249
+ "type": "PQ",
250
+ "unit": "a",
251
+ "value": "17",
252
+ "inclusive?": true,
253
+ "derived?": false
254
+ },
255
+ "high": {
256
+ "type": "PQ",
257
+ "unit": "a",
258
+ "value": "64",
259
+ "inclusive?": true,
260
+ "derived?": false
261
+ }
262
+ },
263
+ "field_values": {
264
+ },
265
+ "inline_code_list": {
266
+ "SNOMED-CT": [
267
+ "424144002"
268
+ ]
269
+ }
270
+ },
271
+ "ageBetween17and21": {
272
+ "title": "ageBetween17and21",
273
+ "standard_category": "individual_characteristic",
274
+ "qds_data_type": "individual_characteristic",
275
+ "children_criteria": [
276
+
277
+ ],
278
+ "property": "age",
279
+ "type": "characteristic",
280
+ "definition": "patient_characteristic_age",
281
+ "hard_status": false,
282
+ "negation": false,
283
+ "source_data_criteria": "ageBetween17and21",
284
+ "value": {
285
+ "type": "IVL_PQ",
286
+ "low": {
287
+ "type": "PQ",
288
+ "unit": "a",
289
+ "value": "17",
290
+ "inclusive?": true,
291
+ "derived?": false
292
+ },
293
+ "high": {
294
+ "type": "PQ",
295
+ "unit": "a",
296
+ "value": "21",
297
+ "inclusive?": true,
298
+ "derived?": false
299
+ }
300
+ },
301
+ "field_values": {
302
+ },
303
+ "inline_code_list": {
304
+ "SNOMED-CT": [
305
+ "424144002"
306
+ ]
307
+ }
308
+ },
309
+ "ageBetween22and29": {
310
+ "title": "ageBetween22and29",
311
+ "standard_category": "individual_characteristic",
312
+ "qds_data_type": "individual_characteristic",
313
+ "children_criteria": [
314
+
315
+ ],
316
+ "property": "age",
317
+ "type": "characteristic",
318
+ "definition": "patient_characteristic_age",
319
+ "hard_status": false,
320
+ "negation": false,
321
+ "source_data_criteria": "ageBetween22and29",
322
+ "value": {
323
+ "type": "IVL_PQ",
324
+ "low": {
325
+ "type": "PQ",
326
+ "unit": "a",
327
+ "value": "22",
328
+ "inclusive?": true,
329
+ "derived?": false
330
+ },
331
+ "high": {
332
+ "type": "PQ",
333
+ "unit": "a",
334
+ "value": "29",
335
+ "inclusive?": true,
336
+ "derived?": false
337
+ }
338
+ },
339
+ "field_values": {
340
+ },
341
+ "inline_code_list": {
342
+ "SNOMED-CT": [
343
+ "424144002"
344
+ ]
345
+ }
346
+ },
347
+ "ageBetween30and39": {
348
+ "title": "ageBetween30and39",
349
+ "standard_category": "individual_characteristic",
350
+ "qds_data_type": "individual_characteristic",
351
+ "children_criteria": [
352
+
353
+ ],
354
+ "property": "age",
355
+ "type": "characteristic",
356
+ "definition": "patient_characteristic_age",
357
+ "hard_status": false,
358
+ "negation": false,
359
+ "source_data_criteria": "ageBetween30and39",
360
+ "value": {
361
+ "type": "IVL_PQ",
362
+ "low": {
363
+ "type": "PQ",
364
+ "unit": "a",
365
+ "value": "30",
366
+ "inclusive?": true,
367
+ "derived?": false
368
+ },
369
+ "high": {
370
+ "type": "PQ",
371
+ "unit": "a",
372
+ "value": "39",
373
+ "inclusive?": true,
374
+ "derived?": false
375
+ }
376
+ },
377
+ "field_values": {
378
+ },
379
+ "inline_code_list": {
380
+ "SNOMED-CT": [
381
+ "424144002"
382
+ ]
383
+ }
384
+ },
385
+ "ageBetween40and49": {
386
+ "title": "Age",
387
+ "standard_category": "individual_characteristic",
388
+ "qds_data_type": "individual_characteristic",
389
+ "children_criteria": [
390
+
391
+ ],
392
+ "property": "age",
393
+ "type": "characteristic",
394
+ "definition": "patient_characteristic_age",
395
+ "hard_status": false,
396
+ "negation": false,
397
+ "source_data_criteria": "ageBetween40and49",
398
+ "value": {
399
+ "type": "IVL_PQ",
400
+ "low": {
401
+ "type": "PQ",
402
+ "unit": "a",
403
+ "value": "40",
404
+ "inclusive?": true,
405
+ "derived?": false
406
+ },
407
+ "high": {
408
+ "type": "PQ",
409
+ "unit": "a",
410
+ "value": "49",
411
+ "inclusive?": true,
412
+ "derived?": false
413
+ }
414
+ },
415
+ "field_values": {
416
+ },
417
+ "inline_code_list": {
418
+ "SNOMED-CT": [
419
+ "424144002"
420
+ ]
421
+ }
422
+ },
423
+ "ageBetween50and59": {
424
+ "title": "Age",
425
+ "standard_category": "individual_characteristic",
426
+ "qds_data_type": "individual_characteristic",
427
+ "children_criteria": [
428
+
429
+ ],
430
+ "property": "age",
431
+ "type": "characteristic",
432
+ "definition": "patient_characteristic_age",
433
+ "hard_status": false,
434
+ "negation": false,
435
+ "source_data_criteria": "ageBetween50and59",
436
+ "value": {
437
+ "type": "IVL_PQ",
438
+ "low": {
439
+ "type": "PQ",
440
+ "unit": "a",
441
+ "value": "50",
442
+ "inclusive?": true,
443
+ "derived?": false
444
+ },
445
+ "high": {
446
+ "type": "PQ",
447
+ "unit": "a",
448
+ "value": "59",
449
+ "inclusive?": true,
450
+ "derived?": false
451
+ }
452
+ },
453
+ "field_values": {
454
+ },
455
+ "inline_code_list": {
456
+ "SNOMED-CT": [
457
+ "424144002"
458
+ ]
459
+ }
460
+ },
461
+ "ageBetween60and64": {
462
+ "title": "Age",
463
+ "standard_category": "individual_characteristic",
464
+ "qds_data_type": "individual_characteristic",
465
+ "children_criteria": [
466
+
467
+ ],
468
+ "property": "age",
469
+ "type": "characteristic",
470
+ "definition": "patient_characteristic_age",
471
+ "hard_status": false,
472
+ "negation": false,
473
+ "source_data_criteria": "ageBetween60and64",
474
+ "value": {
475
+ "type": "IVL_PQ",
476
+ "low": {
477
+ "type": "PQ",
478
+ "unit": "a",
479
+ "value": "60",
480
+ "inclusive?": true,
481
+ "derived?": false
482
+ },
483
+ "high": {
484
+ "type": "PQ",
485
+ "unit": "a",
486
+ "value": "64",
487
+ "inclusive?": true,
488
+ "derived?": false
489
+ }
490
+ },
491
+ "field_values": {
492
+ },
493
+ "inline_code_list": {
494
+ "SNOMED-CT": [
495
+ "424144002"
496
+ ]
497
+ }
498
+ },
499
+ "dummyAge1": {
500
+ "title": "Age",
501
+ "standard_category": "individual_characteristic",
502
+ "qds_data_type": "individual_characteristic",
503
+ "children_criteria": [
504
+
505
+ ],
506
+ "property": "age",
507
+ "type": "characteristic",
508
+ "definition": "patient_characteristic_age",
509
+ "hard_status": false,
510
+ "negation": false,
511
+ "source_data_criteria": "dummyAge1",
512
+ "value": {
513
+ "type": "IVL_PQ",
514
+ "low": {
515
+ "type": "PQ",
516
+ "unit": "a",
517
+ "value": "60",
518
+ "inclusive?": true,
519
+ "derived?": false
520
+ },
521
+ "high": {
522
+ "type": "PQ",
523
+ "unit": "a",
524
+ "value": "64",
525
+ "inclusive?": true,
526
+ "derived?": false
527
+ }
528
+ },
529
+ "field_values": {
530
+ },
531
+ "effective_time": {
532
+ "type": "IVL_TS",
533
+ "low": {
534
+ "type": "TS",
535
+ "value": "20100101",
536
+ "inclusive?": true,
537
+ "derived?": false
538
+ },
539
+ "high": {
540
+ "type": "TS",
541
+ "value": "20111231",
542
+ "inclusive?": true,
543
+ "derived?": false
544
+ }
545
+ },
546
+ "inline_code_list": {
547
+ "SNOMED-CT": [
548
+ "424144002"
549
+ ]
550
+ }
551
+ },
552
+ "dummyAge2": {
553
+ "title": "Age",
554
+ "standard_category": "individual_characteristic",
555
+ "qds_data_type": "individual_characteristic",
556
+ "children_criteria": [
557
+
558
+ ],
559
+ "property": "age",
560
+ "type": "characteristic",
561
+ "definition": "patient_characteristic_age",
562
+ "hard_status": false,
563
+ "negation": false,
564
+ "source_data_criteria": "dummyAge2",
565
+ "value": {
566
+ "type": "IVL_PQ",
567
+ "low": {
568
+ "type": "PQ",
569
+ "unit": "a",
570
+ "value": "60",
571
+ "inclusive?": true,
572
+ "derived?": false
573
+ },
574
+ "high": {
575
+ "type": "PQ",
576
+ "unit": "a",
577
+ "value": "64",
578
+ "inclusive?": true,
579
+ "derived?": false
580
+ }
581
+ },
582
+ "field_values": {
583
+ },
584
+ "effective_time": {
585
+ "type": "IVL_TS",
586
+ "low": {
587
+ "type": "TS",
588
+ "value": "20100101",
589
+ "inclusive?": true,
590
+ "derived?": false
591
+ }
592
+ },
593
+ "inline_code_list": {
594
+ "SNOMED-CT": [
595
+ "424144002"
596
+ ]
597
+ }
598
+ },
599
+ "genderMale": {
600
+ "title": "Gender",
601
+ "standard_category": "individual_characteristic",
602
+ "qds_data_type": "individual_characteristic",
603
+ "children_criteria": [
604
+
605
+ ],
606
+ "property": "gender",
607
+ "type": "characteristic",
608
+ "definition": "patient_characteristic_gender",
609
+ "hard_status": false,
610
+ "negation": false,
611
+ "source_data_criteria": "genderMale",
612
+ "value": {
613
+ "type": "CD",
614
+ "system": "2.16.840.1.113883.5.1",
615
+ "code": "M"
616
+ },
617
+ "field_values": {
618
+ },
619
+ "inline_code_list": {
620
+ "SNOMED-CT": [
621
+ "263495000"
622
+ ]
623
+ }
624
+ },
625
+ "genderFemale": {
626
+ "title": "Gender",
627
+ "standard_category": "individual_characteristic",
628
+ "qds_data_type": "individual_characteristic",
629
+ "children_criteria": [
630
+
631
+ ],
632
+ "property": "gender",
633
+ "type": "characteristic",
634
+ "definition": "patient_characteristic_gender",
635
+ "hard_status": false,
636
+ "negation": false,
637
+ "source_data_criteria": "genderFemale",
638
+ "value": {
639
+ "type": "CD",
640
+ "system": "2.16.840.1.113883.5.1",
641
+ "code": "F"
642
+ },
643
+ "field_values": {
644
+ },
645
+ "inline_code_list": {
646
+ "SNOMED-CT": [
647
+ "263495000"
648
+ ]
649
+ }
650
+ },
651
+ "EDorInpatientEncounter": {
652
+ "title": "EDorInpatientEncounter",
653
+ "standard_category": "encounter",
654
+ "qds_data_type": "encounter",
655
+ "code_list_id": "2.16.840.1.113883.3.464.1.42",
656
+ "children_criteria": [
657
+
658
+ ],
659
+ "type": "encounters",
660
+ "definition": "encounter",
661
+ "hard_status": false,
662
+ "negation": false,
663
+ "source_data_criteria": "EDorInpatientEncounter",
664
+ "field_values": {
665
+ },
666
+ "effective_time": {
667
+ "type": "IVL_TS",
668
+ "high": {
669
+ "type": "TS",
670
+ "inclusive?": true,
671
+ "derived?": true,
672
+ "expression": "MeasurePeriod.high.add(new PQ(-2,'a'))"
673
+ }
674
+ }
675
+ },
676
+ "AmbulatoryEncounter": {
677
+ "title": "AmbulatoryEncounter",
678
+ "standard_category": "encounter",
679
+ "qds_data_type": "encounter",
680
+ "code_list_id": "2.16.840.1.113883.3.464.1.1142",
681
+ "children_criteria": [
682
+
683
+ ],
684
+ "type": "encounters",
685
+ "definition": "encounter",
686
+ "hard_status": false,
687
+ "negation": false,
688
+ "source_data_criteria": "AmbulatoryEncounter",
689
+ "field_values": {
690
+ },
691
+ "effective_time": {
692
+ "type": "IVL_TS",
693
+ "high": {
694
+ "type": "TS",
695
+ "inclusive?": true,
696
+ "derived?": true,
697
+ "expression": "MeasurePeriod.high.add(new PQ(-2,'a'))"
698
+ }
699
+ }
700
+ },
701
+ "DummyLanguage_Arabic": {
702
+ "title": "Language",
703
+ "standard_category": "individual_characteristic",
704
+ "qds_data_type": "individual_characteristic",
705
+ "children_criteria": [
706
+
707
+ ],
708
+ "property": "languages",
709
+ "type": "characteristic",
710
+ "definition": "patient_characteristic_languages",
711
+ "hard_status": false,
712
+ "negation": false,
713
+ "source_data_criteria": "DummyLanguage_Arabic",
714
+ "value": {
715
+ "type": "CD",
716
+ "system": "1.0.639.1",
717
+ "code": "ar"
718
+ },
719
+ "field_values": {
720
+ },
721
+ "inline_code_list": {
722
+ "SNOMED-CT": [
723
+ "102902016"
724
+ ]
725
+ }
726
+ },
727
+ "DummyMaritalStatus_Divorced": {
728
+ "title": "Marital Status",
729
+ "standard_category": "individual_characteristic",
730
+ "qds_data_type": "individual_characteristic",
731
+ "children_criteria": [
732
+
733
+ ],
734
+ "property": "maritalStatus",
735
+ "type": "characteristic",
736
+ "definition": "patient_characteristic_marital_status",
737
+ "hard_status": false,
738
+ "negation": false,
739
+ "source_data_criteria": "DummyMaritalStatus_Divorced",
740
+ "value": {
741
+ "type": "CD",
742
+ "system": "2.16.840.1.113883.5.2",
743
+ "code": "D"
744
+ },
745
+ "field_values": {
746
+ },
747
+ "inline_code_list": {
748
+ "SNOMED-CT": [
749
+ "125680007"
750
+ ]
751
+ }
752
+ },
753
+ "DummyRace_Latin_American": {
754
+ "title": "Race",
755
+ "standard_category": "individual_characteristic",
756
+ "qds_data_type": "individual_characteristic",
757
+ "children_criteria": [
758
+
759
+ ],
760
+ "property": "race",
761
+ "type": "characteristic",
762
+ "definition": "patient_characteristic_race",
763
+ "hard_status": false,
764
+ "negation": false,
765
+ "source_data_criteria": "DummyRace_Latin_American",
766
+ "value": {
767
+ "type": "CD",
768
+ "system": "2.16.840.1.113883.6.238",
769
+ "code": "2178-2"
770
+ },
771
+ "field_values": {
772
+ },
773
+ "inline_code_list": {
774
+ "SNOMED-CT": [
775
+ "103579009"
776
+ ]
777
+ }
778
+ },
779
+ "DummyProcedureAfterHasDiabetes": {
780
+ "title": "DummyProcedureAfterHasDiabetes",
781
+ "standard_category": "procedure",
782
+ "qds_data_type": "procedure_performed",
783
+ "children_criteria": [
784
+
785
+ ],
786
+ "type": "procedures",
787
+ "definition": "procedure",
788
+ "status": "performed",
789
+ "hard_status": false,
790
+ "negation": false,
791
+ "source_data_criteria": "DummyProcedureAfterHasDiabetes",
792
+ "field_values": {
793
+ },
794
+ "effective_time": {
795
+ "type": "IVL_TS",
796
+ "low": {
797
+ "type": "TS",
798
+ "value": "20100101",
799
+ "inclusive?": true,
800
+ "derived?": false
801
+ },
802
+ "high": {
803
+ "type": "TS",
804
+ "value": "20111231",
805
+ "inclusive?": true,
806
+ "derived?": false
807
+ }
808
+ },
809
+ "inline_code_list": {
810
+ "SNOMED-CT": [
811
+ "127355002"
812
+ ]
813
+ },
814
+ "temporal_references": [
815
+ {
816
+ "type": "SAS",
817
+ "reference": "HasDiabetes",
818
+ "range": {
819
+ "type": "IVL_PQ",
820
+ "high": {
821
+ "type": "PQ",
822
+ "unit": "a",
823
+ "value": "1",
824
+ "inclusive?": true,
825
+ "derived?": false
826
+ }
827
+ }
828
+ }
829
+ ]
830
+ },
831
+ "DummyProcedureBeforeMeasurePeriod": {
832
+ "title": "some kind of procedure",
833
+ "standard_category": "procedure",
834
+ "qds_data_type": "procedure_performed",
835
+ "children_criteria": [
836
+
837
+ ],
838
+ "type": "procedures",
839
+ "definition": "procedure",
840
+ "status": "performed",
841
+ "hard_status": false,
842
+ "negation": false,
843
+ "source_data_criteria": "DummyProcedureBeforeMeasurePeriod",
844
+ "field_values": {
845
+ },
846
+ "effective_time": {
847
+ "type": "IVL_TS",
848
+ "low": {
849
+ "type": "TS",
850
+ "value": "20100101",
851
+ "inclusive?": true,
852
+ "derived?": false
853
+ },
854
+ "high": {
855
+ "type": "TS",
856
+ "value": "20111231",
857
+ "inclusive?": true,
858
+ "derived?": false
859
+ }
860
+ },
861
+ "inline_code_list": {
862
+ "LOINC": [
863
+ "127355002"
864
+ ]
865
+ },
866
+ "temporal_references": [
867
+ {
868
+ "type": "SBS",
869
+ "reference": "MeasurePeriod"
870
+ }
871
+ ]
872
+ },
873
+ "DummyProcedureAfterHasDiabetesAndBeforeEncounter": {
874
+ "title": "some kind of procedure",
875
+ "standard_category": "procedure",
876
+ "qds_data_type": "procedure_performed",
877
+ "children_criteria": [
878
+
879
+ ],
880
+ "type": "procedures",
881
+ "definition": "procedure",
882
+ "status": "performed",
883
+ "hard_status": false,
884
+ "negation": false,
885
+ "source_data_criteria": "DummyProcedureAfterHasDiabetesAndBeforeEncounter",
886
+ "field_values": {
887
+ },
888
+ "effective_time": {
889
+ "type": "IVL_TS",
890
+ "low": {
891
+ "type": "TS",
892
+ "value": "20100101",
893
+ "inclusive?": true,
894
+ "derived?": false
895
+ },
896
+ "high": {
897
+ "type": "TS",
898
+ "value": "20111231",
899
+ "inclusive?": true,
900
+ "derived?": false
901
+ }
902
+ },
903
+ "inline_code_list": {
904
+ "LOINC": [
905
+ "127355002"
906
+ ]
907
+ },
908
+ "temporal_references": [
909
+ {
910
+ "type": "SAS",
911
+ "reference": "HasDiabetes",
912
+ "range": {
913
+ "type": "IVL_PQ",
914
+ "high": {
915
+ "type": "PQ",
916
+ "unit": "a",
917
+ "value": "-1",
918
+ "inclusive?": true,
919
+ "derived?": false
920
+ }
921
+ }
922
+ },
923
+ {
924
+ "type": "SBS",
925
+ "reference": "AmbulatoryEncounter"
926
+ }
927
+ ]
928
+ },
929
+ "DummyProcedureAfterHasDiabetesWithCount": {
930
+ "title": "DummyProcedureAfterHasDiabetesWithCount",
931
+ "standard_category": "procedure",
932
+ "qds_data_type": "procedure_performed",
933
+ "children_criteria": [
934
+
935
+ ],
936
+ "type": "procedures",
937
+ "definition": "procedure",
938
+ "status": "performed",
939
+ "hard_status": false,
940
+ "negation": false,
941
+ "source_data_criteria": "DummyProcedureAfterHasDiabetesWithCount",
942
+ "field_values": {
943
+ },
944
+ "effective_time": {
945
+ "type": "IVL_TS",
946
+ "low": {
947
+ "type": "TS",
948
+ "value": "20100101",
949
+ "inclusive?": true,
950
+ "derived?": false
951
+ },
952
+ "high": {
953
+ "type": "TS",
954
+ "value": "20111231",
955
+ "inclusive?": true,
956
+ "derived?": false
957
+ }
958
+ },
959
+ "inline_code_list": {
960
+ "SNOMED-CT": [
961
+ "127355002"
962
+ ]
963
+ },
964
+ "temporal_references": [
965
+ {
966
+ "type": "SAS",
967
+ "reference": "HasDiabetes",
968
+ "range": {
969
+ "type": "IVL_PQ",
970
+ "high": {
971
+ "type": "PQ",
972
+ "unit": "a",
973
+ "value": "1",
974
+ "inclusive?": true,
975
+ "derived?": false
976
+ }
977
+ }
978
+ }
979
+ ],
980
+ "subset_operators": [
981
+ {
982
+ "type": "SUMMARY",
983
+ "value": {
984
+ "type": "IVL_PQ",
985
+ "low": {
986
+ "type": "PQ",
987
+ "value": "2",
988
+ "inclusive?": true,
989
+ "derived?": false
990
+ }
991
+ }
992
+ }
993
+ ]
994
+ },
995
+ "anyDiabetes": {
996
+ "title": "anyDiabetes",
997
+ "standard_category": "",
998
+ "qds_data_type": "",
999
+ "children_criteria": [
1000
+ "HasDiabetes",
1001
+ "HasGestationalDiabetes",
1002
+ "HasSteroidInducedDiabetes"
1003
+ ],
1004
+ "derivation_operator": "UNION",
1005
+ "type": "derived",
1006
+ "definition": "derived",
1007
+ "hard_status": false,
1008
+ "negation": false,
1009
+ "source_data_criteria": "anyDiabetes",
1010
+ "field_values": {
1011
+ }
1012
+ },
1013
+ "allDiabetes": {
1014
+ "title": "allDiabetes",
1015
+ "standard_category": "",
1016
+ "qds_data_type": "",
1017
+ "children_criteria": [
1018
+ "HasDiabetes",
1019
+ "HasGestationalDiabetes",
1020
+ "HasSteroidInducedDiabetes"
1021
+ ],
1022
+ "derivation_operator": "XPRODUCT",
1023
+ "type": "derived",
1024
+ "definition": "derived",
1025
+ "hard_status": false,
1026
+ "negation": false,
1027
+ "source_data_criteria": "allDiabetes",
1028
+ "field_values": {
1029
+ }
1030
+ },
1031
+ "HasDiabetes": {
1032
+ "title": "HasDiabetes",
1033
+ "standard_category": "diagnosis_condition_problem",
1034
+ "qds_data_type": "diagnosis_active",
1035
+ "code_list_id": "2.16.840.1.113883.3.464.1.37",
1036
+ "children_criteria": [
1037
+
1038
+ ],
1039
+ "type": "conditions",
1040
+ "definition": "diagnosis",
1041
+ "status": "active",
1042
+ "hard_status": false,
1043
+ "negation": false,
1044
+ "source_data_criteria": "HasDiabetes",
1045
+ "field_values": {
1046
+ }
1047
+ },
1048
+ "HasGestationalDiabetes": {
1049
+ "title": "HasGestationalDiabetes",
1050
+ "standard_category": "diagnosis_condition_problem",
1051
+ "qds_data_type": "diagnosis_active",
1052
+ "code_list_id": "2.16.840.1.113883.3.464.1.67",
1053
+ "children_criteria": [
1054
+
1055
+ ],
1056
+ "type": "conditions",
1057
+ "definition": "diagnosis",
1058
+ "hard_status": false,
1059
+ "negation": false,
1060
+ "source_data_criteria": "HasGestationalDiabetes",
1061
+ "field_values": {
1062
+ },
1063
+ "effective_time": {
1064
+ "type": "IVL_TS",
1065
+ "low": {
1066
+ "type": "TS",
1067
+ "inclusive?": true,
1068
+ "derived?": true,
1069
+ "expression": "MeasurePeriod.low"
1070
+ },
1071
+ "high": {
1072
+ "type": "TS",
1073
+ "inclusive?": true,
1074
+ "derived?": true,
1075
+ "expression": "MeasurePeriod.high"
1076
+ }
1077
+ }
1078
+ },
1079
+ "HasPolycysticOvaries": {
1080
+ "title": "HasPolycysticOvaries",
1081
+ "standard_category": "diagnosis_condition_problem",
1082
+ "qds_data_type": "diagnosis_active",
1083
+ "code_list_id": "2.16.840.1.113883.3.464.1.98",
1084
+ "children_criteria": [
1085
+
1086
+ ],
1087
+ "type": "conditions",
1088
+ "definition": "diagnosis",
1089
+ "hard_status": false,
1090
+ "negation": false,
1091
+ "source_data_criteria": "HasPolycysticOvaries",
1092
+ "field_values": {
1093
+ },
1094
+ "effective_time": {
1095
+ "type": "IVL_TS",
1096
+ "low": {
1097
+ "type": "TS",
1098
+ "inclusive?": true,
1099
+ "derived?": true,
1100
+ "expression": "MeasurePeriod.low.add(new PQ(-1,'a'))"
1101
+ },
1102
+ "high": {
1103
+ "type": "TS",
1104
+ "inclusive?": true,
1105
+ "derived?": true,
1106
+ "expression": "MeasurePeriod.high"
1107
+ }
1108
+ }
1109
+ },
1110
+ "HasSteroidInducedDiabetes": {
1111
+ "title": "HasSteroidInducedDiabetes",
1112
+ "standard_category": "diagnosis_condition_problem",
1113
+ "qds_data_type": "diagnosis_active",
1114
+ "code_list_id": "2.16.840.1.113883.3.464.1.113",
1115
+ "children_criteria": [
1116
+
1117
+ ],
1118
+ "type": "conditions",
1119
+ "definition": "diagnosis",
1120
+ "hard_status": false,
1121
+ "negation": false,
1122
+ "source_data_criteria": "HasSteroidInducedDiabetes",
1123
+ "field_values": {
1124
+ },
1125
+ "effective_time": {
1126
+ "type": "IVL_TS",
1127
+ "low": {
1128
+ "type": "TS",
1129
+ "inclusive?": true,
1130
+ "derived?": true,
1131
+ "expression": "MeasurePeriod.low"
1132
+ },
1133
+ "high": {
1134
+ "type": "TS",
1135
+ "inclusive?": true,
1136
+ "derived?": true,
1137
+ "expression": "MeasurePeriod.high"
1138
+ }
1139
+ }
1140
+ },
1141
+ "HbA1CNotDone": {
1142
+ "title": "HbA1CNotDone",
1143
+ "standard_category": "laboratory_test",
1144
+ "qds_data_type": "laboratory_test",
1145
+ "code_list_id": "2.16.840.1.113883.3.464.1.72",
1146
+ "children_criteria": [
1147
+
1148
+ ],
1149
+ "type": "laboratory_tests",
1150
+ "definition": "laboratory_test",
1151
+ "status": "performed",
1152
+ "hard_status": false,
1153
+ "negation": true,
1154
+ "negation_code_list_id": "1.2.3.4",
1155
+ "source_data_criteria": "HbA1CNotDone",
1156
+ "field_values": {
1157
+ }
1158
+ },
1159
+ "HbA1C": {
1160
+ "title": "HbA1C",
1161
+ "standard_category": "laboratory_test",
1162
+ "qds_data_type": "laboratory_test",
1163
+ "code_list_id": "2.16.840.1.113883.3.464.1.72",
1164
+ "children_criteria": [
1165
+
1166
+ ],
1167
+ "type": "laboratory_tests",
1168
+ "definition": "laboratory_test",
1169
+ "status": "performed",
1170
+ "hard_status": false,
1171
+ "negation": false,
1172
+ "source_data_criteria": "HbA1C",
1173
+ "value": {
1174
+ "type": "IVL_PQ",
1175
+ "low": {
1176
+ "type": "PQ",
1177
+ "unit": "%",
1178
+ "value": "9",
1179
+ "inclusive?": true,
1180
+ "derived?": false
1181
+ }
1182
+ },
1183
+ "field_values": {
1184
+ }
1185
+ },
1186
+ "DummyInlineCodedResult": {
1187
+ "title": "DummyInlineCodedResult",
1188
+ "standard_category": "laboratory_test",
1189
+ "qds_data_type": "laboratory_test",
1190
+ "code_list_id": "2.16.840.1.113883.3.464.1.72",
1191
+ "children_criteria": [
1192
+
1193
+ ],
1194
+ "type": "laboratory_tests",
1195
+ "definition": "laboratory_test",
1196
+ "status": "performed",
1197
+ "hard_status": false,
1198
+ "negation": false,
1199
+ "source_data_criteria": "DummyInlineCodedResult",
1200
+ "value": {
1201
+ "type": "CD",
1202
+ "system": "1.2.3.4",
1203
+ "code": "xyzzy"
1204
+ },
1205
+ "field_values": {
1206
+ }
1207
+ },
1208
+ "DummyExternalCodedResult": {
1209
+ "title": "DummyExternalCodedResult",
1210
+ "standard_category": "laboratory_test",
1211
+ "qds_data_type": "laboratory_test",
1212
+ "code_list_id": "2.16.840.1.113883.3.464.1.72",
1213
+ "children_criteria": [
1214
+
1215
+ ],
1216
+ "type": "laboratory_tests",
1217
+ "definition": "laboratory_test",
1218
+ "status": "performed",
1219
+ "hard_status": false,
1220
+ "negation": false,
1221
+ "source_data_criteria": "DummyExternalCodedResult",
1222
+ "value": {
1223
+ "type": "CD",
1224
+ "code_list_id": "1.2.3.4"
1225
+ },
1226
+ "field_values": {
1227
+ }
1228
+ },
1229
+ "moreThanTwoHbA1CTests": {
1230
+ "title": "moreThanTwoHbA1CTests",
1231
+ "standard_category": "laboratory_test",
1232
+ "qds_data_type": "laboratory_test",
1233
+ "code_list_id": "2.16.840.1.113883.3.464.1.72",
1234
+ "children_criteria": [
1235
+
1236
+ ],
1237
+ "type": "laboratory_tests",
1238
+ "definition": "laboratory_test",
1239
+ "status": "performed",
1240
+ "hard_status": false,
1241
+ "negation": false,
1242
+ "source_data_criteria": "moreThanTwoHbA1CTests",
1243
+ "field_values": {
1244
+ },
1245
+ "subset_operators": [
1246
+ {
1247
+ "type": "COUNT",
1248
+ "value": {
1249
+ "type": "IVL_PQ",
1250
+ "low": {
1251
+ "type": "PQ",
1252
+ "value": "3",
1253
+ "inclusive?": true,
1254
+ "derived?": false
1255
+ }
1256
+ }
1257
+ }
1258
+ ]
1259
+ },
1260
+ "moreThanFourHbA1CTests": {
1261
+ "title": "moreThanFourHbA1CTests",
1262
+ "standard_category": "laboratory_test",
1263
+ "qds_data_type": "laboratory_test",
1264
+ "code_list_id": "2.16.840.1.113883.3.464.1.72",
1265
+ "children_criteria": [
1266
+
1267
+ ],
1268
+ "type": "laboratory_tests",
1269
+ "definition": "laboratory_test",
1270
+ "status": "performed",
1271
+ "hard_status": false,
1272
+ "negation": false,
1273
+ "source_data_criteria": "moreThanFourHbA1CTests",
1274
+ "field_values": {
1275
+ },
1276
+ "subset_operators": [
1277
+ {
1278
+ "type": "COUNT",
1279
+ "value": {
1280
+ "type": "IVL_PQ",
1281
+ "low": {
1282
+ "type": "PQ",
1283
+ "value": "5",
1284
+ "inclusive?": true,
1285
+ "derived?": false
1286
+ }
1287
+ }
1288
+ }
1289
+ ]
1290
+ },
1291
+ "DiabetesMedAdministered": {
1292
+ "title": "DiabetesMedAdministered",
1293
+ "standard_category": "medication",
1294
+ "qds_data_type": "medication_active",
1295
+ "code_list_id": "2.16.840.1.113883.3.464.1.94",
1296
+ "children_criteria": [
1297
+
1298
+ ],
1299
+ "type": "medications",
1300
+ "definition": "medication",
1301
+ "status": "active",
1302
+ "hard_status": false,
1303
+ "negation": false,
1304
+ "source_data_criteria": "DiabetesMedAdministered",
1305
+ "field_values": {
1306
+ },
1307
+ "effective_time": {
1308
+ "type": "IVL_TS",
1309
+ "low": {
1310
+ "type": "TS",
1311
+ "inclusive?": true,
1312
+ "derived?": true,
1313
+ "expression": "MeasurePeriod.low.add(new PQ(-2,'a'))"
1314
+ }
1315
+ }
1316
+ },
1317
+ "DiabetesMedIntended": {
1318
+ "title": "DiabetesMedIntended",
1319
+ "standard_category": "medication",
1320
+ "qds_data_type": "medication_active",
1321
+ "code_list_id": "2.16.840.1.113883.3.464.1.94",
1322
+ "children_criteria": [
1323
+
1324
+ ],
1325
+ "type": "medications",
1326
+ "definition": "medication",
1327
+ "status": "active",
1328
+ "hard_status": false,
1329
+ "negation": false,
1330
+ "source_data_criteria": "DiabetesMedIntended",
1331
+ "field_values": {
1332
+ },
1333
+ "effective_time": {
1334
+ "type": "IVL_TS",
1335
+ "high": {
1336
+ "type": "TS",
1337
+ "inclusive?": true,
1338
+ "derived?": true,
1339
+ "expression": "MeasurePeriod.high.add(new PQ(-2,'a'))"
1340
+ }
1341
+ }
1342
+ },
1343
+ "DiabetesMedSupplied": {
1344
+ "title": "DiabetesMedSupplied",
1345
+ "standard_category": "medication",
1346
+ "qds_data_type": "medication_dispensed",
1347
+ "code_list_id": "2.16.840.1.113883.3.464.1.94",
1348
+ "children_criteria": [
1349
+
1350
+ ],
1351
+ "type": "medications",
1352
+ "definition": "medication",
1353
+ "status": "dispensed",
1354
+ "hard_status": true,
1355
+ "negation": false,
1356
+ "source_data_criteria": "DiabetesMedSupplied",
1357
+ "field_values": {
1358
+ },
1359
+ "effective_time": {
1360
+ "type": "IVL_TS",
1361
+ "high": {
1362
+ "type": "TS",
1363
+ "inclusive?": true,
1364
+ "derived?": true,
1365
+ "expression": "MeasurePeriod.high.add(new PQ(-2,'a'))"
1366
+ }
1367
+ }
1368
+ },
1369
+ "DiabetesMedOrdered": {
1370
+ "title": "DiabetesMedOrdered",
1371
+ "standard_category": "medication",
1372
+ "qds_data_type": "medication_dispensed",
1373
+ "code_list_id": "2.16.840.1.113883.3.464.1.94",
1374
+ "children_criteria": [
1375
+
1376
+ ],
1377
+ "type": "medications",
1378
+ "definition": "medication",
1379
+ "status": "dispensed",
1380
+ "hard_status": true,
1381
+ "negation": false,
1382
+ "source_data_criteria": "DiabetesMedOrdered",
1383
+ "field_values": {
1384
+ },
1385
+ "effective_time": {
1386
+ "type": "IVL_TS",
1387
+ "high": {
1388
+ "type": "TS",
1389
+ "inclusive?": true,
1390
+ "derived?": true,
1391
+ "expression": "MeasurePeriod.high.add(new PQ(-2,'a'))"
1392
+ }
1393
+ }
1394
+ }
1395
+ },
1396
+ "source_data_criteria": {
1397
+ },
1398
+ "populations": [
1399
+ {
1400
+ "IPP": "IPP",
1401
+ "DENOM": "DENOM",
1402
+ "NUMER": "NUMER",
1403
+ "DENEXCEP": "DENEXCEP",
1404
+ "id": "Population1",
1405
+ "title": "Population Criteria Section"
1406
+ }
1407
+ ],
1408
+ "measure_period": {
1409
+ "type": "IVL_TS",
1410
+ "low": {
1411
+ "type": "TS",
1412
+ "value": "20110101",
1413
+ "inclusive?": true,
1414
+ "derived?": false
1415
+ },
1416
+ "high": {
1417
+ "type": "TS",
1418
+ "value": "20111231",
1419
+ "inclusive?": true,
1420
+ "derived?": false
1421
+ }
1422
+ }
1423
+ }