Sending DICOM Tags to a Web API or REST Service
Integrating medical imaging data often means communicating with modern web services and REST APIs. This tutorial demonstrates how to receive a DICOM file, extract key metadata, and send it as a JSON payload to an API endpoint.
Tutorial video coming soon!
How to Send DICOM Data to a REST API
This workflow will receive a DICOM file and use the HTTP Sender to construct and send a JSON message to a web service, all without writing any code.
-
Configure the DICOM Receiver
Create a new workflow, and set the Activity Type of the activity to DICOM Receiver. Then, drag a sample DICOM file onto the Message Template to populate the binding tree with the available DICOM tags, such as PatientID and StudyInstanceUID. -
Configure the HTTP Sender
Add another activity and set the activity type to HTTP Sender. In its properties, set the URL of the API endpoint you want to call (e.g., https://api.myservice.com/studies). -
Create the JSON Payload
In the Message Template editor of the HTTP Sender, create the JSON structure that your API expects. You can right-click and select "Insert Sample Message > Simple JSON" for a testing template.{ "PatientIdentifier": "", "StudyUID": "", "Accession": "" } -
Map DICOM Tags to the JSON Payload
Drag the desired fields from the DICOM Receiver's binding tree and drop them into the values of your JSON payload. The final template will look like this:
When the workflow runs, these variables will be replaced with the actual data from the received DICOM file before being sent.{ "PatientIdentifier": "${PatientID}", "StudyUID": "${StudyInstanceUID}", "Accession": "${AccessionNumber}" }