DICOM Conformance Statement for Kastoria Health DICOMweb Service
Introduction
This document describes the DICOM conformance statement for the Kastoria Health DICOMweb Service. A DICOM Conformance Statement is a technical document that describes how a device or software implements the DICOM standard.
The Kastoria Health DICOMweb Service supports a subset of the DICOMweb Standard for medical imaging data management. Support includes:
- Studies Service
- Store (STOW-RS)
- Retrieve (WADO-RS)
- Search (QIDO-RS)
The service exposes a REST API following the DICOMweb standard (DICOM PS3.18). It also offers one
operation the standard does not define, attribute
modification (PATCH), as a Kastoria
Health extension; conformance to PS3.18 is neither claimed nor implied by it.
HTTP Methods
Every QIDO-RS search and WADO-RS retrieve transaction is offered on both HTTP
GET and the HTTP QUERY method — the safe HTTP method whose request
parameters travel in the request body rather than in the URL query string.
Both methods are answered by the same handler; a QUERY request carries the
parameters a GET would place in its URL query string in the request body
instead, and the response is identical.
A QUERY request body must be application/x-www-form-urlencoded or
application/json. An empty body is an unfiltered request, the same as a
GET with no query string. A QUERY request whose parameters cannot be read
is refused rather than answered as if it had no parameters:
| Request | Response |
|---|---|
Non-empty body of any other Content-Type, or with no Content-Type |
415 (Unsupported Media Type) with Accept-Query: application/x-www-form-urlencoded, application/json |
| Parameters on the URL query string | 400 (Bad Request); parameters are read only from the body, so move them there or use GET |
| A JSON array body | 400 (Bad Request) |
A body with no usable parameter names (typically a JSON document sent as application/x-www-form-urlencoded) |
400 (Bad Request) |
The STOW-RS transactions use POST and the attribute-modification extension
uses PATCH; neither is QUERY-mirrored. The operational endpoints (/,
/health) answer on GET only.
Deployment option (QUERY-only). A deployment can disable GET and HEAD
on the QIDO-RS and WADO-RS read interface to keep caller-supplied search
parameters — which may carry PHI — out of URLs, access logs, proxy logs, and
browser history (q.v.,
kastoria-health image page). With that
option enabled, a GET or HEAD request to any
QIDO-RS or WADO-RS endpoint is answered 405 (Method Not Allowed) with
Allow: QUERY. The Allow header is complete because every read route has a
QUERY mirror. HEAD is refused alongside GET because a HEAD request is
answered by running the GET handler against the same URL, so it would carry
the same PHI-bearing query string and defeat the point of the gate.
Service Base URL
The service base URL follows the pattern:
https://{host}/
A GET /health endpoint is provided for liveness checks, and GET / returns basic server
information.
Authorization
The Retrieve (WADO-RS) and Search (QIDO-RS) transactions support study-scoped access with viewer
JSON Web Tokens (JWTs). Both GET and QUERY requests to these interfaces are gated the same way.
Authorization is off by default and is enabled per deployment. When it is enabled:
- Every WADO-RS and QIDO-RS request must carry
Authorization: Bearer <jwt>. A missing, malformed, invalid or expired token is refused with401 (Unauthorized). - The token's
studyInstanceUIDsclaim is the authorization scope. A request whose path names a Study Instance UID outside that scope is refused with403 (Forbidden). - Study search (
GETorQUERY /studies) returns only studies within the scope; a token whose scope is empty receives an empty result. - A scope containing
*grants every study.
Store (STOW-RS) requests are not subject to viewer-token authorization.
Attribute modification (PATCH) is
available when authorization is enabled. A PATCH request requires a token whose scope claim
includes dicomweb.modify and whose studyInstanceUIDs claim names the study; a scope of * does
not grant modification. Otherwise the request is refused with 403 (Forbidden).
See JWT Authorization for the token format, claims and verification rules.
Studies Service
The Studies Service allows users to store, retrieve, and search for DICOM Studies, Series, and Instances.
Store (STOW-RS)
This transaction uses the POST method to store representations of studies, series, and instances contained in the request payload.
| Method | Path | Description |
|---|---|---|
| POST | /studies | Store instances |
| POST | /studies/{study} | Store instances for a specific study |
Parameter study corresponds to the DICOM attribute StudyInstanceUID. If specified, any instance
that doesn't belong to the provided study is reported as a failure with failure reason 272 (PS3.18
§6.6.1.2).
Responses are always returned as:
application/dicom+json
The following Content-Type headers are supported:
multipart/related; type="application/dicom"application/dicom
Ingest-Time Transcoding
Unlike a pass-through store, the service may transcode pixel data at ingest time according to rules
evaluated against the instance's metadata (modality, transfer syntax, frame parameters such as bits
allocated/stored, rows, columns, and photometric interpretation — see Transfer Syntax
Support). By default, instances of modalities CR, CT, DX, MG, and MR —
and losslessly-encoded NM, OT, PT, RF, SM, and US instances — are transcoded to High-Throughput JPEG
2000 with RPCL Options (Lossless Only, 1.2.840.10008.1.2.4.202). All other DICOM attributes are
stored as provided.
Two transfer syntaxes are normalized before any rule is evaluated: instances arriving as Deflated
Explicit VR Little Endian (1.2.840.10008.1.2.1.99) or Explicit VR Big Endian
(1.2.840.10008.1.2.2) are re-encoded losslessly to Explicit VR Little Endian, and it is that
re-encoding the service stores — these two syntaxes are never a stored syntax. All data element
values, including pixel data, are preserved, though the bytes are re-serialized as Explicit VR
Little Endian: a big-endian instance comes back with every multi-byte value in little-endian byte
order, and an out-of-order dataset comes back re-sorted into ascending tag order. The file meta
group is rewritten by the encoder and carries its implementation UID rather than the sender's. An
instance whose deflated stream does not decode is rejected like any other unparseable input.
Ingest-time transcoding can be disabled per request with the header:
| Header | Accepted Values | Description |
|---|---|---|
x-kastoria-disable-transcode |
true |
Store instances in their original transfer syntax without transcoding (Deflated and Big Endian inputs are still normalized to Explicit VR Little Endian) |
Part 10 Preamble
The 128-byte Part 10 preamble (PS3.10 §7.1) is not preserved. Every stored instance has its
preamble replaced with zeros at store time, whether or not transcoding is disabled; the DICM
prefix at offset 128 is kept, so the instance remains a valid Part 10 file. A preamble is
free-form, and a sender can fill it with executable-header bytes to make a file that is both a
valid DICOM file and a valid executable
(CVE-2019-11687); because the bytes never enter
storage, no retrieve path can serve them. The preamble carries no DICOM data element, so no
attribute is affected.
Store Required Attributes
Each DICOM file must be parseable as a DICOM Part 10 file, and the following DICOM elements are required to be present:
StudyInstanceUID(0020,000D)SeriesInstanceUID(0020,000E)SOPInstanceUID(0008,0018)TransferSyntaxUID(0002,0010)
Note:
SOPClassUID(0008,0016) is extracted on a best-effort basis; instances lacking it are still accepted- No UID format/length validation is performed beyond presence checks
- Files that fail parsing or are zero-length are reported in the
FailedSOPSequencewith failure reason272
Store Response Status Codes
| Code | Description |
|---|---|
200 (OK) |
All the SOP instances in the request were stored successfully |
202 (Accepted) |
Some instances were stored successfully, others failed. Details are in the response body |
400 (Bad Request) |
The provided Content-Type is neither multipart/related nor application/dicom |
409 (Conflict) |
None of the instances in the store transaction request were stored |
500 (Internal Server Error) |
The server encountered an unexpected error, including a multipart/related Content-Type that names no boundary |
503 (Service Unavailable) |
Storage was busy and nothing was stored; the response carries Retry-After, and the request can be retried as sent |
Store Response Payload
The response payload populates a DICOM dataset with the following elements:
| Tag | Name | Description |
|---|---|---|
| (0008,1190) | RetrieveURL |
The Retrieve URL of the study if StudyInstanceUID was provided and at least one instance was successfully stored |
| (0008,1198) | FailedSOPSequence |
The sequence of instances that failed to store |
| (0008,1199) | ReferencedSOPSequence |
The sequence of stored instances |
Each dataset in the FailedSOPSequence has the following elements:
| Tag | Name | Description |
|---|---|---|
| (0008,1150) | ReferencedSOPClassUID |
The SOP class UID of the instance that failed to store |
| (0008,1155) | ReferencedSOPInstanceUID |
The SOP instance UID of the instance that failed to store |
| (0008,1197) | FailureReason |
The reason code why this instance failed to store |
Each dataset in the ReferencedSOPSequence has the following elements:
| Tag | Name | Description |
|---|---|---|
| (0008,1150) | ReferencedSOPClassUID |
The SOP class UID of the instance that was stored (omitted when unavailable) |
| (0008,1155) | ReferencedSOPInstanceUID |
The SOP instance UID of the instance that was stored |
| (0008,1190) | RetrieveURL |
The retrieve URL of this instance on the DICOM server |
Note on Retrieve URLs: For POST /studies (without a study UID), the top-level study
RetrieveURL is only included when all stored instances belong to a single study.
Retrieve URL tags are omitted entirely when the base URL cannot be determined. The
authoritative base URL for retrieval from the DICOMweb service is configured in the service
deployment. As a RetrieveURL is dereferenced by whoever receives it, it is never built from an
unverified request header. If the base URL is not configured for a deployment, store responses from
that service carry no (0008,1190) at either level. The store itself still succeeds and the response
is otherwise unchanged — the instances are stored and listed in the ReferencedSOPSequence, without
a URL to fetch them back by.
Store Failure Reason Codes
| Code | Description |
|---|---|
272 (0x0110) |
Processing failure — used for all store failures, including parse failures, zero-length parts, storage errors, and instances whose StudyInstanceUID does not match the study UID stated in the request path |
Attribute Modification (PATCH) — Kastoria Health Extension
PS3.18 does not define a Modify operation for the Studies Service; the operations the standard specifies are Retrieve, Store and Search. Attribute modification is therefore a Kastoria Health extension, not a standard DICOMweb capability, and conformance to PS3.18 is neither claimed nor implied by it. In-place correction of a stored SOP Instance without changing its UID is, however, recognized by PS3.3 C.12.1.1.9; the extension is the HTTP transaction, not the act.
| Method | Path | Description |
|---|---|---|
| PATCH | /studies/{study} | Modify every instance of a study |
| PATCH | /studies/{study}/series/{series} | Modify every instance of a series |
| PATCH | /studies/{study}/series/{series}/instances/{instance} | Modify a single instance |
The extension is available only when authorization is enabled, and requires the
dicomweb.modify capability described there.
The request body is an application/dicom+json Data Set in the RFC 5789 patch sense, at most 1 MB.
An attribute with a Value is added or replaced; an attribute with "Value": [] is removed. The
"Value": [] removal form is a second, smaller extension: PS3.18 F.2.5 gives an absent Value the
meaning empty and defines no JSON form for absent. BulkDataURI and InlineBinary are not
accepted.
The patch is applied atomically — every targeted instance is modified or none is. Modification is in-place: UIDs are preserved and the prior version is retained in the study's version history.
Modifiable Attributes
| Attributes | Modifiable through |
|---|---|
| Patient Name, Patient ID, Patient Birth Date, Patient Sex, Study Date, Study Time, Study Description, Referring Physician Name, Accession Number, Study ID — the patient- and study-level attributes the study search reports | The study resource only |
| Modality, Series Description, Series Number, Series Date and Time, Manufacturer, Institution Name, Manufacturer Model Name, Body Part Examined, Protocol Name, Performing Physician Name, Performed Procedure Step Start Date and Time, Request Attributes Sequence — the series-level attributes the series search reports | The study or series resource |
| Every other attribute not listed below | Any of the three resources |
Not modifiable:
- the attributes that address storage: Study, Series and SOP Instance UIDs, SOP Class UID, and the File Meta SOP Class and SOP Instance UIDs derived from them;
- the attributes the stored pixel data depends on: Rows, Columns, Samples per Pixel, Photometric Interpretation, Planar Configuration, Number of Frames, Frame Increment Pointer, Bits Allocated, Bits Stored, High Bit, Pixel Representation, the (0028,0106–0109) pixel-value ranges, the Palette Color Lookup Table Descriptors (0028,1101–1103), Transfer Syntax, Pixel Data, and the Lossy Image Compression family — Lossy Image Compression (0028,2110), Lossy Image Compression Ratio (0028,2112) and Lossy Image Compression Method (0028,2114);
SpecificCharacterSet(0008,0005);- the File Meta group (0002);
- all private (odd-group) attributes.
Value and Instance Requirements
- Values are checked against their Value Representation, and a value that is invalid for it is
refused with
400. - Text that is not printable ASCII is accepted only for an instance that declares
ISO_IR 192(UTF-8) as itsSpecificCharacterSet; for any other instance it is refused with400. - Every selected instance must be stored as Explicit VR Little Endian (
1.2.840.10008.1.2.1). A request that selects an instance stored in any other transfer syntax is refused with503and changes nothing. - An instance whose stored text cannot be decoded without loss is refused with
422and left unchanged.
De-identification is not implemented and is not what this extension is for.
Modification Response
A successful modification returns 200 (OK) with the Store Instances Response Module (see
Store Response Payload): one ReferencedSOPSequence item per modified
instance. The FailedSOPSequence is never populated.
A 200 reports the modification committed; visibility through the search and retrieve
transactions follows when the study processor has processed the new version (see
Index Requirements).
Modification Response Status Codes
| Code | Description |
|---|---|
200 (OK) |
Every selected instance was modified |
400 (Bad Request) |
The body is not a valid patch (see Value and Instance Requirements), or names an attribute that is not modifiable through this resource (see Modifiable Attributes) |
401 (Unauthorized) |
No valid bearer token; see Authorization |
403 (Forbidden) |
The token does not grant modification of this study; see Authorization |
404 (Not Found) |
The study does not exist, or the path selects no instance |
409 (Conflict) |
The study changed while the modification was being applied; nothing was changed |
413 (Content Too Large) |
The request body is larger than 1 MB |
415 (Unsupported Media Type) |
The Content-Type is not application/dicom+json |
422 (Unprocessable Content) |
An instance cannot take the modification; nothing was changed |
500 (Internal Server Error) |
The server encountered an unexpected error |
503 (Service Unavailable) |
A selected instance is not stored as Explicit VR Little Endian, or storage was busy (with Retry-After) |
Retrieve (WADO-RS)
This transaction offers support for retrieving stored studies, series, instances, frames, metadata, rendered images, and thumbnails by reference.
| Method | Path | Description |
|---|---|---|
| GET, QUERY | /studies/{study} | Retrieve all instances within a study |
| GET, QUERY | /studies/{study}/metadata | Retrieve metadata for all instances within a study |
| GET, QUERY | /studies/{study}/series/{series} | Retrieve all instances within a series |
| GET, QUERY | /studies/{study}/series/{series}/metadata | Retrieve metadata for all instances within a series |
| GET, QUERY | /studies/{study}/series/{series}/instances/{instance} | Retrieve a single instance |
| GET, QUERY | /studies/{study}/series/{series}/instances/{instance}/metadata | Retrieve metadata for a single instance |
| GET, QUERY | /studies/{study}/series/{series}/instances/{instance}/frames/{frames} | Retrieve one or many frames from a single instance (comma-separated frame numbers, 1-indexed) |
| GET, QUERY | /studies/{study}/series/{series}/instances/{instance}/rendered | Retrieve an instance rendered into an image format (renders frame 0) |
| GET, QUERY | /studies/{study}/series/{series}/instances/{instance}/frames/{frames}/rendered | Retrieve frame(s) rendered into an image format |
| GET, QUERY | /studies/{study}/series/{series}/instances/{instance}/thumbnail | Retrieve a thumbnail of an instance (renders frame 0) |
| GET, QUERY | /studies/{study}/series/{series}/instances/{instance}/frames/{frames}/thumbnail | Retrieve thumbnail(s) of frame(s) |
Retrieve Instances Within Study or Series
The following Accept headers are supported for retrieving instances:
multipart/related; type="application/dicom"application/dicomapplication/**/*(defaults tomultipart/related; type="application/dicom")
The transfer-syntax Accept-header parameter (PS3.18 §8.7.3.5.2) is supported. When a specific
transfer syntax is requested and differs from the stored one, each instance is transcoded on the fly
before being returned. transfer-syntax=* (or omitting the parameter) returns instances in their
stored transfer syntax (which may be the result of ingest-time transcoding — see
Store). Each part's Content-Type carries a transfer-syntax parameter
identifying the actual returned syntax (PS3.18 §8.7.9). An unsupported requested transfer syntax
results in 406 Not Acceptable.
Retrieve an Instance
The following Accept headers are supported for retrieving a specific instance:
multipart/related; type="application/dicom"application/dicomapplication/**/*(defaults tomultipart/related; type="application/dicom")
The transfer-syntax Accept-header parameter is supported as described above — the instance is
transcoded when the requested syntax differs from the stored one.
The Part 10 preamble of a retrieved instance is zero-filled — see Part 10 Preamble.
Retrieve Frames
The following Accept headers are supported for retrieving frames:
multipart/related- returnsmultipart/related; type="<frame media type>"with appropriate media type based on the instance's transfer syntaxapplication/octet-streamapplication/**/*
The frame media type is derived from the returned transfer syntax:
application/octet-stream- Uncompressedimage/dicom-rle- RLE Losslessimage/jpeg- JPEG Baseline or JPEG Losslessimage/jls- JPEG-LSimage/jp2- JPEG 2000image/jxl- JPEG XLimage/jphc- High-Throughput JPEG 2000
A single-part response carries the frame media type, not application/octet-stream. A request
for one frame under Accept: */* against a JPEG-encoded instance is answered Content-Type:
image/jpeg; only an instance in an uncompressed transfer syntax is answered
application/octet-stream. There is no single-part media type this service falls back to — the
bytes are the stored frame, and the header names what they actually are.
A request naming more than one frame is always answered as multipart/related, whatever the
Accept header allows, because separate frames need separate body parts (PS3.18 §10.4.3).
The Accept header is checked against every frame media type this service can produce, not
against the one this instance will produce. A request with Accept: application/octet-stream for
a JPEG-encoded frame is therefore answered 200 with Content-Type: image/jpeg rather than 406.
A client that can only decode one encoding should name the transfer syntax it wants with the
transfer-syntax Accept-header parameter, which does govern what comes back. That parameter is
read from a multipart/related, application/dicom, application/* or */* media range only —
carried on a concrete image media type such as image/jpeg, it is ignored.
The transfer-syntax Accept-header parameter is supported. When a specific transfer syntax is
requested and differs from the stored one, frames are transcoded on the fly and the frame media type
reflects the target syntax. transfer-syntax=* (or omitting the parameter) returns frames in their
stored format. An unsupported requested transfer syntax results in 406 Not Acceptable.
Retrieve Metadata (for Study, Series, or Instance)
The following Accept header is supported for retrieving metadata:
application/dicom+json, or a wildcard that covers it (application/*,*/*, or noAcceptheader at all)
Metadata is returned in DICOM JSON format as defined in PS3.18 Annex F.
Compression: Metadata responses are served gzip-compressed when the client sends
Accept-Encoding: gzip.
Note: Bulk pixel data (PixelData, 7FE0,0010) is never included in metadata responses; retrieve
it via the frames or instance endpoints.
Retrieve Rendered Image (for Instance or Frame)
The following Accept headers are supported for retrieving a rendered image:
image/pngimage/jpegimage/bmpimage/*(defaults to PNG)*/*(defaults to PNG)multipart/relatedorapplication/octet-stream(defaults to PNG) — accepted so a client that names only a container gets a rendered image rather than a406
The service renders the specified instance or frame(s) into the requested image format. For instance
endpoints, frame 0 is rendered. Multiple frames are returned as multipart/related with individual
image parts.
Supported Query Parameters:
| Parameter | Format | Description |
|---|---|---|
viewport |
vw,vh[,sx,sy,sw,sh] |
Scaling dimensions (vw, vh: required positive integers, with vw×vh at most 16,777,216). Optional crop, all four values or none: sx, sy non-negative integers, sw, sh positive integers; the source region is extracted before scaling |
window |
center,width,function |
Windowing parameters. center and width must be numbers; function must be linear or sigmoid |
quality |
1-100 |
JPEG quality (integer 1-100, applies only to JPEG output) |
Priority: Image formats are selected in priority order: PNG > JPEG > BMP
Retrieve Thumbnail (for Instance or Frame)
The following Accept headers are supported for retrieving a thumbnail:
image/jpeg(default per DICOM spec)image/pngimage/bmpimage/*(defaults to JPEG)*/*(defaults to JPEG)multipart/relatedorapplication/octet-stream(defaults to JPEG) — accepted so a client that names only a container gets a thumbnail rather than a406
The service generates a thumbnail of the specified instance or frame(s). For instance endpoints,
frame 0 is rendered. Multiple frames are returned as multipart/related with individual image
parts.
Supported Query Parameters:
| Parameter | Format | Description |
|---|---|---|
viewport |
vw,vh |
Thumbnail dimensions (width and height are required positive integers, with vw×vh at most 1,048,576). Defaults to 128,128 |
Priority: Image formats are selected in priority order: JPEG > PNG > BMP
Retrieve Response Status Codes
| Code | Description |
|---|---|
200 (OK) |
All requested data was retrieved successfully |
400 (Bad Request) |
Invalid query parameters (e.g., malformed viewport, window, or quality value, a parameter given more than once, or a frame number that is not a positive integer written in decimal digits), a /rendered or /thumbnail request naming more frames than the service is configured to render at once, a request body that cannot be parsed, or a QUERY request refused under HTTP Methods |
401 (Unauthorized) |
Authorization is enabled and the request carries no valid bearer token; see Authorization |
403 (Forbidden) |
Authorization is enabled and the requested study is not in the token's scope; see Authorization |
404 (Not Found) |
The specified DICOM resource could not be found, or the instance does not contain pixel data for rendered/thumbnail requests |
405 (Method Not Allowed) |
Deployment option: GET/HEAD are disabled on this server (see HTTP Methods); the response carries Allow: QUERY |
406 (Not Acceptable) |
The specified Accept header is not supported, or a requested transfer-syntax cannot be transcoded to |
413 (Content Too Large) |
The request body is too large |
415 (Unsupported Media Type) |
A QUERY request body is neither application/x-www-form-urlencoded nor application/json; the response carries Accept-Query (see HTTP Methods) |
500 (Internal Server Error) |
The server encountered an unexpected error (if a mid-stream error occurs after headers are sent, the connection is torn down instead) |
Search (QIDO-RS)
Query based on ID for DICOM Objects (QIDO) enables searching for studies, series and instances by attributes.
| Method | Path | Description |
|---|---|---|
| GET, QUERY | /studies | Search for studies |
| GET, QUERY | /studies/{study}/series | Search for series in a study |
| GET, QUERY | /studies/{study}/instances | Search for instances in a study |
| GET, QUERY | /studies/{study}/series/{series}/instances | Search for instances in a series |
The following Accept header is supported for searching:
application/dicom+json, or a wildcard that covers it (application/*,*/*, or noAcceptheader at all)
Index Requirements
Search queries are served from search indexes that are maintained automatically by a background study-processing stage after instances are stored.
Important: Newly stored studies become searchable once this processing has completed. Queries against studies that have not yet been processed return an empty array.
Supported Search Parameters (Study-Level)
The following query parameters are supported for study-level searches:
| Parameter | Support | Description |
|---|---|---|
StudyInstanceUID |
Direct lookup | Unique study identifier |
PatientID |
Exact or starts-with, case-insensitive | Patient identifier. A single trailing * matches every value starting with what precedes it; * alone matches every study |
StudyDate |
Single date or range | Study date in YYYYMMDD format. Supports single date (20240101) or range (20240101-20240131, 20240101-, -20240131) |
PatientName |
Leading components, case-insensitive | Patient's name in DICOM PN form. The value names leading components and each matches whole: DOE matches DOE^JOHN, DOE^JOHN matches DOE^JOHN^Q but not DOE^JOHNSON. A single * as the last character of the whole value makes everything before it a prefix of the stored name, spanning the ^ separator: DOE* matches DOESMORE^ANN, and ^JOH* matches only a name with no family that begins JOH. Matched against the alphabetic component group |
StudyTime |
Single time or range | Study time in DICOM TM format, HH[MM[SS[.FFFFFF]]]. Supports single time (143000) or range (080000-170000, 080000-, -170000) |
AccessionNumber |
Exact or starts-with, case-insensitive | Accession number. A single trailing * matches every value starting with what precedes it; * alone matches every study |
StudyDescription |
Exact or starts-with, case-insensitive | Study description. A single trailing * matches every value starting with what precedes it; * alone matches every study |
ModalitiesInStudy |
List; matches any one modality, ignoring case | Modality (e.g. CT, MR). A list separated by \ or , is an IN clause — the study matches when any of its modalities equals any listed value |
limit |
Supported (default 100, maximum 1000) | Maximum number of matches returned in one response |
offset |
Supported (default 0, maximum 1000) | Number of matches skipped before the first returned one. A value above the maximum is rejected with 400, not capped |
Search Matching
The service supports the following matching types:
| Search Type | Supported Attributes | Example |
|---|---|---|
| Range Query | StudyDate, StudyTime |
StudyDate=20240101-20240131 - Inclusive range. Either bound may be omitted (e.g., StudyDate=20240101- or StudyDate=-20240131) |
| Exact Match | StudyInstanceUID, PatientID, AccessionNumber, StudyDescription, ModalitiesInStudy |
PatientID=PATIENT001 |
| Leading Components | PatientName |
PatientName=DOE matches DOE^JOHN — the value names leading PN components and each matches whole, so this is not an exact match on the full name. An empty component means empty: ^DOE names a study with no family |
| Universal Match | PatientName, PatientID, AccessionNumber, StudyDescription |
PatientID=* — the value * drops the predicate and matches every study, as does an empty value (PS3.4 §C.2.2.2.1, §C.2.2.2.4) |
| Starts-with Wildcard | PatientName, PatientID, AccessionNumber, StudyDescription |
PatientName=DOE^JOH*, PatientID=AAA* — one * as the last character of the value (PS3.18 §10.6.3.1); see the wildcard rules below |
Note:
- Wildcard matching (PS3.18 §10.6.3.1) is supported in restricted form for
PatientName,PatientID,AccessionNumber, andStudyDescription: - A single
*as the last character of the value is a starts-with match over the whole value:PatientID=AAA*matches every value that begins withAAA, ignoring case. OnPatientNamethe value is the text a stored name begins with and the*spans the^component separator as PS3.4's wildcard does:DOE*matchesDOESMORE^ANN,DOE^JOH*matchesDOE^JOHN^Q,^JOH*matches a family-less^JOHNNY. - The value
*alone is universal matching (PS3.4 §C.2.2.2.4): the predicate is dropped and every study matches. - Any other wildcard construct is rejected. A leading or embedded
*(*DOE,DOE*SMITH,DOE*^JOH*,*^DOE), more than one*, or any?returns400 (Bad Request)naming the offending parameter. OnPatientNamea value naming a component group with=is rejected too. - Why: a widened or narrowed result set would not be the one the query asked for.
- A
*or?in any other matching attribute (for exampleModalitiesInStudy=C*) is not a wildcard; it is compared literally. - A
PatientNamewith no wildcard names leading whole components, and an empty component means empty. DOEmatchesDOE^JOHN^Q.^DOEnames a study with no family whose given name is DOE, so it does not matchSMITH^DOE.DOE^^Qrequires a name with no given name.- This is not first-name-only search.
- Trailing separators carry no significance (PS3.5 §6.2):
DOE^^^isDOE, andDOE^asks whatDOEasks. - On a
PatientNamewith a trailing*, padding is trimmed from every component but the last.DOE^ JOHN^*isDOE^JOHN^*. - Why: the last component is text the caller cut short, so it loses only its leading spaces.
DOE^JO *asks for given names beginningJOand does not matchDOE^JOHN. - A zero-length value is universal matching (PS3.4 §C.2.2.2.1) on all four wildcard
attributes as on the others:
PatientID=places no constraint and every study matches. It is neither an error nor an ignored parameter, so it carries no Warning header field — a universal matcher selects everything by definition.PatientName=is the empty name, and a value spelling the empty name with separators (^,^^, spaces) is the same empty name - An attribute named twice, once by keyword and once by tag number (
PatientName=DOE&00100010=*), is rejected with400 (Bad Request)naming the attribute and both spellings, in study, series, and instance searches alike. - Why: PS3.18 §8.3.4.1 allows either spelling, but only one value can take effect and which one would depend on the order the keys arrive in.
- Matching ignores case for every attribute except
StudyInstanceUID, which is a UID:aa-1234andAA-1234are one identifier, andchrisandCHRISare one person StudyTimevalues are compared by the instant they denote, so a query and a stored value written to different precision (090000and090000.000000) match- The upper bound of a
StudyTimerange runs to the end of the unit it names, matching the way aStudyDateupper bound runs to the end of its day.-235959includes a study acquired at235959.500, and-0900includes one at090030. An explicit fraction names an instant instead, so-090030.000ends exactly there - Each query parameter must be supplied at most once. A repeated parameter —
PatientID=A&PatientID=B— is rejected with400 (Bad Request)naming the parameter - A
StudyTimenaming the whole day —000000-235959,000000-,-235959, or a bare-— narrows nothing and is treated as absent rather than searched for
Attribute ID
Query parameter keys may be encoded as either of the following (per PS3.18 §8.3.4.1):
| Value | Example |
|---|---|
{group}{element} |
0020000D |
{dicomKeyword} |
StudyInstanceUID |
Response Pagination
Both search transactions implement response pagination per PS3.18 §8.3.4.4.
| Parameter | Default | Behavior |
|---|---|---|
offset |
0 | Number of matches skipped before the first returned match; an explicit value above 1000 is rejected with 400 |
limit |
100 | Maximum matches returned in one response; an explicit value above 1000 is capped |
maxResults (PS3.18 §8.3.4.4.1) is 1000 — the ceiling on an explicit limit, so no single
response returns more than 1000 matches. A request that supplies no limit receives 100.
When matches remain beyond those returned, the response carries a Warning header field:
Warning: 299 {service}: There are more additional results that can be requested
The header announces that a further page can be requested. It does not carry a count of the matches not returned.
Search Depth
A search is limited in how far back it reaches, but only where it has to be. Naming anything
selective — a patient identifier, an accession number — settles the search almost at once, and it is
then answered in full however old the matches are. The limit is reached only when what the query
names is broad: several broad attributes searched together, a single broad starts-with value
(PatientID=A*, StudyDescription=CT*) that covers much of the archive, or a broad search whose
StudyTime rules out most of the studies it reaches.
Where a search is limited, the response is 200 (OK) and carries a Warning header field naming the
earliest study date covered:
Warning: 299 {service}: Searched studies from 20241216 onward; earlier matches may exist
Results from that date onward are complete. Nothing is claimed about studies before it.
A PatientName search and any starts-with search name no date. A PatientName filter matches
leading components and a starts-with filter matches every value sharing its base. Each is answered
from a range covering several distinct values, and inside that range entries are ordered by value
before date, so the search reaches the second value only after exhausting the first and cannot name
a date before which its answer is complete. Where such a search is limited, the warning states the
limit without dating it:
Warning: 299 {service}: The search was limited before every matching study was examined; further matches may exist
Both spellings mean the same thing to a caller: the result set is not known to be complete. Only the first tells you from when it is.
A search on a single exact-match attribute, or on none, normally fills its page long before the
limit matters, and is then answered in full however old the matches are — a search for a modality
last acquired three years ago returns it. It is limited only when most of what it reads is rejected
afterwards, as with a broad value behind a StudyTime. A starts-with search is bounded in the same
way: the cost of a prefix is the number of studies sharing it, so a deliberately broad prefix with
nothing else to narrow it stops after a bounded number of index entries and answers with what it
read, carrying the Warning header field above rather than presenting itself as complete. A
StudyDate supplied alongside a starts-with value keeps the search
proportional to that date window rather than to every study sharing the prefix.
An empty result set carries the warning too, when the search was limited. 200 (OK) with an
empty array and no Warning header means no study matches. 200 (OK) with an empty array and this
warning means no study matches within the range searched. These are different answers, and they are
distinguished by the header rather than by the payload.
An explicit StudyDate narrows the search but does not remove the limit. It is the most
effective thing a caller can supply: it bounds every attribute at once, so a search that names a
date is normally answered in full and carries no warning whatever attributes accompany it.
A caller needing a longer history for a broad combination of attributes should page through it by date, a range at a time.
Unsupported Query Parameters
A query parameter this service does not match on is accepted, ignored, and announced. The
response is 200 (OK) and carries a Warning header field naming every parameter that was
ignored:
Warning: 299 {service}: The following query parameters are not supported and were ignored: PatientSex\StudyID
This applies to both search transactions, and to any parameter other than that level's matching
attributes listed above and the limit / offset controls — including an attribute the service
returns but cannot match on, and a parameter it does not recognize at all. The result set is
therefore wider than the request asked for: the ignored parameter narrowed nothing.
A 400 is not used here. PS3.18 reserves it for a query the service cannot parse, and PS3.4
§C.2.2.1.3 permits an Optional Key to be returned without being matched on — so a well-formed
query the service can only partly honor is answered, with the shortfall stated.
Parameter names are separated by \, the DICOM multi-valued delimiter, rather than by a comma.
Warning is a comma-delimited list field, so a comma inside one warn-text would make two warnings
impossible to tell apart.
A name this service cannot repeat back is reported as (unprintable). DICOM keywords and
Attribute IDs are alphanumeric, so a parameter name outside that shape is not one this service
defines, and echoing it would place caller-supplied text — a line break included — into a header
field. The substitution keeps the count honest: the caller is still told how many of its parameters
were ignored, even where one of them cannot be named. The parentheses are what make the token
impossible to mistake for an Attribute ID.
Warning: 299 {service}: The following query parameters are not supported and were ignored: PatientSex\(unprintable)
Both warnings are sent when both apply — a query naming an ignored attribute can still overflow its page — as two warn-values, the query's shortcoming before the response's:
Warning: 299 {service}: The following query parameters are not supported and were ignored: PatientSex
Warning: 299 {service}: There are more additional results that can be requested
Both parameters must be non-negative integers. A malformed value is rejected with 400 Bad
Request rather than ignored — silently dropping a limit would return the full result set to a
caller that asked for one page.
offset may not exceed 1000 — the same ceiling as limit, so a request may skip no more than
it may retrieve — and a larger one is rejected with 400 (Bad Request) rather than capped. Paging is
offset-based with no cursor, so reaching a match means loading every match in front of it, and a
skipped match costs the same storage reads as a returned one. A caller needing to go deeper should
narrow the query rather than page further into an unnarrowed one.
limit is capped rather than rejected because a capped page is still a prefix of the page
requested, and the Warning header says more remains — whereas a capped offset would silently
answer with a different page than the one asked for.
Results are ordered by study date and time, most recent first. Two exceptions:
- A search on
PatientNamethat names fewer components than the stored name —SMITHmatchingSMITH^JOHN— is ordered most-recent-first within each matching patient, but is not ordered by date across several patients sharing those leading components. - A starts-with search is not ordered by date: its order is not guaranteed, because the entries it reads are ordered by value before date.
Notes for Client Implementers
Do not treat 200 (OK) with an empty array as definitive without checking for a Warning header
field. A search limited to a window returns the same empty payload whether nothing matches at all
or nothing matches recently. The header is the only distinction.
Treat a 299 warning as information, not an error. It accompanies a successful response and
does not indicate a failed or degraded search. A response may carry more than one — an ignored
parameter, a limited window, and further pages available are independent conditions and can all
apply at once.
To search a longer history, page by date rather than widening the range. Take the date the
warning names, and issue the next request with a StudyDate range ending the day before it. Repeat
until a response arrives without the warning, or until far enough back to stop. Each request is
bounded, and together they cover the history without any single request being expensive.
Supply a StudyDate whenever one is known. It bounds every attribute at once, which is both
faster and the surest way to receive a complete answer rather than a limited one.
Make a starts-with value as long as the identifier allows. The cost of a prefix is the number
of studies sharing it, not the length of what was typed: PatientID=AA-12* reads a handful of
entries where PatientID=A* may span most of the archive.
Prefer StudyInstanceUID when it is known. It is answered as a direct lookup, without reading
any index.
Supported Search Parameters (Series-Level)
The following query parameters are supported for series-level searches within a study:
| Parameter | Support | Description |
|---|---|---|
Modality |
List; matches any one, ignoring case | Filter by modality. A list separated by \ or , is an IN clause |
SeriesInstanceUID |
Exact match | Filter by series UID (a UID has no case to ignore) |
SeriesNumber |
Exact match | Filter by series number |
limit |
Supported (default 100, maximum 1000) | Maximum number of matches returned in one response |
offset |
Supported (default 0, maximum 1000) | Number of matches skipped before the first returned. A value above the maximum is rejected with 400, not capped |
Supported Search Parameters (Instance-Level)
The following query parameters are supported for instance-level searches, both within a series and within a whole study:
| Parameter | Support | Description |
|---|---|---|
SOPInstanceUID |
Exact match | Filter by SOP Instance UID (a UID has no case to ignore) |
InstanceNumber |
Exact match | Filter by instance number |
SeriesInstanceUID |
Exact match | Filter by series UID. On the study-level endpoint this narrows the search to one series; on the series-level endpoint the series is already fixed by the path, so asking for a different one returns an empty array |
limit |
Supported (default 100, maximum 1000) | Maximum number of matches returned in one response |
offset |
Supported (default 0, maximum 1000) | Number of matches skipped before the first returned. A value above the maximum is rejected with 400, not capped |
Instance-level searches do not use the search indexes, but they read data built by the same study-processing stage described under Index Requirements. As with series-level searches, a study that has not yet been processed returns an empty array.
Search Response
The response is an array of DICOM datasets in DICOM JSON format. The following attributes are returned by default for study-level searches:
Default Study Tags:
| Tag | Attribute Name |
|---|---|
| (0020,000D) | StudyInstanceUID |
| (0010,0020) | PatientID |
| (0010,0010) | PatientName |
| (0010,0030) | PatientBirthDate |
| (0010,0040) | PatientSex |
| (0020,0010) | StudyID |
| (0008,0020) | StudyDate |
| (0008,0030) | StudyTime |
| (0008,0050) | AccessionNumber |
| (0008,0061) | ModalitiesInStudy |
| (0008,1030) | StudyDescription |
| (0020,1206) | NumberOfStudyRelatedSeries |
| (0020,1208) | NumberOfStudyRelatedInstances |
Default Series Tags:
| Tag | Attribute Name |
|---|---|
| (0020,000D) | StudyInstanceUID |
| (0020,000E) | SeriesInstanceUID |
| (0020,0011) | SeriesNumber |
| (0008,0005) | SpecificCharacterSet |
| (0008,0060) | Modality |
| (0008,0021) | SeriesDate |
| (0008,0031) | SeriesTime |
| (0008,103E) | SeriesDescription |
| (0008,0070) | Manufacturer |
| (0008,0080) | InstitutionName |
| (0008,0090) | ReferringPhysicianName |
| (0008,1090) | ManufacturerModelName |
| (0018,0015) | BodyPartExamined |
| (0018,1030) | ProtocolName |
| (0020,1209) | NumberOfSeriesRelatedInstances |
Default Instance Tags:
The minimum set of PS3.18 Table 10.6.3-5, returned by both instance-level searches:
| Tag | Attribute Name |
|---|---|
| (0008,0016) | SOPClassUID |
| (0008,0018) | SOPInstanceUID |
| (0020,000D) | StudyInstanceUID |
| (0020,000E) | SeriesInstanceUID |
| (0020,0013) | InstanceNumber |
| (0028,0008) | NumberOfFrames |
Note: The service does not currently support the includefield parameter to return additional
attributes beyond the defaults.
Search Response Status Codes
| Code | Description |
|---|---|
200 (OK) |
The response payload contains all matching resources (an empty array when there are no matches) |
400 (Bad Request) |
The query cannot be honored as written: a range that cannot match (a StudyDate or StudyTime range whose end precedes its start; a StudyTime range does not wrap past midnight), a limit or offset that is not a non-negative integer, an offset above 1000, a query parameter supplied more than once, an attribute named by both its keyword and its tag number, a wildcard construct other than a single trailing * (see Search Matching), a request body that cannot be parsed, or a QUERY request refused under HTTP Methods |
401 (Unauthorized) |
Authorization is enabled and the request carries no valid bearer token; see Authorization |
403 (Forbidden) |
Authorization is enabled and a request for a study by UID, or for anything beneath it (series, instances, frames, metadata, etc.), names a Study Instance UID that is not in the token's scope; see Authorization |
405 (Method Not Allowed) |
Deployment option: GET/HEAD are disabled on this server (see HTTP Methods); the response carries Allow: QUERY |
406 (Not Acceptable) |
The specified Accept header does not allow application/dicom+json |
413 (Content Too Large) |
The request body is too large |
415 (Unsupported Media Type) |
A QUERY request body is neither application/x-www-form-urlencoded nor application/json; the response carries Accept-Query (see HTTP Methods) |
500 (Internal Server Error) |
The server encountered an unexpected error |
Search Notes
- An empty result set is returned with
200 (OK)and an empty JSON array —204 (No Content)is not used - A
200 (OK)always means the search ran to completion. A search that fails part-way through returns500, and never a partial or empty array with200— a client must be able to distinguish "no studies match" from "the search could not be completed". A query the service cannot satisfy because of how it is written returns400, so a caller can tell its own mistake from the server's. - A
200 (OK)does not by itself mean every parameter was applied. Two things narrow what the payload holds relative to what was asked, and both are stated in a Warning header field rather than left for the client to infer: - A parameter this service does not match on is ignored, so the result set is wider than the request — see Unsupported Query Parameters.
- Matches beyond
limitare not returned, so the result set is narrower than the whole match set — see themaxResultsnote above.
A response carrying no Warning header field is complete in every sense: every parameter was applied, no match was left behind, and no limit was placed on how far back the search reached.
Technical Specifications
Transfer Syntax Support
The following transfer syntaxes are recognized for ingest-time transcoding decisions. Transfer syntaxes not in this list are stored as-is (no transcoding is attempted).
Uncompressed:
- 1.2.840.10008.1.2 (Implicit VR Little Endian)
- 1.2.840.10008.1.2.1 (Explicit VR Little Endian)
- 1.2.840.10008.1.2.2 (Explicit VR Big Endian) — accepted on ingest, stored as Explicit VR Little Endian (see Ingest-Time Transcoding); available as a retrieve target
- 1.2.840.10008.1.2.1.99 (Deflated Explicit VR Little Endian) — accepted on ingest, stored as Explicit VR Little Endian (see Ingest-Time Transcoding); not available as a retrieve target
Compressed:
- 1.2.840.10008.1.2.5 (RLE Lossless)
- 1.2.840.10008.1.2.4.50 (JPEG Baseline Process 1)
- 1.2.840.10008.1.2.4.57 (JPEG Lossless, Non-Hierarchical)
- 1.2.840.10008.1.2.4.70 (JPEG Lossless, Non-Hierarchical, First-Order Prediction)
- 1.2.840.10008.1.2.4.80 (JPEG-LS Lossless)
- 1.2.840.10008.1.2.4.81 (JPEG-LS Lossy)
- 1.2.840.10008.1.2.4.90 (JPEG 2000 Lossless Only)
- 1.2.840.10008.1.2.4.91 (JPEG 2000)
- 1.2.840.10008.1.2.4.110 (JPEG XL Lossless)
- 1.2.840.10008.1.2.4.112 (JPEG XL)
- 1.2.840.10008.1.2.4.201 (High-Throughput JPEG 2000 Lossless Only)
- 1.2.840.10008.1.2.4.202 (High-Throughput JPEG 2000 with RPCL Options Lossless Only)
- 1.2.840.10008.1.2.4.203 (High-Throughput JPEG 2000)
Ingest Transcoding Rules
At store time the first matching rule determines the target transfer syntax; if the instance is already in the target syntax (or no rule matches), it is stored unchanged. Rules are evaluated against the post-normalization transfer syntax, so an instance sent as Deflated or Big Endian Explicit VR is evaluated as Explicit VR Little Endian:
| Modality | Condition | Target Transfer Syntax |
|---|---|---|
| CR, CT, DX, MG, MR | Always | 1.2.840.10008.1.2.4.202 (HTJ2K RPCL Lossless Only) |
| NM, OT, PT, RF, SM, US | Source transfer syntax is lossless | 1.2.840.10008.1.2.4.202 (HTJ2K RPCL Lossless Only) |
Transcoding can be disabled per request with the x-kastoria-disable-transcode: true header.
Retrieve-Time Transcoding
WADO-RS retrieve endpoints (study, series, instance, and frames) honor the transfer-syntax
Accept-header parameter. When the requested transfer syntax differs from the stored one, the service
transcodes on the fly using the same transfer syntax support table above. Deflated Explicit VR
Little Endian is not offered as a retrieve target. Transcoding between any other pair of supported
transfer syntaxes is available, Explicit VR Big Endian included; requesting an unsupported transfer
syntax (or one for which no codec is available) results in 406 Not Acceptable.
Character Set Support
The service supports all DICOM-defined character sets.
Limitations and Known Issues
Current Limitations
The following optional features are not supported:
-
Wildcard Matching beyond starts-with: On
PatientName,PatientID,AccessionNumber, andStudyDescription, a*anywhere other than as the single last character of the value is not supported, and neither is?or the contains-wildcard form (PS3.18 §10.6.3.1 alternative b,*on both ends). Any such value is rejected with400rather than answered with a widened or narrowed result set. What is supported is stated under Search Matching: one*as the last character of the value. A*or?in any other matching attribute (for exampleModalitiesInStudy=C*) is not a wildcard: it is compared literally. For attributes with a PN VR, PS3.4 §C.2.2.2.4 makes wildcard matching implementation dependent: the supported form is the whole name value with a single trailing*(DOE*,DOE^JOH*,^JOH*), which spans the^component separator, and only the alphabetic component group is matched on. OnPatientName, matching is case-insensitive but accent-sensitive: diacritics are compared as written, not folded. Trailing empty components carry no significance (PS3.5 §6.2), so a stored name^DAVEdoes not match^DAVE^^*. -
QIDO-RS includefield: The optional
includefieldparameter (PS3.18 §8.3.4.3) to return additional attributes beyond defaults is not currently supported. -
Rendered Image Viewport Cropping: Only the numeric
sx,sy,sw,shform (PS3.18 §8.3.5.1.3) is supported. Empty crop sub-values (which the standard defines as defaulting to 0 or the image edge) and negativesw/sh(which the standard defines as a horizontal/vertical flip) are rejected with400rather than honored. -
ETag/Cache Validation: ETag headers and If-None-Match cache validation (optional per PS3.18 §8.3.3) are not supported for metadata endpoints.
-
Fuzzy Matching: Fuzzy matching (optional per PS3.18 §10.6.3.2) is not supported in any search parameters and matching is always literal. A search that asks for it —
fuzzymatching=true— is answered with literal matching and a Warning header field:
Warning: 299 {service}: The fuzzymatching parameter is not supported. Only literal matching has been performed.
fuzzymatching=false asks for what the service does anyway and is answered silently. Any other
value is reported as an unsupported query parameter.
-
De-identification: The De-identification Profile (PS3.15 Annex E) is not implemented, and the attribute-modification extension is not a de-identification facility.
-
Study deletion: Deleting studies, series, or instances is not supported; no DELETE transactions are exposed on any resource.
References
DICOM® is the registered trademark of the National Electrical Manufacturers Association for its standards publications relating to digital communications of medical information.