Skip to content
Partner Developer Portal

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.

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)
  • Soft deletion is represented by the is_deleted column in this view. This model is additionally filtered to active, processable agreements in the serving layer.

Get active sharer organisations (non-deleted)

Section titled “Get active sharer organisations (non-deleted)”
SELECT
agreement_name,
sharer_name,
sharer_ods,
sharer_status
FROM explorer_open_safely.sharing_agreement
WHERE sharer_status = '02. Activated'
SELECT
agreement_name,
sharer_name,
sharer_status,
last_modified_datetime
FROM explorer_open_safely.sharing_agreement
WHERE last_modified_datetime >= CURRENT_TIMESTAMP - INTERVAL '30' DAY
ORDER BY last_modified_datetime DESC
SELECT
agreement_name,
sharer_name,
sharer_ods,
sharer_status
FROM explorer_open_safely.sharing_agreement
WHERE sharer_status IN ('03. Deactivated', '05. Closed Site')