<!---
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.4 $
$Id: lockunlock_action.cfm,v 1.4 2009/03/25 19:32:33 arlen Exp $
$Date: 2009/03/25 19:32:33 $
--->
<body bgcolor="#FFFFFF"> 
<cfif isDefined("url.lock")> 
  <cfquery  name="Lock" datasource="#Application.DataSrc#">
   INSERT INTO #Request.prefix_db_agency#.PatientRecordLock ( Patient_Id, Agency_ID, LockDate, LockedBy_ID ) VALUES ( #url.Patient#, #session.AgencyID#, #CreateODBCDateTime(Now())#, #Session.EmployeeID# )
  </cfquery> 
  <cflocation url="index.cfm?page=agency&cat=OasisManagement&rpt=lockedpatients"> 
</cfif> 
<cfif isDefined("url.unlock")> 
  <cfquery  name="Unlock" datasource="#Application.DataSrc#">
   UPDATE #Request.prefix_db_agency#.PatientRecordLock SET UnlockDate = #CreateODBCDateTime(Now())#, UnLockedBy_ID = 2623, Downloaded = 1 WHERE PatientRecordLock_ID = #url.PatientLock#
  </cfquery> 
  <cflocation url="index.cfm?page=agency&cat=OasisManagement&rpt=lockedpatients" addtoken="no"> 
</cfif> 

