How cmsgov/bluebutton-web-server works
Blue Button Web Server is a Django data provider that lets beneficiaries securely share Medicare claims data with third-party applications. The documented flow is beneficiary authentication through Medicare.gov, OAuth2 authorization and permission-grant validation, then versioned FHIR API access backed by an external FHIR server. The graph also preserves application registration/discovery, identity crosswalks, and operational logging. Internal edges are limited to relationships visible in excerpts or SOURCE INDEX references; several route-to-view and runtime configuration links are not shown.
Main entry points: generic.py FHIR Resource Views · authorization.py OAuth Authorization · forms.py OAuth Forms · models.py OAuth Models
Components 26
Identity and Grants
- Accounts and Profiles
apps/accounts/models.py - Medicare Callback
apps/mymedicare_cb/authorization.py - Access Grants
apps/authorization/models.py - Grant Permissions
apps/authorization/permissions.py - Beneficiary Crosswalk
apps/fhir/bluebutton/models.py
OAuth Applications
- OAuth Authorization
apps/dot_ext/views/authorization.py - OAuth Forms
apps/dot_ext/forms.py - App Registration
apps/dot_ext/views/application.py - OAuth Models
apps/dot_ext/models.py - Scopes
apps/dot_ext/scopes.py - Capabilities
apps/capabilities/models.py - Capability Permissions
apps/capabilities/permissions.py - OAuth Token Flow
apps/pkce/oauth2_server.py - Public App Discovery
apps/wellknown/views/application.py
FHIR Data API
- FHIR Resource Views
apps/fhir/bluebutton/views/generic.py - FHIR Permissions
apps/fhir/bluebutton/permissions.py - FHIR Search
apps/fhir/bluebutton/views/search.py - FHIR Server Authentication
apps/fhir/server/authentication.py - API Versions
apps/versions.py
External Integrations
- Medicare.gov
- Backend FHIR
Logging and Operations
- Request Logging
apps/logging/request_logger.py - ITS Log Handler
apps/logging/its_log_handler.py
Other components
- Beneficiary
- Third-Party App
- Django Server
Connections 26
- Beneficiary → Medicare Callback: signs in
- Medicare Callback → Medicare.gov: authenticates with
- Third-Party App → OAuth Authorization: requests authorization
- OAuth Authorization → Grant Permissions: validates grants
- OAuth Authorization → OAuth Forms: uses forms
- OAuth Forms → OAuth Models: validates application
apps/dot_ext/forms.py - OAuth Forms → Scopes: uses scopes
apps/dot_ext/forms.py - OAuth Forms → Capabilities: checks capabilities
apps/dot_ext/forms.py - App Registration → OAuth Forms: registers applications
apps/dot_ext/views/application.py - App Registration → OAuth Models: manages applications
- OAuth Models → Capabilities: references capabilities
apps/dot_ext/models.py - OAuth Authorization → OAuth Token Flow: issues OAuth tokens
- Beneficiary → FHIR Resource Views: requests claims data
- Third-Party App → FHIR Resource Views: requests claims data
- FHIR Resource Views → FHIR Permissions: checks access
- FHIR Search → FHIR Resource Views: delegates resource handling
apps/fhir/bluebutton/views/search.py - FHIR Search → Grant Permissions: checks grant access
apps/fhir/bluebutton/views/search.py - FHIR Search → Capability Permissions: checks capabilities
apps/fhir/bluebutton/views/search.py - FHIR Permissions → Capabilities: checks capability records
apps/fhir/bluebutton/permissions.py - FHIR Server Authentication → Backend FHIR: queries patient
apps/fhir/server/authentication.py - FHIR Resource Views → Backend FHIR: fetches FHIR data
- FHIR Resource Views → Beneficiary Crosswalk: resolves beneficiary IDs
- FHIR Resource Views → API Versions: supports API versions
- Public App Discovery → OAuth Models: lists applications
apps/wellknown/views/application.py - OAuth Authorization → Request Logging: records requests
- Request Logging → ITS Log Handler: formats and posts logs