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

Uploaded Python 3

File details

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

File metadata

  • Download URL: fhir_sdc_tools-0.4.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.4.0.tar.gz
Algorithm Hash digest
SHA256 df8f18cdce6649844e53c92816fb4d666d0f1efb79dd2f6ce8ab0c557627cdeb
MD5 33d52a1618592070331420385f452797
BLAKE2b-256 37b5eb280cd75993b600c3cfda75222941076384c3b1c7e4d232eac07c8e90a5

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: fhir_sdc_tools-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 110.4 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 749b91313f7fcb9752eb19f9cbd7dc8b56a7b540b8312b5e11347b85404748be
MD5 41dbe4b10c56848685de7f7deb59e319
BLAKE2b-256 293356cb8fa3c32312ff0cd3855fce38be039e24b503347b7e00361378f9674a

See more details on using hashes here.

Provenance

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