

# Searching DICOM data in HealthImaging
<a name="dicomweb-search"></a>

AWS HealthImaging offers representations of [ DICOMweb QIDO-RS](https://www.dicomstandard.org/using/dicomweb/query-qido-rs) APIs to search for studies, series, and instances by Patient ID, and receive their unique identifiers for further usage. HealthImaging's DICOMweb QIDO-RS APIs offer flexibility in how you search for data stored in HealthImaging and provide interoperability with legacy applications.

**Important**  
HealthImaging's DICOMweb APIs can be used to return image set information with QIDO-RS. HealthImaging DICOMweb APIs reference only [image sets](getting-started-concepts.md#concept-image-set) unless otherwise noted. Use HealthImaging [cloud native actions,](https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_Operations.html) or the optional image set parameter of DICOMweb actions to retrieve non-primary image sets. HealthImaging's DICOMweb APIs can be used to return image set information with DICOMweb-conformant responses.  
 HealthImaging DICOMweb QIDO-RS actions can return a maximum of 10,000 records. In the case that more than 10,000 resources exist, they will not be retrievable via the QIDO-RS actions, but may be retrieved via DICOMweb WADO-RS actions or [cloud native actions](https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_Operations.html).   
The APIs listed in this section are built in conformance to the DICOMweb (QIDO-RS) standard for web-based medical imaging. They are not offered through AWS CLI and AWS SDKs.

## DICOMweb search APIs for HealthImaging
<a name="dicomweb-search-services"></a>

The following table describes all HealthImaging representations of DICOMweb QIDO-RS APIs available for searching data in HealthImaging.


**HealthImaging representations of DICOMweb QIDO-RS APIs**  

| Name | Description | 
| --- | --- | 
| SearchDICOMStudies | Search for DICOM studies in HealthImaging by specifying search query elements using a GET request. Study search results are returned in JSON format, ordered by last update, date descending (latest to oldest). See [Search for studies](dicomweb-search-studies.md). | 
| SearchDICOMSeries | Search for DICOM series in HealthImaging by specifying search query elements using a GET request. Series search results are returned in JSON format, ordered by Series Number (0020, 0011) in ascending order (oldest to latest). See [Search for series](dicomweb-search-series.md). | 
| SearchDICOMInstances | Search for DICOM instances in HealthImaging by specifying search query elements using a GET request. Instance search results are returned in JSON format, ordered by Instance Number (0020, 0013) in ascending order (oldest to latest). See [Search for instances](dicomweb-search-instances.md). | 

## Supported DICOMweb query types for HealthImaging
<a name="dicomweb-query-types"></a>

HealthImaging supports QIDO-RS hierarchical resource queries at the Study, Series, and SOP Instance levels. When using QIDO-RS hierarchical search for HealthImaging:
+ Searching for studies returns a list of Studies
+ Searching for a Study’s Series requires a known `StudyInstanceUID` and returns a list of Series
+ Searching a list of Instances requires a known `StudyInstanceUID` and `SeriesInstanceUID`

The following table describes supported QIDO-RS hierarchical query types for searching data in HealthImaging.


**HealthImaging supported QIDO-RS query types**  

| Query type | Example | 
| --- | --- | 
| Attribute value queries | Search for all series in a Study where `modality=CT`. `.../studies/1.3.6.1.4.1.14519.5.2.1.6279.6001.101370605276577556143013894866/series?00080060=CT` Search all studies where patient ID and study date are these values, respectively. `…/studies?PatientID=11235813&StudyDate=20130509` | 
| Keyword queries | Search all series using the `SeriesInstanceUID` keyword. `.../studies/1.3.6.1.4.1.14519.5.2.1.6279.6001.101370605276577556143013894866/series?SeriesInstanceUID=1.3.6.1.4.1.14519.5.2.1.6279.6001.101370605276577556143013894868` | 
| Tag queries | Search for tags using query parameters passed in group/element form. \{group\}\{element\} like 0020000D | 
| Range queries |  `...?Modality=CT&StudyDate=AABBYYYY-BBCCYYYY`  | 
| Result paging with limit and offset | `.../studies?limit=1&offset=0&00080020=20000101` You can use the limit and offset parameters to paginate search responses. The default value of limit is 1000, and see [AWS HealthImaging endpoints and quotas](endpoints-quotas.md) for the maximum value. Max limit = 1000, Max offset = 9000  | 
| Wildcard queries |  Wildcard queries provide more flexibility on search using "\*" and "?". "\*" matches any sequence of characters (including a zero length value) and "?" matches any single character. Search for all studies in a datastore where StudyDescription contains "Nuclear": `.../studies?StudyDescription=*Nuclear*` Search for all studies where StudyDescription ends with "Nuclear": `.../studies?StudyDescription=*Nuclear` Search for all studies where StudyDescription starts with "Nuclear": `.../studies?StudyDescription=Nuclear*` Search for all studies where PatientID has exactly any 3 characters after 200965981: `.../studies?PatientID=200965981???`  | 
| FuzzyMatching queries |  Enable fuzzy matching on name DICOM attributes (PatientName (0010,0010), ReferringPhysicianName(0008,0090)) by adding the fuzzymatching optional query parameter: `.../studies?fuzzymatching=true&PatientName="Thomas^Albert"` This query performs case-insensitive prefix word matching on any part of the PatientName value. It returns results with PatientName values like "thomas", "Albert", "Thomas Albert", "Thomas^Albert", but not "hom" or "ber".  | 

**Topics**
+ [DICOMweb search APIs for HealthImaging](#dicomweb-search-services)
+ [Supported DICOMweb query types for HealthImaging](#dicomweb-query-types)
+ [Searching for DICOM studies in HealthImaging](dicomweb-search-studies.md)
+ [Searching for DICOM series in HealthImaging](dicomweb-search-series.md)
+ [Searching for DICOM instances in HealthImaging](dicomweb-search-instances.md)