From d949eca6a805771c50eeb76def35778738313b33 Mon Sep 17 00:00:00 2001 From: DevSoftTech Server Date: Thu, 8 Oct 2026 10:23:59 +0530 Subject: [PATCH] fix(abdm): add __construct to AbdmGateway to initialize db and connector --- app/Controllers/AbdmGateway.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/Controllers/AbdmGateway.php b/app/Controllers/AbdmGateway.php index 66ecc5e..d735896 100644 --- a/app/Controllers/AbdmGateway.php +++ b/app/Controllers/AbdmGateway.php @@ -18,6 +18,19 @@ class AbdmGateway extends BaseController { private AbdmConnectorInterface $connector; + public function __construct() + { + if ($this->db === null) { + $this->db = db_connect(); + } + if (! isset($this->connector)) { + $this->connector = AbdmConnectorFactory::make(); + } + if (! isset($this->fhirR4Builder)) { + $this->fhirR4Builder = new FhirR4Builder(); + } + } + public function initController( \CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response,