Skip to content
Partner Developer Portal

Definition

The Patient data model provides a comprehensive record of individuals registered with healthcare organizations. It serves as the foundational dataset for patient-centric information, containing demographic details, registration status, organisation context, and key administrative data such as data sharing opt-in flags. This model is essential for accurately identifying and managing patient information across various healthcare services and systems.

  • Soft deletion: When is_deleted is true this means the patient record in the source database has been deleted, not that the patient status has changed. Data fields will be nullified in upstream transformations and should be excluded from most analytical queries. Primary keys are preserved so deleted records and their relationships can still be identified. Foreign keys to coding tables are nullified as the coded information is no longer valid.

The patient model exposes registration timing and activity indicators for each patient.

Field Description
registration_start_datetime Registration start timestamp
registration_end_datetime Registration end timestamp where present
is_active Patient is currently on the active caseload
has_died Patient is deceased
organisation_id Organisation identifier associated with the patient row

The patient model exposes two boolean fields that reflect a patient’s data sharing consent status.

Indicates whether a patient has consented for GP data sharing (SNOMED code 93C1).

Value Meaning
FALSE Patient has a Type 1 opt-out — GP record should not be shared beyond direct care
TRUE / NULL Patient does not have a Type 1 opt-out

is_national_data_opted_in — National Data Opt-Out

Section titled “is_national_data_opted_in — National Data Opt-Out”

Indicates whether a patient has opted in to national data sharing (e.g. for research and planning purposes).

Value Meaning
FALSE / NULL Patient is opted out of national data sharing
TRUE Patient is opted in to national data sharing
  • Type 1 Opt-Outs treat NULL as opted IN, a NULL means no opt-out has been recorded, not that the status is unknown.
  • National Data Opt-Outs treat NULL as opted OUT, NDOP requires specific confirmation that a patient is opted in or out and a NULL value should be treated as opted out as a defensive fallback.
-- Exclude patients with a Type 1 opt-out
WHERE COALESCE(is_consent_9nu0, TRUE) = TRUE
-- Exclude patients opted out of national data sharing
WHERE COALESCE(is_national_data_opted_in, FALSE) = TRUE
-- Exclude patients with either opt-out
WHERE COALESCE(is_consent_9nu0, TRUE) = TRUE
AND COALESCE(is_national_data_opted_in, FALSE) = TRUE