<report title="OMD Roster Reconciliation-EMR Report - OSCAR PRO" description="Active, enrolled patients - searchable by enrolled provider.<br>Created by OntarioMD August 2025 to support the Roster Reconciliation Tool developed by Dr. Kevin Brophy and Dr. Alex Duong" active="1">
<query>



SELECT 
CONCAT( "<a  target=new href=../../demographic/demographiccontrol.jsp?demographic_no=", demographic_no, "&displaymode=edit&dboperation=search_detail/>", demographic_no, "<a/>" ) AS "Pt #",
demographic.last_name as "Last Name",
demographic.first_name as "First Name",
CONCAT(demographic.year_of_birth,'-', demographic.month_of_birth,'-', demographic.date_of_birth) as "DOB",
TIMESTAMPDIFF(YEAR, DATE(CONCAT(demographic.year_of_birth , "-", demographic.month_of_birth, "-", demographic.date_of_birth)), NOW()) as "Age",
demographic.sex as "Gender",
demographic.patient_status as "Status",
demographic.roster_status as "Roster",
demographic.hin as HCN

FROM demographic

WHERE 
demographic.provider_no LIKE {provider} 

AND demographic.patient_status ="AC"

AND demographic.roster_status="RO"



;

</query>

<param id="provider" type="list" description="Provider Number">
<param-query>select provider_no, CONCAT(last_name, ', ', first_name, ' (', provider_no, ')') from provider 
order by last_name;</param-query>
 </param>



</report>