public function loadGeneratedHierarchy( $filename )
	{
		$result = true;

		$extension = strtolower( pathinfo( $filename, PATHINFO_EXTENSION ) );

		if ( $extension === 'zip' )
		{
			$zip = new ZipArchive();
			if ( $zip->open( $filename ) === true )
			{
				$json = $zip->getFromName( 'hierarchies.json' );
				$zip->close();
			} else
			{
				$result = 'Failed to open zip file $filename';
			}
		}
		else
		{
			$json = file_get_contents( $filename );
		}

		if (  $result )
		{
			$this->hierarchies = json_decode( $json, true );
			if ( json_last_error() !== JSON_ERROR_NONE )
			{
				$result = "An error occurred generating the JSON for the hierarchies: " . XBRL::json_last_error_msg();
			}

			$this->alignWithValidYears();

			foreach ( $this->hierarchies as $roleKey => $role )
			{
				$this->countDepth( $role['hierarchy'] );
			}

		}

		return $result;
	}