Call configurable custom gateway endpoints (LocationHierarchy & PractitionerDetail) - #1559
Open
allan-on wants to merge 6 commits into
Open
Call configurable custom gateway endpoints (LocationHierarchy & PractitionerDetail)#1559allan-on wants to merge 6 commits into
allan-on wants to merge 6 commits into
Conversation
Add getFhirCustomEndpointBaseURL to react-utils. It resolves the base URL for custom (non-FHIR) gateway endpoints by stripping a trailing /fhir, or using an explicit override. Custom endpoints such as LocationHierarchy and PractitionerDetail are served at the gateway root, not under /fhir.
LocationHierarchy is a custom endpoint served at the gateway root as a plain GET. Request it via customRequest against the resolved custom base instead of FHIRServiceClass.list(), which wrongly produced /fhir/LocationHierarchy/_search. Thread an optional fhirCustomEndpointBaseURL prop through the hierarchy call sites (LocationUnitList, AddEditLocationUnit, OrganizationAffiliation) and update the affected tests.
PractitionerDetail is a custom endpoint served at the gateway root as a plain GET. Request it via customRequest against the resolved custom base instead of FHIRServiceClass.list(), and thread the custom-endpoint base prop through the user details view. Update tests.
Add REACT_APP_FHIR_WEB_CUSTOM_ENDPOINT_BASE_URL (defaults to the FHIR base with a trailing /fhir stripped) and thread it through the app prop bundles and routes. Also repairs pre-existing gaps where the location list and user details routes did not pass fhirBaseURL to their components.
Add REACT_APP_FHIR_WEB_CUSTOM_ENDPOINT_BASE_URL to the env samples and the docker config template, and document the custom-endpoint base URL behaviour in env.md, getting-started.md and the docker deployment guide.
Add /react/app/fhir/web/custom/endpoint/base/url to the confd watch keys so the custom-endpoint base URL override can be supplied at runtime in Docker deployments. Without this key confd would not fetch the value from the backend, leaving the config.js.tmpl getv fallback to the empty default. The template already emits REACT_APP_FHIR_WEB_CUSTOM_ENDPOINT_BASE_URL and env.ts already reads it; this closes the runtime-config chain.
Author
ndegwamartin
approved these changes
Jul 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


closes #1558
Changes included with this PR
getFhirCustomEndpointBaseURL(fhirBaseURL, override)in@opensrp/react-utils— returns the override if set, elsefhirBaseURLwith a trailing/fhirstripped.REACT_APP_FHIR_WEB_CUSTOM_ENDPOINT_BASE_URL(confd key/react/app/fhir/web/custom/endpoint/base/url). Self-defaults: if unset, derives fromREACT_APP_FHIR_API_BASE_URLby stripping/fhir. Only needs setting if custom endpoints live on a different host.LocationHierarchyandPractitionerDetailcalls (location management, user management, org affiliation) to use the custom-endpoint base + bare resource path..env.sample/ confd template / env config updated.Checklist