diff --git a/ppmutils/fhir.py b/ppmutils/fhir.py index c3b290d..5ec8106 100644 --- a/ppmutils/fhir.py +++ b/ppmutils/fhir.py @@ -2779,6 +2779,12 @@ def _query_bundle(resource_type: str, query: dict[str, Any] = None) -> Bundle: if link["relation"] == "next": url = link["url"] + # Swap domain if necessary + if furl(url).host != furl(PPM.fhir_url()).host: + + # Set it + url = furl(url).set(host=furl(PPM.fhir_url().host)).url + return Bundle(total_bundle) @staticmethod