# compareLabelVersions

**Identifier:** `dailymed_compareLabelVersions`

**Provider:** [DailyMed](https://kirha.com/providers/dailymed.md)

Show what changed in a DailyMed drug label between two versions: sections added, removed or modified, with the added and removed sentences. Give sinceDate to compare the label in force at that date with the current one ('what changed in the label since X'), or explicit versions from getLabelHistory. Defaults to the latest change (previous version vs current). Sentence-level diff of the SPL text; tables are flattened.

## Run it with the CLI

```bash
kirha tools run dailymed_compareLabelVersions \
  --input '{
    "setId": "<setId>"
  }'
```

`--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": "dailymed_compareLabelVersions",
  "input": {
    "setId": "<setId>"
  }
}'
```

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": {
    "fromVersion": {
      "description": "Overrides sinceDate",
      "maximum": 9007199254740991,
      "minimum": 1,
      "type": "integer"
    },
    "setId": {
      "description": "SPL set ID from searchLabels or openfda-mcp searchDrugLabels",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      "type": "string"
    },
    "sinceDate": {
      "description": "YYYY-MM-DD; baseline = the version in force before this date",
      "format": "date",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
      "type": "string"
    },
    "toVersion": {
      "description": "Defaults to the current version",
      "maximum": 9007199254740991,
      "minimum": 1,
      "type": "integer"
    }
  },
  "required": [
    "setId"
  ],
  "type": "object"
}
```

## Output schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "changedSectionCount": {
      "type": "number"
    },
    "changes": {
      "description": "Section label without numbering; at most 15 sentences per side, counts give the full size",
      "items": {
        "additionalProperties": false,
        "properties": {
          "addedCount": {
            "type": "number"
          },
          "addedText": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "change": {
            "enum": [
              "added",
              "removed",
              "modified"
            ],
            "type": "string"
          },
          "removedCount": {
            "type": "number"
          },
          "removedText": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "section": {
            "type": "string"
          }
        },
        "required": [
          "section",
          "change",
          "addedText",
          "removedText",
          "addedCount",
          "removedCount"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "context": {
      "type": "string"
    },
    "fromVersion": {
      "additionalProperties": false,
      "properties": {
        "publishedDate": {
          "type": "string"
        },
        "version": {
          "type": "number"
        }
      },
      "required": [
        "version",
        "publishedDate"
      ],
      "type": "object"
    },
    "setId": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "toVersion": {
      "additionalProperties": false,
      "properties": {
        "publishedDate": {
          "type": "string"
        },
        "version": {
          "type": "number"
        }
      },
      "required": [
        "version",
        "publishedDate"
      ],
      "type": "object"
    },
    "versionsPublishedInBetween": {
      "description": "Versions published after fromVersion up to toVersion",
      "type": "number"
    }
  },
  "required": [
    "context",
    "setId",
    "fromVersion",
    "toVersion",
    "versionsPublishedInBetween",
    "changedSectionCount",
    "changes"
  ],
  "type": "object"
}
```

## Related tools

Other DailyMed tools that this tool refers to, or that refer to it.

- [`getLabelHistory`](https://kirha.com/providers/dailymed/getLabelHistory.md)
- [`searchLabels`](https://kirha.com/providers/dailymed/searchLabels.md)

-----

[All DailyMed tools](https://kirha.com/providers/dailymed.md) · [< Back to tools list](https://kirha.com/tools.md)