LinuxForHealth / FHIR

The LinuxForHealth FHIR® Server and related projects
https://linuxforhealth.github.io/FHIR
Apache License 2.0
321 stars 156 forks source link

FhirRegistry: dynamic resource CodeSystem,ValueSet loading #4223

Open gdecagna opened 1 year ago

gdecagna commented 1 year ago

Describe the bug dynamic resource CodeSystem, ValueSet loading

Environment 5.1.1

To Reproduce Steps to reproduce the behavior:

Expected behavior dynamic reloading of resources

Additional context FhirRegistry: I used the PackageRegistryResourceProvider procedure to register a set of CodeSystem and ValueSet resources. This procedure, inserted in a jar located in the userLib, correctly loads the resources present in the .index.json file at start Up. Is it possible to reload this procedure via URL command or other without restarting the server? The goal is to edit the jar, copy it into the userLib and reload it without restarting the whole system.

lmsurpre commented 1 year ago

The RegistryResourceProviders are discovered during startup (using the java ServiceLoader pattern) and so registering new providers is not supported at runtime.

That said, it should be possible to implement a provider that can change what it provides dynamically. At one point, our ExtensionSearchParametersResourceProvider worked liked that (prior to https://github.com/LinuxForHealth/FHIR/pull/2942/files).

It might also be possible to invent a new way to register a new provider at runtime (e.g. via FHIRRegistry#addProvider()) but that is not exposed at the server level at this time.