Total Number in "clinical_reports"

ijaraho wrote on Wednesday, July 03, 2013:

hi,
I want to get the"Total Number of Patients" in the “clinical_reports”
at the bottom of the report
how I can do it???
thanks

visolveemr wrote on Wednesday, July 03, 2013:

Hi,
This can be accomplished by simple code changes.
insert these lines in the file /interface/reports/clinical_reports.php

Line 528 : $tot_pat_query = $sqlstmt." ".$whr_stmt;
Line 541 : $tot_pat_query .= " GROUP BY pd.pid ";
           $tot_pat_count =sqlNumRows(sqlStatement($tot_pat_query,$sqlBindArray));
Line 769 : <tr><td><?php echo htmlspecialchars(xl('Total Number of patients:'),ENT_NOQUOTES); ?></b></td><td><?php echo htmlspecialchars($tot_pat_count,ENT_NOQUOTES); ?></td></tr>

When you print the report with other detailed searches (Example: with Drug field as %), the result may contain multiple records for a single patient. So we need to add the above mentioned lines.

Hope This Helps.

Thanks
Your OpenEMR Customization/Support provider,
ViSolve,Inc
services@visolve.com

ijaraho wrote on Wednesday, July 03, 2013:

thank you
It success, I added it at the line 763 at the end of the loop

thanks again

fsgl wrote on Sunday, September 01, 2013:

Some illustrations should help.

The last line of code is so long that it required 2 screenshots.

This modification comes in very handy when preparing for the Additional Clinical Quality Measures for Stage 1 Meaningful Use.