# ImagingStudy _search

`POST /ImagingStudy/_search`

This resource contains content from a Digital Imaging and Communications in Medicine (DICOM) study.

Since this resource type represents medical images and related data that adhere to DICOM standards, the resource entries and elements map to DICOM attributes. A <u>series</u> comprises one type of imaging, while a <u>study</u> may have one or more series of different types within a resource. [Learn more about translating DICOM to FHIR](https://docs.redoxengine.com/permalink/6Zh4WUgV18ilvx8dynUYie).

You can review DICOM content or retrieve its storage location.

> **Supported fields and schema examples**
>
> We support any valid FHIR field. However, we only display fields we’ve defined in our schema, which are usually based on what’s included in the U.S. Core profile. We recommend relying on U.S. Core requirements. 
>
> Our schema examples show the shape and possibility of each FHIR resource; they aren’t code for real-time API calls. We don’t currently recommend copying and pasting these schema examples for your API calls. [Consider reviewing FHIR API actions](/fhir-api-actions) for realistic examples for particular use cases.

### \_search

Query for the storage location of a patient’s imaging results.

This correlates to a <u>**QIDO-RS**</u> DICOM operation in DICOM to Redox FHIR translation.

> **Flexible FHIR queries, different query parameters**
>
> FHIR queries are a flexible option with parameters to refine your search. The response returns a bundle of resources, known as a `searchset` bundle type. [Learn about bundles and bundle types](https://docs.redoxengine.com/permalink/23Q1Oku3NdxxvwYnQGJVrg) in our FHIR glossary.
>
> We only note which query parameters are required _if you’re querying a FHIR server directly_. Remember that Redox (i.e., data on demand) isn’t a FHIR server, and your connection may not be either.
>
> _Query parameters will vary between sites._ Work with your connection to find out which query parameters they require for a successful search.

###### Data on demand requirements

For data on demand searches, you must include at least one of these query parameters:

- FHIR resource ID for `Patient` resource ([learn about FHIR references](https://docs.redoxengine.com/basics/redox-fhir-api/fhir-glossary/#reference) or [review HL7’s docs on references](https://build.fhir.org/search.html#reference))
- `identifier` ([learn about handling FHIR identifiers](https://docs.redoxengine.com/permalink/3D5vEc8GfbxZ0SLhMbLfuQ))

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `patient` | Array of string | No | The patient that is the subject of the imaging study. |
| `patient.identifier` | Array of string | No | One or more external identifiers for the patient |
| `identifier` | Array of string | No | Identifiers for the Study, such as DICOM Study Instance UID and Accession number |
| `modality` | Array of string | No | Modality (machine type) for the Study. |
| `instance` | Array of string | No | SOP Instance UID for an instance. This finds studies based on the ids of instances contained within. |
| `series` | Array of string | No | DICOM Series Instance UID for a series. This finds studies based on the ids of series contained within. |
| `started` | Array of string | No | Time and date when the study was started. |
| `status` | Array of string | No | The status of the study. |

## Request example

_Generated from the schema: the values are placeholders, not a real payload._

```bash
curl 'https://api.redoxengine.com/fhir/R4/{destinationSlug}/{environmentFlag}/ImagingStudy/_search' \
--request POST \
--header 'Authorization: Bearer $API_TOKEN' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'patient=string' \
--data-urlencode 'patient.identifier=string' \
--data-urlencode 'identifier=string' \
--data-urlencode 'modality=string' \
--data-urlencode 'instance=string' \
--data-urlencode 'series=string' \
--data-urlencode 'started=string' \
--data-urlencode 'status=string'
```

## Responses

### 200

Search results (Bundle)

Response to a ImagingStudy search operation

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `resourceType` | string | Yes | Identifies the type of the resource. Value: Bundle |
| `type` | string | Yes | Identifies this bundle as a response to a search. Value: searchset |
| `total` | number | Yes | The total number of matches |
| `entry` | Array of ImagingStudy or Other | No | A resource matching the search criteria or related to a matching resource |
| `entry[] (ImagingStudy).resource` | object | Yes | Representation of the content produced in a DICOM imaging study. |
| `entry[] (ImagingStudy).resource.resourceType` | string | Yes | Identifies the type of the resource. Value: ImagingStudy |
| `entry[] (ImagingStudy).resource.status` | string | Yes | The current state of the ImagingStudy. Possible values: registered, available, cancelled, entered-in-error, unknown |
| `entry[] (ImagingStudy).resource.subject` | object | Yes | The subject, typically a patient, of the imaging study. Must be a resource of type `Patient`. |
| `entry[] (ImagingStudy).resource.subject.reference` | string | No | A reference to another resource. This is typically either a relative reference which includes the resource type and ID, or an internal reference which starts with `#` and refers to a contained resource. |
| `entry[] (ImagingStudy).resource.id` | string | No | The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes. |
| `entry[] (ImagingStudy).resource.identifier` | Array of object | No | Identifiers for the ImagingStudy such as DICOM Study Instance UID, and Accession Number. |
| `entry[] (ImagingStudy).resource.identifier[].extension` | Array of Boolean or String or CodeableConcept or Coding or HumanName or Reference | No | May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. |
| `entry[] (ImagingStudy).resource.identifier[].extension[] (Boolean).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `entry[] (ImagingStudy).resource.identifier[].extension[] (Boolean).valueBoolean` | boolean | No | A single value for the extension. |
| `entry[] (ImagingStudy).resource.identifier[].extension[] (String).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `entry[] (ImagingStudy).resource.identifier[].extension[] (String).valueString` | string | No | A single value for the extension. |
| `entry[] (ImagingStudy).resource.identifier[].extension[] (CodeableConcept).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `entry[] (ImagingStudy).resource.identifier[].extension[] (CodeableConcept).valueCodeableConcept` | object | No | A single value for the extension. |
| `entry[] (ImagingStudy).resource.identifier[].extension[] (CodeableConcept).valueCodeableConcept.coding` | Array of object | No | A reference to a code defined by a terminology system. |
| `entry[] (ImagingStudy).resource.identifier[].extension[] (CodeableConcept).valueCodeableConcept.coding[].system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `entry[] (ImagingStudy).resource.identifier[].extension[] (CodeableConcept).valueCodeableConcept.coding[].code` | string | No | A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). |
| `entry[] (ImagingStudy).resource.identifier[].extension[] (CodeableConcept).valueCodeableConcept.text` | string | No | A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. |
| `entry[] (ImagingStudy).resource.identifier[].extension[] (Coding).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `entry[] (ImagingStudy).resource.identifier[].extension[] (Coding).valueCoding` | object | No | A single value for the extension. |
| `entry[] (ImagingStudy).resource.identifier[].extension[] (Coding).valueCoding.system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `entry[] (ImagingStudy).resource.identifier[].extension[] (Coding).valueCoding.code` | string | No | A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). |
| `entry[] (ImagingStudy).resource.identifier[].extension[] (HumanName).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `entry[] (ImagingStudy).resource.identifier[].extension[] (HumanName).valueHumanName` | object | No | A single value for the extension. |
| `entry[] (ImagingStudy).resource.identifier[].extension[] (HumanName).valueHumanName.use` | string | No | Identifies the purpose for this name. Possible values: usual, official, temp, nickname, anonymous, old, maiden |
| `entry[] (ImagingStudy).resource.identifier[].extension[] (HumanName).valueHumanName.family` | string | No | The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father. |
| `entry[] (ImagingStudy).resource.identifier[].extension[] (HumanName).valueHumanName.given` | Array of string | No | Given name. |
| `entry[] (ImagingStudy).resource.identifier[].extension[] (Reference).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `entry[] (ImagingStudy).resource.identifier[].extension[] (Reference).valueReference` | object | No | A single value for the extension. |
| `entry[] (ImagingStudy).resource.identifier[].extension[] (Reference).valueReference.reference` | string | No | A reference to another resource. This is typically either a relative reference which includes the resource type and ID, or an internal reference which starts with `#` and refers to a contained resource. |
| `entry[] (ImagingStudy).resource.identifier[].use` | string | No | The purpose of this identifier. Possible values: usual, official, temp, secondary, old (If known) |
| `entry[] (ImagingStudy).resource.identifier[].system` | string | No | Establishes the namespace for the value - that is, a URL that describes a set values that are unique. |
| `entry[] (ImagingStudy).resource.identifier[].value` | string | No | The portion of the identifier typically relevant to the user and which is unique within the context of the system. |
| `entry[] (ImagingStudy).resource.modality` | Array of object | No | A list of all the series.modality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19). |
| `entry[] (ImagingStudy).resource.modality[].system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `entry[] (ImagingStudy).resource.modality[].code` | string | No | A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). |
| `entry[] (ImagingStudy).resource.started` | string | No | Date and time the study started. |
| `entry[] (ImagingStudy).resource.referrer` | object | No | The requesting/referring physician. Must reference one of the following types of resources: - `PractitionerRole` - `Practitioner` |
| `entry[] (ImagingStudy).resource.referrer.reference` | string | No | A reference to another resource. This is typically either a relative reference which includes the resource type and ID, or an internal reference which starts with `#` and refers to a contained resource. |
| `entry[] (ImagingStudy).resource.endpoint` | Array of object | No | The network service providing access (e.g., query, view, or retrieval) for the study. See implementation notes for information about using DICOM endpoints. A study-level endpoint applies to each series in the study, unless overridden by a series-level endpoint with the same Endpoint.connectionType. Must be a resource of type `Endpoint`. |
| `entry[] (ImagingStudy).resource.endpoint[].reference` | string | No | A reference to another resource. This is typically either a relative reference which includes the resource type and ID, or an internal reference which starts with `#` and refers to a contained resource. |
| `entry[] (ImagingStudy).resource.numberOfSeries` | number | No | Number of Series in the Study. This value given may be larger than the number of series elements this Resource contains due to resource availability, security, or other factors. This element should be present if any series elements are present. |
| `entry[] (ImagingStudy).resource.numberOfInstances` | number | No | Number of SOP Instances in Study. This value given may be larger than the number of instance elements this resource contains due to resource availability, security, or other factors. This element should be present if any instance elements are present. |
| `entry[] (ImagingStudy).resource.procedureCode` | Array of object | No | The code for the performed procedure type. |
| `entry[] (ImagingStudy).resource.procedureCode[].coding` | Array of object | No | A reference to a code defined by a terminology system. |
| `entry[] (ImagingStudy).resource.procedureCode[].coding[].system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `entry[] (ImagingStudy).resource.procedureCode[].coding[].code` | string | No | A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). |
| `entry[] (ImagingStudy).resource.procedureCode[].text` | string | No | A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. |
| `entry[] (ImagingStudy).resource.location` | object | No | The principal physical location where the ImagingStudy was performed. Must be a resource of type `Location`. |
| `entry[] (ImagingStudy).resource.location.reference` | string | No | A reference to another resource. This is typically either a relative reference which includes the resource type and ID, or an internal reference which starts with `#` and refers to a contained resource. |
| `entry[] (ImagingStudy).resource.reasonCode` | Array of object | No | Description of clinical condition indicating why the ImagingStudy was requested. |
| `entry[] (ImagingStudy).resource.reasonCode[].coding` | Array of object | No | A reference to a code defined by a terminology system. |
| `entry[] (ImagingStudy).resource.reasonCode[].coding[].system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `entry[] (ImagingStudy).resource.reasonCode[].coding[].code` | string | No | A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). |
| `entry[] (ImagingStudy).resource.reasonCode[].text` | string | No | A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. |
| `entry[] (ImagingStudy).resource.description` | string | No | The Imaging Manager description of the study. Institution-generated description or classification of the Study (component) performed. |
| `entry[] (ImagingStudy).resource.series` | Array of object | No | Each study has one or more series of images or other content. |
| `entry[] (ImagingStudy).resource.series[].uid` | string | Yes | The DICOM Series Instance UID for the series. |
| `entry[] (ImagingStudy).resource.series[].modality` | object | Yes | The modality of this series sequence. |
| `entry[] (ImagingStudy).resource.series[].modality.system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `entry[] (ImagingStudy).resource.series[].modality.code` | string | No | A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). |
| `entry[] (ImagingStudy).resource.series[].number` | number | No | The numeric identifier of this series in the study. |
| `entry[] (ImagingStudy).resource.series[].description` | string | No | A description of the series. |
| `entry[] (ImagingStudy).resource.series[].numberOfInstances` | number | No | Number of SOP Instances in the Study. The value given may be larger than the number of instance elements this resource contains due to resource availability, security, or other factors. This element should be present if any instance elements are present. |
| `entry[] (ImagingStudy).resource.series[].started` | string | No | The date and time the series was started. |
| `entry[] (ImagingStudy).resource.series[].performer` | Array of object | No | Indicates who or what performed the series and how they were involved. |
| `entry[] (ImagingStudy).resource.series[].performer[].actor` | object | Yes | Indicates who or what performed the series. Must reference one of the following types of resources: - `PractitionerRole` - `Practitioner` - `Organization` |
| `entry[] (ImagingStudy).resource.series[].performer[].actor.reference` | string | No | A reference to another resource. This is typically either a relative reference which includes the resource type and ID, or an internal reference which starts with `#` and refers to a contained resource. |
| `entry[] (ImagingStudy).resource.series[].performer[].function` | object | No | Distinguishes the type of involvement of the performer in the series. |
| `entry[] (ImagingStudy).resource.series[].performer[].function.coding` | Array of object | No | A reference to a code defined by a terminology system. |
| `entry[] (ImagingStudy).resource.series[].performer[].function.coding[].system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `entry[] (ImagingStudy).resource.series[].performer[].function.coding[].code` | string | No | A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). |
| `entry[] (ImagingStudy).resource.series[].performer[].function.text` | string | No | A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. |
| `entry[] (ImagingStudy).resource.series[].instance` | Array of object | No | A single SOP instance within the series, e.g. an image, or presentation state. |
| `entry[] (ImagingStudy).resource.series[].instance[].uid` | string | Yes | The DICOM SOP Instance UID for this image or other DICOM content. |
| `entry[] (ImagingStudy).resource.series[].instance[].sopClass` | object | Yes | DICOM instance  type. |
| `entry[] (ImagingStudy).resource.series[].instance[].sopClass.system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `entry[] (ImagingStudy).resource.series[].instance[].sopClass.code` | string | No | A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). |
| `entry[] (ImagingStudy).resource.series[].instance[].number` | number | No | The number of instance in the series. |
| `entry[] (ImagingStudy).resource.series[].instance[].title` | string | No | The description of the instance. |
| `entry[] (ImagingStudy).search` | object | Yes | Information about the search process that lead to the creation of this entry. |
| `entry[] (ImagingStudy).search.mode` | string | Yes | Identifies the ImagingStudy as matching the search parameters. Value: match |
| `entry[] (Other).search` | object | Yes | Information about the search process that lead to the creation of this entry. |
| `entry[] (Other).search.mode` | string | No | Why this entry is in the result set - whether it's included as a match or because of an _include requirement, or to convey information or warning information about the search process. Possible values: match, include, outcome - why this is in the result set |

_Generated from the schema: the values are placeholders, not a real payload._

```json
{
  "resourceType": "Bundle",
  "type": "searchset",
  "total": 0,
  "entry": [
    {
      "resource": {
        "resourceType": "ImagingStudy",
        "id": "example-x-ray",
        "identifier": [
          {
            "use": "official",
            "system": "urn:dicom:uid",
            "value": "urn:oid:1.2.840.114350.1.13.12345.1.7.2.698084.9"
          },
          {
            "use": "usual",
            "value": "81248247421",
            "type": {
              "coding": [
                {
                  "code": "ACSN",
                  "system": "http://terminology.hl7.org/CodeSystem/v2-0203"
                }
              ],
              "text": "Accession Number"
            }
          }
        ],
        "status": "available",
        "modality": [
          {
            "code": "DX",
            "system": "http://dicom.nema.org/resources/ontology/DCM"
          }
        ],
        "subject": {
          "reference": "Patient/RedoxPatientExampleTimothy"
        },
        "started": "2022-01-01T11:01:20+03:00",
        "numberOfSeries": 1,
        "numberOfInstances": 2,
        "procedureCode": [
          {
            "coding": [
              {
                "code": "RPID2589",
                "system": "http://www.radlex.org",
                "display": "XR Wrist 3+ Views"
              }
            ]
          }
        ],
        "series": [
          {
            "uid": "2.16.124.113543.6003.1154777499.30246.19789.3503430045.1",
            "number": 3,
            "modality": {
              "code": "DX",
              "system": "http://dicom.nema.org/medical/dicom/current/output/chtml/part16/sect_CID_33.html"
            },
            "description": "XR Wrist 3+ Views",
            "numberOfInstances": 2,
            "instance": [
              {
                "uid": "2.16.124.113543.6003.1154777499.30246.19789.3503430045.1.1",
                "sopClass": {
                  "code": "urn:oid:1.2.840.10008.5.1.4.1.1.2",
                  "system": "urn:ietf:rfc:3986"
                },
                "number": 1,
                "title": "PA VIEW"
              },
              {
                "uid": "2.16.124.113543.6003.1154777499.30246.19789.3503430045.1.2",
                "sopClass": {
                  "code": "urn:oid:1.2.840.10008.5.1.4.1.1.2",
                  "system": "urn:ietf:rfc:3986"
                },
                "number": 2,
                "title": "LL VIEW"
              }
            ]
          }
        ]
      },
      "search": {
        "mode": "match"
      }
    }
  ]
}
```

### 400

Request could not be processed or failed validation

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `resourceType` | string | Yes | Identifies the type of the resource. Value: OperationOutcome |
| `issue` | Array of object | Yes | A structured respresentation of the error that occurred |
| `issue[].severity` | string | Yes | Generally `error` or `fatal` Possible values: fatal, error, warning, information |
| `issue[].code` | string | Yes | A FHIR category code that describes the general type of issue. See http://hl7.org/fhir/ValueSet/issue-type for details |
| `issue[].id` | string | No | If the error occurs in the RedoxEngine, this corresponds to an Error record in the organization. |
| `issue[].details` | object | No | Additional details about the error. This may be a text description of the error or a system code that identifies the error. |
| `issue[].details.coding` | Array of object | No | A more granular FHIR code for the specific error. Typically from http://hl7.org/fhir/ValueSet/operation-outcome |
| `issue[].details.coding[].system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `issue[].details.coding[].code` | string | No | A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). |
| `issue[].details.text` | string | No | A human-readable interpretation of the issue code |
| `issue[].diagnostics` | string | No | Additional diagnostic information about the issue. |

```json
{
  "resourceType": "OperationOutcome",
  "issue": [
    {
      "severity": "fatal",
      "code": "invalid",
      "details": {
        "coding": [
          {
            "code": "MSG_BAD_SYNTAX",
            "system": "http://terminology.hl7.org/CodeSystem/operation-outcome"
          }
        ],
        "text": "Invalid content found in request body."
      }
    }
  ]
}
```

### 401

Authorization is required

Same fields as 400.

```json
{
  "resourceType": "OperationOutcome",
  "issue": [
    {
      "severity": "fatal",
      "code": "unknown",
      "details": {
        "coding": [
          {
            "code": "MSG_AUTH_REQUIRED",
            "system": "http://terminology.hl7.org/CodeSystem/operation-outcome"
          }
        ],
        "text": "Invalid authorization token"
      }
    }
  ]
}
```

### 500

Internal server error

Same fields as 400.

```json
{
  "resourceType": "OperationOutcome",
  "issue": [
    {
      "severity": "fatal",
      "code": "processing",
      "details": {
        "coding": [
          {
            "code": "MSG_RESOURCE_ID_FAIL",
            "system": "http://terminology.hl7.org/CodeSystem/operation-outcome"
          }
        ],
        "text": "Unable to allocate resource id."
      }
    }
  ]
}
```

### 503

Service unavailable

Same fields as 400.

```json
{
  "resourceType": "OperationOutcome",
  "issue": [
    {
      "severity": "fatal",
      "code": "transient",
      "details": {
        "text": "System is unable to process this message at this time."
      }
    }
  ]
}
```
