ConceptsAvailability Task

Availability Task

Purpose

An Availability Task is a standardised request triggered by a researcher asking for a count of individuals matching a defined cohort specification. The task includes metadata such as the collection ID, and task ID, along with the cohort definition expressed as structured rules.

Upon retrieving the task, Bunny securely queries the OMOP dataset within the Data Custodian’s environment. The result is a numerical count of matching records, subject to disclosure controls.

💡

No raw or identifiable data leaves the system; only the count is returned.

Example Input Schema

An example Availability task:

This task uses one Rule, to instruct Bunny to query the OMOP condition_occurrence table for individuals who have a recorded condition concept ID equal to 4323688, which represents a specific clinical condition (“Cough at rest”).

The time field specifies a time constraint:

1|:TIME:M indicates the condition must have occurred at least one month ago (i.e. the record’s start date is at least one month before the time of query execution).

Only individuals with at least one such condition occurrence meeting this time constraint will match this rule.

{
  "task_id" : "job-2025-02-14-09:03:27-RQ-87808b58-b878-4b59-839f-3537727c64a6",
  "project" : "project_id",
  "owner" : "user1",
  "cohort" : {
    "groups": [
      {
        "rules": [
          {
            "varname": "OMOP",
            "varcat": "Condition",
            "type": "TEXT",
            "oper": "=",
            "value": "4323688",
            "time": "1|:TIME:M"
          }
        ],
        "rules_oper": "OR"
      }
    ],
    "groups_oper": "AND"
  },
  "collection": "collection_id",
  "protocol_version" : "v2",
  "char_salt" : "salt",
  "uuid" : "9541374b-8b97-41a4-9717-4a2a25f437ae"
}

Response Schema

Bunny returns a structured JSON response upon completing an Availability Query.

The key field is the queryResult.count, the number of individuals in the dataset who met the specified criteria.

{
  "status": "ok",
  "protocolVersion": "v2",
  "uuid": "9541374b-8b97-41a4-9717-4a2a25f437ae",
  "queryResult": {
    "count": 10,
    "datasetCount": 0,
    "files": []
  },
  "message": "",
  "collection_id": "collection_id"
}
Last updated on