Definition
The Enhanced Sharing Agreement model describes the data-sharing agreements that control which organisations’ data you can access. Each row represents one organisation’s participation in a single agreement, along with the status of both parties and summary metrics for the sharing organisation.
Information
Section titled “Information”The model provides agreements that links a requester — the organisation asking for access — to one or more sharers — the organisations supplying data. Columns are prefixed to tell you which side they describe:
requester_- The organisation requesting access under the agreement.sharer_- The organisation sharing its data under the agreement.agreement_- The agreement itself — its name, purpose, type and enabled state.
This model contains the following key information for sharing agreements:
- Record identifiers
- Agreement status
- Requester and sharer context and status
- Sharer metadata
- Agreement population and user coverage
- Agreement and system dates
- User information
Grain and Scope
Section titled “Grain and Scope”Each record is uniquely identified by agreement_guid,
requester_organisation_guid, sharer_organisation_guid, and
emis_index_schema_id columns.
This model includes the following key identifiers:
- agreement_guid: The unique internal identifier for the agreement record.
- requester_organisation_guid: The GUID for the requester organisation.
- sharer_organisation_guid: The GUID for the sharer organisation.
- emis_index_schema_id: The unique internal identifier for the region that the organisation belongs to.
The following fields are important for tracking data lineage and freshness:
- is_deleted: Indicates whether the sharing agreement has been deleted at source.
- transform_datetime: The timestamp indicating when the record was last processed and updated in the data model. This field is crucial for understanding the current state of the data.
Agreement and participation status
Section titled “Agreement and participation status”There are several status columns, and they answer different questions:
-
Is the agreement live?
agreement_statusAvailable values:
Enabled— The agreement is active.Disabled— The agreement is not active.
-
Has the requester activated its side of the agreement?
requester_statusAvailable values:
Not Activated— The requester has not yet activated their side.Activated— The requester has activated their side.Deactivated— The requester previously activated it, but it is not active now.Deleted— The requester’s side has been removed.
-
Has the sharer activated its side of the agreement?
sharer_statusAvailable values:
01. Ready for Activation— The agreement is visible in EMIS Web Data Sharing Manager and is waiting for the Data Controller to review and approve it. No data is being shared yet.02. Activated— The Data Controller has approved the agreement and data sharing is now live. Their data will appear in your Explorer environment.03. Deactivated— The Data Controller has withdrawn their approval for data sharing. The agreement is still in place on EMIS Web Data Sharing Manager and they can reactivate it at any time. While deactivated, their data will not be processed.04. Deleted— The Data Controller has been permanently removed from the agreement. This typically happens when a contract or data protection agreement has ended, or the Data Controller was listed in error. The agreement is no longer visible to them and cannot be reactivated.05. Closed Site— The Data Controller has permanently closed (for example, due to a merger, closure, or move to another supplier). Data already extracted to your local servers will remain, but their data will be removed from your Explorer environment.
sharer_statusvalues are deliberately prefixed with a sort key so that alphabetical ordering matches lifecycle order. Match on the full string, including the prefix. -
Is data actually flowing for this requester/sharer pairing?
can_processAvailable values:
TRUE— Data can currently be processed for this pairing.FALSE— Data is not currently being processed for this pairing.
Things to be aware of
Section titled “Things to be aware of”-
Each record is per agreement, per requester organisation, per sharer organisation, per EMIS Index schema, per user.
-
Results are user specific. This model is filtered to the signed-in user. You will only ever see the agreements and organisations linked to your own account, and two users querying the same view can legitimately get different results. Do not compare row counts between users, and do not cache results as if they were global.
-
The
organisationcolumn is different on this model. It does not identify the EMIS Web instance from which the record came, as it does in other models. It is set toEMISfor all records. Use thesharer_cdbcolumn instead to retrieve the sharing organisation’s CDB number. -
Use
sharer_cdbto retrieve the sharer’s CDB number, notorganisation. Theorganisationvalue does not identify the sharer or indicate organisation or agreement status. -
Use
sharer_status,requester_statusandagreement_statusto assess the relevant status. -
Join on
sharer_organisation_guidorrequester_organisation_guidagainstorganisation_guidon the Organisation model to identify the EMIS Web instance of the sharer or the requester. -
Counts come from EMIS Index, not from your extract, so they will not tie exactly to row counts in the clinical models.
Examples
Section titled “Examples”Get active sharer organisations (non-deleted)
SELECT agreement_name, sharer_name, sharer_ods_code, sharer_status, active_user_count, active_patient_countFROM internal.enhanced_sharing_agreementWHERE is_deleted = FALSE AND sharer_status = '02. Activated';Agreements modified in timeframe
SELECT agreement_name, sharer_name, sharer_status, last_modified_datetimeFROM internal.enhanced_sharing_agreementWHERE is_deleted = FALSE AND last_modified_datetime >= CURRENT_TIMESTAMP - INTERVAL '30' DAYORDER BY last_modified_datetime DESC;Get closed or deactivated organisations
SELECT agreement_name, sharer_name, sharer_ods_code, sharer_status, sharer_close_datetimeFROM internal.enhanced_sharing_agreementWHERE is_deleted = FALSE AND sharer_status IN ('03. Deactivated', '05. Closed Site');Patient count fields are null when the source record is deleted. The count of non-null patient counts shows how many sharers contribute to each status total.