RDC Interoperability Guide
1.4.0

Search DeviceDefinitions by ID

The client can search for multiple DeviceDefinition resources by their FHIR IDs in a single request. Because DeviceDefinition describes a device model rather than a device belonging to a specific patient, no data-sharing consent is required for any of the requested IDs.

The search can be performed either with a GET request or with a POST request.

Search using GET

The client provides a comma-separated list of FHIR IDs in the _id query parameter:

curl -sS "https://${server}/${basePath}/DeviceDefinition?_id=${device_definition_fhir_id_1},${device_definition_fhir_id_2}" \
  -H "client_id: ${client_id}" \
  -H "client_secret: ${client_secret}" \
  -H "org_id: ${org_id}" \
  -H "certificate: ${certificate}" | jq

Search using POST

Alternatively, the same search can be performed using a POST request with the parameters supplied as a URL-encoded form body:

curl -sS -X POST \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data "_id=${device_definition_fhir_id_1},${device_definition_fhir_id_2}" \
  "https://${server}/${basePath}/DeviceDefinition/_search" \
  -H "client_id: ${client_id}" \
  -H "client_secret: ${client_secret}" \
  -H "org_id: ${org_id}" \
  -H "certificate: ${certificate}" | jq

Constraints

  • The _id parameter is required. Omitting it results in a 400 Bad Request response.
  • Each ID in the list must match the FHIR ID format [A-Za-z0-9\-.]{1,64}. An invalid ID results in a 400 Bad Request response.
  • The maximum number of IDs that can be requested in a single call is 100. Exceeding this limit results in a 400 Bad Request response.

Response

The server responds with 200 OK and a FHIR R5 Bundle of type searchset. Each entry in the Bundle represents either a successfully retrieved device definition or an error for a specific requested ID:

  • Successful entries have search.mode set to match and contain a DeviceDefinition resource conforming to the Roche profile https://roche.com/fhir/iop/StructureDefinition/rdc-DeviceDefinition.
  • Error entries have search.mode set to outcome and contain an OperationOutcome resource with a description of the problem (e.g. the device definition was not found).

Example response:

{
  "resourceType": "Bundle",
  "type": "searchset",
  "link": [
    {
      "relation": "self",
      "url": "/fhir/r5/DeviceDefinition?_id=ed434a7c-8fd6-4382-ba7b-eccff3e6e07b,unknown-id"
    }
  ],
  "entry": [
    {
      "resource": {
        "resourceType": "DeviceDefinition",
        "id": "ed434a7c-8fd6-4382-ba7b-eccff3e6e07b",
        "meta": {
          "profile": [
            "https://roche.com/fhir/iop/StructureDefinition/rdc-DeviceDefinition"
          ]
        },
        "manufacturer": {
          "display": "Roche Diagnostics"
        },
        "deviceName": [
          {
            "name": "Accu-Chek Guide",
            "type": "registered-name"
          }
        ],
        "modelNumber": "2.0.0"
      },
      "search": {
        "mode": "match"
      }
    },
    {
      "resource": {
        "resourceType": "OperationOutcome",
        "issue": [
          {
            "severity": "error",
            "code": "not-found",
            "details": {
              "text": "Problem encountered with requested resource DeviceDefinition/unknown-id"
            }
          }
        ]
      },
      "search": {
        "mode": "outcome"
      }
    }
  ]
}

Error responses

Errors that apply to the request as a whole result in a non-200 HTTP status code:

Status Code Cause
400 Bad Request The _id parameter is missing, one of the provided IDs does not match the FHIR ID format, or more than 100 IDs were requested
500 Internal Server Error An unexpected server-side error occurred

Per-resource errors (device definition not found) are reported inline as OperationOutcome entries in the response Bundle rather than as a top-level HTTP error.

All error responses follow the FHIR OperationOutcome format described in Error Responses.