From 4a9f25118a6ea94571b4fcd8b0ecc5139fea2a93 Mon Sep 17 00:00:00 2001 From: Chris Boustred Date: Fri, 10 Oct 2025 17:34:28 +0100 Subject: [PATCH] Return bundle when searching for FHIR Tasks --- cgpclient/fhir.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cgpclient/fhir.py b/cgpclient/fhir.py index 3f67942..82c4ca8 100644 --- a/cgpclient/fhir.py +++ b/cgpclient/fhir.py @@ -282,6 +282,15 @@ def search_for_tasks(self, search_params: FHIRConfig | None = None) -> list[Task ) ) + bundle: Bundle = self.search_for_fhir_resource( + resource_type=Task.__name__, + query_params=query_params, + ) + + if bundle.entry: + return [entry.resource for entry in bundle.entry] + return [] + def search_for_document_references( self, search_params: FHIRConfig | None = None ) -> list[DocumentReference]: