# DHAKA dehydration score (Levine)

DHAKA

Status: LIVE
Price: $0.005 USDC
`GET /api/calc/dhaka`
HTML: https://magentlab.com/docs/dhaka
Markdown: https://magentlab.com/docs/dhaka.md

Not a medical device. Not a diagnosis, dose, or listing recommendation.

## What it computes

Sum four caller-assigned Levine 2015 DHAKA Table 3 items and return the published total (max 12) and dehydration band (no, some, or severe).

## When to use

When an agent has already assigned Levine 2015 Table 3 general appearance, respirations, skin pinch, and tears and needs the published DHAKA Dehydration Score total and band, not a WHO IMCI algorithm, fluids order, or the DHAKA Tree.

## When not to use

- Not a medical device and not a WHO IMCI algorithm clone. This is the empirically derived Levine 2015 DHAKA Dehydration Score (Table 3), not the DHAKA Tree / recursive partitioning model.
- Each of the four items is caller-assigned. magent does not examine the child or order fluids.
- Derived in children younger than 5 years with acute diarrhea. Age is not a score item and is not required.
- Table 3 bands only: no_dehydration 0–1, some_dehydration 2–3, severe_dehydration ≥4. Respirations have only Normal and Deep (no very-deep cell).

## Formula

```
DHAKA = general_appearance (normal 0, restless_irritable 2, lethargic_unconscious 4) + respirations (normal 0, deep 2) + skin_pinch (normal 0, slow 2, very_slow 4) + tears (normal 0, decreased 1, absent 2); Levine 2015 Table 3; max 12
```

## Citation

[Empirically Derived Dehydration Scoring and Decision Tree Models for Children With Diarrhea: Assessment and Internal Validation in a Prospective Cohort Study in Dhaka, Bangladesh](https://doi.org/10.9745/GHSP-D-15-00097)
Levine AC, Glavis-Bloom J, Modi P, Nasrin S, Rege S, Chu C, Schmid CH, Alam NH
Glob Health Sci Pract. 2015;3(3):405-418
DOI: [10.9745/GHSP-D-15-00097](https://doi.org/10.9745/GHSP-D-15-00097)

## Worked example

### All items normal

Given: `general_appearance=normal, respirations=normal, skin_pinch=normal, tears=normal`

1. general_appearance normal 0 + respirations normal 0 + skin_pinch normal 0 + tears normal 0
2. Score = 0 (max 12); dhaka_band no_dehydration


### Deep respirations only

Given: `general_appearance=normal, respirations=deep, skin_pinch=normal, tears=normal`

1. respirations deep 2; other items 0
2. Score = 2 (max 12); dhaka_band some_dehydration


### Maximum Table 3 score

Given: `general_appearance=lethargic_unconscious, respirations=deep, skin_pinch=very_slow, tears=absent`

1. lethargic_unconscious 4 + deep 2 + very_slow 4 + absent 2
2. Score = 12 (max 12); dhaka_band severe_dehydration


## Also searched as

- dhaka score
- pediatric dehydration
- diarrhea dehydration
- DHAKA dehydration score
- Levine DHAKA
- DHAKA Table 3
- child diarrhea dehydration

## Parameters

- `general_appearance` (string, required): Caller-assigned Levine 2015 Table 3 general appearance: normal (0), restless_irritable (2), or lethargic_unconscious (4). magent does not examine the child.
- `respirations` (string, required): Caller-assigned Levine 2015 Table 3 respirations: normal (0) or deep (2). Table 3 has no very-deep cell. magent does not examine the child.
- `skin_pinch` (string, required): Caller-assigned Levine 2015 Table 3 skin pinch: normal (0), slow (2), or very_slow (4). magent does not examine the child.
- `tears` (string, required): Caller-assigned Levine 2015 Table 3 tears: normal (0), decreased (1), or absent (2). magent does not examine the child.

## Bulk (POST)

POST the same path with a JSON items array. The first item is the GET unit; each additional item is $0.002. Invalid items return HTTP 400 before settlement.

Method: `POST /api/calc/dhaka`
Max items: 25
Price: unit_amount + extra_item_amount * (n - 1) (unit 5000 atomic, extra 2000 atomic)
Status: PREVIEW

- 1 to 25 items. Each item uses the same keys as the GET query parameters.
- POST of 1 item costs the same as GET. Lists longer than 25: chunk into multiple POSTs. Extra items still execute; do not pad dummy rows.
- The first invalid item fails the whole request (index in the 400 JSON). You are not charged.
- HTTP 200 is {count, path, items}. Each items[i] is the GET 200 body for that row.
- Catalog misses (empty matches, found=false) stay paid 200s inside that slot.
- x402 resource URL is this path plus n and body_sha256. Browsers that prefer text/html get the same paywall as GET; Pay retries POST with the same items.

Example request:

```json
{
  "items": [
    {
      "general_appearance": "normal",
      "respirations": "normal",
      "skin_pinch": "normal",
      "tears": "normal"
    },
    {
      "general_appearance": "normal",
      "respirations": "normal",
      "skin_pinch": "normal",
      "tears": "normal"
    }
  ]
}
```

Human paywall (two-item fixture): https://api.magentlab.com/paywall/bulk/dhaka

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/dhaka",
  "items": [
    {
      "components": [
        {
          "value": "normal",
          "factor": "general_appearance",
          "points": 0,
          "present": true
        },
        {
          "value": "normal",
          "factor": "respirations",
          "points": 0,
          "present": true
        },
        {
          "value": "normal",
          "factor": "skin_pinch",
          "points": 0,
          "present": true
        },
        {
          "value": "normal",
          "factor": "tears",
          "points": 0,
          "present": true
        }
      ],
      "disclaimer": "Not a medical device. Deterministic published-formula or published-code output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
      "citation": {
        "authors": "Levine AC, Glavis-Bloom J, Modi P, Nasrin S, Rege S, Chu C, Schmid CH, Alam NH",
        "doi": "10.9745/GHSP-D-15-00097",
        "id": "levine-2015",
        "pmid": "26374802",
        "source": "Glob Health Sci Pract. 2015;3(3):405-418",
        "title": "Empirically Derived Dehydration Scoring and Decision Tree Models for Children With Diarrhea: Assessment and Internal Validation in a Prospective Cohort Study in Dhaka, Bangladesh"
      },
      "formula": "dhaka",
      "formula_expression": "DHAKA = general_appearance (normal 0, restless_irritable 2, lethargic_unconscious 4) + respirations (normal 0, deep 2) + skin_pinch (normal 0, slow 2, very_slow 4) + tears (normal 0, decreased 1, absent 2); Levine 2015 Table 3; max 12",
      "max_score": 12,
      "score": 0,
      "dhaka_band": "no_dehydration",
      "general_appearance": "normal",
      "respirations": "normal",
      "skin_pinch": "normal",
      "tears": "normal"
    },
    {
      "components": [
        {
          "value": "normal",
          "factor": "general_appearance",
          "points": 0,
          "present": true
        },
        {
          "value": "normal",
          "factor": "respirations",
          "points": 0,
          "present": true
        },
        {
          "value": "normal",
          "factor": "skin_pinch",
          "points": 0,
          "present": true
        },
        {
          "value": "normal",
          "factor": "tears",
          "points": 0,
          "present": true
        }
      ],
      "disclaimer": "Not a medical device. Deterministic published-formula or published-code output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
      "citation": {
        "authors": "Levine AC, Glavis-Bloom J, Modi P, Nasrin S, Rege S, Chu C, Schmid CH, Alam NH",
        "doi": "10.9745/GHSP-D-15-00097",
        "id": "levine-2015",
        "pmid": "26374802",
        "source": "Glob Health Sci Pract. 2015;3(3):405-418",
        "title": "Empirically Derived Dehydration Scoring and Decision Tree Models for Children With Diarrhea: Assessment and Internal Validation in a Prospective Cohort Study in Dhaka, Bangladesh"
      },
      "formula": "dhaka",
      "formula_expression": "DHAKA = general_appearance (normal 0, restless_irritable 2, lethargic_unconscious 4) + respirations (normal 0, deep 2) + skin_pinch (normal 0, slow 2, very_slow 4) + tears (normal 0, decreased 1, absent 2); Levine 2015 Table 3; max 12",
      "max_score": 12,
      "score": 0,
      "dhaka_band": "no_dehydration",
      "general_appearance": "normal",
      "respirations": "normal",
      "skin_pinch": "normal",
      "tears": "normal"
    }
  ]
}
```

## Response fields

- `formula` (string): dhaka
- `formula_expression` (string): Exact expression used
- `score` (integer): DHAKA Table 3 points 0-12
- `max_score` (integer): Always 12
- `dhaka_band` (string): Levine 2015 Table 3 category: no_dehydration (0-1), some_dehydration (2-3), or severe_dehydration (≥4). A score band, not a fluids order and not the DHAKA Tree.
- `general_appearance` (string): Caller-assigned token used: normal, restless_irritable, or lethargic_unconscious
- `respirations` (string): Caller-assigned token used: normal or deep
- `skin_pinch` (string): Caller-assigned token used: normal, slow, or very_slow
- `tears` (string): Caller-assigned token used: normal, decreased, or absent
- `components` (array): Per-item caller-assigned points
- `citation` (object): Levine et al. Glob Health Sci Pract 2015 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "value": "normal",
      "factor": "general_appearance",
      "points": 0,
      "present": true
    },
    {
      "value": "normal",
      "factor": "respirations",
      "points": 0,
      "present": true
    },
    {
      "value": "normal",
      "factor": "skin_pinch",
      "points": 0,
      "present": true
    },
    {
      "value": "normal",
      "factor": "tears",
      "points": 0,
      "present": true
    }
  ],
  "disclaimer": "Not a medical device. Deterministic published-formula or published-code output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
  "citation": {
    "authors": "Levine AC, Glavis-Bloom J, Modi P, Nasrin S, Rege S, Chu C, Schmid CH, Alam NH",
    "doi": "10.9745/GHSP-D-15-00097",
    "id": "levine-2015",
    "pmid": "26374802",
    "source": "Glob Health Sci Pract. 2015;3(3):405-418",
    "title": "Empirically Derived Dehydration Scoring and Decision Tree Models for Children With Diarrhea: Assessment and Internal Validation in a Prospective Cohort Study in Dhaka, Bangladesh"
  },
  "formula": "dhaka",
  "formula_expression": "DHAKA = general_appearance (normal 0, restless_irritable 2, lethargic_unconscious 4) + respirations (normal 0, deep 2) + skin_pinch (normal 0, slow 2, very_slow 4) + tears (normal 0, decreased 1, absent 2); Levine 2015 Table 3; max 12",
  "max_score": 12,
  "score": 0,
  "dhaka_band": "no_dehydration",
  "general_appearance": "normal",
  "respirations": "normal",
  "skin_pinch": "normal",
  "tears": "normal"
}
```

## Errors

- HTTP 400 `invalid_dhaka_appearance`: general_appearance must be normal, restless_irritable, or lethargic_unconscious (Levine 2015 DHAKA Table 3). Returned before settlement; you are not charged.
- HTTP 400 `invalid_dhaka_respirations`: respirations must be normal or deep (Levine 2015 DHAKA Table 3). Returned before settlement; you are not charged.
- HTTP 400 `invalid_dhaka_skin_pinch`: skin_pinch must be normal, slow, or very_slow (Levine 2015 DHAKA Table 3). Returned before settlement; you are not charged.
- HTTP 400 `invalid_dhaka_tears`: tears must be normal, decreased, or absent (Levine 2015 DHAKA Table 3). Returned before settlement; you are not charged.
- HTTP 400 `invalid_items`: POST body must be a JSON object with only an items array Returned before settlement; you are not charged.
- HTTP 400 `invalid_item_count`: items must be an array of 1 to 25 objects Returned before settlement; you are not charged.
- HTTP 400 `invalid_item`: each items entry must be a JSON object Returned before settlement; you are not charged.

Shared HTTP 402 and 503: https://magentlab.com/docs/payments

## Related tools

- [Westley croup](https://magentlab.com/docs/westley-croup) — Sum the Westley 1978 croup clinical score from caller-assigned consciousness, cyanosis, stridor, air entry, and retractions (maximum 17).

## Payment

Unpaid requests return HTTP 402 even if query parameters or POST items are missing or invalid, so CDP and agents can index the path. After a PAYMENT-SIGNATURE, invalid params return HTTP 400 JSON before settlement. magent does not charge. Fix the params, then request a new 402 quote for that complete URL. Catalog misses (empty matches, found=false) are valid paid 200s.

- GET the tool with Accept: application/json (do not send Accept: text/html unless you want the human paywall).
- HTTP 402 means you have not paid. Decode the base64 PAYMENT-REQUIRED header. HTTP 503 is not a new quote.
- Sign accepts[0] (exact, EIP-3009) with validBefore = now + maxTimeoutSeconds (600 seconds), or accepts[1] (batch-settlement deposit/voucher) on product GET. Ping and POST {items} stay exact. Magent retries transient facilitator 429/5xx before answering.
- Retry the same URL with PAYMENT-SIGNATURE (base64 JSON of accepted and payload). Magent attaches canonical extensions.bazaar on CDP verify/settle; echoing 402 bazaar is optional.
- Success is HTTP 200 JSON plus PAYMENT-RESPONSE. exact settles before the tool. batch-settlement verifies (and deposit-settles) before the tool and commits the charge after HTTP 2xx. HTTP 503: retry the same PAYMENT-SIGNATURE. Mint a new exact nonce only after a new HTTP 402.

- offered `exact` on eip155:8453: Fixed-price USDC on Base. The buyer authorizes the advertised amount (EIP-3009). magent settles before the tool runs (paymentFlow upfront). extra.assetTransferMethod=eip3009 extra.paymentFlow=upfront.
- offered `batch-settlement` on eip155:8453: Payment-channel vouchers claimed later in batches. Exact stays accepts[0]. Same-path POST {items} is still exact. extra.assetTransferMethod=eip3009 extra.paymentFlow=authorization.

- not offered `upto`: Not offered. Usage-based: buyer authorizes a ceiling, seller settles the actual amount after work. Reserved for a future metered tool. Not for current calculators or code search.

Same-path POST {items} is still scheme exact: one EIP-3009 authorization for GET unit plus $0.002 per extra item. That is not x402 batch-settlement (payment channels / vouchers).

Shared HTTP 402 and 503 table: https://magentlab.com/docs/payments

Stdio MCP (one process per host): https://magentlab.com/docs/mcp

## Guarantees

- HTTP 402 is unpaid, including a missing query. After PAYMENT-SIGNATURE, invalid parameters return HTTP 400 before settlement. You are not charged. HTTP 402 never includes the tool JSON.
- exact: settlement finishes before the tool (paymentFlow upfront). batch-settlement: verify/deposit before the tool; chargedCumulativeAmount commits after HTTP 2xx. Uncertain or failed settlement fails closed (HTTP 503). Retry the same PAYMENT-SIGNATURE.
- HTTP 402 is unpaid only. Do not sign a second authorization because of a 503.
- Execution is timeout-bounded and concurrency-capped.
- Calculator inputs are stored encrypted for allowlisted operators (Magent Console). They are not in public logs, SSH lookups, catalog, or rollups. Request logs store path without query.
