-
Notifications
You must be signed in to change notification settings - Fork 4
Add ability to specify default FHIR server #576
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #576 +/- ##
=======================================
Coverage 66.13% 66.14%
=======================================
Files 99 99
Lines 4028 4029 +1
Branches 894 917 +23
=======================================
+ Hits 2664 2665 +1
Misses 1354 1354
Partials 10 10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
// Sort so that the default server is always first | ||
configs.sort((a, b) => | ||
b.defaultServer === true ? 1 : a.defaultServer === true ? -1 : 0, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noticing on dev startup that since the default isn't initialized any way outside of user input, that Public HAPI ends up being the default server on a fresh run of the app (ie without anyone marking a default) since it shows up first. We could just ask devs to mark Aidbox as default manually each time the start the app up fresh, but in self interest wondering if we could come up with something else 😅
Screen.Recording.2025-05-02.at.10.29.04.AM.mov
Can we think of a way between the way we're returning the servers here and the way we're setting the default on the frontend to still have Aidbox populate? Maybe by also alphabetizing the list as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left one suggestion but otherwise lgtm!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! same note as bob; initializing the FHIR server mostly makes sense. I kinda wonder if we want to have some way to set the default on the /query
page, as well, but
PULL REQUEST
Summary
Adds the ability to choose one FHIR server as the default.
Related Issue
Fixes #535
https://linear.app/skylight-cdc/issue/QUE-248/make-default-fhir-server-configurable
Copilot summary
This pull request introduces a "default server" feature for FHIR servers, allowing one server to be designated as the default. Key changes include database schema updates, backend service modifications, and frontend adjustments to support this new functionality.
Database Updates:
default_server
column to thefhir_servers
table and enforced a unique constraint to ensure only one server can be marked as default at a time. (flyway/sql/V13_01__add_default_fhir_server.sql
)Backend Changes:
FhirServerConfigService
class to handle thedefaultServer
property, including sorting servers to prioritize the default server and modifying SQL queries to include the new column. (src/app/backend/dbServices/fhir-servers.ts
) [1] [2] [3]default_server
field when inserting new FHIR server records. (src/app/backend/dbServices/util.ts
) [1] [2]Frontend Changes:
src/app/(pages)/fhirServers/page.tsx
)src/app/(pages)/fhirServers/page.tsx
)src/app/(pages)/query/page.tsx
)Code Cleanup:
src/app/shared/constants.ts
,src/app/(pages)/query/components/searchForm/SearchForm.tsx
) [1] [2]These changes ensure that the default server feature is consistently applied across the application, enhancing usability and reducing manual configuration.
Screenshots