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" --name MyForm \
  | sdc item add --link-id 1 --text "Name" --type string \
  | sdc item add --link-id 2 --text "Age" --type integer \
  | sdc validate

--name sets an optional computer-friendly identifier (Questionnaire.name), distinct from --title (the human-readable label). Use it when you need a stable, machine-readable name for programmatic look-up. Both sdc init and sdc meta accept this flag.

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

Feedback & Issues

Found a bug or have a feature idea? Open an issue on GitHub:

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.5.0.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.5.0-py3-none-any.whl (117.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fhir_sdc_tools-0.5.0.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.5.0.tar.gz
Algorithm Hash digest
SHA256 918757e351e36cf57b77daf5eb34e949f703005f6dd7d8b75c2e1f04fc100fb4
MD5 a5249877f1c1248ab00babb2f4232229
BLAKE2b-256 818007617fd02323025294a7af4fa318d4d4b9c9505f898b5691abb96ad90d43

See more details on using hashes here.

Provenance

The following attestation bundles were made for fhir_sdc_tools-0.5.0.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.5.0-py3-none-any.whl.

File metadata

  • Download URL: fhir_sdc_tools-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 117.2 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.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 85042827fd40111b331f0c2c4a0ab995b316afe2fb69f9e2df4f759d0fd65ab7
MD5 b30709cd176a9e07a685505d57dd647a
BLAKE2b-256 dcc1685819dc5bc5eff060fd273b31500d38ca944b88cc11bce521eda3452697

See more details on using hashes here.

Provenance

The following attestation bundles were made for fhir_sdc_tools-0.5.0-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