Implementation Features
Spec: FHIR Versioning, Version-aware UpdatesVersion Management
Sequential Integer Versions
Ferrum uses sequential integer versions starting at 1 for each resource:Version Lifecycle
Each CRUD operation affects versioning differently:Database Storage
Ferrum stores versions in two tables:resources: All resource versions with metadataresource_versions: Version counter per resource
Versioned Read (vread)
Spec: vread Read a specific version of a resource:Response Behavior
Successful vread (200 OK):
404 Not Found):
410 Gone):
HEAD Support
Check version existence without fetching body:Caching Headers
vread responses include immutable caching headers since versions never change:History Operations
Instance History
Spec: Instance History Get all versions of a specific resource:Type History
Get history for all resources of a specific type:System History
Get history across all resource types:History Parameters
All history endpoints support standard parameters:History Entry Methods
Ferrum automatically determines the HTTP method for each history entry:Version-Aware Operations
Optimistic Locking with If-Match
Spec: Version-aware Updates Always useIf-Match for safe updates:
Version Conflict Handling
Successful update (200 OK):
412 Precondition Failed):
Recovery from Conflicts
When version conflicts occur:- Refetch the current version
- Merge your changes with current state
- Retry with new version
Delete and History
Soft Delete (Default)
With soft delete (hard_delete: false):
- Creates new version marked as deleted
- History remains accessible
GET /Patient/123→410 GoneGET /Patient/123/_history→200 OK(full history)GET /Patient/123/_history/3→410 Gone(deletion version)
Hard Delete
With hard delete (hard_delete: true):
- Physically removes all versions from database
- History becomes inaccessible
GET /Patient/123→404 Not FoundGET /Patient/123/_history→404 Not Found- Enables history deletion endpoints
History Deletion (Hard Delete Only)
When hard delete is enabled, you can delete specific versions or entire history:History Bundles (Replication)
Spec: Bundle.type=history Ferrum supports history bundle replication for data synchronization:History Bundle Processing
Ferrum processes history bundles with these rules:- Sequential Processing: Entries processed in order (not atomic)
- ID Preservation: Resource IDs preserved from bundle
- Version Checking: Older/duplicate versions ignored
- Create or Update: Creates if resource doesn’t exist, updates if newer
- Delete Handling: Entries with
response.status="410 Gone"trigger deletion
Version Conflict Resolution
Performance Considerations
Indexing Strategy
Ferrum indexes key version-related columns:History Query Optimization
For large history sets, use pagination:Version Cleanup
Configure version limits to manage storage:Version Cleanup: When enabled, Ferrum automatically removes old versions
beyond the configured limit, keeping the most recent versions.
Configuration
Key configuration options for versioning and history:Error Handling
Common versioning-related errors:Error Response Examples
Version not found:Testing Your Implementation
Use the interactive API playground to test versioning operations:Versioned Read
Test vread operations
Instance History
Browse resource history
Type History
Query type-level history
System History
Access system-wide history
Next Steps
CRUD Operations
Learn about create, read, update, delete
Search Operations
Query resources efficiently
Batch & Transaction
Perform multiple operations atomically
Configuration
Configure versioning behavior