Table List

Database Tables

Pages produced by a web-based metadata application,
which joins the database dictionary to
entity-level information entered by the analyst.
See the author's web page

Table Details :: MEDICATION

 

MEDICATION

Description:Medications that the patient took
What defines a unique row:The logical key is PATIENT_ID, CLINIC_ID, ADMINISTRATION_DATE, and DRUG_CODE. Only one row with LASTEST_ROW_IND='Y' is expected for each logical key. Multiple administrations of the same medication in a day are aggregated by the ETL process. The logical key and the INSERT_DATE consitute the database unique key.
Current rows:LATEST_ROW_IND = 'Y'
Historical rows:LATEST_ROW_IND = 'N'

 

Show more details

S.MEDICATION in DEMODB

 

view S.MEDICATION_VW in DEMODB

 
S.MEDICATION_VW
Column Name Type   Column Name Type  
CLINIC_IDComments:
Clinic number
Joins:
Join to table S.CLINIC on:
CLINIC_ID = CLINIC_ID
Sources:
Clinical System: clin.med.clinic_number
NUMBER(22)  CLINIC_IDComments:
Clinic number
Joins:
Join to table S.CLINIC on:
CLINIC_ID = CLINIC_ID
Sources:
Clinical System: clin.med.clinic_number
NUMBER(22) 
PATIENT_IDComments:
Patient record number
Joins:
Join to table S.PATIENT on:
PATIENT_ID = PATIENT_ID
NUMBER(22)     
ADMINISTRATION_DATEComments:
Date the patient took the medication
Sources:
Clinical System: clin.med.med_administration_date
NUMBER(22)  ADMINISTRATION_DATEComments:
Date the patient took the medication
Sources:
Clinical System: clin.med.med_administration_date
NUMBER(22) 
DIAGNOSIS_CODEComments:
Diagnosis for which the medication was taken
Joins:
Join to table S.DIAGNOSIS on:
DIAGNOSIS_CODE = DIAGNOSIS_CODE
Sources:
Clinical System: clin.med.med_diag_code
VARCHAR2(9)  DIAGNOSIS_CODEComments:
Diagnosis for which the medication was taken
Joins:
Join to table S.DIAGNOSIS on:
DIAGNOSIS_CODE = DIAGNOSIS_CODE
Sources:
Clinical System: clin.med.med_diag_code
VARCHAR2(9) 
     DIAGNOSIS_DESCRIPTIONComments:
Available in the view based on join to the reference table
VARCHAR2(75) 
DRUG_CODEJoins:
Join to table S.DRUG on:
DRUG_CODE = DRUG_CODE (VARCHAR2 <==> NUMBER)
Sources:
Clinical System: clin.med.med_drug_number
VARCHAR2(9)  DRUG_CODEJoins:
Join to table S.DRUG on:
DRUG_CODE = DRUG_CODE (VARCHAR2 <==> NUMBER)
Sources:
Clinical System: clin.med.med_drug_number
VARCHAR2(9) 
     DRUG_NAMEComments:
Available in the view based on join to the reference table
VARCHAR2(80) 
ROUTE_CODEJoins:
Join to table S.ROUTE on:
ROUTE_CODE = ROUTE_CODE
Sources:
Clinical System: clin.med.med_route_code
VARCHAR2(9)  ROUTE_CODEJoins:
Join to table S.ROUTE on:
ROUTE_CODE = ROUTE_CODE
Sources:
Clinical System: clin.med.med_route_code
VARCHAR2(9) 
     ROUTE_DESCRIPTIONComments:
Available in the view based on join to the reference table
VARCHAR2(60) 
MEASUREMENT_CODEJoins:
Join to table S.MEASUREMENT on:
MEASUREMENT_CODE = MEASUREMENT_CODE
Sources:
Clinical System: clin.med.med_qty_unit
VARCHAR2(9)  MEASUREMENT_CODEJoins:
Join to table S.MEASUREMENT on:
MEASUREMENT_CODE = MEASUREMENT_CODE
Sources:
Clinical System: clin.med.med_qty_unit
VARCHAR2(9) 
     MEASUREMENT_DESCRIPTIONComments:
Available in the view based on join to the reference table
VARCHAR2(60) 
QUANTITYComments:
Quantity of whatever the DOSE_CODE refers to
Sources:
Clinical System: clin.med.med_qty_number
NUMBER(22)  QUANTITYComments:
Quantity of whatever the DOSE_CODE refers to
Sources:
Clinical System: clin.med.med_qty_number
NUMBER(22) 
DOSE_CODEComments:
Values in the DOSE table
Joins:
Join to table S.DOSE on:
DOSE_CODE = DOSE_CODE (NUMBER <==> VARCHAR2)
Sources:
Clinical System: clin.med.med_dose
NUMBER(22)  DOSE_CODEComments:
Values in the DOSE table
Joins:
Join to table S.DOSE on:
DOSE_CODE = DOSE_CODE (NUMBER <==> VARCHAR2)
Sources:
Clinical System: clin.med.med_dose
NUMBER(22) 
INSERT_DATESources:
ETL: audit_columns.g.system_date_at_insert
DATE(7)  INSERT_DATESources:
ETL: audit_columns.g.system_date_at_insert
DATE(7) 
UPDATE_DATESources:
ETL: audit_columns.g.system_date_at_update
DATE(7)  UPDATE_DATESources:
ETL: audit_columns.g.system_date_at_update
DATE(7) 
LATEST_ROW_INDSources:
ETL: audit_columns.g.process
CHAR(1)  LATEST_ROW_INDSources:
ETL: audit_columns.g.process
CHAR(1) 

 

Show sources for MEDICATION

Table Diagram:

Table diagram

Sample query script:

Highlight all, copy to clipboard, and paste as needed