Web Analytics

Một phương pháp dự báo dịch bệnh

Mục lục

Bài 1: Phương pháp đánh giá dịch bệnh, từ đó đưa ra các quyết định trong phòng chống dịch bệnh

Bài 2: Một phương pháp dự báo dịch bệnh [được chuyển đến đây từ link gốc đã xuất bản ngày 18/7/2021]

Bài 3: Sóng Siêu lây nhiễm

Phụ lục: Các bài phân tích làn sóng dịch Covid-19 thứ 4 từ 14/07 - 29/08


Một phương pháp dự báo dịch bệnh

Trong bài viết này chúng tôi đề cập đến bài toán dự báo. Dự báo một bệnh dịch là rất khó do có rất nhiều yếu tố khác nhau tác động đến bệnh dịch (RT). Nó nôm na như có nhiều yếu tố khác nhau tác động đến GDP trong kinh tế. Như CDC Mỹ dùng 26 mô hình của các nhóm nghiên cứu khác nhau, sau đó tổng hợp chúng lại thành một mô hình (được gọi là Ensemble) 1.

Trong bài cập nhật hàng tuần, vào trưa 15/7/2001, do RT hôm 14/7 là 1,66 và có chỉ thị 16 cho TP Hồ Chí Minh, chúng tôi đưa ra dự đoán thô là tổng số ca phát hiện trong 4 ngày 17/7 đến 18/7 sẽ gấp ít nhất 1,5 lần tổng số ca phát hiện trong 4 ngày 11/7 đến 14/7 trên Việt Nam. Tuy nhiên RT không tiếp tục đi xuống mà đi ngang, và dữ liệu hôm nay cho thấy con số trên là 1,7 (nếu làm trơn RT thì là 1,62). Trong bài này, chúng tôi sẽ đưa ra một phương pháp dự đoán khác phương pháp dự đoán thô.

Đầu tiên ta nói qua về phương pháp dự đoán thô. Nếu RT không thay đổi trong tương lai, thì số ca được phát hiện trong n*T ngày tương lai là (khi RT > 1)

(Số ca trong T hôm gần nhất) * RT * (RT n – 1)/( RT – 1).

Phương pháp này nhanh nhưng không tốt cho khoảng thời gian dài (n lớn). Vì lý do này, chung tôi trình bày một phương pháp khác cho phép dự báo xa hơn. Dựa trên dữ liệu chúng tôi có chỉ là số ca phát hiện mỗi ngày, và thuộc tính thời gian ủ bệnh của COVID-19, chúng tôi lựa chọn mô hình đơn giản nhất, đó là SEIR. Chúng ta cần thay đổi một số thứ khi áp dụng SEIR. Tập I trong SEIR sẽ đại diện cho số ca mới phát hiện trong vòng T ngày, tập E đại diện cho những ca chưa phát hiện. Cuối cùng chúng tôi sử dụng nhiều mô hình SEIR trên các khoảng thời gian liên tiếp thay vì chỉ một mô hình SEIR (hoặc SEIR với tham số phụ thuộc thời gian), nhằm đáp ứng việc hệ số lây nhiễm cơ bản thay đổi. Gọi t0 là thời điểm xuất phát sao cho nó trước hôm nay T = 4 hôm (do đó hôm nay là t0 + 4). Ta chọn t0 làm điểm xuất phát do ta cần dữ liệu ước lượng các tham số. Các tham số được dùng trong mô hình SEIR được liệt kê trong bảng sau (8 tham số).

Tham số

Giá trị

Lý do

N: Tổng dân số Việt Nam

98 triệu

Xấp xỉ

E0 : Số ca bệnh chưa được phát hiện hôm t0

Tổng số ca phát hiện từ t0 +1 đến t0 + 4

Đây là khoảng thời gian đa số những ca này được phát hiện

I0 : Số ca bệnh được phát hiện trong vòng T ngày cho tới t0

Tổng số ca phát hiện từ t0 – 3 đến t0

 

Remove0: Số ca không liên quan quá trình lây bệnh

1 triệu

Không ảnh hưởng quá nhiều tới mô hình

Gamma: Thời gian ủ bệnh trung bình

4 ngày

Thời gian ủ bệnh trung bình cho chủng Delta khoảng 4 ngày

Delta

4 ngày

T

Re

Ước lượng của RT hôm t0

 

Beta

Tính từ các tham số trên

 

Ta cần RT để dự đoán số ca tương lai. Do việc dự đoán RT khó, chúng tôi đưa ra một số kịch bản trong bảng sau.

Tên

RT

Lý do

Kịch bản 1

RT được ước lượng theo đường làm trơn (smooth spline với spar 0.6).

Một cách ước lượng RT.

Kịch bản 2

RT là hằng số, được ước lượng bằng giá trị hôm nay của đường làm trơn.

Tình huống xấu khi ta dập dịch không hiệu quả, chỉ đủ duy trì tình hình hiện tại.

Kịch bản 3

RT giảm tuyến tính từ giá trị ước lượng hôm nay (1,62) xuống 1.1 trong vòng 3 tuần (giảm 0,025/ngày).

Dựa vào tình hình phong tỏa một số nơi trên thế giới, Bắc Giang, và Bắc Ninh, chúng tôi cho rằng đây là một viễn cảnh lạc quan.

Do ước lượng của RT hiện nay gần như là hằng số nên chúng tôi bỏ kịch bản 1. Kết quả kịch bản 2 được biểu diễn trong các Hình 1 và 2. Trong Hình 1, ta thất bại và chỉ duy trì RT ở 1,62, khi đó dịch vẫn lên đỉnh sau khoảng 3 tháng rồi đi xuống. Tuy nhiên số ca được phát hiện lúc đỉnh dịch sẽ trên 1 triệu ca/ngày. Đường màu đỏ là số ca mắc mới. Số ca mắc mới nhiều hơn số ca được phát hiện trong giai đoạn đầu do có nhiều ca mắc mới ta chưa phát hiện ra. Điều này bị đảo ngược lại trong tương lai khi số người lành không mang bệnh giảm đi. Hình 2 là giới hạn của Hình 1 trong 21 ngày. Chỉ trong 13 ngày tới, tổng số ca được phát hiện đã gần 100 nghìn (chưa tính số ca chưa được phát hiện). Tổng số ca được phát hiện trong 21 ngày tới là 219.771.

Kết quả của kịch bản 3 trong Hình 3. Dù đây là kịch bản chúng tôi cho là lạc quan, chỉ trong 17 ngày tới, tổng số ca được phát hiện đã xấp xỉ 100 nghìn (chưa tính số ca chưa được phát hiện). Tổng số ca được phát hiện trong 21 ngày tới là 165.353.

Chi tiết về việc sử dụng compartmental model nói chung và SEIR nói riêng cho dự báo có thể được xem trong slide đính kèm trong bài viết trước và các tài liệu tham khảo được đề cập trong đó.

Tài liệu tham khảo

1.  COVID-19 Forecasts: Cases | CDC. Available at: https://www.cdc.gov/coronavirus/2019-ncov/science/forecasting/forecasts-cases.html. (Accessed: 18th July 2021)

Hình 1. Kịch bản 2 với RT = 1.62.

Hình 2. Kịch bản 2 với RT = 1.62 trong 21 ngày đầu tiên.

(Tổng số ca được phát hiện trong 21 ngày tới là 219.771.)

Hình 3. Kịch bản 3 với RT giảm tuyến tính từ 1.62 xuống 1.1 trong vòng 21 ngày (hay giảm 0.025/ngày)

(Sau 21 ngày gần bắt kịp dịch bệnh với 165k ca bệnh, đây là viễn cảnh lạc quan.)

Bình luận:

Chưa có bình luận nào.

Thông tin bình luận:

Chưa nhập họ tên.
Chưa nhập email.

Whoops! There was an error.
Predis \ Response \ ServerException
MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error. Predis\Response\ServerException thrown with message "MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error." Stacktrace: #12 Predis\Response\ServerException in /var/www/html/onyx.vn/covid19/vendor/predis/predis/src/Client.php:370 #11 Predis\Client:onErrorResponse in /var/www/html/onyx.vn/covid19/vendor/predis/predis/src/Client.php:335 #10 Predis\Client:executeCommand in /var/www/html/onyx.vn/covid19/vendor/predis/predis/src/Client.php:314 #9 Predis\Client:__call in /var/www/html/onyx.vn/covid19/vendor/laravel/framework/src/Illuminate/Redis/Connections/Connection.php:96 #8 Illuminate\Redis\Connections\Connection:command in /var/www/html/onyx.vn/covid19/vendor/laravel/framework/src/Illuminate/Redis/Connections/Connection.php:108 #7 Illuminate\Redis\Connections\Connection:__call in /var/www/html/onyx.vn/covid19/vendor/laravel/framework/src/Illuminate/Cache/RedisStore.php:93 #6 Illuminate\Cache\RedisStore:put in /var/www/html/onyx.vn/covid19/vendor/laravel/framework/src/Illuminate/Cache/Repository.php:195 #5 Illuminate\Cache\Repository:put in /var/www/html/onyx.vn/covid19/vendor/laravel/framework/src/Illuminate/Session/CacheBasedSessionHandler.php:66 #4 Illuminate\Session\CacheBasedSessionHandler:write in /var/www/html/onyx.vn/covid19/vendor/laravel/framework/src/Illuminate/Session/Store.php:129 #3 Illuminate\Session\Store:save in /var/www/html/onyx.vn/covid19/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php:87 #2 Illuminate\Session\Middleware\StartSession:terminate in /var/www/html/onyx.vn/covid19/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:218 #1 Illuminate\Foundation\Http\Kernel:terminateMiddleware in /var/www/html/onyx.vn/covid19/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:189 #0 Illuminate\Foundation\Http\Kernel:terminate in /var/www/html/onyx.vn/covid19/index.php:60
12
Predis\Response\ServerException
/vendor/predis/predis/src/Client.php370
11
Predis\Client onErrorResponse
/vendor/predis/predis/src/Client.php335
10
Predis\Client executeCommand
/vendor/predis/predis/src/Client.php314
9
Predis\Client __call
/vendor/laravel/framework/src/Illuminate/Redis/Connections/Connection.php96
8
Illuminate\Redis\Connections\Connection command
/vendor/laravel/framework/src/Illuminate/Redis/Connections/Connection.php108
7
Illuminate\Redis\Connections\Connection __call
/vendor/laravel/framework/src/Illuminate/Cache/RedisStore.php93
6
Illuminate\Cache\RedisStore put
/vendor/laravel/framework/src/Illuminate/Cache/Repository.php195
5
Illuminate\Cache\Repository put
/vendor/laravel/framework/src/Illuminate/Session/CacheBasedSessionHandler.php66
4
Illuminate\Session\CacheBasedSessionHandler write
/vendor/laravel/framework/src/Illuminate/Session/Store.php129
3
Illuminate\Session\Store save
/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php87
2
Illuminate\Session\Middleware\StartSession terminate
/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php218
1
Illuminate\Foundation\Http\Kernel terminateMiddleware
/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php189
0
Illuminate\Foundation\Http\Kernel terminate
/index.php60
/var/www/html/onyx.vn/covid19/vendor/predis/predis/src/Client.php
     *
     * @return mixed
     */
    protected function onErrorResponse(CommandInterface $command, ErrorResponseInterface $response)
    {
        if ($command instanceof ScriptCommand && $response->getErrorType() === 'NOSCRIPT') {
            $eval = $this->createCommand('EVAL');
            $eval->setRawArguments($command->getEvalArguments());
 
            $response = $this->executeCommand($eval);
 
            if (!$response instanceof ResponseInterface) {
                $response = $command->parseResponse($response);
            }
 
            return $response;
        }
 
        if ($this->options->exceptions) {
            throw new ServerException($response->getMessage());
        }
 
        return $response;
    }
 
    /**
     * Executes the specified initializer method on `$this` by adjusting the
     * actual invokation depending on the arity (0, 1 or 2 arguments). This is
     * simply an utility method to create Redis contexts instances since they
     * follow a common initialization path.
     *
     * @param string $initializer Method name.
     * @param array  $argv        Arguments for the method.
     *
     * @return mixed
     */
    private function sharedContextFactory($initializer, $argv = null)
    {
        switch (count($argv)) {
            case 0:
Arguments
  1. "MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error."
    
/var/www/html/onyx.vn/covid19/vendor/predis/predis/src/Client.php
    }
 
    /**
     * {@inheritdoc}
     */
    public function createCommand($commandID, $arguments = array())
    {
        return $this->profile->createCommand($commandID, $arguments);
    }
 
    /**
     * {@inheritdoc}
     */
    public function executeCommand(CommandInterface $command)
    {
        $response = $this->connection->executeCommand($command);
 
        if ($response instanceof ResponseInterface) {
            if ($response instanceof ErrorResponseInterface) {
                $response = $this->onErrorResponse($command, $response);
            }
 
            return $response;
        }
 
        return $command->parseResponse($response);
    }
 
    /**
     * Handles -ERR responses returned by Redis.
     *
     * @param CommandInterface       $command  Redis command that generated the error.
     * @param ErrorResponseInterface $response Instance of the error response.
     *
     * @throws ServerException
     *
     * @return mixed
     */
    protected function onErrorResponse(CommandInterface $command, ErrorResponseInterface $response)
    {
Arguments
  1. Predis\Command\StringSetExpire {}
    
  2. Predis\Response\Error {}
    
/var/www/html/onyx.vn/covid19/vendor/predis/predis/src/Client.php
        );
 
        if ($response instanceof ResponseInterface) {
            if ($response instanceof ErrorResponseInterface) {
                $error = true;
            }
 
            return (string) $response;
        }
 
        return $response;
    }
 
    /**
     * {@inheritdoc}
     */
    public function __call($commandID, $arguments)
    {
        return $this->executeCommand(
            $this->createCommand($commandID, $arguments)
        );
    }
 
    /**
     * {@inheritdoc}
     */
    public function createCommand($commandID, $arguments = array())
    {
        return $this->profile->createCommand($commandID, $arguments);
    }
 
    /**
     * {@inheritdoc}
     */
    public function executeCommand(CommandInterface $command)
    {
        $response = $this->connection->executeCommand($command);
 
        if ($response instanceof ResponseInterface) {
            if ($response instanceof ErrorResponseInterface) {
Arguments
  1. Predis\Command\StringSetExpire {}
    
/var/www/html/onyx.vn/covid19/vendor/laravel/framework/src/Illuminate/Redis/Connections/Connection.php
     *
     * @param  array|string  $channels
     * @param  \Closure  $callback
     * @return void
     */
    public function psubscribe($channels, Closure $callback)
    {
        return $this->createSubscription($channels, $callback, __FUNCTION__);
    }
 
    /**
     * Run a command against the Redis database.
     *
     * @param  string  $method
     * @param  array   $parameters
     * @return mixed
     */
    public function command($method, array $parameters = [])
    {
        return $this->client->{$method}(...$parameters);
    }
 
    /**
     * Pass other method calls down to the underlying client.
     *
     * @param  string  $method
     * @param  array  $parameters
     * @return mixed
     */
    public function __call($method, $parameters)
    {
        return $this->command($method, $parameters);
    }
}
 
Arguments
  1. "setex"
    
  2. array:3 [
      0 => "laravel_cache:8z6fHsO96i8fYmMxcF14l5pn78xyprYlYAiqoODu"
      1 => 7200
      2 => "s:192:"a:3:{s:6:"_token";s:40:"yu8VmGSF5Y2tOg72WgBvSOGoPGnreyDQCbozxTIm";s:9:"_previous";a:1:{s:3:"url";s:34:"https://onyx.vn/covid19/baiviet/14";}s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}}";"
    ]
    
/var/www/html/onyx.vn/covid19/vendor/laravel/framework/src/Illuminate/Redis/Connections/Connection.php
     *
     * @param  string  $method
     * @param  array   $parameters
     * @return mixed
     */
    public function command($method, array $parameters = [])
    {
        return $this->client->{$method}(...$parameters);
    }
 
    /**
     * Pass other method calls down to the underlying client.
     *
     * @param  string  $method
     * @param  array  $parameters
     * @return mixed
     */
    public function __call($method, $parameters)
    {
        return $this->command($method, $parameters);
    }
}
 
Arguments
  1. "setex"
    
  2. array:3 [
      0 => "laravel_cache:8z6fHsO96i8fYmMxcF14l5pn78xyprYlYAiqoODu"
      1 => 7200
      2 => "s:192:"a:3:{s:6:"_token";s:40:"yu8VmGSF5Y2tOg72WgBvSOGoPGnreyDQCbozxTIm";s:9:"_previous";a:1:{s:3:"url";s:34:"https://onyx.vn/covid19/baiviet/14";}s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}}";"
    ]
    
/var/www/html/onyx.vn/covid19/vendor/laravel/framework/src/Illuminate/Cache/RedisStore.php
 
        foreach ($values as $index => $value) {
            $results[$keys[$index]] = ! is_null($value) ? $this->unserialize($value) : null;
        }
 
        return $results;
    }
 
    /**
     * Store an item in the cache for a given number of minutes.
     *
     * @param  string  $key
     * @param  mixed   $value
     * @param  float|int  $minutes
     * @return void
     */
    public function put($key, $value, $minutes)
    {
        $this->connection()->setex(
            $this->prefix.$key, (int) max(1, $minutes * 60), $this->serialize($value)
        );
    }
 
    /**
     * Store multiple items in the cache for a given number of minutes.
     *
     * @param  array  $values
     * @param  float|int  $minutes
     * @return void
     */
    public function putMany(array $values, $minutes)
    {
        $this->connection()->multi();
 
        foreach ($values as $key => $value) {
            $this->put($key, $value, $minutes);
        }
 
        $this->connection()->exec();
    }
Arguments
  1. "setex"
    
  2. array:3 [
      0 => "laravel_cache:8z6fHsO96i8fYmMxcF14l5pn78xyprYlYAiqoODu"
      1 => 7200
      2 => "s:192:"a:3:{s:6:"_token";s:40:"yu8VmGSF5Y2tOg72WgBvSOGoPGnreyDQCbozxTIm";s:9:"_previous";a:1:{s:3:"url";s:34:"https://onyx.vn/covid19/baiviet/14";}s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}}";"
    ]
    
/var/www/html/onyx.vn/covid19/vendor/laravel/framework/src/Illuminate/Cache/Repository.php
            $this->forget($key);
        });
    }
 
    /**
     * Store an item in the cache.
     *
     * @param  string  $key
     * @param  mixed   $value
     * @param  \DateTimeInterface|\DateInterval|float|int|null  $minutes
     * @return void
     */
    public function put($key, $value, $minutes = null)
    {
        if (is_array($key)) {
            return $this->putMany($key, $value);
        }
 
        if (! is_null($minutes = $this->getMinutes($minutes))) {
            $this->store->put($this->itemKey($key), $value, $minutes);
 
            $this->event(new KeyWritten($key, $value, $minutes));
        }
    }
 
    /**
     * {@inheritdoc}
     */
    public function set($key, $value, $ttl = null)
    {
        $this->put($key, $value, $ttl);
    }
 
    /**
     * Store multiple items in the cache for a given number of minutes.
     *
     * @param  array  $values
     * @param  \DateTimeInterface|\DateInterval|float|int  $minutes
     * @return void
     */
Arguments
  1. "8z6fHsO96i8fYmMxcF14l5pn78xyprYlYAiqoODu"
    
  2. "a:3:{s:6:"_token";s:40:"yu8VmGSF5Y2tOg72WgBvSOGoPGnreyDQCbozxTIm";s:9:"_previous";a:1:{s:3:"url";s:34:"https://onyx.vn/covid19/baiviet/14";}s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}}"
    
  3. "120"
    
/var/www/html/onyx.vn/covid19/vendor/laravel/framework/src/Illuminate/Session/CacheBasedSessionHandler.php
     */
    public function close()
    {
        return true;
    }
 
    /**
     * {@inheritdoc}
     */
    public function read($sessionId)
    {
        return $this->cache->get($sessionId, '');
    }
 
    /**
     * {@inheritdoc}
     */
    public function write($sessionId, $data)
    {
        return $this->cache->put($sessionId, $data, $this->minutes);
    }
 
    /**
     * {@inheritdoc}
     */
    public function destroy($sessionId)
    {
        return $this->cache->forget($sessionId);
    }
 
    /**
     * {@inheritdoc}
     */
    public function gc($lifetime)
    {
        return true;
    }
 
    /**
     * Get the underlying cache repository.
Arguments
  1. "8z6fHsO96i8fYmMxcF14l5pn78xyprYlYAiqoODu"
    
  2. "a:3:{s:6:"_token";s:40:"yu8VmGSF5Y2tOg72WgBvSOGoPGnreyDQCbozxTIm";s:9:"_previous";a:1:{s:3:"url";s:34:"https://onyx.vn/covid19/baiviet/14";}s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}}"
    
  3. "120"
    
/var/www/html/onyx.vn/covid19/vendor/laravel/framework/src/Illuminate/Session/Store.php
     *
     * @param  string  $data
     * @return string
     */
    protected function prepareForUnserialize($data)
    {
        return $data;
    }
 
    /**
     * Save the session data to storage.
     *
     * @return bool
     */
    public function save()
    {
        $this->ageFlashData();
 
        $this->handler->write($this->getId(), $this->prepareForStorage(
            serialize($this->attributes)
        ));
 
        $this->started = false;
    }
 
    /**
     * Prepare the serialized session data for storage.
     *
     * @param  string  $data
     * @return string
     */
    protected function prepareForStorage($data)
    {
        return $data;
    }
 
    /**
     * Age the flash data for the session.
     *
     * @return void
Arguments
  1. "8z6fHsO96i8fYmMxcF14l5pn78xyprYlYAiqoODu"
    
  2. "a:3:{s:6:"_token";s:40:"yu8VmGSF5Y2tOg72WgBvSOGoPGnreyDQCbozxTIm";s:9:"_previous";a:1:{s:3:"url";s:34:"https://onyx.vn/covid19/baiviet/14";}s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}}"
    
/var/www/html/onyx.vn/covid19/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php
        if ($this->sessionConfigured()) {
            $this->storeCurrentUrl($request, $session);
 
            $this->addCookieToResponse($response, $session);
        }
 
        return $response;
    }
 
    /**
     * Perform any final actions for the request lifecycle.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Symfony\Component\HttpFoundation\Response  $response
     * @return void
     */
    public function terminate($request, $response)
    {
        if ($this->sessionHandled && $this->sessionConfigured() && ! $this->usingCookieSessions()) {
            $this->manager->driver()->save();
        }
    }
 
    /**
     * Start the session for the given request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Contracts\Session\Session
     */
    protected function startSession(Request $request)
    {
        return tap($this->getSession($request), function ($session) use ($request) {
            $session->setRequestOnHandler($request);
 
            $session->start();
        });
    }
 
    /**
     * Get the session implementation from the manager.
/var/www/html/onyx.vn/covid19/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php
     * @return void
     */
    protected function terminateMiddleware($request, $response)
    {
        $middlewares = $this->app->shouldSkipMiddleware() ? [] : array_merge(
            $this->gatherRouteMiddleware($request),
            $this->middleware
        );
 
        foreach ($middlewares as $middleware) {
            if (! is_string($middleware)) {
                continue;
            }
 
            [$name] = $this->parseMiddleware($middleware);
 
            $instance = $this->app->make($name);
 
            if (method_exists($instance, 'terminate')) {
                $instance->terminate($request, $response);
            }
        }
    }
 
    /**
     * Gather the route middleware for the given request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    protected function gatherRouteMiddleware($request)
    {
        if ($route = $request->route()) {
            return $this->router->gatherRouteMiddleware($route);
        }
 
        return [];
    }
 
    /**
Arguments
  1. Illuminate\Http\Request {
      #json: null
      #convertedFiles: null
      #userResolver: Closure($guard = null) { …4}
      #routeResolver: Closure() { …4}
      +attributes: Symfony\Component\HttpFoundation\ParameterBag {}
      +request: Symfony\Component\HttpFoundation\ParameterBag {#1}
      +query: Symfony\Component\HttpFoundation\ParameterBag {#1}
      +server: Symfony\Component\HttpFoundation\ServerBag {}
      +files: Symfony\Component\HttpFoundation\FileBag {}
      +cookies: Symfony\Component\HttpFoundation\ParameterBag {}
      +headers: Symfony\Component\HttpFoundation\HeaderBag {}
      #content: null
      #languages: null
      #charsets: null
      #encodings: null
      #acceptableContentTypes: array:1 [
        0 => "*/*"
      ]
      #pathInfo: "/baiviet/14"
      #requestUri: "/covid19/baiviet/14"
      #baseUrl: "/covid19"
      #basePath: null
      #method: "GET"
      #format: null
      #session: Illuminate\Session\Store {}
      #locale: null
      #defaultLocale: "en"
      -preferredFormat: null
      -isHostValid: true
      -isForwardedValid: true
      basePath: "/covid19"
      format: "html"
    }
    
  2. Illuminate\Http\Response {}
    
/var/www/html/onyx.vn/covid19/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php
     */
    protected function dispatchToRouter()
    {
        return function ($request) {
            $this->app->instance('request', $request);
 
            return $this->router->dispatch($request);
        };
    }
 
    /**
     * Call the terminate method on any terminable middleware.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Illuminate\Http\Response  $response
     * @return void
     */
    public function terminate($request, $response)
    {
        $this->terminateMiddleware($request, $response);
 
        $this->app->terminate();
    }
 
    /**
     * Call the terminate method on any terminable middleware.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Illuminate\Http\Response  $response
     * @return void
     */
    protected function terminateMiddleware($request, $response)
    {
        $middlewares = $this->app->shouldSkipMiddleware() ? [] : array_merge(
            $this->gatherRouteMiddleware($request),
            $this->middleware
        );
 
        foreach ($middlewares as $middleware) {
            if (! is_string($middleware)) {
Arguments
  1. Illuminate\Http\Request {
      #json: null
      #convertedFiles: null
      #userResolver: Closure($guard = null) { …4}
      #routeResolver: Closure() { …4}
      +attributes: Symfony\Component\HttpFoundation\ParameterBag {}
      +request: Symfony\Component\HttpFoundation\ParameterBag {#1}
      +query: Symfony\Component\HttpFoundation\ParameterBag {#1}
      +server: Symfony\Component\HttpFoundation\ServerBag {}
      +files: Symfony\Component\HttpFoundation\FileBag {}
      +cookies: Symfony\Component\HttpFoundation\ParameterBag {}
      +headers: Symfony\Component\HttpFoundation\HeaderBag {}
      #content: null
      #languages: null
      #charsets: null
      #encodings: null
      #acceptableContentTypes: array:1 [
        0 => "*/*"
      ]
      #pathInfo: "/baiviet/14"
      #requestUri: "/covid19/baiviet/14"
      #baseUrl: "/covid19"
      #basePath: null
      #method: "GET"
      #format: null
      #session: Illuminate\Session\Store {}
      #locale: null
      #defaultLocale: "en"
      -preferredFormat: null
      -isHostValid: true
      -isForwardedValid: true
      basePath: "/covid19"
      format: "html"
    }
    
  2. Illuminate\Http\Response {}
    
/var/www/html/onyx.vn/covid19/index.php
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request
| through the kernel, and send the associated response back to
| the client's browser allowing them to enjoy the creative
| and wonderful application we have prepared for them.
|
*/
 
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
 
$response = $kernel->handle(
    $request = Illuminate\Http\Request::capture()
);
 
$response->send();
 
$kernel->terminate($request, $response);
 
Arguments
  1. Illuminate\Http\Request {
      #json: null
      #convertedFiles: null
      #userResolver: Closure($guard = null) { …4}
      #routeResolver: Closure() { …4}
      +attributes: Symfony\Component\HttpFoundation\ParameterBag {}
      +request: Symfony\Component\HttpFoundation\ParameterBag {#1}
      +query: Symfony\Component\HttpFoundation\ParameterBag {#1}
      +server: Symfony\Component\HttpFoundation\ServerBag {}
      +files: Symfony\Component\HttpFoundation\FileBag {}
      +cookies: Symfony\Component\HttpFoundation\ParameterBag {}
      +headers: Symfony\Component\HttpFoundation\HeaderBag {}
      #content: null
      #languages: null
      #charsets: null
      #encodings: null
      #acceptableContentTypes: array:1 [
        0 => "*/*"
      ]
      #pathInfo: "/baiviet/14"
      #requestUri: "/covid19/baiviet/14"
      #baseUrl: "/covid19"
      #basePath: null
      #method: "GET"
      #format: null
      #session: Illuminate\Session\Store {}
      #locale: null
      #defaultLocale: "en"
      -preferredFormat: null
      -isHostValid: true
      -isForwardedValid: true
      basePath: "/covid19"
      format: "html"
    }
    
  2. Illuminate\Http\Response {}
    

Environment & details:

empty
empty
empty
Key Value
PHPSESSID
"ubj41pntf08lm392lef8lji8n2"
_csrf
"019ea07284873f0784f249ecedc9a252252d398354ceb0122630e70b8993b9baa:2:{i:0;s:5:"_csrf";i:1;s:32:"am2MqZxNv1rFDgEkddECIZB2L0VBPekd";}"
empty
Key Value
REDIRECT_UNIQUE_ID
"aVvPLJz8MkIfVslFk8LF3QAAABM"
REDIRECT_HTTPS
"on"
REDIRECT_SSL_TLS_SNI
"onyx.vn"
REDIRECT_STATUS
"200"
UNIQUE_ID
"aVvPLJz8MkIfVslFk8LF3QAAABM"
HTTPS
"on"
SSL_TLS_SNI
"onyx.vn"
HTTP_ACCEPT
"*/*"
HTTP_USER_AGENT
"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)"
HTTP_COOKIE
"PHPSESSID=ubj41pntf08lm392lef8lji8n2; _csrf=019ea07284873f0784f249ecedc9a252252d398354ceb0122630e70b8993b9baa%3A2%3A%7Bi%3A0%3Bs%3A5%3A%22_csrf%22%3Bi%3A1%3Bs%3A32%3A%22am2MqZxNv1rFDgEkddECIZB2L0VBPekd%22%3B%7D"
HTTP_ACCEPT_ENCODING
"gzip, br, zstd, deflate"
HTTP_HOST
"onyx.vn"
PATH
"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"
SERVER_SIGNATURE
""
SERVER_SOFTWARE
"Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.1.33"
SERVER_NAME
"onyx.vn"
SERVER_ADDR
"103.63.109.98"
SERVER_PORT
"443"
REMOTE_ADDR
"216.73.216.212"
DOCUMENT_ROOT
"/var/www/html/onyx.vn"
REQUEST_SCHEME
"https"
CONTEXT_PREFIX
""
CONTEXT_DOCUMENT_ROOT
"/var/www/html/onyx.vn"
SERVER_ADMIN
"root@localhost"
SCRIPT_FILENAME
"/var/www/html/onyx.vn/covid19/index.php"
REMOTE_PORT
"23465"
REDIRECT_URL
"/covid19/baiviet/14"
GATEWAY_INTERFACE
"CGI/1.1"
SERVER_PROTOCOL
"HTTP/1.1"
REQUEST_METHOD
"GET"
QUERY_STRING
""
REQUEST_URI
"/covid19/baiviet/14"
SCRIPT_NAME
"/covid19/index.php"
PHP_SELF
"/covid19/index.php"
REQUEST_TIME_FLOAT
1767624492.535
REQUEST_TIME
1767624492
empty
0. Whoops\Handler\PrettyPageHandler