Extracting DICOM Tags to a Database

One of the most common integration tasks is to extract metadata from DICOM files and store it in a database for reporting, indexing, or triggering other business processes.

This tutorial shows how to create a simple workflow that receives DICOM files, and using only visual tools, inserts patient and study information into a database table.

Tutorial video coming soon!

How to Save DICOM Tags to a Database

This workflow uses a DICOM Receiver to accept the file and a Database Query activity to perform the SQL INSERT. All data mapping is done visually with drag-and-drop.

  1. Configure the DICOM Receiver
    Adding a DICOM Receiver activity. In the "Message Template" editor, drag and drop a sample DICOM file. You'll see the binding tree on the right populate with the DICOM file's JSON structure. The DICOM tags are listed with a simplified structure, making it easy to find important details like PatientName and AccessionNumber.
  2. Set up the Database Query
    Add a Database Query activity and configure its connection string to point to your database. In the "SQL Query" editor, write a standard SQL INSERT statement using parameters for the values you want to save. For example:
    INSERT INTO Studies (PatientName, PatientID, Accession)
    VALUES (@PatientName, @PatientID, @Accession)
  3. Map DICOM Tags to SQL Parameters
    As you type the parameters in the SQL query, they will appear below the editor. Simply drag the corresponding fields from the binding tree on the right (from the DICOM Receiver) and drop them onto the SQL parameters on the left.
  4. Format the Data (Optional)
    To ensure data consistency, you can easily format the values. For instance, right-click the binding for the @PatientName parameter, navigate to Format Text and Names, and select Title Case to properly capitalize the patient's name before it's inserted into the database. Also, consider using the McNames formatter to capitalize like McDonald or LeBlanc correctly.