Seeking Guidance: Creating API Call for image Instance Retrieval in OHIF Viewer

I am currently using OHIF Viewer (version 3.9.0-beta.88) and have connected it successfully with DCM4CHEE by following this guide:
Run minimum set of archive services on a single host using Docker Compose.

I want to implement an API call to dynamically fetch the current DICOM instance displayed in the segmentation view and send it to another server. This server is a Flask-based application deployed at a specific IP and port, which provides responses based on the instance.

Here’s an example of the API endpoint I intend to call:

http://<system-ip>:5053/process_dicom?pacs_url=http://<system-ip>:8080/dcm4chee-arc/aets/DCM4CHEE/rs/studies/<study-UID>/series/<series-UID>/instances/<instance-UID>  

In this case:

  • system-ip refers to the IP address of my system.
  • The PACS URL… that i need to dynamically points to the instance currently displayed in the segmentation view.-- to check the llm i use the Retriv

    al url from the dcm4chee pac server interface for a instance

Objective:
I need guidance on how to create an API in OHIF Viewer to:

  1. Dynamically fetch the current instance being displayed in the segmentation view.
  2. Construct the PACS URL based on the retrieved instance details.
  3. Send this PACS URL to the Flask server at the specified endpoint.

I want this to trigger when the user clicks a “LLM STUDY” button (which I have positioned in the right panel of the segmentation mode view), an API call is made to send the currently displayed image instance in the segmentation view to a Flask server for further processing.

Here’s the basic structure of the API I want to call: http://:5053/process_dicom?pacs_url=http://:8080/dcm4chee-arc/aets/DCM4CHEE/rs/studies//series//instances/

Any help, examples, or guidance would be greatly appreciated!

Thank you!

This is a complex situation that we need to talk more in depth.
You can come to OHIF office hours (starting back in Jan 7th)