:doc:`HealthImaging <../../medical-imaging>` / Client / search_image_sets

*****************
search_image_sets
*****************



.. py:method:: HealthImaging.Client.search_image_sets(**kwargs)

  

  Search image sets based on defined input attributes.

   

  .. note::

    

    ``SearchImageSets`` accepts a single search query parameter and returns a paginated response of all image sets that have the matching criteria. All date range queries must be input as ``(lowerBound, upperBound)``.

     

    By default, ``SearchImageSets`` uses the ``updatedAt`` field for sorting in descending order from newest to oldest.

    

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/SearchImageSets>`_  


  **Request Syntax**
  ::

    response = client.search_image_sets(
        datastoreId='string',
        searchCriteria={
            'filters': [
                {
                    'values': [
                        {
                            'DICOMPatientId': 'string',
                            'DICOMAccessionNumber': 'string',
                            'DICOMStudyId': 'string',
                            'DICOMStudyInstanceUID': 'string',
                            'DICOMSeriesInstanceUID': 'string',
                            'createdAt': datetime(2015, 1, 1),
                            'updatedAt': datetime(2015, 1, 1),
                            'DICOMStudyDateAndTime': {
                                'DICOMStudyDate': 'string',
                                'DICOMStudyTime': 'string'
                            },
                            'isPrimary': True|False
                        },
                    ],
                    'operator': 'EQUAL'|'BETWEEN'
                },
            ],
            'sort': {
                'sortOrder': 'ASC'|'DESC',
                'sortField': 'updatedAt'|'createdAt'|'DICOMStudyDateAndTime'
            }
        },
        maxResults=123,
        nextToken='string'
    )
    
  :type datastoreId: string
  :param datastoreId: **[REQUIRED]** 

    The identifier of the data store where the image sets reside.

    

  
  :type searchCriteria: dict
  :param searchCriteria: 

    The search criteria that filters by applying a maximum of 1 item to ``SearchByAttribute``.

    

  
    - **filters** *(list) --* 

      The filters for the search criteria.

      

    
      - *(dict) --* 

        The search filter.

        

      
        - **values** *(list) --* **[REQUIRED]** 

          The search filter values.

          

        
          - *(dict) --* 

            The search input attribute value.

            .. note::    This is a Tagged Union structure. Only one of the     following top level keys can be set: ``DICOMPatientId``, ``DICOMAccessionNumber``, ``DICOMStudyId``, ``DICOMStudyInstanceUID``, ``DICOMSeriesInstanceUID``, ``createdAt``, ``updatedAt``, ``DICOMStudyDateAndTime``, ``isPrimary``. 

          
            - **DICOMPatientId** *(string) --* 

              The patient ID input for search.

              

            
            - **DICOMAccessionNumber** *(string) --* 

              The DICOM accession number for search.

              

            
            - **DICOMStudyId** *(string) --* 

              The DICOM study ID for search.

              

            
            - **DICOMStudyInstanceUID** *(string) --* 

              The DICOM study instance UID for search.

              

            
            - **DICOMSeriesInstanceUID** *(string) --* 

              The Series Instance UID input for search.

              

            
            - **createdAt** *(datetime) --* 

              The created at time of the image set provided for search.

              

            
            - **updatedAt** *(datetime) --* 

              The timestamp input for search.

              

            
            - **DICOMStudyDateAndTime** *(dict) --* 

              The aggregated structure containing DICOM study date and study time for search.

              

            
              - **DICOMStudyDate** *(string) --* **[REQUIRED]** 

                The DICOM study date provided in ``yyMMdd`` format.

                

              
              - **DICOMStudyTime** *(string) --* 

                The DICOM study time provided in ``HHmmss.FFFFFF`` format.

                

              
            
            - **isPrimary** *(boolean) --* 

              The primary image set flag provided for search.

              

            
          
      
        - **operator** *(string) --* **[REQUIRED]** 

          The search filter operator for ``imageSetDateTime``.

          

        
      
  
    - **sort** *(dict) --* 

      The sort input for search criteria.

      

    
      - **sortOrder** *(string) --* **[REQUIRED]** 

        The sort order for search criteria.

        

      
      - **sortField** *(string) --* **[REQUIRED]** 

        The sort field for search criteria.

        

      
    
  
  :type maxResults: integer
  :param maxResults: 

    The maximum number of results that can be returned in a search.

    

  
  :type nextToken: string
  :param nextToken: 

    The token used for pagination of results returned in the response. Use the token returned from the previous request to continue results where the previous request ended.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'imageSetsMetadataSummaries': [
              {
                  'imageSetId': 'string',
                  'version': 123,
                  'createdAt': datetime(2015, 1, 1),
                  'updatedAt': datetime(2015, 1, 1),
                  'lastAccessedAt': datetime(2015, 1, 1),
                  'storageTier': 'FREQUENT_ACCESS'|'ARCHIVE_INSTANT_ACCESS',
                  'DICOMTags': {
                      'DICOMPatientId': 'string',
                      'DICOMPatientName': 'string',
                      'DICOMPatientBirthDate': 'string',
                      'DICOMPatientSex': 'string',
                      'DICOMStudyInstanceUID': 'string',
                      'DICOMStudyId': 'string',
                      'DICOMStudyDescription': 'string',
                      'DICOMNumberOfStudyRelatedSeries': 123,
                      'DICOMNumberOfStudyRelatedInstances': 123,
                      'DICOMAccessionNumber': 'string',
                      'DICOMSeriesInstanceUID': 'string',
                      'DICOMSeriesModality': 'string',
                      'DICOMSeriesBodyPart': 'string',
                      'DICOMSeriesNumber': 123,
                      'DICOMStudyDate': 'string',
                      'DICOMStudyTime': 'string'
                  },
                  'isPrimary': True|False
              },
          ],
          'sort': {
              'sortOrder': 'ASC'|'DESC',
              'sortField': 'updatedAt'|'createdAt'|'DICOMStudyDateAndTime'
          },
          'nextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **imageSetsMetadataSummaries** *(list) --* 

        The model containing the image set results.

        
        

        - *(dict) --* 

          Summary of the image set metadata.

          
          

          - **imageSetId** *(string) --* 

            The image set identifier.

            
          

          - **version** *(integer) --* 

            The image set version.

            
          

          - **createdAt** *(datetime) --* 

            The time an image set is created. Sample creation date is provided in ``1985-04-12T23:20:50.52Z`` format.

            
          

          - **updatedAt** *(datetime) --* 

            The time an image set was last updated.

            
          

          - **lastAccessedAt** *(datetime) --* 

            When the image set was last accessed.

            
          

          - **storageTier** *(string) --* 

            The image set's storage tier.

            
          

          - **DICOMTags** *(dict) --* 

            The DICOM tags associated with the image set.

            
            

            - **DICOMPatientId** *(string) --* 

              The unique identifier for a patient in a DICOM Study.

              
            

            - **DICOMPatientName** *(string) --* 

              The patient name.

              
            

            - **DICOMPatientBirthDate** *(string) --* 

              The patient birth date.

              
            

            - **DICOMPatientSex** *(string) --* 

              The patient sex.

              
            

            - **DICOMStudyInstanceUID** *(string) --* 

              The DICOM provided identifier for the Study Instance UID.

              
            

            - **DICOMStudyId** *(string) --* 

              The DICOM provided identifier for the Study ID.

              
            

            - **DICOMStudyDescription** *(string) --* 

              The DICOM provided Study Description.

              
            

            - **DICOMNumberOfStudyRelatedSeries** *(integer) --* 

              The total number of series in the DICOM study.

              
            

            - **DICOMNumberOfStudyRelatedInstances** *(integer) --* 

              The total number of instances in the DICOM study.

              
            

            - **DICOMAccessionNumber** *(string) --* 

              The accession number for the DICOM study.

              
            

            - **DICOMSeriesInstanceUID** *(string) --* 

              The DICOM provided identifier for the Series Instance UID.

              
            

            - **DICOMSeriesModality** *(string) --* 

              The DICOM provided identifier for the series Modality.

              
            

            - **DICOMSeriesBodyPart** *(string) --* 

              The DICOM provided identifier for the series Body Part Examined.

              
            

            - **DICOMSeriesNumber** *(integer) --* 

              The DICOM provided identifier for the Series Number.

              
            

            - **DICOMStudyDate** *(string) --* 

              The study date.

              
            

            - **DICOMStudyTime** *(string) --* 

              The study time.

              
        
          

          - **isPrimary** *(boolean) --* 

            The flag to determine whether the image set is primary or not.

            
      
    
      

      - **sort** *(dict) --* 

        The sort order for image set search results.

        
        

        - **sortOrder** *(string) --* 

          The sort order for search criteria.

          
        

        - **sortField** *(string) --* 

          The sort field for search criteria.

          
    
      

      - **nextToken** *(string) --* 

        The token for pagination results.

        
  
  **Exceptions**
  
  *   :py:class:`HealthImaging.Client.exceptions.ThrottlingException`

  
  *   :py:class:`HealthImaging.Client.exceptions.ConflictException`

  
  *   :py:class:`HealthImaging.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`HealthImaging.Client.exceptions.ValidationException`

  
  *   :py:class:`HealthImaging.Client.exceptions.InternalServerException`

  
  *   :py:class:`HealthImaging.Client.exceptions.ResourceNotFoundException`

  