# Device _search

`POST /Device/_search`

This resource contains details about a medical or non-medical device. It provides administrative context for a device used during a patient visit or administered for home use. This resource is usually referenced by other resources.

You can review or retrieve device details.

> **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 details about a device. 

> **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 add a `required` label only to query parameters _a FHIR server requires if you query it directly_. Remember that Redox <u>**data on demand**</u> isn’t a FHIR server, and your connection may not be either.
>
> _Query parameters vary between sites._ Work with your connection to find out which query parameters they require for a successful search.

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `patient` | Array of string | No | Who the device is for |

## Request example

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

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

## Responses

### 200

Search results (Bundle)

| 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 Device or Other | No | A resource matching the search criteria or related to a matching resource |
| `entry[] (Device).resource` | object | Yes | A type of a manufactured item that is used in the provision of healthcare |
| `entry[] (Device).resource.resourceType` | string | Yes | Identifies the type of the resource. Value: Device |
| `entry[] (Device).resource.type` | object | Yes | The kind or type of device. |
| `entry[] (Device).resource.type.coding` | Array of object | No | A reference to a code defined by a terminology system. |
| `entry[] (Device).resource.type.coding[].system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `entry[] (Device).resource.type.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[] (Device).resource.type.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[] (Device).resource.patient` | object | Yes | Patient information, If the device is affixed to a person. Must be a resource of type `Patient`. |
| `entry[] (Device).resource.patient.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[] (Device).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[] (Device).resource.identifier` | Array of object | No | Unique instance identifiers assigned to a device by manufacturers other organizations or owners. |
| `entry[] (Device).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[] (Device).resource.identifier[].extension[] (Boolean).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `entry[] (Device).resource.identifier[].extension[] (Boolean).valueBoolean` | boolean | No | A single value for the extension. |
| `entry[] (Device).resource.identifier[].extension[] (String).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `entry[] (Device).resource.identifier[].extension[] (String).valueString` | string | No | A single value for the extension. |
| `entry[] (Device).resource.identifier[].extension[] (CodeableConcept).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `entry[] (Device).resource.identifier[].extension[] (CodeableConcept).valueCodeableConcept` | object | No | A single value for the extension. |
| `entry[] (Device).resource.identifier[].extension[] (CodeableConcept).valueCodeableConcept.coding` | Array of object | No | A reference to a code defined by a terminology system. |
| `entry[] (Device).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[] (Device).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[] (Device).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[] (Device).resource.identifier[].extension[] (Coding).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `entry[] (Device).resource.identifier[].extension[] (Coding).valueCoding` | object | No | A single value for the extension. |
| `entry[] (Device).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[] (Device).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[] (Device).resource.identifier[].extension[] (HumanName).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `entry[] (Device).resource.identifier[].extension[] (HumanName).valueHumanName` | object | No | A single value for the extension. |
| `entry[] (Device).resource.identifier[].extension[] (HumanName).valueHumanName.use` | string | No | Identifies the purpose for this name. Possible values: usual, official, temp, nickname, anonymous, old, maiden |
| `entry[] (Device).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[] (Device).resource.identifier[].extension[] (HumanName).valueHumanName.given` | Array of string | No | Given name. |
| `entry[] (Device).resource.identifier[].extension[] (Reference).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `entry[] (Device).resource.identifier[].extension[] (Reference).valueReference` | object | No | A single value for the extension. |
| `entry[] (Device).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[] (Device).resource.identifier[].use` | string | No | The purpose of this identifier. Possible values: usual, official, temp, secondary, old (If known) |
| `entry[] (Device).resource.identifier[].system` | string | No | Establishes the namespace for the value - that is, a URL that describes a set values that are unique. |
| `entry[] (Device).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[] (Device).resource.udiCarrier` | Array of object | No | Unique device identifier (UDI) assigned to device label or package.  Note that the Device may include multiple udiCarriers as it either may include just the udiCarrier for the jurisdiction it is sold, or for multiple jurisdictions it could have been sold. |
| `entry[] (Device).resource.udiCarrier[].deviceIdentifier` | string | Yes | The device identifier (DI) is a mandatory, fixed portion of a UDI that identifies the labeler and the specific version or model of a device. |
| `entry[] (Device).resource.udiCarrier[].issuer` | string | No | Organization that is charged with issuing UDIs for devices.  For example, the US FDA issuers include : 1) GS1: `http://hl7.org/fhir/NamingSystem/gs1-di`, 2) HIBCC: `http://hl7.org/fhir/NamingSystem/hibcc-dI`, 3) ICCBBA for blood containers: `http://hl7.org/fhir/NamingSystem/iccbba-blood-di`, 4) ICCBA for other devices: `http://hl7.org/fhir/NamingSystem/iccbba-other-di`. |
| `entry[] (Device).resource.udiCarrier[].jurisdiction` | string | No | The identity of the authoritative source for UDI generation within a jurisdiction. All UDIs are globally unique within a single namespace with the appropriate repository uri as the system. For example, UDIs of devices managed in the U.S. by the FDA, the value is `http://hl7.org/fhir/NamingSystem/fda-udi`. |
| `entry[] (Device).resource.status` | string | No | Status of the Device availability. Possible values: active, inactive, entered-in-error, unknown |
| `entry[] (Device).resource.distinctIdentifier` | string | No | The distinct identification string as required by regulation for a human cell, tissue, or cellular and tissue-based product. |
| `entry[] (Device).resource.manufacturer` | string | No | A name of the manufacturer. |
| `entry[] (Device).resource.manufactureDate` | string | No | The date and time when the device was manufactured. |
| `entry[] (Device).resource.expirationDate` | string | No | The date and time beyond which this device is no longer valid or should not be used (if applicable). |
| `entry[] (Device).resource.lotNumber` | string | No | Lot number assigned by the manufacturer. |
| `entry[] (Device).resource.serialNumber` | string | No | The serial number assigned by the organization when the device was manufactured. |
| `entry[] (Device).resource.deviceName` | Array of object | No | This represents the manufacturer's name of the device as provided by the device, from a UDI label, or by a person describing the Device.  This typically would be used when a person provides the name(s) or when the device represents one of the names available from DeviceDefinition. |
| `entry[] (Device).resource.deviceName[].name` | string | Yes | The name of the device. |
| `entry[] (Device).resource.deviceName[].type` | string | Yes | The type of deviceName. UDILabelName \| UserFriendlyName \| PatientReportedName \| ManufactureDeviceName \| ModelName. Possible values: udi-label-name, user-friendly-name, patient-reported-name, manufacturer-name, model-name, other |
| `entry[] (Device).resource.modelNumber` | string | No | The model number for the device. |
| `entry[] (Device).resource.partNumber` | string | No | The part number of the device. |
| `entry[] (Device).resource.note` | Array of object | No | Descriptive information, usage information or implantation information that is not captured in an existing element. |
| `entry[] (Device).resource.note[].text` | string | Yes | The text of the annotation in markdown format. |
| `entry[] (Device).resource.safety` | Array of object | No | Provides additional safety characteristics about a medical device.  For example devices containing latex. |
| `entry[] (Device).resource.safety[].coding` | Array of object | No | A reference to a code defined by a terminology system. |
| `entry[] (Device).resource.safety[].coding[].system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `entry[] (Device).resource.safety[].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[] (Device).resource.safety[].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[] (Device).search` | object | Yes | Information about the search process that lead to the creation of this entry. |
| `entry[] (Device).search.mode` | string | Yes | Identifies the Device 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 |

```json
{
  "resourceType": "Bundle",
  "id": "RedoxDeviceSearchBundleExample",
  "type": "searchset",
  "total": 1,
  "entry": [
    {
      "resource": {
        "resourceType": "Device",
        "id": "ed094d3e-67e6-5f13-a5e4-211914682e43",
        "patient": {
          "reference": "Patient/RedoxPatientExampleTimothy"
        },
        "identifier": [
          {
            "system": "urn:oid:2.16.840.1.113883.3.3719",
            "value": "(01)3577700909(11)180715(17)241115(10)005677(21)2069700001"
          }
        ],
        "type": {
          "text": "Eye Bolt"
        },
        "status": "active",
        "udiCarrier": [
          {
            "deviceIdentifier": "3577700909",
            "issuer": "http://hl7.org/fhir/NamingSystem/gs1-di",
            "jurisdiction": "http://hl7.org/fhir/NamingSystem/fda-udi"
          }
        ],
        "distinctIdentifier": "180715",
        "manufacturer": "Siemens",
        "manufactureDate": "2018-07-15",
        "expirationDate": "2024-11-15",
        "lotNumber": "005677",
        "serialNumber": "2069700001",
        "modelNumber": "BX-0007",
        "partNumber": "35467886",
        "deviceName": [
          {
            "name": "BoltX",
            "type": "model-name"
          }
        ],
        "safety": [
          {
            "coding": [
              {
                "code": "C106038",
                "system": "urn:oid:2.16.840.1.113883.3.26.1.1",
                "display": "Not Made with Natural Rubber Latex"
              }
            ]
          },
          {
            "coding": [
              {
                "code": "C113844",
                "system": "urn:oid:2.16.840.1.113883.3.26.1.1",
                "display": "Labeling does not contain MRI Safety Information"
              }
            ]
          }
        ],
        "note": [
          {
            "text": "Example device comment"
          }
        ]
      },
      "search": {
        "mode": "match"
      },
      "fullUrl": "urn:uuid:ed094d3e-67e6-5f13-a5e4-211914682e43"
    }
  ]
}
```

### 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."
      }
    }
  ]
}
```
