Columns
| Column | Description | API Field Name |
|---|---|---|
prescription_id | Primary key and prescription unique identifier. | id |
created | The timestamp when the prescription record was created. | |
modified | The timestamp when the prescription record was last modified. | |
is_deleted | Indicates whether the prescription record is deleted. | |
clinic_id | Foreign key to the clinic & clinic_enriched tables. The identifier of the clinic associated with the prescription. | clinic_id |
clinic_patient_id | Foreign key to the patient & client_enriched tables. The identifier of the patient associated with the prescription. | clinic_patient_id |
item | JSON object containing the prescribed item’s identifier and name (id, name). | item |
item_id | Foreign key to the item & item_enriched table. The identifier of the item prescribed. | item_id |
item_name | Name of the item (denormalized from item). | item_name |
directions | The directions for the prescription (instructions to the client). | directions |
client_notes | Additional notes to the client for the prescription. | client_notes |
allowed_uses | The number of fills allowed; each fill has quantity denoted by quantity. | allowed_uses |
quantity | Recommended number of items per fill. | quantity |
days_supply | How many days one unit of the prescription is intended to last. | days_supply |
expiration_date | When the prescription expires. | expiration_date |
status | The status of the latest prescription fill (e.g., ACTIVE, DRAFT, DECLINED, IMPORTED). | status |
prescribed_at | The timestamp when the prescription fill was created (prescribed). | prescribed_at |
prescribed_by_doctor_id | Foreign key to the doctor table. The identifier of the doctor who prescribed. | |
prescribed_by | Full name of the prescribing doctor (first_name + last_name, denormalized from doctor). | prescribed_by |
is_prn | Whether the prescription has unlimited refills (as needed). | is_prn |
total_allowed_uses | Total allowed quantity for the prescription (allowed_uses * quantity). Null if there is no active fill or if the prescription is PRN. | total_allowed_uses |
total_uses | Total quantity of items dispensed (fill order count total_uses + external_uses). | total_uses |
remaining_fills | Number of fills remaining on the prescription. Null for PRN (as-needed) prescriptions. | remaining_fills |
last_filled_at | The date and time when the last fill was dispensed (most recent order_placed_time across non-canceled order items). | last_filled_at |
latest_fill_id | Foreign key to the prescription_fill table. The identifier of the latest prescription fill for this prescription. | |
last_updated | The timestamp when the prescription record was last updated in the source table. This is the most recent timestamp from all related tables (prescription, fill, item, doctor, fill_order_counts). | |
vetcove_corporate_id | The unique identifier of the corporate group associated with this record. |
Relationships
SQL Definition
View SQL
View SQL