android-fhir icon indicating copy to clipboard operation
android-fhir copied to clipboard

Add support for search with SearchParameter resources stored in DB

Open LZRS opened this issue 1 year ago • 5 comments

Is your feature request related to a problem? Please describe. We'd like to support a configurable way of adding custom search parameters in our application, that could be fetched from the server. The current implementation only allows defining custom SearchParameters during initialization of the FhirEngine

Describe the solution you'd like The enhancement I'd like to suggest is the support for use of SearchParameter resources saved to the resources DB during indexing and search for resources, such that any new SearchParameters defined after initialization of the FhirEngine would also be considered. The SearchParameters may or may not be synced back to the server

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

Would you like to work on the issue? Yes

LZRS avatar Jan 16 '25 09:01 LZRS

If I understand it correctly, you need support for custom search parameters being added dynamically to the database while the application is live, right ? Because one can add more custom search params (the newly synced ones) if you close and restart the app as the FhirEngine will be re-initialized and the indexing will be added too.

MJ1998 avatar Jan 19 '25 13:01 MJ1998

If I understand it correctly, you need support for custom search parameters being added dynamically to the database while the application is live, right ?

Yeah, exactly. We wanted it to support adding search parameters dynamically when an application is running.

Because one can add more custom search params (the newly synced ones) if you close and restart the app as the FhirEngine will be re-initialized and the indexing will be added too.

Yeah, the current implementation supports passing list of custom search params when initializing FhirEngine. The challenge that we have with this is that we can't persist the search params to DB because we require the FhirEngine to access the DB, and the FhirEngine only allows for passing of the search params during it's initialization.

LZRS avatar Jan 20 '25 10:01 LZRS

I guess the suggestion I had was for a similar implementation to this whereby indexing on a resource would be pick up a SearchParameter resource stored in the DB

LZRS avatar Jan 20 '25 10:01 LZRS

Yeah, the current implementation supports passing list of custom search params when initializing FhirEngine. The challenge that we have with this is that we can't persist the search params to DB because we require the FhirEngine to access the DB, and the FhirEngine only allows for passing of the search params during it's initialization.

One way is to store them in sharedpreferences and provide them when reinitializing fhir engine ? Is this the workaround you'll are doing ? What is the priority of this issue ?

MJ1998 avatar Jan 21 '25 11:01 MJ1998

One way is to store them in sharedpreferences and provide them when reinitializing fhir engine ? Is this the workaround you'll are doing ?

Yeah, but we opted for internal storage instead.

What is the priority of this issue ?

I'd say medium, for having to reinitialize fhir engine

LZRS avatar Jan 21 '25 12:01 LZRS