public function delete($id, $filter = null)
    {
        if (empty($id)) {
            throw new StorageException('Invalid id parameter.');
        }

        if (!$filter) {
            $filter = [];
        }

        $filter[self::DIAGNOSTIC_ID] = $id;

        try {
            \common_Logger::i('Deleting diagnostic result ' . $id);
            $query = 'DELETE FROM ' . self::DIAGNOSTIC_TABLE;
            return (boolean) $this->query($query, $filter)->rowCount();
        } catch (\PDOException $e) {
            throw new StorageException($e->getMessage());
        }
    }