# Blood supply card

> Canonical HTML: https://screenrig.ai/docs/cards/blood-supply/

Blood-type inventory levels: eight types as filling bags, and who is needed most.

Category: Health. Tags: Healthcare, Charts and gauges, Numbers and metrics.

## Previews

![Blood supply](/cards/blood-supply/v1/screenshots/canvas-bloom.webp?sha=140a29117c5656a5a478cb35a1d880ac8e54d2da303ab95fec778c2098325a06)

Canvas

![Blood supply](/cards/blood-supply/v1/screenshots/corner-bloom.webp?sha=b3646699dcabdd0f84d9ae66674b8cfa373338e473fc7bbf2b9f099915e1732b)

Corner

![Blood supply](/cards/blood-supply/v1/screenshots/chip-bloom.webp?sha=d82642ea268914fcb818836a76e7b0f58942418a8bd150d46555517a940fc9a4)

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

This card uses its configured properties and live card data.

Shows stock levels by blood type only; never donor names, appointments or patient information.

## 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 | `"Blood supply"` | maxLength: `40` |  |
| `targetDays` | number | `6` | minimum: `0.5`; maximum: `30` | Days of supply that count as the full target when only days are given. |
| `criticalBelow` | number | `25` | minimum: `1`; maximum: `100` | Below this percent of target a type is critical. |
| `lowBelow` | number | `50` | minimum: `1`; maximum: `100` | Below this percent of target a type is low. |
| `staleMinutes` | integer | `1440` | minimum: `1`; maximum: `20160` | Levels older than this show how long ago they were updated. |

### Dynamic properties

| Name | Type | Default | Values and limits | Description |
| --- | --- | --- | --- | --- |
| `updatedAt` | string | `""` | maxLength: `40` | When the levels were last updated, as an ISO 8601 instant. Empty shows no age. |
| `types` | array | `[]` | minItems: `0`; maxItems: `8` | Blood types and their levels. A type left out shows No data. |
| `types[].type` | string |  | minLength: `1`; maxLength: `16`; Required | A, B, AB or O with + or - (O-, AB pos, A negative). |
| `types[].status` | string | `""` | `"critical"`, `"low"`, `"adequate"`, `"good"`, `""` | Overrides the status worked out from percent or days. |
| `types[].percent` | number, null | `null` | minimum: `0`; maximum: `300` | Stock as a percentage of the target. |
| `types[].days` | number, null | `null` | minimum: `0`; maximum: `99` | Days of supply on hand. |
| `appeal` | string | `""` | maxLength: `140` | A line under the board, such as how to book a donation. |

## 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": "blood-supply",
  "primitive": "card",
  "card": "blood-supply",
  "major": 1,
  "params": {
    "theme": "neomustard"
  },
  "rect": {
    "x": 0,
    "y": 0,
    "width": 1920,
    "height": 1080
  },
  "layer": 0,
  "content_fit": "fill",
  "data": "blood-supply-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/blood-supply-main" \
  --header "Authorization: Bearer $SCREENRIG_TOKEN" \
  --header "ScreenRig-Project: $SCREENRIG_PROJECT" \
  --header "Content-Type: application/json" \
  --data '{"document":{"updatedAt":"","types":[],"appeal":""}}'
```
