drug_sales


If there is patient data for this table the file for this export will be found in the extracted zip folder location under the filename of drug_sales.csv

If there are non-patient data column elements that are not part of the designated record set they will be marked in the Comment's column for that data element

Description

Product/Drug sales to Patients

Columns

Column Type Size Nulls Auto Default Children Parents Comments
sale_id INT 10 null

The unique identifier for this record

drug_id INT 10 null
drugs.drug_id Defined in XML R

The id of the drug that was sold to the patient. 0 if the record is not dispensed to a patient

inventory_id INT 10 null
prescription_id INT 10 0
pid BIGINT 19 0
patient_data.pid Defined in XML R

The internal patient identifier

encounter INT 10 0
form_encounter.encounter Defined in XML R

The patient encounter which resulted in this drug being sold to the patient.

user VARCHAR 255 NULL
sale_date DATE 10 null

The date the sale occurred on

quantity INT 10 0

The number of items sold of the drug

fee DECIMAL 12,2 0.00

The total price of the sale for the drug that was sold to the patient

billed BOOLEAN 3 0

indicates if the sale is posted to accounting

xfer_inventory_id INT 10 0
distributor_id BIGINT 19 0

UNUSED - will be removed in the future

notes VARCHAR 255 ''
pricelevel VARCHAR 31 ''
selector VARCHAR 255 ''

references drug_templates.selector

bill_date DATETIME 19 NULL
trans_type TINYINT 3 1

1=sale, 2=purchase, 3=return, 4=transfer, 5=adjustment

chargecat VARCHAR 31 ''

Indexes

Constraint Name Type Sort Column(s)
PRIMARY Primary key Asc sale_id

Relationships