lib/generator/population_criteria.js.erb in hqmf2js-1.2.1 vs lib/generator/population_criteria.js.erb in hqmf2js-1.3.0
- old
+ new
@@ -1,4 +1,9 @@
hqmfjs.<%= type %> = function(patient, initialSpecificContext) {
- return <%= js_for_precondition(criteria, 0, true) -%>;
+ population_criteria_fn = <%= js_for_precondition(criteria, 0, true) -%>;
+ if (typeof(population_criteria_fn) == 'function') {
+ return population_criteria_fn();
+ } else {
+ return population_criteria_fn;
+ }
};