# Drug alerts card

> Canonical HTML: https://screenrig.ai/docs/cards/drug-alerts/

Drug recalls and shortages, most serious first: the product, the reason, the recall class and when it was issued.

Category: Health. Tags: Alerts and status, Healthcare.

## Previews

![Drug alerts](/cards/drug-alerts/v1/screenshots/canvas-bloom.webp?sha=dd4dc0de21768b743410ced9441b9ee94464a16a59d9468f464e3daa10d99422)

Canvas

![Drug alerts](/cards/drug-alerts/v1/screenshots/corner-bloom.webp?sha=a0be3e4b5aad81d94b36a33df02ecdb408eaa8daa15b44c148d70504486563b3)

Corner

![Drug alerts](/cards/drug-alerts/v1/screenshots/chip-bloom.webp?sha=aa067d616a4d96ac488aa46f6f049546068dd8c79db9c7d615c5acaf91bcc72b)

Chip

## Views and forms

Views: canvas, corner, chip. Canvas forms: landscape, portrait, square, strip.

[Card views, themes and publishing](/docs/cards/). [Browse the gallery](/apps/#cards).

## Data and privacy

Feed: `screenrig.drugalerts/v1`.

Feed documents carry source attribution. The Player supplies the feed to the card.

## Properties

For theme, background, accent and position, see [Common properties](/docs/cards/#common-properties).

Set static properties in `params`. Bind `data` to a project card data key for live values; that document holds only dynamic properties. Without a data key, put the complete configuration in `params`. Nested rows describe the contents of their parent property.

### Static properties

| Name | Type | Default | Values and limits | Description |
| --- | --- | --- | --- | --- |
| `title` | string | `"Drug alerts"` | maxLength: `40` |  |
| `show` | string | `"all"` | `"all"`, `"recalls"`, `"shortages"` | Which alerts the board lists. |
| `maxAgeDays` | integer | `90` | minimum: `1`; maximum: `730` | Alerts issued longer ago than this are left out. |
| `staleMinutes` | integer | `1440` | minimum: `1`; maximum: `10080` | A feed older than this shows how long ago it updated. |
| `timeZone` | string, null | `null` |  | IANA zone; null uses the screen's zone. |

### Dynamic properties

| Name | Type | Default | Values and limits | Description |
| --- | --- | --- | --- | --- |
| `alerts` | array | `[]` | minItems: `0`; maxItems: `40` | Alerts, the same document as the screenrig.drugalerts/v1 feed's `alerts`. The feed wins when present. |
| `alerts[].kind` | string |  | `"recall"`, `"shortage"`; Required |  |
| `alerts[].drug` | string |  | minLength: `1`; maxLength: `60`; Required |  |
| `alerts[].reason` | string | `""` | maxLength: `140` |  |
| `alerts[].class` | string | `""` | `"I"`, `"II"`, `"III"`, `""` | A recall's class, I the most serious. |
| `alerts[].agency` | string | `""` | maxLength: `24` | FDA, Health Canada. |
| `alerts[].issued` | string | `""` | maxLength: `32` | Date or ISO 8601 instant. |
| `alerts[].status` | string | `"ongoing"` | `"ongoing"`, `"resolved"` |  |
| `footnote` | string | `""` | maxLength: `140` |  |

## Canvas example

Add this item to a playlist page’s `primitives`. [Publish the playlist and assign a screen](/docs/cards/#publish-a-card-canvas).

```json
{
  "id": "drug-alerts",
  "primitive": "card",
  "card": "drug-alerts",
  "major": 1,
  "params": {
    "theme": "neomustard"
  },
  "rect": {
    "x": 0,
    "y": 0,
    "width": 1920,
    "height": 1080
  },
  "layer": 0,
  "content_fit": "fill",
  "data": "drug-alerts-main"
}
```

## Write live data

Create this document before showing the card, then replace it to update the screen without republishing. Use the same project as the playlist. Supply your API authorization through the environment; see [API authentication](/docs/authentication/).

```console
curl --request PUT "https://api.screenrig.ai/api/card-data/drug-alerts-main" \
  --header "Authorization: Bearer $SCREENRIG_TOKEN" \
  --header "ScreenRig-Project: $SCREENRIG_PROJECT" \
  --header "Content-Type: application/json" \
  --data '{"document":{"alerts":[],"footnote":""}}'
```
