FHIR Complete

Staff Login

Staff authentication flow via SMART on FHIR

Authenticate

POST /smart-auth/authenticate
Content-Type: application/json

Request

{
  "email": "doctor@hospital.com",
  "password": "your-password"
}

Response — Single Organization

If the user belongs to only one organization, a full token is returned immediately:

{
  "access_token": "eyJhbGciOiJFUzI1NiIs...",
  "token_type": "bearer",
  "expires_in": 86400,
  "user_id": "uuid",
  "email": "doctor@hospital.com",
  "org_id": "org-uuid",
  "org_name": "City Hospital",
  "roles": ["doctor"],
  "role": "doctor",
  "privileges": ["view_patients", "manage_encounters"],
  "practitioner": "practitioner-uuid",
  "practitioner_id": "ZCT_doctor_001",
  "practitioner_reference": "Practitioner/ZCT_doctor_001",
  "is_national": false
}

Response — Multiple Organizations

If the user belongs to multiple organizations, returns an org list:

{
  "requires_org_selection": true,
  "organizations": [
    {
      "org_id": "uuid-1",
      "org_name": "City Hospital",
      "role": "doctor",
      "roles": ["doctor"],
      "is_national": false
    },
    {
      "org_id": "uuid-2",
      "org_name": "National Registry",
      "role": "admin",
      "roles": ["admin"],
      "is_national": true
    }
  ],
  "access_token": "temporary-token-for-org-selection"
}

Then call Select Staff Organization with the chosen org.

SMART Configuration

No authentication required.

GET /smart-auth/.well-known/smart-configuration

Returns SMART on FHIR metadata (token endpoint, supported scopes, etc.).

OpenID Configuration

No authentication required.

GET /smart-auth/.well-known/openid-configuration