lib/generator/data_criteria.js.erb in hqmf2js-1.1.0 vs lib/generator/data_criteria.js.erb in hqmf2js-1.2.0
- old
+ new
@@ -4,11 +4,11 @@
var <%= js_name(criteria) %> = <%= js_for_value(criteria.value) %>;
<%- end -%>
// Data critera
<%- all_criteria.select {|c| c.type != :variable}.each do |criteria| -%>
-hqmfjs.<%= js_name(criteria) %> = function(patient) {
+hqmfjs.<%= js_name(criteria) %> = function(patient, initialSpecificContext) {
<%- if criteria.type == :characteristic and !criteria.property.nil? -%>
<%= js_for_characteristic(criteria) %>
<%- else -%>
<%- if criteria.type != :derived -%>
<%= js_for_patient_data(criteria) %>
@@ -35,10 +35,10 @@
events.specificContext=hqmf.SpecificsManager.identity()
<%- end -%>
<%- end -%>
<%- if criteria.subset_operators -%>
<%- criteria.subset_operators.select {|subset_operator| subset_operator.type}.each do |subset_operator| -%>
- events = <%= subset_operator.type %>(events<%= ", #{js_for_bounds(subset_operator.value)}" if subset_operator.value %>);
+ events = <%= subset_operator.type %>(events<%= ", #{js_for_bounds(subset_operator.value)}" if subset_operator.value %>, initialSpecificContext);
<%- end # each operator -%>
<%- end # subset operators -%>
return events;
<%- end # non-characteristic criteria -%>
}
\ No newline at end of file