Definition
Sharing agreements is a reference model designed to provide a comprehensive view of data sharing agreements, including detailed information about both requester and sharer organisations, agreement status, and processing permissions.
Information
Section titled “Information”This model exposes agreement status at requester/sharer organisation level. Records include identifiers, status fields, and processing controls used by OpenSafely data-sharing workflows.
Each organisation can activate (or deactivate) the agreement at any time. The model provides details including:
- Requester organisation details (name, CDB, status)
- Sharer organisation details (name, ODS code, CDB, status)
- Agreement information (type, purpose, status, processing capabilities)
- Temporal tracking (last modified dates, transform_datetime)
Constraints and Notes
Section titled “Constraints and Notes”- Soft deletion is represented by the
is_deletedcolumn in this view. This model is additionally filtered to active, processable agreements in the serving layer.
Examples
Section titled “Examples”Get active sharer organisations (non-deleted)
Section titled “Get active sharer organisations (non-deleted)”SELECT agreement_name, sharer_name, sharer_ods, sharer_statusFROM explorer_open_safely.sharing_agreementWHERE sharer_status = '02. Activated'Agreements modified in timeframe
Section titled “Agreements modified in timeframe”SELECT agreement_name, sharer_name, sharer_status, last_modified_datetimeFROM explorer_open_safely.sharing_agreementWHERE last_modified_datetime >= CURRENT_TIMESTAMP - INTERVAL '30' DAYORDER BY last_modified_datetime DESCGet closed or deactivated organisations
Section titled “Get closed or deactivated organisations”SELECT agreement_name, sharer_name, sharer_ods, sharer_statusFROM explorer_open_safely.sharing_agreementWHERE sharer_status IN ('03. Deactivated', '05. Closed Site')