<?php

namespace App\Validation;

use CodeIgniter\Database\BaseConnection;

class PatientRules
{
    public static function checkPatientExists($str, ?string $fields = null, array $data = [], ?BaseConnection &$db = null): bool
    {
        $db = $db ?? \Config\Database::connect();
        return $db->table('patients')->where('id', $str)->countAllResults() > 0;
    }
}
