 	
 BEGIN
 
-	-- Determine if the calling user is authorized
+	-- Determine if the calling user is authorized ---------------------------
 	_calling_login := (SELECT _in_data ->> 'changing_user_login')::text;
 	
 	_input_authorized_json :=	(SELECT json_build_object(


	ELSIF _organization_id IS NULL THEN	-- organization DOESN'T exist
	
		_message := (SELECT 'The specified organization ' || (SELECT _in_data ->> 'organization_name')::text, || ' does not exist so the Organizational Level CAN NOT be entered.') ;
		_out_json :=  (SELECT json_build_object(
				'result_indicator', 'Failure',
				'message', _message,
				'organization_level_name', (SELECT _in_data ->> 'organization_level_name')::text,
				'organization_level_display_name', (SELECT _in_data ->> 'organization_level_display_name')::text,
				'organization_level_description',  (SELECT _in_data ->> 'organization_level_description')::text,

		OR (SELECT _in_data ->> 'organization_name')::text IS NULL  
		OR (SELECT _in_data ->> 'changing_user_login')::text IS NULL 
		OR (SELECT _in_data ->> 'enter_or_update')::text IS NULL 
		OR ((SELECT _in_data ->> 'enter_or_update')::text = 'Update'
			AND (SELECT _in_data ->> 'organization_level_id')::text IS NULL)
	THEN -- data is incomplete		
		_message := (SELECT 'The data is incomplete as submitted so the Organization Level CAN NOT be entered, please resubmit with complete data.') ;
		_out_json :=  (SELECT json_build_object(
				'result_indicator', 'Failure',
				'message', _message,
				'organization_level_id', (SELECT _in_data ->> 'organization_level_id')::text,
				'organization_level_name', (SELECT _in_data ->> 'organization_level_name')::text,
				'organization_level_display_name', (SELECT _in_data ->> 'organization_level_display_name')::text,
				'organization_level_description',  (SELECT _in_data ->> 'organization_level_description')::text,
