| prescription_guid |
varchar |
Unique identifier for the prescription record. |
| prescription_id |
integer |
Primary identifier of the Scottish SETP prescription. |
| setp_prescription_item_id |
integer |
Unique identifier for each Scotland prescribed item line. |
| prescribing_scotland_id |
varchar |
Non-null surrogate of organisation, SETP prescription/item, and nullable extended claim GUID; retains no-claim items and separate episodes. |
| pharmacy_name |
varchar |
The name of the pharmacy. Displayed in the application. |
| prescription_item_id |
integer |
Primary key. Unique identifier for each prescribed item line. |
| pmr_prescription_item_id |
integer |
SETP item’s parent PMRPrescriptionItemId; null when the SETP item is not linked to a PMR item. |
| prescription_item_guid |
varchar |
GUID for the prescription item, used in message exchanges. |
| final_cost |
numeric |
This captures the final cost (all dispensed items) for the prescription item. |
| patient_id |
integer |
Foreign key to the patient being registered for the service. |
| unique_patient_id |
varchar |
A globally unique patient identifier. Source documentation flags this value as inconsistent with the SQL Server contract and not a valid counting key. |
| patient_surname |
varchar |
Patient’s surname as received on the prescription. |
| patient_middle_name |
varchar |
Patient’s middle name(s) as received on the prescription. |
| patient_given_name |
varchar |
Patient’s first/given name as received on the prescription. |
| patient_title |
varchar |
Patient’s title (Mr, Mrs, Dr, etc.) as received on the prescription. |
| patient_full_name |
varchar |
Patient name assembled from surname, given name, middle name, and title when present. |
| prescription_item_deleted |
boolean |
Boolean indicating the linked PMR item for this episode has been deleted. |
| scotland_prescription_status |
varchar |
Human-readable status name, such as New, Dispensed, Claimed, Request, HubRequest, or ClaimCancellation. |
| scotland_request_type |
varchar |
Human-readable description of the request action, such as RequestSend, RequestRejection, ClaimSend, or CancellationSend. |
| scotland_registration_status |
varchar |
Latest registration status for the patient; falls back to Not Registered when the patient exists but has no registration request. |
| scotland_registration_status_description |
varchar |
Human-readable status description from the patient’s latest SETP registration request, when present. |
| scotland_patient_upn |
varchar |
Identifier assigned to the prescription by the national prescribing system, such as Scottish EPS. |
| patient_chi_number |
varchar |
The patient’s Community Health Index (CHI) number, the unique NHS Scotland patient identifier. |
| scotland_expiry_date |
date |
Expiry date of the prescription. |
| scotland_item_number |
integer |
Sequential item number within the prescription, used for ordering and display. |
| scotland_is_cd_item |
boolean |
True when the PMR item’s preparation has a controlled drug schedule greater than zero in the dispensing pharmacy’s region. |
| scotland_repeat_number |
integer |
Repeat or episode number for this dispensing instance within the CMS serial. |
| scotland_repeat_total |
integer |
Total number of repeat dispensing episodes authorised for this CMS item. |
| episode |
varchar |
Repeat episode label formed from the repeat number and total, such as 3 of 12. |
| scotland_claim_prescription_status_description |
varchar |
Human-readable status of the specific claim episode, derived from the status linked to its extended claim record. |
| scotland_prescription_modified_date |
timestamp |
Date and time the Scotland prescription record was last modified. |
| scotland_registration_modified_date |
timestamp |
Date and time the patient’s latest Scotland registration request record was last modified. |
| scotland_claim_request_type |
varchar |
Human-readable request type associated with the claim episode. |
| scotland_claim_modified_date |
timestamp |
Date and time the prescription item extended claim record was last modified. |
| scotland_claim_added_date |
timestamp |
Date and time the prescription item extended claim record was originally created. |
| pmr_prescription_deleted |
boolean |
Whether the local PMR prescription header linked through the PMR item is deleted. |
| scotland_prescription_added_date |
timestamp |
Date and time the SETP prescription record was created. |
| service_type |
varchar |
Human-readable name of the service, such as AMS (Acute Medication Service), CMS (Chronic Medication Service), or MAS (Minor Ailment Service). |
| prescription_item_extended_claim_guid |
varchar |
Canonical extended claim identity. |
| scotland_claimed_quantity |
numeric |
Quantity recorded as claimed for the Scotland prescription item extended claim. |
| prescribed_quantity |
numeric |
Current parent PMR quantity, not OriginalQuantity or endorsed quantity. |
| original_prescribed_quantity |
numeric |
Parent PMR OriginalQuantity retained for amendment assessment. |
| supplied_quantity |
numeric |
Deduplicated positive given supply for the parent PMR item in this organisation. |
| is_fully_dispensed |
boolean |
True when the parent PMR item and header are not deleted and eligible supply fulfills positive current quantity. |
| claim_pmr_prescription_item_id |
integer |
Extended claim PMR link with no fallback to the parent item. |
| claim_prescribed_quantity |
numeric |
Current claim-linked PMR quantity. |
| claim_original_prescribed_quantity |
numeric |
Original claim-linked PMR quantity, not the fulfillment target. |
| claim_supplied_quantity |
numeric |
Eligible supply for this claim’s PMR item, shared by instances linking to the same item. |
| claim_is_fully_dispensed |
boolean |
True when claim-linked full current-quantity fulfillment is met, excluding deleted links and not-given supply; no endorsement exceptions apply. |
| eligible_dispensing_count |
integer |
Distinct non-deleted, given dispensing GUIDs for the parent PMR item in this organisation; 0 when unlinked. |
| has_dispensing_activity |
boolean |
True when eligible_dispensing_count is greater than 0. |
| first_dispensed_date_time |
timestamp |
Earliest eligible dispensing date and time for the parent PMR item. |
| last_dispensed_date_time |
timestamp |
Latest eligible dispensing date and time for the parent PMR item. |
| product_name |
varchar |
Maximum product name across eligible dispensings for the parent PMR item. |
| organisation |
varchar |
An organisation is synonymous with a pharmacy and is also known as the RXid. |
| branch_identifier |
varchar |
Branch identifier assigned by the head office. Used when sending and receiving data from a head office, but otherwise not used by the application. |
| national_practice_code |
varchar |
Pharmacy NacsCode. Used to identify the pharmacy when the user logs in. |
| row_id |
varchar |
Unique hash generated based on column values. Used to identify data changes. |
| last_updated_date |
date |
The date this record was last updated, based on the ingestion process and populated by job orchestration. |