
<cfsetting requesttimeout="66000">
<cfquery  name="GetEmployee" datasource="#Application.DataSrc#">

Select employee_Id,authority_Level,(select AgencyType from #Request.prefix_db_lookup#.Agency where Agency_ID=Employee.Agency_ID) as agencyType,skill from #Request.prefix_db_lookup#.Employee where employee_Id not in (select eaID from #Request.prefix_db_agency#.employee_auth where employee_auth.eaID=Employee.employee_Id)  ;

</cfquery>
<cfloop query="GetEmployee">
	<cfif GetEmployee.authority_Level eq 1.0>
	
		<cfif GetEmployee.agencyType eq 1>
		
			<cfquery  name="InsertLevel1Type1" datasource="#Application.DataSrc#">
			
				INSERT INTO 
				#Request.prefix_db_agency#.employee_auth
				(
					eaID,
					eaSetSchedule,
					eaSetCareplanItems,
					eaSetCommSubjects,
					eaSetEmployees,
					eaSetIncidentSubjects,
					eaSetPayers,
					eaSetPayrollCodes,
					eaSetPhysicians,
					eaSetReferralSrcs,
					eaSetRevenueCodes,
					eaSetSupplies,
					eaSetAgyInfoUpdate,
					eaPayroll,
					eaBilling,
					eaOrders,
					eaAuthorizations,
					eaDataTransmit,
					eaType,
					eaCareplan,
					eaLock,
					eaSchedule,
					eaClientEdit,
					eaNoteEdit,
					eaUndo,
					eaReports,
					eaStatistics
				)
				values
				(
					#GetEmployee.employee_Id#,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					2,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1				
				)
			
			</cfquery>			
		<cfelseif GetEmployee.agencyType eq 2>
		
			<cfquery  name="InsertLevel1Type2" datasource="#Application.DataSrc#">
			
				INSERT INTO 
				#Request.prefix_db_agency#.employee_auth
				(
					eaID,
					eaSetSchedule,
					eaSetCareplanItems,
					eaSetCommSubjects,
					eaSetEmployees,
					eaSetIncidentSubjects,
					eaSetPayers,
					eaSetPayrollCodes,
					eaSetPhysicians,
					eaSetReferralSrcs,
					eaSetRevenueCodes,
					eaSetSupplies,
					eaSetAgyInfoUpdate,
					eaPayroll,
					eaBilling,
					eaOrders,
					eaAuthorizations,
					eaDataTransmit,
					eaType,
					eaCareplan,
					eaLock,
					eaSchedule,
					eaClientEdit,
					eaNoteEdit,
					eaUndo,
					eaReports,
					eaStatistics
				)
				values
				(
					#GetEmployee.employee_Id#,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					2,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1				
				)
			
			</cfquery>
			
		
		<cfelseif GetEmployee.agencyType eq 3>
		
			<cfquery  name="InsertLevel1Type3" datasource="#Application.DataSrc#">
			
				INSERT INTO 
				#Request.prefix_db_agency#.employee_auth
				(
					eaID,
					eaSetSchedule,
					eaSetCareplanItems,
					eaSetCommSubjects,
					eaSetEmployees,
					eaSetIncidentSubjects,
					eaSetPayers,
					eaSetPayrollCodes,
					eaSetPhysicians,
					eaSetReferralSrcs,
					eaSetRevenueCodes,
					eaSetSupplies,
					eaSetAgyInfoUpdate,
					eaPayroll,
					eaBilling,
					eaOrders,
					eaAuthorizations,
					eaDataTransmit,
					eaType,
					eaCareplan,
					eaLock,
					eaSchedule,
					eaClientEdit,
					eaNoteEdit,
					eaUndo,
					eaReports,
					eaStatistics
				)
				values
				(
					#GetEmployee.employee_Id#,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					2,
					1,
					1,
					1,
					1,
					0,
					1,
					1,
					1				
				)
			
			</cfquery>
			
		
		<cfelseif GetEmployee.agencyType eq 4>
		
			<cfquery  name="InsertLevel1Type4" datasource="#Application.DataSrc#">
			
				INSERT INTO 
				#Request.prefix_db_agency#.employee_auth
				(
					eaID,
					eaSetSchedule,
					eaSetCareplanItems,
					eaSetCommSubjects,
					eaSetEmployees,
					eaSetIncidentSubjects,
					eaSetPayers,
					eaSetPayrollCodes,
					eaSetPhysicians,
					eaSetReferralSrcs,
					eaSetRevenueCodes,
					eaSetSupplies,
					eaSetAgyInfoUpdate,
					eaPayroll,
					eaBilling,
					eaOrders,
					eaAuthorizations,
					eaDataTransmit,
					eaType,
					eaCareplan,
					eaLock,
					eaSchedule,
					eaClientEdit,
					eaNoteEdit,
					eaUndo,
					eaReports,
					eaStatistics
				)
				values
				(
					#GetEmployee.employee_Id#,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					2,
					1,
					1,
					1,
					1,
					0,
					1,
					1,
					1				
				)
			
			</cfquery>
			
		</cfif>
				
	<cfelseif GetEmployee.authority_Level eq 2.0>
	
		<cfif GetEmployee.agencyType eq 1>
		
			<cfquery  name="InsertLevel2Type1" datasource="#Application.DataSrc#">
			
				INSERT INTO 
				#Request.prefix_db_agency#.employee_auth
				(
					eaID,
					eaSetSchedule,
					eaSetCareplanItems,
					eaSetCommSubjects,
					eaSetEmployees,
					eaSetIncidentSubjects,
					eaSetPayers,
					eaSetPayrollCodes,
					eaSetPhysicians,
					eaSetReferralSrcs,
					eaSetRevenueCodes,
					eaSetSupplies,
					eaSetAgyInfoUpdate,
					eaPayroll,
					eaBilling,
					eaOrders,
					eaAuthorizations,
					eaDataTransmit,
					eaType,
					eaCareplan,
					eaLock,
					eaSchedule,
					eaClientEdit,
					eaNoteEdit,
					eaUndo,
					eaReports,
					eaStatistics
				)
				values
				(
					#GetEmployee.employee_Id#,
					1,
					1,
					1,
					0,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					0,
					1,
					1,
					1,
					1,
					2,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1				
				)
			
			</cfquery>
			
		<cfelseif GetEmployee.agencyType eq 2>
		
			<cfquery  name="InsertLevel2Type2" datasource="#Application.DataSrc#">
			
				INSERT INTO 
				#Request.prefix_db_agency#.employee_auth
				(
					eaID,
					eaSetSchedule,
					eaSetCareplanItems,
					eaSetCommSubjects,
					eaSetEmployees,
					eaSetIncidentSubjects,
					eaSetPayers,
					eaSetPayrollCodes,
					eaSetPhysicians,
					eaSetReferralSrcs,
					eaSetRevenueCodes,
					eaSetSupplies,
					eaSetAgyInfoUpdate,
					eaPayroll,
					eaBilling,
					eaOrders,
					eaAuthorizations,
					eaDataTransmit,
					eaType,
					eaCareplan,
					eaLock,
					eaSchedule,
					eaClientEdit,
					eaNoteEdit,
					eaUndo,
					eaReports,
					eaStatistics
				)
				values
				(
					#GetEmployee.employee_Id#,
					1,
					1,
					1,
					0,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					0,
					1,
					1,
					1,
					1,
					2,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1				
				)
			
			</cfquery>
			
		
		<cfelseif GetEmployee.agencyType eq 3>
		
			<cfquery  name="InsertLevel2Type3" datasource="#Application.DataSrc#">
			
				INSERT INTO 
				#Request.prefix_db_agency#.employee_auth
				(
					eaID,
					eaSetSchedule,
					eaSetCareplanItems,
					eaSetCommSubjects,
					eaSetEmployees,
					eaSetIncidentSubjects,
					eaSetPayers,
					eaSetPayrollCodes,
					eaSetPhysicians,
					eaSetReferralSrcs,
					eaSetRevenueCodes,
					eaSetSupplies,
					eaSetAgyInfoUpdate,
					eaPayroll,
					eaBilling,
					eaOrders,
					eaAuthorizations,
					eaDataTransmit,
					eaType,
					eaCareplan,
					eaLock,
					eaSchedule,
					eaClientEdit,
					eaNoteEdit,
					eaUndo,
					eaReports,
					eaStatistics
				)
				values
				(
					#GetEmployee.employee_Id#,
					1,
					1,
					1,
					0,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					0,
					1,
					1,
					1,
					1,
					2,
					1,
					1,
					1,
					1,
					0,
					1,
					1,
					1				
				)
			
			</cfquery>
			
		
		<cfelseif GetEmployee.agencyType eq 4>
		
			<cfquery  name="InsertLevel2Type4" datasource="#Application.DataSrc#">
			
				INSERT INTO 
				#Request.prefix_db_agency#.employee_auth
				(
					eaID,
					eaSetSchedule,
					eaSetCareplanItems,
					eaSetCommSubjects,
					eaSetEmployees,
					eaSetIncidentSubjects,
					eaSetPayers,
					eaSetPayrollCodes,
					eaSetPhysicians,
					eaSetReferralSrcs,
					eaSetRevenueCodes,
					eaSetSupplies,
					eaSetAgyInfoUpdate,
					eaPayroll,
					eaBilling,
					eaOrders,
					eaAuthorizations,
					eaDataTransmit,
					eaType,
					eaCareplan,
					eaLock,
					eaSchedule,
					eaClientEdit,
					eaNoteEdit,
					eaUndo,
					eaReports,
					eaStatistics
				)
				values
				(
					#GetEmployee.employee_Id#,
					1,
					1,
					1,
					0,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					0,
					1,
					1,
					1,
					1,
					2,
					1,
					1,
					1,
					1,
					0,
					1,
					1,
					1				
				)
			
			</cfquery>
			
		
		
		
	</cfif>
	
	<cfelseif GetEmployee.authority_Level eq 3.0>
	
		<cfif GetEmployee.agencyType eq 1>
		
			<cfquery  name="InsertLevel3Type1" datasource="#Application.DataSrc#">
			
				INSERT INTO 
				#Request.prefix_db_agency#.employee_auth
				(
					eaID,
					eaSetSchedule,
					eaSetCareplanItems,
					eaSetCommSubjects,
					eaSetEmployees,
					eaSetIncidentSubjects,
					eaSetPayers,
					eaSetPayrollCodes,
					eaSetPhysicians,
					eaSetReferralSrcs,
					eaSetRevenueCodes,
					eaSetSupplies,
					eaSetAgyInfoUpdate,
					eaPayroll,
					eaBilling,
					eaOrders,
					eaAuthorizations,
					eaDataTransmit,
					eaType,
					eaCareplan,
					eaLock,
					eaSchedule,
					eaClientEdit,
					eaNoteEdit,
					eaUndo,
					eaReports,
					eaStatistics
				)
				values
				(
					#GetEmployee.employee_Id#,
					1,
					1,
					1,
					0,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					0,
					0,
					1,
					1,
					1,
					2,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					0			
				)
			
			</cfquery>
			
		<cfelseif GetEmployee.agencyType eq 2>
			
			<cfquery  name="InsertLevel3Type2" datasource="#Application.DataSrc#">
			
				INSERT INTO 
				#Request.prefix_db_agency#.employee_auth
				(
					eaID,
					eaSetSchedule,
					eaSetCareplanItems,
					eaSetCommSubjects,
					eaSetEmployees,
					eaSetIncidentSubjects,
					eaSetPayers,
					eaSetPayrollCodes,
					eaSetPhysicians,
					eaSetReferralSrcs,
					eaSetRevenueCodes,
					eaSetSupplies,
					eaSetAgyInfoUpdate,
					eaPayroll,
					eaBilling,
					eaOrders,
					eaAuthorizations,
					eaDataTransmit,
					eaType,
					eaCareplan,
					eaLock,
					eaSchedule,
					eaClientEdit,
					eaNoteEdit,
					eaUndo,
					eaReports,
					eaStatistics
				)
				values
				(
					#GetEmployee.employee_Id#,
					1,
					1,
					1,
					0,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					0,
					0,
					1,
					1,
					1,
					2,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					0			
				)
			
			</cfquery>
			
		
		<cfelseif GetEmployee.agencyType eq 3>
		
			<cfquery  name="InsertLevel3Type3" datasource="#Application.DataSrc#">
			
				INSERT INTO 
				#Request.prefix_db_agency#.employee_auth
				(
					eaID,
					eaSetSchedule,
					eaSetCareplanItems,
					eaSetCommSubjects,
					eaSetEmployees,
					eaSetIncidentSubjects,
					eaSetPayers,
					eaSetPayrollCodes,
					eaSetPhysicians,
					eaSetReferralSrcs,
					eaSetRevenueCodes,
					eaSetSupplies,
					eaSetAgyInfoUpdate,
					eaPayroll,
					eaBilling,
					eaOrders,
					eaAuthorizations,
					eaDataTransmit,
					eaType,
					eaCareplan,
					eaLock,
					eaSchedule,
					eaClientEdit,
					eaNoteEdit,
					eaUndo,
					eaReports,
					eaStatistics
				)
				values
				(
					#GetEmployee.employee_Id#,
					1,
					1,
					1,
					0,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					0,
					0,
					1,
					1,
					1,
					2,
					1,
					1,
					1,
					1,
					0,
					1,
					1,
					0			
				)
			
			</cfquery>
			
		
		<cfelseif GetEmployee.agencyType eq 4>
		
			<cfquery  name="InsertLevel3Type4" datasource="#Application.DataSrc#">
			
				INSERT INTO 
				#Request.prefix_db_agency#.employee_auth
				(
					eaID,
					eaSetSchedule,
					eaSetCareplanItems,
					eaSetCommSubjects,
					eaSetEmployees,
					eaSetIncidentSubjects,
					eaSetPayers,
					eaSetPayrollCodes,
					eaSetPhysicians,
					eaSetReferralSrcs,
					eaSetRevenueCodes,
					eaSetSupplies,
					eaSetAgyInfoUpdate,
					eaPayroll,
					eaBilling,
					eaOrders,
					eaAuthorizations,
					eaDataTransmit,
					eaType,
					eaCareplan,
					eaLock,
					eaSchedule,
					eaClientEdit,
					eaNoteEdit,
					eaUndo,
					eaReports,
					eaStatistics
				)
				values
				(
					#GetEmployee.employee_Id#,
					1,
					1,
					1,
					0,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					1,
					0,
					0,
					1,
					1,
					1,
					2,
					1,
					1,
					1,
					1,
					0,
					1,
					1,
					0			
				)
			
			</cfquery>
			
		
	</cfif>
	
	<cfelseif GetEmployee.authority_Level eq 4.0>
	
		<cfif GetEmployee.agencyType eq 1>
		
			<cfquery  name="InsertLevel4Type1" datasource="#Application.DataSrc#">
			
				INSERT INTO 
				#Request.prefix_db_agency#.employee_auth
				(
					eaID,
					eaSetSchedule,
					eaSetCareplanItems,
					eaSetCommSubjects,
					eaSetEmployees,
					eaSetIncidentSubjects,
					eaSetPayers,
					eaSetPayrollCodes,
					eaSetPhysicians,
					eaSetReferralSrcs,
					eaSetRevenueCodes,
					eaSetSupplies,
					eaSetAgyInfoUpdate,
					eaPayroll,
					eaBilling,
					eaOrders,
					eaAuthorizations,
					eaDataTransmit,
					eaType,
					eaCareplan,
					eaLock,
					eaSchedule,
					eaClientEdit,
					eaNoteEdit,
					eaUndo,
					eaReports,
					eaStatistics
				)
				values
				(
					#GetEmployee.employee_Id#,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					2,
					0,
					0,
					1,
					1,
					0,
					0,
					0,
					0			
				)
			
			</cfquery>
			
		<cfelseif GetEmployee.agencyType eq 2>
		
			<cfquery  name="InsertLevel4Type2" datasource="#Application.DataSrc#">
			
				INSERT INTO 
				#Request.prefix_db_agency#.employee_auth
				(
					eaID,
					eaSetSchedule,
					eaSetCareplanItems,
					eaSetCommSubjects,
					eaSetEmployees,
					eaSetIncidentSubjects,
					eaSetPayers,
					eaSetPayrollCodes,
					eaSetPhysicians,
					eaSetReferralSrcs,
					eaSetRevenueCodes,
					eaSetSupplies,
					eaSetAgyInfoUpdate,
					eaPayroll,
					eaBilling,
					eaOrders,
					eaAuthorizations,
					eaDataTransmit,
					eaType,
					eaCareplan,
					eaLock,
					eaSchedule,
					eaClientEdit,
					eaNoteEdit,
					eaUndo,
					eaReports,
					eaStatistics
				)
				values
				(
					#GetEmployee.employee_Id#,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					2,
					0,
					0,
					1,
					1,
					0,
					0,
					0,
					0			
				)
			
			</cfquery>
			
		
		<cfelseif GetEmployee.agencyType eq 3>
		
			<cfquery  name="InsertLevel4Type3" datasource="#Application.DataSrc#">
			
				INSERT INTO 
				#Request.prefix_db_agency#.employee_auth
				(
					eaID,
					eaSetSchedule,
					eaSetCareplanItems,
					eaSetCommSubjects,
					eaSetEmployees,
					eaSetIncidentSubjects,
					eaSetPayers,
					eaSetPayrollCodes,
					eaSetPhysicians,
					eaSetReferralSrcs,
					eaSetRevenueCodes,
					eaSetSupplies,
					eaSetAgyInfoUpdate,
					eaPayroll,
					eaBilling,
					eaOrders,
					eaAuthorizations,
					eaDataTransmit,
					eaType,
					eaCareplan,
					eaLock,
					eaSchedule,
					eaClientEdit,
					eaNoteEdit,
					eaUndo,
					eaReports,
					eaStatistics
				)
				values
				(
					#GetEmployee.employee_Id#,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					2,
					0,
					0,
					1,
					1,
					0,
					0,
					0,
					0			
				)
			
			</cfquery>
			
		
		<cfelseif GetEmployee.agencyType eq 4>
		
			<cfquery  name="InsertLevel4Type4" datasource="#Application.DataSrc#">
			
				INSERT INTO 
				#Request.prefix_db_agency#.employee_auth
				(
					eaID,
					eaSetSchedule,
					eaSetCareplanItems,
					eaSetCommSubjects,
					eaSetEmployees,
					eaSetIncidentSubjects,
					eaSetPayers,
					eaSetPayrollCodes,
					eaSetPhysicians,
					eaSetReferralSrcs,
					eaSetRevenueCodes,
					eaSetSupplies,
					eaSetAgyInfoUpdate,
					eaPayroll,
					eaBilling,
					eaOrders,
					eaAuthorizations,
					eaDataTransmit,
					eaType,
					eaCareplan,
					eaLock,
					eaSchedule,
					eaClientEdit,
					eaNoteEdit,
					eaUndo,
					eaReports,
					eaStatistics
				)
				values
				(
					#GetEmployee.employee_Id#,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					2,
					0,
					0,
					1,
					1,
					0,
					0,
					0,
					0			
				)
			
			
			</cfquery>
			
	
		
	</cfif>
	
	<cfelseif GetEmployee.authority_Level eq 5.0>
	
	
	
		<cfif GetEmployee.agencyType eq 1>
		

			<cfquery  name="InsertLevel5Type1" datasource="#Application.DataSrc#">
			
				INSERT INTO 
				#Request.prefix_db_agency#.employee_auth
				(
					eaID,
					eaSetSchedule,
					eaSetCareplanItems,
					eaSetCommSubjects,
					eaSetEmployees,
					eaSetIncidentSubjects,
					eaSetPayers,
					eaSetPayrollCodes,
					eaSetPhysicians,
					eaSetReferralSrcs,
					eaSetRevenueCodes,
					eaSetSupplies,
					eaSetAgyInfoUpdate,
					eaPayroll,
					eaBilling,
					eaOrders,
					eaAuthorizations,
					eaDataTransmit,
					eaType,
					eaCareplan,
					eaLock,
					eaSchedule,
					eaClientEdit,
					eaNoteEdit,
					eaUndo,
					eaReports,
					eaStatistics
				)
				values
				(
					#GetEmployee.employee_Id#,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					1,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0			
				)
			
			</cfquery>
			
		<cfelseif GetEmployee.agencyType eq 2>
		
			<cfquery  name="InsertLevel5Type2" datasource="#Application.DataSrc#">
			
				INSERT INTO 
				#Request.prefix_db_agency#.employee_auth
				(
					eaID,
					eaSetSchedule,
					eaSetCareplanItems,
					eaSetCommSubjects,
					eaSetEmployees,
					eaSetIncidentSubjects,
					eaSetPayers,
					eaSetPayrollCodes,
					eaSetPhysicians,
					eaSetReferralSrcs,
					eaSetRevenueCodes,
					eaSetSupplies,
					eaSetAgyInfoUpdate,
					eaPayroll,
					eaBilling,
					eaOrders,
					eaAuthorizations,
					eaDataTransmit,
					eaType,
					eaCareplan,
					eaLock,
					eaSchedule,
					eaClientEdit,
					eaNoteEdit,
					eaUndo,
					eaReports,
					eaStatistics
				)
				values
				(
					#GetEmployee.employee_Id#,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					1,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0			
				)
			
			
			</cfquery>
			
		
		<cfelseif GetEmployee.agencyType eq 3>	
		
			<cfquery  name="InsertLevel5Type3" datasource="#Application.DataSrc#">
				INSERT INTO 
				#Request.prefix_db_agency#.employee_auth
				(
					eaID,
					eaSetSchedule,
					eaSetCareplanItems,
					eaSetCommSubjects,
					eaSetEmployees,
					eaSetIncidentSubjects,
					eaSetPayers,
					eaSetPayrollCodes,
					eaSetPhysicians,
					eaSetReferralSrcs,
					eaSetRevenueCodes,
					eaSetSupplies,
					eaSetAgyInfoUpdate,
					eaPayroll,
					eaBilling,
					eaOrders,
					eaAuthorizations,
					eaDataTransmit,
					eaType,
					eaCareplan,
					eaLock,
					eaSchedule,
					eaClientEdit,
					eaNoteEdit,
					eaUndo,
					eaReports,
					eaStatistics
				)
				values
				(
					#GetEmployee.employee_Id#,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					1,
					0,
					0,
					0,
					1,
					1,
					0,
					0,
					0			
				)
			</cfquery>
			
	
		<cfelseif GetEmployee.agencyType eq 4>		
		
		
			<cfquery  name="InsertLevel5Type4" datasource="#Application.DataSrc#">
				INSERT INTO 
				#Request.prefix_db_agency#.employee_auth
				(
					eaID,
					eaSetSchedule,
					eaSetCareplanItems,
					eaSetCommSubjects,
					eaSetEmployees,
					eaSetIncidentSubjects,
					eaSetPayers,
					eaSetPayrollCodes,
					eaSetPhysicians,
					eaSetReferralSrcs,
					eaSetRevenueCodes,
					eaSetSupplies,
					eaSetAgyInfoUpdate,
					eaPayroll,
					eaBilling,
					eaOrders,
					eaAuthorizations,
					eaDataTransmit,
					eaType,
					eaCareplan,
					eaLock,
					eaSchedule,
					eaClientEdit,
					eaNoteEdit,
					eaUndo,
					eaReports,
					eaStatistics
				)
				values
				(
					#GetEmployee.employee_Id#,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					0,
					1,
					0,
					0,
					0,
					1,
					1,
					0,
					0,
					0			
				)
			</cfquery>
		
	</cfif>
	
	</cfif>
</cfloop>