WorldVistA / popHealth

popHealth - An open source clinical quality measure reporting and visualization tool. For announcements and information on current state of popHealth, please visit -
http://osehra.org/popHealth
Apache License 2.0
46 stars 45 forks source link

Update queries_controller.rb #209

Closed adrianlfns closed 1 year ago

adrianlfns commented 2 years ago

Please review the pull request below. I had to add this specifically for the measure 165. That measure have multiple population sets so the statement qc = CQM::QualityReport.where('measure_id' => measure.id, 'effective_date' => options[:effective_date],'start_date' => options[:start_date], "sub_id" => params[:sub_id], "filters.providers" => {'$in': params[:providers]}).first does not find any value.

I added the statement below in order to prevent an exception when the qc.status is called.

if qc.nil? qc = CQM::QualityReport.where('measure_id' => measure.id, 'effective_date' => options[:effective_date],'start_date' => options[:start_date], "filters.providers" => {'$in': params[:providers]}).first end