# getSubstanceCases

**Identifier:** `mhraidap_getSubstanceCases`

**Provider:** [MHRA Yellow Card iDAP](https://kirha.com/providers/mhraidap.md)

UK case-level reporting profile for one substance from MHRA Yellow Card iDAP: totals and demographic, seriousness, reporter and route breakdowns. Resolve the substance name with searchSubstances first.

## Run it with the CLI

```bash
kirha tools run mhraidap_getSubstanceCases \
  --input '{
    "substanceName": "PARACETAMOL"
  }'
```

`--input` takes a JSON object that matches the input schema. Pass `--input -` to read it from stdin.

## Call it over HTTP

```bash
curl https://api.kirha.com/tools/v1/execute \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: **********' \
  --data '{
  "tool_name": "mhraidap_getSubstanceCases",
  "input": {
    "substanceName": "PARACETAMOL"
  }
}'
```

Replace the stars with an API key from https://app.kirha.com/api-keys.

## Input schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "substanceName": {
      "description": "From searchSubstances, e.g. PARACETAMOL",
      "type": "string"
    }
  },
  "required": [
    "substanceName"
  ],
  "type": "object"
}
```

## Output schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "asOfDate": {
      "type": "string"
    },
    "byAgeBand": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "cases": {
            "maximum": 9007199254740991,
            "minimum": 0,
            "type": "integer"
          },
          "label": {
            "type": "string"
          }
        },
        "required": [
          "label",
          "cases"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "byReceivedYear": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "cases": {
            "maximum": 9007199254740991,
            "minimum": 0,
            "type": "integer"
          },
          "label": {
            "type": "string"
          }
        },
        "required": [
          "label",
          "cases"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "byReporter": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "cases": {
            "maximum": 9007199254740991,
            "minimum": 0,
            "type": "integer"
          },
          "label": {
            "type": "string"
          }
        },
        "required": [
          "label",
          "cases"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "byRoute": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "cases": {
            "maximum": 9007199254740991,
            "minimum": 0,
            "type": "integer"
          },
          "label": {
            "type": "string"
          }
        },
        "required": [
          "label",
          "cases"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "bySex": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "cases": {
            "maximum": 9007199254740991,
            "minimum": 0,
            "type": "integer"
          },
          "label": {
            "type": "string"
          }
        },
        "required": [
          "label",
          "cases"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "context": {
      "type": "string"
    },
    "fatalCases": {
      "maximum": 9007199254740991,
      "minimum": 0,
      "type": "integer"
    },
    "meddraVersion": {
      "type": "string"
    },
    "seriousCases": {
      "description": "Including fatal",
      "maximum": 9007199254740991,
      "minimum": 0,
      "type": "integer"
    },
    "sourceUrl": {
      "type": "string"
    },
    "substanceName": {
      "type": "string"
    },
    "totalCases": {
      "description": "Distinct reports",
      "maximum": 9007199254740991,
      "minimum": 0,
      "type": "integer"
    },
    "tradeProductCount": {
      "maximum": 9007199254740991,
      "minimum": 0,
      "type": "integer"
    },
    "tradeProducts": {
      "description": "First 25",
      "items": {
        "type": "string"
      },
      "type": "array"
    }
  },
  "required": [
    "context",
    "substanceName",
    "totalCases",
    "fatalCases",
    "seriousCases",
    "meddraVersion",
    "asOfDate",
    "bySex",
    "byAgeBand",
    "byReceivedYear",
    "byReporter",
    "byRoute",
    "tradeProducts",
    "tradeProductCount",
    "sourceUrl"
  ],
  "type": "object"
}
```

## Related tools

Other MHRA Yellow Card iDAP tools that this tool refers to, or that refer to it.

- [`searchSubstances`](https://kirha.com/providers/mhraidap/searchSubstances.md)

-----

[All MHRA Yellow Card iDAP tools](https://kirha.com/providers/mhraidap.md) · [< Back to tools list](https://kirha.com/tools.md)