Skip to main content

Composable Python library and CLI for building FHIR SDC Questionnaires

Project description

fhir-sdc-tools

Composable Python library and CLI for building FHIR SDC Questionnaires, with an MCP server for interactive previews.

Quick start: Claude Code plugin

Install everything (MCP server + skill + CLI) as a plugin. Inside Claude Code:

/plugin marketplace add Tiro-health/fhir-sdc-tools
/plugin install fhir-sdc-tools

This gives you:

  • render-questionnaire MCP tool for interactive previews
  • sdc-builder skill that teaches Claude to build questionnaires using the Python API
  • sdc CLI for shell-based workflows

Quick start: Claude Desktop / claude.ai

Add to your Claude Desktop config (claude_desktop_config.json):

{
  "mcpServers": {
    "Tiro.health FHIR SDC tools": {
      "command": "uvx",
      "args": ["--from", "fhir-sdc-tools[mcp]", "fhir-sdc-mcp"]
    }
  }
}

Restart Claude Desktop. The render-questionnaire tool will appear in the tools menu.

Prerequisite: uv must be installed.

Quick start: Claude Code

claude mcp add "Tiro.health FHIR SDC tools" -- uvx --from "fhir-sdc-tools[mcp]" fhir-sdc-mcp

Python library

pip install fhir-sdc-tools
from sdc import (
    Questionnaire, QuestionnaireItem, QuestionnaireItemType,
    FhirVersion, add_item, set_fhir_version, validate,
)

q = Questionnaire(url="http://example.org/intake", title="Intake Form")
q = set_fhir_version(q, FhirVersion.R5)
q = add_item(q, QuestionnaireItem(link_id="name", text="Full name", type=QuestionnaireItemType.STRING))
q = add_item(q, QuestionnaireItem(link_id="dob", text="Date of birth", type=QuestionnaireItemType.DATE))

warnings = validate(q)
print(q.model_dump_json(by_alias=True, exclude_none=True, indent=2))

CLI

pip install fhir-sdc-tools

sdc init --url http://example.org/q1 --title "My Form" \
  | sdc item add --link-id 1 --text "Name" --type string \
  | sdc item add --link-id 2 --text "Age" --type integer \
  | sdc validate

Extensions (SDC shortcuts and custom URLs):

sdc init --url http://example.org/q1 --title "My Form" \
  | sdc item add --link-id 1 --text "Name" --type string \
  | sdc extension add custom --link-id 1 \
      --url "http://example.org/ext" --value-string "hello" \
  | sdc validate

Install options

Install Gets you
pip install fhir-sdc-tools Python library + sdc CLI
pip install fhir-sdc-tools[mcp] Above + fhir-sdc-mcp server with render-questionnaire tool

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fhir_sdc_tools-0.4.1.tar.gz (1.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fhir_sdc_tools-0.4.1-py3-none-any.whl (110.5 kB view details)

Uploaded Python 3

File details

Details for the file fhir_sdc_tools-0.4.1.tar.gz.

File metadata

  • Download URL: fhir_sdc_tools-0.4.1.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fhir_sdc_tools-0.4.1.tar.gz
Algorithm Hash digest
SHA256 818eb8f62e6562b9a34c9c6451919edd588ae2b416152b8f8604751b23ee0cb7
MD5 9a97d10b02a464b61dbdffd694ca465a
BLAKE2b-256 4675221205fd72153fac278de03281b9cf1f88c8095e6b88072385ddc3ade759

See more details on using hashes here.

Provenance

The following attestation bundles were made for fhir_sdc_tools-0.4.1.tar.gz:

Publisher: publish.yml on Tiro-health/fhir-sdc-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fhir_sdc_tools-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: fhir_sdc_tools-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 110.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fhir_sdc_tools-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e8b25560b08a1dc42c61d2c36c633ca059e55a531d9cffad24db83f1cd547691
MD5 a2009275be9b502a2a6abac0ff96f2e3
BLAKE2b-256 de55dfb37a4d4f14c010a1aa20ff1872dc8948f6148519fb6499769bf33d45b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for fhir_sdc_tools-0.4.1-py3-none-any.whl:

Publisher: publish.yml on Tiro-health/fhir-sdc-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page