<!---
This file is Copyright © 1998-2009 by Home Care Business Services. This work may not be reproduced, in whole or in part, 
using any medium, including, but not limited to, electronic transmission, CD-ROM or published in print, without the express 
permission of Home Care Business Services.

$Revision: 1.10 $
$Id: employee_compliance.cfm,v 1.10 2009/08/24 21:19:15 arlen Exp $
$Date: 2009/08/24 21:19:15 $
--->


<!--- Page specific code, such as queries and variable settings should go here --->
<!--- Otherwise, only display those patients assigned to the agent logged in --->
<cfif isdefined('url.id') and #url.id# neq ''>
<cfquery  datasource="#Application.DataSrc#" name="GetList">
   select sch.Visit_Date, sch.Visit_Type, sch.Rev_Code,  sch.HCPCS, py.PayName, au.StartDate, au.EndDate,
   pt.Last_Name_M0040 AS Last_Name, pt.First_Name_M0040 AS First_Name  
   from #Request.prefix_db_agency#.ScheduleItems sch, #Request.prefix_db_agency#.authorizations au, #Request.prefix_db_agency#.patient pt, #Request.prefix_db_agency#.Payer py
 where sch.Rev_CodeID = au.Rev_CodeID 
 AND sch.Payer_ID = au.Payer_ID
  AND sch.Payer_ID = py.Payer_ID 
 AND sch.Patient_ID = au.Patient_ID 
 and sch.Visit_Date between au.StartDate and au.EndDate
 and sch.Patient_Id = pt.Patient_Id 
 and sch.Auth_Id = 0
 and au.Deleted <> 1
 and pt.Patient_Id  = #url.id#;
</cfquery>
<cfelse>
invalid request
<cfabort>
</cfif>
<!--- End page specific code --->
<style>
@media print{
a[href]:after
{
content:none
}
}
</style>

<div class="portlet box blue">
				<div class="portlet-title">
					<div class="caption">
						<i class="fa fa-gear"></i>
						<cfoutput>
						#GetList.Last_Name# #GetList.First_Name#  Not Connected to an Active Authorization
						</cfoutput>
					</div>
				</div>
				<div class="portlet-body flip-scroll">
					<table class="table table-bordered table-striped table-condensed flip-content" id="sample_2">
						<thead class="flip-content">
						<tr>
							<th></th>
						<th>Visit Date</th>
                        <th>Prior Auth Start</th>
                        <th>Prior Auth End</th>
                        <th>Prior Auth Payer</th>
                        <th>Prior Auth Visit Type</th>
						</tr>
						</thead>
						<tbody>

                      <cfoutput query="GetList" >
						<tr>
						    <td></td>
							<td>#DateFormat(Visit_Date,"mm/dd/yyyy")#</td>
							<td>#DateFormat(StartDate,"mm/dd/yyyy")#</td>
							<td>#DateFormat(EndDate,"mm/dd/yyyy")#</td>
							<td>#PayName#</td>
                            <td>#Visit_Type#</td>
						</tr>
						</cfoutput>
			
		              </tbody>
					  </table>
					  </div>
					  </div>

