lib/qme/map/map_reduce_builder.rb in quality-measure-engine-0.8.0 vs lib/qme/map/map_reduce_builder.rb in quality-measure-engine-1.0.1
- old
+ new
@@ -83,9 +83,12 @@
def finalize_function
reduce =
"function (key, value) {
var patient = value;
patient.measure_id = \"#{@measure_def['id']}\";\n"
+ if @params['test_id'] && @params['test_id'].class==BSON::ObjectId
+ reduce += " patient.test_id = new ObjectId(\"#{@params['test_id']}\");\n"
+ end
if @measure_def['sub_id']
reduce += " patient.sub_id = \"#{@measure_def['sub_id']}\";\n"
end
reduce += "patient.effective_date = #{@params['effective_date']};
\ No newline at end of file