# DICOMweb QIDO-RS Extractor (`datamule/dicomweb-qido-extractor`) Actor

Point at ANY DICOMweb QIDO-RS server (Orthanc, dcm4chee, Google Healthcare, DICOMcloud) and query medical-imaging metadata at study, series or instance level. Decodes DICOM-tag JSON to clean fields, keeps the raw tags. Metadata only, no pixels.

- **URL**: https://apify.com/datamule/dicomweb-qido-extractor.md
- **Developed by:** [Datamule](https://apify.com/datamule) (community)
- **Categories:** Developer tools, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.35 / 1,000 record extracteds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## DICOMweb QIDO-RS Extractor

**Point at ANY DICOMweb server and pull medical-imaging metadata into clean, structured rows — study, series or instance level — with one Actor.**

QIDO-RS (*Query based on ID for DICOM Objects, RESTful Services*) is the DICOM PS3.18 web standard for querying imaging metadata. Every conformant PACS / VNA / cloud imaging store — **Orthanc, dcm4chee, Google Cloud Healthcare API, DICOMcloud**, and many more — exposes the *same* uniform `/studies`, `/series`, `/instances` wire grammar. This Actor speaks that grammar generically: give it a base URL, a query level, and optional QIDO filters, and it returns normalized rows from any of them. **No pixel data is ever fetched — metadata only.**

### What it does

- **Three query levels** (`mode`):
  - `studies` — one row per matching study.
  - `series` — one row per series (across all studies, or scoped under a `StudyInstanceUID`).
  - `instances` — one row per SOP instance (all, under a study, or under a specific series).
- **Standard QIDO filters**: `PatientID`, `PatientName`, `StudyDate` (single or range), `ModalitiesInStudy`, `AccessionNumber`, plus `includefield`, `fuzzymatching`, and any extra query params the server supports.
- **Decodes DICOM+JSON for you.** Results come back tag-keyed (`00100010` = PatientName) with `{vr, Value[]}` structures. This Actor maps the common tags to readable field names, normalizes Person-Name values (`Last^First` → `First Last`), coerces numeric attributes — **and keeps the complete raw tag object** in `_raw` plus a name-keyed `tags` projection, so nothing is ever lost.
- **Multi-server**: pass several base URLs to harvest a whole fleet in one run.
- **Paginated & de-duplicated** via `limit`/`offset` with per-level UID dedup.

### Example input

```json
{
  "dicomWebUrls": ["https://demo.orthanc-server.com/dicom-web"],
  "mode": "studies",
  "ModalitiesInStudy": "CT",
  "StudyDate": "20060101-20061231",
  "maxRecords": 500
}
```

### Example output (one study row, abridged)

```json
{
  "_source": "https://demo.orthanc-server.com/dicom-web",
  "_level": "studies",
  "StudyInstanceUID": "2.16.840.1.113669.632.20.1211.10000315526",
  "PatientName": "VIX",
  "PatientID": "vAD7q3",
  "StudyDate": "20061005",
  "ModalitiesInStudy": "CT",
  "AccessionNumber": "0",
  "NumberOfStudyRelatedSeries": 1,
  "NumberOfStudyRelatedInstances": 250,
  "tags": { "PatientName": "VIX", "Modality": "CT", "...": "..." },
  "_raw": { "00100010": { "vr": "PN", "Value": [ { "Alphabetic": "VIX" } ] }, "...": "..." }
}
```

### Input reference

| Field | Type | Notes |
|---|---|---|
| `dicomWebUrls` | array (required) | One or more DICOMweb roots (the part before `/studies`). |
| `mode` | select | `studies` | `series` | `instances`. Default `studies`. |
| `studyInstanceUID` | string | Scope `series`/`instances` under one study. |
| `seriesInstanceUID` | string | With a study + `instances`, scope under one series. |
| `PatientID`, `PatientName`, `StudyDate`, `ModalitiesInStudy`, `AccessionNumber` | string | Standard QIDO match filters. |
| `includefield` | array | Extra attributes to return, or `all`. |
| `fuzzymatching` | boolean | Approximate name matching (server-dependent). |
| `extraQueryParams` | object | Any additional QIDO match keys. |
| `pageLimit` | integer | Page size (`limit`). Default 100. |
| `maxRecords` | integer | Row cap across all sources. Default 1000. |
| `bearerToken` | string (secret) | Optional OAuth2 bearer for protected servers (e.g. Google Cloud Healthcare). |
| `extraHeaders` | object | Optional extra request headers. |

### Notes

- Sends `Accept: application/dicom+json` on every request, so servers that default to multipart XML still return JSON.
- Authentication is optional and never required or logged for public servers.
- A study/series with zero children, or a query matching nothing, is a real empty answer. A run where **no** source returns anything fails fast so you never get a silently-empty result.
- **Metadata only.** This Actor does not retrieve pixel data (that is WADO-RS, a different service).

### Pricing

Pay-per-event: you are charged per **record** emitted. Subscription-tier discounts apply automatically.

# Actor input Schema

## `dicomWebUrls` (type: `array`):

One or more DICOMweb QIDO-RS root URLs — the part BEFORE /studies, e.g. https://demo.orthanc-server.com/dicom-web . Works with any conformant server (Orthanc, dcm4chee, Google Cloud Healthcare, DICOMcloud, …). A trailing /studies, /series or /instances is stripped automatically.

## `mode` (type: `string`):

Which QIDO-RS level to query. 'studies' = one row per matching study; 'series' = one row per series (all studies, or under a given study); 'instances' = one row per SOP instance (all, under a study, or under a specific series).

## `studyInstanceUID` (type: `string`):

Optional. Scope 'series'/'instances' modes UNDER this study (queries /studies/{uid}/series or /instances). Leave blank to query the level across the whole server.

## `seriesInstanceUID` (type: `string`):

Optional. With a StudyInstanceUID and mode=instances, scope instances UNDER this specific series (/studies/{study}/series/{series}/instances).

## `PatientID` (type: `string`):

Optional QIDO match filter on PatientID (tag 00100020).

## `PatientName` (type: `string`):

Optional QIDO match filter on PatientName (tag 00100010). Wildcards (\*) are supported by most servers; enable fuzzymatching for partial names.

## `StudyDate` (type: `string`):

Optional QIDO match on StudyDate (tag 00080020). Single date YYYYMMDD, or a range YYYYMMDD-YYYYMMDD (e.g. 20060101-20061231).

## `ModalitiesInStudy` (type: `string`):

Optional QIDO match on ModalitiesInStudy (tag 00080061), e.g. CT, MR, US, CR. Studies-level filter.

## `AccessionNumber` (type: `string`):

Optional QIDO match on AccessionNumber (tag 00080050).

## `includefield` (type: `array`):

Optional list of DICOM keywords or hex tags to additionally return, or the single value 'all' to request every available attribute. QIDO-RS 'includefield' param.

## `fuzzymatching` (type: `boolean`):

Request fuzzymatching=true so the server does approximate PatientName matching (support varies by server).

## `extraQueryParams` (type: `object`):

Optional free-form extra query parameters forwarded verbatim (any DICOM keyword/tag the server supports as a match key). limit/offset are managed for you and ignored here.

## `pageLimit` (type: `integer`):

QIDO 'limit' per request. The actor paginates with limit+offset until a short page or maxRecords.

## `maxRecords` (type: `integer`):

Stop after emitting this many rows across all sources (safety cap). Default 1000.

## `bearerToken` (type: `string`):

Optional OAuth2 bearer token for protected DICOMweb servers (e.g. Google Cloud Healthcare). Sent as Authorization: Bearer <token>. Never required or logged for public servers.

## `extraHeaders` (type: `object`):

Optional extra request headers (e.g. an API key header) merged into every request.

## Actor input object example

```json
{
  "dicomWebUrls": [
    "https://demo.orthanc-server.com/dicom-web"
  ],
  "mode": "studies",
  "fuzzymatching": false,
  "pageLimit": 100,
  "maxRecords": 1000
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "dicomWebUrls": [
        "https://demo.orthanc-server.com/dicom-web"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("datamule/dicomweb-qido-extractor").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "dicomWebUrls": ["https://demo.orthanc-server.com/dicom-web"] }

# Run the Actor and wait for it to finish
run = client.actor("datamule/dicomweb-qido-extractor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "dicomWebUrls": [
    "https://demo.orthanc-server.com/dicom-web"
  ]
}' |
apify call datamule/dicomweb-qido-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=datamule/dicomweb-qido-extractor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/zbe3uvbb1kgTAlzhK/builds/fI59NlDAg3ne1hHle/openapi.json
