<!---influenza_vaccine.cfm--->

<style>
@media print{
a[href]:after
{
content:none
}
}
</style>


<cfquery  datasource="#Application.DataSrc#" name="GetPatients">
	SELECT  DISTINCT MAX(an.Start_of_Care_M0030) AS MAXDATE,an.Assessment_Id, 
	an.Admission_Status, an.Assessment_Reason_M0100, an.Start_of_Care_M0030,an.M1040_Influ,an.M1050_Pneu, 
	an.Assessment_Tracker_Id,an.Certification_Start, an.Certification_End,p.Patient_ID,p.*,pd.*  FROM
	#Request.prefix_db_agency#.patient p 
	left outer join #Request.prefix_db_agency#.Assessment_New an on an.Patient_Id = p.Patient_Id 
    left outer join #Request.prefix_db_agency#.Pathway_Details pd on an.Assessment_ID = pd.Assessment_ID 
	WHERE p.Agency_Id = <cfqueryparam cfsqltype="cf_sql_integer" value="#session.AgencyID#">
	AND   an.Patient_Id = p.Patient_Id
	AND	  an.deleted <> 1
    ANd pd.Description like 'M1041%'  and pd.Deleted  is null
	Group by p.Patient_ID
	ORDER BY p.Last_Name_M0040, p.First_Name_M0040, MAXDATE ASC
</cfquery>
 
<cfset Patient_Ctr = 0>
<div class="portlet box blue">
	<div class="portlet-title">
		<div class="caption">
			<i class="fa fa-gear"></i>Influenza vaccine status
		</div>
		<div class="tools">
			<a href="javascript:;" class="fullscreen"></a>
		</div>
		<div class="actions">
		      <cfoutput>
			<form method="post" name="Active_form" id="Active_form" action="index.cfm?page=reports&cat=patients&rpt=influenza_vaccine_export">
				<input class="btn btn-default btn-sm" id="assbutton" type="button" name="Cancel" value="Back" onClick="window.history.back();">
				<!---<input class="btn btn-default btn-sm" type="submit" name="submit" value="Export Report">--->
			</form>
		</cfoutput>
		</div>
	</div>
<div class="portlet-body flip-scroll">
<br />
<div class="form-group">
		 <label>Filter by Payer Type:</label>&nbsp;&nbsp;
 <input type=checkbox name=active value=1 <cfif isdefined('url.active') and url.active eq 1>checked</cfif> onclick="if (this.checked) active=1;else active=0;secureHREF('index.cfm?page=reports&cat=patients&rpt=influenza_vaccine&active='+active);"> <span class="margin-right-10" style="font-weight:bold;color:green;">Active</span>&nbsp;
 <input type=checkbox name=Inactive value=1 <cfif isdefined('url.Inactive') and url.Inactive eq 1>checked</cfif> onclick="if (this.checked) Inactive=1;else Inactive=0;secureHREF('index.cfm?page=reports&cat=patients&rpt=influenza_vaccine&Inactive='+Inactive);"> <span class="margin-right-10" style="font-weight:bold;color:red;">In Active</span>&nbsp;
 <input type=checkbox name=all value=1 <cfif isdefined('url.all') and url.all eq 1>checked</cfif> onclick="if (this.checked) all=1;else all=0;secureHREF('index.cfm?page=reports&cat=patients&rpt=influenza_vaccine&all='+all);"> <span class="margin-right-10" style="font-weight:bold;">ALL Patients</span>
 <br /><br />
<table class="table table-striped table-bordered table-hover" id="sample_3">
			<thead>
				<tr>
				<th></th>
					<th>Patients</th>
					<th>Start of Care Date</th>
					<th>M1041</th>
					</tr>
			</thead>
			<tbody>
				<cfoutput query="GetPatients" group="patient_ID">
					<tr>
					<td></td>
						<td>
							<a href="javascript:void(0);" onClick="javascript:secureHREF('index.cfm?page=patient&cat=PatientSummary&ID=#Patient_ID#')">#Last_Name_M0040#, #First_Name_M0040# #Middle_Initial_M0040#</a><cfif Agency_Assigned_ID IS NOT "">(#Agency_Assigned_ID#)</cfif><br>
						</td>
						<td>#DateFormat(MAXDATE,"mm/dd/yyyy")#</td>
                        <td><!---#Pert#--->#M1040_Influ#</td>
					</tr>
				   <cfset Patient_Ctr = Patient_Ctr + 1 />
			</cfoutput>
		</tbody>
	</table>
		<center><p><b>Total  patients:</b>&nbsp;&nbsp;&nbsp; <b><cfoutput>#Patient_Ctr#</cfoutput></b></p></center>
	</div>
</div>
<!---</cfif>--->