Skip to content
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

[Feature Request] Adding data source dynamically from my own backend API #4710

Open
SedanaYoga opened this issue Jan 20, 2025 · 3 comments
Open

Comments

@SedanaYoga
Copy link

What feature or change would you like to see made?

I want to use OHIF Viewer as an iframe inside my Hospital Information Management System App. In my app I want to have a setting page for configuring data sources, and able to add as many data sources as I can. Thus, I want to initialize the data sources array based on data source array that I save on my own backend server through an gateway API. I'm gonna use the Data Source Configuration object, like using DicomWebConfig type, and save it as my backend object to make sure everything is synced. Is this possible? if so please let me know the best practice. Thanks! :)

Why should we prioritize this feature?

Based on my understanding, this will make the viewer be more flexible in terms of how it can interacts with multiple data sources from backend server sources.

Copy link
Member

sedghi commented Jan 22, 2025

To create a dynamic data source, you can use some pretty useful hooks. Check out the documentation at https://docs.ohif.org/configuration/dataSources/configuration-ui and take a look at the platform/app/public/config/google.js file for more information. The data source object also has an onConfiguration option, which is really handy. You can find more details about it by searching inside the extensions/default/src/DicomWebDataSource/index.ts file.

@SedanaYoga
Copy link
Author

To create a dynamic data source, you can use some pretty useful hooks. Check out the documentation at https://docs.ohif.org/configuration/dataSources/configuration-ui and take a look at the platform/app/public/config/google.js file for more information. The data source object also has an onConfiguration option, which is really handy. You can find more details about it by searching inside the extensions/default/src/DicomWebDataSource/index.ts file.

Hey @sedghi, thanks for the reply.

I have read docs you referred. But in order to attach customized module like in config/google.js I need to attach at least one data source in dataSources field. In my case, because of the data sources are very dependent on the data I stored in my own backend. So that, I need to find a way to initialize the data sources at the very beginning of the app loads. In other word, I don't want to attach any data source in dataSources array field. Do you have any other hook that support it?

Btw, about the onConfiguration option, I guess I have to have one data source in the config file and from the URL params and query, I need to use those query in order to get the data source which is inconvenient for me since the params that I want to use might be varies based on what kind of data source that I want to use.

@sedghi
Copy link
Member

sedghi commented Jan 23, 2025

I think the proxy data source is the only option you have, basically you specify the data source in a url to grab https://docs.ohif.org/configuration/datasources/dicom-web-proxy/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants