spool DDLScript.txt;
SET FEEDBACK OFF;
SET ECHO OFF;
-- Software Version: MKF 4.4.1, ProdDefinition.XML version: 201603221300, CreateDate: 3/22/2016
REM DROP TABLE fdb_ahfs_assoc_gs_monograph PURGE;
CREATE TABLE fdb_ahfs_assoc_gs_monograph (monographidgeneralstatement INTEGER NOT NULL ,monographid INTEGER NOT NULL );
ALTER TABLE fdb_ahfs_assoc_gs_monograph ADD CONSTRAINT pkfdbahfsassocgsmonograph PRIMARY KEY (monographidgeneralstatement,monographid);

REM DROP TABLE fdb_ahfs_assoc_monograph_class PURGE;
CREATE TABLE fdb_ahfs_assoc_monograph_class (monographid INTEGER NOT NULL ,class VARCHAR2 (8) NOT NULL );
ALTER TABLE fdb_ahfs_assoc_monograph_class ADD CONSTRAINT pkfdbahfsassocmonographclass PRIMARY KEY (monographid,class);

REM DROP TABLE fdb_ahfs_classification_link PURGE;
CREATE TABLE fdb_ahfs_classification_link (classid VARCHAR2 (8) NOT NULL ,classunivid VARCHAR2 (50) NOT NULL );
ALTER TABLE fdb_ahfs_classification_link ADD CONSTRAINT pkahfsclasslink PRIMARY KEY (classid);

REM DROP TABLE fdb_ahfs_monograph PURGE;
CREATE TABLE fdb_ahfs_monograph (monographid INTEGER NOT NULL ,filename VARCHAR2 (50) NOT NULL );
ALTER TABLE fdb_ahfs_monograph ADD CONSTRAINT pkfdbahfsmonograph PRIMARY KEY (monographid);

REM DROP TABLE fdb_ahfs_section PURGE;
CREATE TABLE fdb_ahfs_section (monographid INTEGER NOT NULL ,sectionid VARCHAR2 (255) NOT NULL ,sectiontitle VARCHAR2 (255) NULL ,sectionlevel INTEGER NOT NULL ,searchtitle VARCHAR2 (255) NULL ,phonetictitle VARCHAR2 (255) NULL );
ALTER TABLE fdb_ahfs_section ADD CONSTRAINT pkfdbahfssection PRIMARY KEY (monographid,sectionid);

REM DROP TABLE fdb_ahfs_title PURGE;
CREATE TABLE fdb_ahfs_title (monographid INTEGER NOT NULL ,monographtitle VARCHAR2 (255) NOT NULL ,searchtitle VARCHAR2 (255) NOT NULL ,phonetictitle VARCHAR2 (255) NOT NULL );
ALTER TABLE fdb_ahfs_title ADD CONSTRAINT pkfdbahfstitle PRIMARY KEY (monographid);

REM DROP TABLE fdb_allergen_ext_vocab_link PURGE;
CREATE TABLE fdb_allergen_ext_vocab_link (extvocabid VARCHAR2 (50) NOT NULL ,extvocabtypecode VARCHAR2 (4) NOT NULL ,fdbunivid VARCHAR2 (50) NOT NULL ,dam_picklist_ind SMALLINT NOT NULL ,multi_set_ind SMALLINT NOT NULL ,rxcui VARCHAR2 (8) NULL ,link_add_date VARCHAR2 (8) NOT NULL ,link_inactive_date VARCHAR2 (8) NULL );
ALTER TABLE fdb_allergen_ext_vocab_link ADD CONSTRAINT pkfdballergenextvocablink PRIMARY KEY (extvocabid,extvocabtypecode,fdbunivid);

REM DROP TABLE fdb_allergengroup PURGE;
CREATE TABLE fdb_allergengroup (allergengroupid INTEGER NOT NULL ,descdisplay VARCHAR2 (60) NULL ,descsearch VARCHAR2 (60) NULL ,potentiallyinactivecode VARCHAR2 (1) NULL ,statuscode VARCHAR2 (1) NULL ,altdescsearch VARCHAR2 (60) NULL ,univid VARCHAR2 (50) NULL );
ALTER TABLE fdb_allergengroup ADD CONSTRAINT pkfdballergengroup PRIMARY KEY (allergengroupid);

REM DROP TABLE fdb_allergenpicklist_search PURGE;
CREATE TABLE fdb_allergenpicklist_search (conceptunivid VARCHAR2 (50) NOT NULL ,descsearch VARCHAR2 (255) NULL ,altdescsearch VARCHAR2 (255) NULL );
ALTER TABLE fdb_allergenpicklist_search ADD CONSTRAINT pkfdballergenpicklistsearch PRIMARY KEY (conceptunivid);

REM DROP TABLE fdb_allergycrosssensitivity PURGE;
CREATE TABLE fdb_allergycrosssensitivity (axsid SMALLINT NOT NULL ,description VARCHAR2 (50) NULL ,potentiallyinactivecode VARCHAR2 (1) NULL ,statuscode VARCHAR2 (1) NULL ,univid VARCHAR2 (50) NULL );
ALTER TABLE fdb_allergycrosssensitivity ADD CONSTRAINT pkfdballergycrosssensitivity PRIMARY KEY (axsid);

REM DROP TABLE fdb_classification PURGE;
CREATE TABLE fdb_classification (univid VARCHAR2 (50) NOT NULL ,classtypecode VARCHAR2 (2) NULL ,descdisplay VARCHAR2 (100) NULL ,descsearch VARCHAR2 (100) NULL ,ultimatechildcode VARCHAR2 (1) NULL ,directdruglinkcode VARCHAR2 (1) NULL ,parentunivid VARCHAR2 (50) NULL ,formularylevelcode VARCHAR2 (1) NULL ,presentationseqno INTEGER NULL ,ultiparentunivid VARCHAR2 (50) NULL ,hierarchylevel SMALLINT NULL ,sortnumber INTEGER NULL ,retiredcode VARCHAR2 (1) NULL ,retireddate VARCHAR2 (8) NULL ,altcode VARCHAR2 (20) NULL ,altdescsearch VARCHAR2 (100) NULL );
ALTER TABLE fdb_classification ADD CONSTRAINT pkfdbclassification PRIMARY KEY (univid);

REM DROP TABLE fdb_classification_class_link PURGE;
CREATE TABLE fdb_classification_class_link (univid VARCHAR2 (50) NOT NULL ,linkedunivid VARCHAR2 (50) NOT NULL );
ALTER TABLE fdb_classification_class_link ADD CONSTRAINT pkfdbclassificationclasslink PRIMARY KEY (univid,linkedunivid);

REM DROP TABLE fdb_classification_drug_link PURGE;
CREATE TABLE fdb_classification_drug_link (drugunivid VARCHAR2 (50) NOT NULL ,classunivid VARCHAR2 (50) NOT NULL ,commonuseind SMALLINT NOT NULL ,defaultuseind SMALLINT NOT NULL ,relativeorder SMALLINT NULL );
ALTER TABLE fdb_classification_drug_link ADD CONSTRAINT pkfdbclassificationdruglink PRIMARY KEY (drugunivid,classunivid);

REM DROP TABLE fdb_clinical_link PURGE;
CREATE TABLE fdb_clinical_link (drugunivid VARCHAR2 (50) NOT NULL ,clinicalmoduleunivid VARCHAR2 (50) NOT NULL );
ALTER TABLE fdb_clinical_link ADD CONSTRAINT pkfdbclinicallink PRIMARY KEY (drugunivid,clinicalmoduleunivid);

REM DROP TABLE fdb_clinical_link_ahfsmono PURGE;
CREATE TABLE fdb_clinical_link_ahfsmono (drugunivid VARCHAR2 (50) NOT NULL ,monographid INTEGER NOT NULL ,ahfspna INTEGER NOT NULL ,ahfspan INTEGER NOT NULL );
ALTER TABLE fdb_clinical_link_ahfsmono ADD CONSTRAINT pkfdbahfsxclinlinkmono PRIMARY KEY (drugunivid,monographid);

REM DROP TABLE fdb_clinical_link_dam PURGE;
CREATE TABLE fdb_clinical_link_dam (drugallergyunivid VARCHAR2 (50) NOT NULL ,hitvalunivid VARCHAR2 (50) NOT NULL ,activeingredientidlist VARCHAR2 (255) NULL ,inactiveingredientidlist VARCHAR2 (255) NULL ,activeproductscode VARCHAR2 (1) NULL ,ingredienttypecode VARCHAR2 (1) NULL ,druglinkonlyind SMALLINT NOT NULL );
ALTER TABLE fdb_clinical_link_dam ADD CONSTRAINT pkfdbclinicallinkdam PRIMARY KEY (drugallergyunivid,hitvalunivid);

REM DROP TABLE fdb_clinical_link_dam_relhit PURGE;
CREATE TABLE fdb_clinical_link_dam_relhit (hitvalunivid VARCHAR2 (50) NOT NULL ,relatedhitvalunivid VARCHAR2 (50) NOT NULL ,activelinkonlyind SMALLINT NOT NULL );
ALTER TABLE fdb_clinical_link_dam_relhit ADD CONSTRAINT pkfdbclinicallinkdamrelhit PRIMARY KEY (hitvalunivid,relatedhitvalunivid);

REM DROP TABLE fdb_clinical_link_ddc PURGE;
CREATE TABLE fdb_clinical_link_ddc (drugunivid VARCHAR2 (50) NOT NULL ,ddxcn INTEGER NOT NULL ,drugid INTEGER NOT NULL ,drugcode VARCHAR2 (2) NOT NULL );
ALTER TABLE fdb_clinical_link_ddc ADD CONSTRAINT pkfdbclinicallinkddc PRIMARY KEY (drugunivid,ddxcn);

REM DROP TABLE fdb_clinical_link_ind PURGE;
CREATE TABLE fdb_clinical_link_ind (drugunivid VARCHAR2 (50) NOT NULL ,indcts INTEGER NOT NULL ,drugid INTEGER NOT NULL ,drugcode VARCHAR2 (2) NOT NULL );
ALTER TABLE fdb_clinical_link_ind ADD CONSTRAINT pkfdbclinicallinkind PRIMARY KEY (drugunivid,indcts);

REM DROP TABLE fdb_clinical_link_side PURGE;
CREATE TABLE fdb_clinical_link_side (drugunivid VARCHAR2 (50) NOT NULL ,sideid INTEGER NOT NULL ,drugid INTEGER NOT NULL ,drugcode VARCHAR2 (2) NOT NULL );
ALTER TABLE fdb_clinical_link_side ADD CONSTRAINT pkfdbclinicallinkside PRIMARY KEY (drugunivid,sideid);

REM DROP TABLE fdb_cmm_link PURGE;
CREATE TABLE fdb_cmm_link (drugunivid VARCHAR2 (50) NOT NULL ,languageid SMALLINT NOT NULL ,cmmid SMALLINT NOT NULL ,priority SMALLINT NULL );
ALTER TABLE fdb_cmm_link ADD CONSTRAINT pkfdbcmmlink PRIMARY KEY (drugunivid,languageid,cmmid);

REM DROP TABLE fdb_cmm_message PURGE;
CREATE TABLE fdb_cmm_message (languageid SMALLINT NOT NULL ,cmmid SMALLINT NOT NULL ,profmessage1 VARCHAR2 (34) NULL ,profmessage2 VARCHAR2 (34) NULL ,patmessage1 VARCHAR2 (25) NULL ,patmessage2 VARCHAR2 (25) NULL );
ALTER TABLE fdb_cmm_message ADD CONSTRAINT pkfdbcmmmessage PRIMARY KEY (languageid,cmmid);

REM DROP TABLE fdb_codedefinition PURGE;
CREATE TABLE fdb_codedefinition (codetype SMALLINT NOT NULL ,codevalue VARCHAR2 (100) NOT NULL ,codedescription VARCHAR2 (255) NULL );
ALTER TABLE fdb_codedefinition ADD CONSTRAINT pkfdbcodedefinition PRIMARY KEY (codetype,codevalue);

REM DROP TABLE fdb_codedefinition_expanded PURGE;
CREATE TABLE fdb_codedefinition_expanded (codetype SMALLINT NOT NULL ,codevalue VARCHAR2 (100) NOT NULL ,sequencenumber SMALLINT NOT NULL ,codedescription VARCHAR2 (255) NULL );
ALTER TABLE fdb_codedefinition_expanded ADD CONSTRAINT pkfdbcodedefinitionexpanded PRIMARY KEY (codetype,codevalue,sequencenumber);

REM DROP TABLE fdb_codetype PURGE;
CREATE TABLE fdb_codetype (codetype SMALLINT NOT NULL ,codetypedescription VARCHAR2 (255) NULL ,singlelineind SMALLINT NULL ,multiplelineind SMALLINT NOT NULL );
ALTER TABLE fdb_codetype ADD CONSTRAINT pkfdbcodetype PRIMARY KEY (codetype);

REM DROP TABLE fdb_ddc PURGE;
CREATE TABLE fdb_ddc (ddxcn INTEGER NOT NULL ,dxid INTEGER NOT NULL ,sequencenumber SMALLINT NOT NULL ,drugdesc VARCHAR2 (100) NOT NULL ,diseasedesc VARCHAR2 (100) NOT NULL ,severitylevelcode VARCHAR2 (1) NULL ,pagereference VARCHAR2 (26) NULL );
ALTER TABLE fdb_ddc ADD CONSTRAINT pkfdbddc PRIMARY KEY (ddxcn,dxid);

REM DROP TABLE fdb_ddim_inactive_link PURGE;
CREATE TABLE fdb_ddim_inactive_link (drugunivid VARCHAR2 (50) NOT NULL ,interactionid INTEGER NOT NULL ,hicseqno INTEGER NOT NULL ,complementid INTEGER NULL );
ALTER TABLE fdb_ddim_inactive_link ADD CONSTRAINT pkfdbddiminactivelink PRIMARY KEY (drugunivid,interactionid,hicseqno);

REM DROP TABLE fdb_ddim_link PURGE;
CREATE TABLE fdb_ddim_link (drugunivid VARCHAR2 (50) NOT NULL ,interactionid INTEGER NOT NULL ,complementid INTEGER NULL );
ALTER TABLE fdb_ddim_link ADD CONSTRAINT pkfdbddimlink PRIMARY KEY (drugunivid,interactionid);

REM DROP TABLE fdb_ddiminteraction PURGE;
CREATE TABLE fdb_ddiminteraction (interactionid INTEGER NOT NULL ,description VARCHAR2 (121) NULL ,severitylevelcode VARCHAR2 (1) NULL ,monographid INTEGER NULL ,edipageref VARCHAR2 (9) NULL ,docmfgcode VARCHAR2 (1) NULL ,dochumantrialcode VARCHAR2 (1) NULL ,docanimalstudycode VARCHAR2 (1) NULL ,docmtgabstractcode VARCHAR2 (1) NULL ,docrvwarticlecode VARCHAR2 (1) NULL ,doccaserptcode VARCHAR2 (1) NULL ,clinicaleffectcode1 VARCHAR2 (3) NULL ,clinicaleffectcode2 VARCHAR2 (3) NULL ,univid VARCHAR2 (50) NULL );
ALTER TABLE fdb_ddiminteraction ADD CONSTRAINT pkfdbddiminteraction PRIMARY KEY (interactionid);

REM DROP TABLE fdb_dfiminteraction PURGE;
CREATE TABLE fdb_dfiminteraction (interactionid INTEGER NOT NULL ,interactor VARCHAR2 (21) NULL ,monographid INTEGER NULL ,interactionresult VARCHAR2 (45) NULL ,interactionmessage VARCHAR2 (55) NULL ,significancelevelcode VARCHAR2 (1) NULL ,univid VARCHAR2 (50) NULL );
ALTER TABLE fdb_dfiminteraction ADD CONSTRAINT pkfdbdfiminteraction PRIMARY KEY (interactionid);

REM DROP TABLE fdb_disclaimer PURGE;
CREATE TABLE fdb_disclaimer (languageid SMALLINT NOT NULL ,versioncode VARCHAR2 (1) NOT NULL ,categorycode VARCHAR2 (10) NOT NULL ,sequencenumber SMALLINT NOT NULL ,sectioncode VARCHAR2 (1) NULL ,formatcode VARCHAR2 (1) NULL ,linetext VARCHAR2 (255) NULL );
ALTER TABLE fdb_disclaimer ADD CONSTRAINT pkfdbdisclaimer PRIMARY KEY (languageid,versioncode,categorycode,sequencenumber);

REM DROP TABLE fdb_dispensable PURGE;
CREATE TABLE fdb_dispensable (medid INTEGER NOT NULL ,description VARCHAR2 (70) NOT NULL ,descriptiontm VARCHAR2 (70) NULL ,mnid INTEGER NOT NULL ,rtid INTEGER NOT NULL ,dfid INTEGER NOT NULL ,strength VARCHAR2 (15) NULL ,strengthunits VARCHAR2 (15) NULL ,rmid INTEGER NOT NULL ,rdfmid INTEGER NOT NULL ,gcnseqno INTEGER NULL ,gcnseqnoassigncode VARCHAR2 (1) NOT NULL ,nametypecode VARCHAR2 (1) NOT NULL ,singleingredientind SMALLINT NOT NULL ,medicaldeviceind SMALLINT NOT NULL ,haspackdrugsind SMALLINT NOT NULL ,hasequivpackdrugsind SMALLINT NOT NULL ,piececount SMALLINT NULL ,piececountsourcecode VARCHAR2 (4) NULL ,statuscode VARCHAR2 (1) NOT NULL ,univid VARCHAR2 (50) NULL ,reffederallegendcode VARCHAR2 (1) NULL ,obsoletedate VARCHAR2 (8) NULL ,tm_sourcecode VARCHAR2 (1) NULL ,reffederaldeaclasscode VARCHAR2 (1) NULL ,refgenericdrugnamecode VARCHAR2 (1) NULL ,refgenerictheraequivcode VARCHAR2 (1) NULL ,hasimagesind VARCHAR2 (1) NOT NULL ,refinnovatorcode VARCHAR2 (1) NULL ,refmultisourcecode VARCHAR2 (1) NULL ,namesourcecode VARCHAR2 (1) NULL ,refprivlabeledprodcode VARCHAR2 (1) NULL ,refrepackagercode VARCHAR2 (1) NULL );
ALTER TABLE fdb_dispensable ADD CONSTRAINT pkfdbdispensable PRIMARY KEY (medid);

REM DROP TABLE fdb_dispensable_clncl_qty PURGE;
CREATE TABLE fdb_dispensable_clncl_qty (medid INTEGER NOT NULL ,medidsn INTEGER NOT NULL ,clnqtysubunitqty decimal(18, 7)  NULL ,clnqtysubuomdesc VARCHAR2 (70) NOT NULL ,clnqtypkgdesc VARCHAR2 (50) NULL ,clnqtydesc VARCHAR2 (255) NOT NULL ,erxqty decimal(18, 7)  NOT NULL ,erxscriptuomdesc VARCHAR2 (50) NOT NULL ,erxscriptpotunitcd VARCHAR2 (10) NOT NULL );
ALTER TABLE fdb_dispensable_clncl_qty ADD CONSTRAINT pkfdbdispensableclnclqty PRIMARY KEY (medid,medidsn);

REM DROP TABLE fdb_dispensable_gen_link PURGE;
CREATE TABLE fdb_dispensable_gen_link (medid INTEGER NOT NULL ,gcnseqno INTEGER NOT NULL );
ALTER TABLE fdb_dispensable_gen_link ADD CONSTRAINT pkfdbdispensablegenlink PRIMARY KEY (medid,gcnseqno);

REM DROP TABLE fdb_dispensable_labeler PURGE;
CREATE TABLE fdb_dispensable_labeler (medid INTEGER NOT NULL ,labelerid VARCHAR2 (6) NOT NULL ,repackagercode VARCHAR2 (1) NULL ,packprodnamelinkind SMALLINT NOT NULL );
ALTER TABLE fdb_dispensable_labeler ADD CONSTRAINT pkfdbdispensablelabeler PRIMARY KEY (medid,labelerid);

REM DROP TABLE fdb_dispensable_packageddrug PURGE;
CREATE TABLE fdb_dispensable_packageddrug (medid INTEGER NOT NULL ,pdid VARCHAR2 (20) NOT NULL ,packprodnamelinkind SMALLINT NOT NULL );
ALTER TABLE fdb_dispensable_packageddrug ADD CONSTRAINT pkfdbdispensablepackageddrug PRIMARY KEY (medid,pdid);

REM DROP TABLE fdb_dispensable_search PURGE;
CREATE TABLE fdb_dispensable_search (medid INTEGER NOT NULL ,sequencenumber SMALLINT NOT NULL ,descsearch VARCHAR2 (70) NOT NULL ,descdisplay VARCHAR2 (70) NOT NULL ,altdescsearch VARCHAR2 (70) NULL );
ALTER TABLE fdb_dispensable_search ADD CONSTRAINT pkfdbdispensablesearch PRIMARY KEY (medid,sequencenumber);

REM DROP TABLE fdb_dispensable_search_term PURGE;
CREATE TABLE fdb_dispensable_search_term (medid INTEGER NOT NULL ,searchtermtypecd SMALLINT NOT NULL ,textdisplay VARCHAR2 (150) NOT NULL ,textsearch VARCHAR2 (150) NOT NULL ,alttextsearch VARCHAR2 (150) NULL ,medicalsupplyind SMALLINT NOT NULL );
ALTER TABLE fdb_dispensable_search_term ADD CONSTRAINT pkfdbdispensablesearchterm PRIMARY KEY (medid,searchtermtypecd,textdisplay);

REM DROP TABLE fdb_dispensable_value PURGE;
CREATE TABLE fdb_dispensable_value (medid INTEGER NOT NULL ,propertyid SMALLINT NOT NULL ,sequencenumber SMALLINT NOT NULL ,propertyvalue VARCHAR2 (255) NULL );
ALTER TABLE fdb_dispensable_value ADD CONSTRAINT pkfdbdispensablevalue PRIMARY KEY (medid,propertyid,sequencenumber);

REM DROP TABLE fdb_dose_type PURGE;
CREATE TABLE fdb_dose_type (dose_type_id SMALLINT NOT NULL ,dose_type_desc VARCHAR2 (60) NULL ,legacy_dose_type_cd VARCHAR2 (2) NULL ,ov_adjustment_ind SMALLINT NOT NULL );
ALTER TABLE fdb_dose_type ADD CONSTRAINT pkfdbdosetype PRIMARY KEY (dose_type_id);

REM DROP TABLE fdb_dosing PURGE;
CREATE TABLE fdb_dosing (drugunivid VARCHAR2 (50) NOT NULL ,rtid INTEGER NOT NULL ,lowagedays INTEGER NOT NULL ,highagedays INTEGER NOT NULL ,dxid INTEGER NOT NULL ,dosetypecode VARCHAR2 (2) NOT NULL ,lowgestbirthageweeks SMALLINT NOT NULL ,highgestbirthageweeks SMALLINT NOT NULL ,lowcurrentweightgrams INTEGER NOT NULL ,highcurrentweightgrams INTEGER NOT NULL ,exclusioncode VARCHAR2 (1) NULL ,patientparamreqind SMALLINT NULL ,dosingagesourcecode VARCHAR2 (1) NULL ,lowdoseperday_m decimal(19,6)  NULL ,lowdoseperdayunitid_m INTEGER NULL ,highdoseperday_m decimal(19,6)  NULL ,highdoseperdayunitid_m INTEGER NULL ,lowdoseperday_f decimal(19,6)  NULL ,lowdoseperdayunitid_f INTEGER NULL ,highdoseperday_f decimal(19,6)  NULL ,highdoseperdayunitid_f INTEGER NULL ,maxdoseperday_m decimal(19,6)  NULL ,maxdoseperdayunitid_m INTEGER NULL ,maxdoseperday_f decimal(19,6)  NULL ,maxdoseperdayunitid_f INTEGER NULL ,maxsingledose_m decimal(19,6)  NULL ,maxsingledoseunitid_m INTEGER NULL ,maxsingledose_f decimal(19,6)  NULL ,maxsingledoseunitid_f INTEGER NULL ,maxlifedose_m decimal(19,6)  NULL ,maxlifedoseunitid_m INTEGER NULL ,maxlifedose_f decimal(19,6)  NULL ,maxlifedoseunitid_f INTEGER NULL ,ntesingledose_m decimal(19,6)  NULL ,ntesingledoseunitid_m INTEGER NULL ,ntesingledose_f decimal(19,6)  NULL ,ntesingledoseunitid_f INTEGER NULL ,lowelimhalflife decimal(19,6)  NULL ,highelimhalflife decimal(19,6)  NULL ,halflifeunitid INTEGER NULL ,lowfrequency_m decimal(19,6)  NULL ,highfrequency_m decimal(19,6)  NULL ,lowfrequency_f decimal(19,6)  NULL ,highfrequency_f decimal(19,6)  NULL ,lowdurationoftx INTEGER NULL ,highdurationoftx INTEGER NULL ,maxdurationoftx INTEGER NULL ,hepaticimpairmentind SMALLINT NULL ,renalimpairmentind SMALLINT NULL ,creatinineclrthreshold SMALLINT NULL ,creatinineclrthresholdunitid INTEGER NULL ,exclusionreasonid INTEGER NULL ,severitylevelcode VARCHAR2 (1) NULL ,availableprecautionind SMALLINT NULL ,exclusionmessagetext VARCHAR2 (750) NULL ,nextscreeningdosetext VARCHAR2 (510) NULL ,nextscreeningdoseagetext VARCHAR2 (255) NULL ,antineoplastics_ind SMALLINT NOT NULL );
ALTER TABLE fdb_dosing ADD CONSTRAINT pkfdbdosing PRIMARY KEY (drugunivid,rtid,lowagedays,highagedays,dxid,dosetypecode,lowgestbirthageweeks,highgestbirthageweeks,lowcurrentweightgrams,highcurrentweightgrams);

REM DROP TABLE fdb_dosing_exclusion_reason PURGE;
CREATE TABLE fdb_dosing_exclusion_reason (exclusionreasonid INTEGER NOT NULL ,exclusionreasontextlong VARCHAR2 (750) NULL ,exclusionreasontextshort VARCHAR2 (255) NULL ,exclusionreasonstatuscode VARCHAR2 (8) NULL );
ALTER TABLE fdb_dosing_exclusion_reason ADD CONSTRAINT pkfdbdosingexclusionreason PRIMARY KEY (exclusionreasonid);

REM DROP TABLE fdb_dosing_minmax PURGE;
CREATE TABLE fdb_dosing_minmax (drugunivid VARCHAR2 (50) NOT NULL ,lowage INTEGER NOT NULL ,highage INTEGER NOT NULL ,mindailydosestrength decimal(19,6)  NULL ,mindailydosestrengthunitid INTEGER NULL ,mindailydoseunits decimal(19,6)  NULL ,mindailydoseunitsunitid INTEGER NULL ,maxdailydosestrength decimal(19,6)  NULL ,maxdailydosestrengthunitid INTEGER NULL ,maxdailydoseunits decimal(19,6)  NULL ,maxdailydoseunitsunitid INTEGER NULL ,ntedailydosestrength decimal(19,6)  NULL ,ntedailydosestrengthunitid INTEGER NULL ,ntedailydoseunits decimal(19,6)  NULL ,ntedailydoseunitsunitid INTEGER NULL ,dosingagesourcecode VARCHAR2 (1) NULL ,warningcode VARCHAR2 (1) NULL ,patientparamreqind SMALLINT NOT NULL );
ALTER TABLE fdb_dosing_minmax ADD CONSTRAINT pkfdbdosingminmax PRIMARY KEY (drugunivid,lowage,highage);

REM DROP TABLE fdb_dosing_minmax_pat_param PURGE;
CREATE TABLE fdb_dosing_minmax_pat_param (drugunivid VARCHAR2 (50) NOT NULL ,lowage INTEGER NOT NULL ,highage INTEGER NOT NULL ,patient_param_req_cd VARCHAR2 (4) NOT NULL );
ALTER TABLE fdb_dosing_minmax_pat_param ADD CONSTRAINT pkfdbdosingminmaxpatparam PRIMARY KEY (drugunivid,lowage,highage,patient_param_req_cd);

REM DROP TABLE fdb_dosing_pat_param PURGE;
CREATE TABLE fdb_dosing_pat_param (drugunivid VARCHAR2 (50) NOT NULL ,rtid INTEGER NOT NULL ,lowagedays INTEGER NOT NULL ,highagedays INTEGER NOT NULL ,dxid INTEGER NOT NULL ,dosetypecode VARCHAR2 (2) NOT NULL ,lowgestbirthageweeks SMALLINT NOT NULL ,highgestbirthageweeks SMALLINT NOT NULL ,lowcurrentweightgrams INTEGER NOT NULL ,highcurrentweightgrams INTEGER NOT NULL ,patient_param_req_cd VARCHAR2 (4) NOT NULL );
ALTER TABLE fdb_dosing_pat_param ADD CONSTRAINT pkfdbdosingpatparam PRIMARY KEY (drugunivid,rtid,lowagedays,highagedays,dxid,dosetypecode,lowgestbirthageweeks,highgestbirthageweeks,lowcurrentweightgrams,highcurrentweightgrams,patient_param_req_cd);

REM DROP TABLE fdb_dosing_renal PURGE;
CREATE TABLE fdb_dosing_renal (drugunivid VARCHAR2 (50) NOT NULL ,rtid INTEGER NOT NULL ,lowagedays INTEGER NOT NULL ,highagedays INTEGER NOT NULL ,dxid INTEGER NOT NULL ,dosetypecode VARCHAR2 (2) NOT NULL ,lowcreatinineclr SMALLINT NOT NULL ,highcreatinineclr SMALLINT NOT NULL ,sortorder SMALLINT NOT NULL ,dosingadjustmenttypecode VARCHAR2 (4) NULL ,patientparamreqind SMALLINT NOT NULL ,lowdoseperday_m decimal(19, 6)  NULL ,lowdoseperdayunitid_m INTEGER NULL ,highdoseperday_m decimal(19, 6)  NULL ,highdoseperdayunitid_m INTEGER NULL ,lowdoseperday_f decimal(19, 6)  NULL ,lowdoseperdayunitid_f INTEGER NULL ,highdoseperday_f decimal(19, 6)  NULL ,highdoseperdayunitid_f INTEGER NULL ,maxdoseperday_m decimal(19, 6)  NULL ,maxdoseperdayunitid_m INTEGER NULL ,maxdoseperday_f decimal(19, 6)  NULL ,maxdoseperdayunitid_f INTEGER NULL ,maxsingledose_m decimal(19, 6)  NULL ,maxsingledoseunitid_m INTEGER NULL ,maxsingledose_f decimal(19, 6)  NULL ,maxsingledoseunitid_f INTEGER NULL ,ntesingledose_m decimal(19, 6)  NULL ,ntesingledoseunitid_m INTEGER NULL ,ntesingledose_f decimal(19, 6)  NULL ,ntesingledoseunitid_f INTEGER NULL ,lowfrequency_m decimal(19, 6)  NULL ,highfrequency_m decimal(19, 6)  NULL ,lowfrequency_f decimal(19, 6)  NULL ,highfrequency_f decimal(19, 6)  NULL ,footnote VARCHAR2 (255) NULL ,monographid INTEGER NULL );
ALTER TABLE fdb_dosing_renal ADD CONSTRAINT pkfdbdosingrenal PRIMARY KEY (drugunivid,rtid,lowagedays,highagedays,dxid,dosetypecode,lowcreatinineclr,highcreatinineclr,sortorder);

REM DROP TABLE fdb_dosing_renal_pat_param PURGE;
CREATE TABLE fdb_dosing_renal_pat_param (drugunivid VARCHAR2 (50) NOT NULL ,rtid INTEGER NOT NULL ,lowagedays INTEGER NOT NULL ,highagedays INTEGER NOT NULL ,dxid INTEGER NOT NULL ,dosetypecode VARCHAR2 (2) NOT NULL ,lowcreatinineclr SMALLINT NOT NULL ,highcreatinineclr SMALLINT NOT NULL ,sortorder SMALLINT NOT NULL ,patient_param_req_cd VARCHAR2 (4) NOT NULL );
ALTER TABLE fdb_dosing_renal_pat_param ADD CONSTRAINT pkfdbdosingrenalpatparam PRIMARY KEY (drugunivid,rtid,lowagedays,highagedays,dxid,dosetypecode,lowcreatinineclr,highcreatinineclr,sortorder,patient_param_req_cd);

REM DROP TABLE fdb_dosing_severity_level PURGE;
CREATE TABLE fdb_dosing_severity_level (severitylevelcode VARCHAR2 (1) NOT NULL ,severityleveldescription VARCHAR2 (255) NULL ,severitylevelmessagetext VARCHAR2 (255) NULL ,geriseveritylevelcode VARCHAR2 (1) NULL ,pediseveritylevelcode VARCHAR2 (1) NULL );
ALTER TABLE fdb_dosing_severity_level ADD CONSTRAINT pkfdbdosingseveritylevel PRIMARY KEY (severitylevelcode);

REM DROP TABLE fdb_drug_gen_drugname PURGE;
CREATE TABLE fdb_drug_gen_drugname (drugunivid VARCHAR2 (50) NOT NULL ,hiclseqno INTEGER NOT NULL );
ALTER TABLE fdb_drug_gen_drugname ADD CONSTRAINT pkfdbdruggendrugname PRIMARY KEY (drugunivid,hiclseqno);

REM DROP TABLE fdb_drug_gen_named_link PURGE;
CREATE TABLE fdb_drug_gen_named_link (drugunivid VARCHAR2 (50) NOT NULL ,gennamedunivid VARCHAR2 (50) NOT NULL );
ALTER TABLE fdb_drug_gen_named_link ADD CONSTRAINT pkfdbdruggennamedlink PRIMARY KEY (drugunivid,gennamedunivid);

REM DROP TABLE fdb_drug_inactive_ingred PURGE;
CREATE TABLE fdb_drug_inactive_ingred (drugunivid VARCHAR2 (50) NOT NULL ,hicseqno INTEGER NOT NULL ,notpresentcount INTEGER NOT NULL ,presentcount INTEGER NULL );
ALTER TABLE fdb_drug_inactive_ingred ADD CONSTRAINT pkfdbdruginactiveingred PRIMARY KEY (drugunivid,hicseqno);

REM DROP TABLE fdb_drug_inactive_study PURGE;
CREATE TABLE fdb_drug_inactive_study (drugunivid VARCHAR2 (50) NOT NULL ,totalproductscount INTEGER NULL ,productsresearchedcount INTEGER NOT NULL );
ALTER TABLE fdb_drug_inactive_study ADD CONSTRAINT pkfdbdruginactivestudy PRIMARY KEY (drugunivid);

REM DROP TABLE fdb_drugname PURGE;
CREATE TABLE fdb_drugname (mnid INTEGER NOT NULL ,description VARCHAR2 (30) NOT NULL ,descriptiontm VARCHAR2 (70) NULL ,nametypecode VARCHAR2 (1) NOT NULL ,singleingredientind SMALLINT NOT NULL ,medicaldeviceind SMALLINT NOT NULL ,haspackdrugsind SMALLINT NOT NULL ,hasequivpackdrugsind SMALLINT NOT NULL ,statuscode VARCHAR2 (1) NOT NULL ,univid VARCHAR2 (50) NULL ,reffederallegendcode VARCHAR2 (1) NULL ,obsoletedate VARCHAR2 (8) NULL ,tm_sourcecode VARCHAR2 (1) NULL );
ALTER TABLE fdb_drugname ADD CONSTRAINT pkfdbdrugname PRIMARY KEY (mnid);

REM DROP TABLE fdb_drugname_gen_link PURGE;
CREATE TABLE fdb_drugname_gen_link (mnid INTEGER NOT NULL ,hiclseqno INTEGER NOT NULL );
ALTER TABLE fdb_drugname_gen_link ADD CONSTRAINT pkfdbdrugnamegenlink PRIMARY KEY (mnid,hiclseqno);

REM DROP TABLE fdb_drugname_search PURGE;
CREATE TABLE fdb_drugname_search (mnid INTEGER NOT NULL ,sequencenumber SMALLINT NOT NULL ,descsearch VARCHAR2 (30) NOT NULL ,descdisplay VARCHAR2 (30) NOT NULL ,altdescsearch VARCHAR2 (30) NULL );
ALTER TABLE fdb_drugname_search ADD CONSTRAINT pkfdbdrugnamesearch PRIMARY KEY (mnid,sequencenumber);

REM DROP TABLE fdb_drugname_value PURGE;
CREATE TABLE fdb_drugname_value (mnid INTEGER NOT NULL ,propertyid SMALLINT NOT NULL ,sequencenumber SMALLINT NOT NULL ,propertyvalue VARCHAR2 (255) NULL );
ALTER TABLE fdb_drugname_value ADD CONSTRAINT pkfdbdrugnamevalue PRIMARY KEY (mnid,propertyid,sequencenumber);

REM DROP TABLE fdb_duplicatetherapy PURGE;
CREATE TABLE fdb_duplicatetherapy (dtcid INTEGER NOT NULL ,description VARCHAR2 (60) NULL ,duplicationallowance SMALLINT NOT NULL );
ALTER TABLE fdb_duplicatetherapy ADD CONSTRAINT pkfdbduplicatetherapy PRIMARY KEY (dtcid);

REM DROP TABLE fdb_ext_allergen_vocab_link PURGE;
CREATE TABLE fdb_ext_allergen_vocab_link (extvocabid VARCHAR2 (50) NOT NULL ,extvocabtypecode VARCHAR2 (4) NOT NULL ,fdbunivid VARCHAR2 (50) NOT NULL ,rxcui VARCHAR2 (8) NULL ,preferred_ind SMALLINT NOT NULL ,related_ind SMALLINT NOT NULL ,link_add_date VARCHAR2 (8) NOT NULL ,link_inactive_date VARCHAR2 (8) NULL );
ALTER TABLE fdb_ext_allergen_vocab_link ADD CONSTRAINT pkfdbextallergenfdbvocablink PRIMARY KEY (extvocabid,extvocabtypecode,fdbunivid);

REM DROP TABLE fdb_ext_product_cd_desc PURGE;
CREATE TABLE fdb_ext_product_cd_desc (ext_product_code_type_id INTEGER NOT NULL ,description VARCHAR2 (50) NOT NULL ,data_type VARCHAR2 (20) NOT NULL ,field_length INTEGER NOT NULL ,code_definition VARCHAR2 (2000) NULL );
ALTER TABLE fdb_ext_product_cd_desc ADD CONSTRAINT pkfdbextproductcddesc PRIMARY KEY (ext_product_code_type_id);

REM DROP TABLE fdb_ext_product_code PURGE;
CREATE TABLE fdb_ext_product_code (fdb_product_id INTEGER NOT NULL ,ext_product_code_type_id INTEGER NOT NULL ,ext_product_code_start_date VARCHAR2 (8) NOT NULL ,ext_product_code VARCHAR2 (100) NOT NULL ,ext_product_code_end_date VARCHAR2 (8) NULL ,drugunivid VARCHAR2 (100) NOT NULL );
ALTER TABLE fdb_ext_product_code ADD CONSTRAINT pkfdbextproductcode PRIMARY KEY (fdb_product_id,ext_product_code_type_id,ext_product_code_start_date);

REM DROP TABLE fdb_ext_vocab PURGE;
CREATE TABLE fdb_ext_vocab (extvocabid VARCHAR2 (50) NOT NULL ,extvocabtypecode VARCHAR2 (4) NOT NULL ,description VARCHAR2 (2000) NOT NULL ,desc_search VARCHAR2 (2000) NOT NULL ,alt_desc_search VARCHAR2 (2000) NULL ,univid VARCHAR2 (50) NOT NULL );
ALTER TABLE fdb_ext_vocab ADD CONSTRAINT pkextvocab PRIMARY KEY (extvocabid,extvocabtypecode);

REM DROP TABLE fdb_ext_vocab_category_link PURGE;
CREATE TABLE fdb_ext_vocab_category_link (extvocabcategorycode VARCHAR2 (100) NOT NULL ,extvocabtypecode VARCHAR2 (4) NOT NULL );
ALTER TABLE fdb_ext_vocab_category_link ADD CONSTRAINT pkfdbextvocabcategorylink PRIMARY KEY (extvocabcategorycode,extvocabtypecode);

REM DROP TABLE fdb_ext_vocab_data_version PURGE;
CREATE TABLE fdb_ext_vocab_data_version (extvocabdataid SMALLINT NOT NULL ,extvocabdatadescription VARCHAR2 (50) NULL ,extvocabdatasourcecode VARCHAR2 (4) NULL ,extvocabdataversiondate VARCHAR2 (8) NULL );
ALTER TABLE fdb_ext_vocab_data_version ADD CONSTRAINT pkfdbextvocabdataversion PRIMARY KEY (extvocabdataid);

REM DROP TABLE fdb_ext_vocab_ext_link PURGE;
CREATE TABLE fdb_ext_vocab_ext_link (extvocabid1 VARCHAR2 (50) NOT NULL ,extvocabtypecode1 VARCHAR2 (4) NOT NULL ,extvocabid2 VARCHAR2 (50) NOT NULL ,extvocabtypecode2 VARCHAR2 (4) NOT NULL );
ALTER TABLE fdb_ext_vocab_ext_link ADD CONSTRAINT pkfdbextvocabextlink PRIMARY KEY (extvocabid1,extvocabtypecode1,extvocabid2,extvocabtypecode2);

REM DROP TABLE fdb_ext_vocab_ext_link_value PURGE;
CREATE TABLE fdb_ext_vocab_ext_link_value (extvocabid1 VARCHAR2 (50) NOT NULL ,extvocabtypecode1 VARCHAR2 (4) NOT NULL ,extvocabid2 VARCHAR2 (50) NOT NULL ,extvocabtypecode2 VARCHAR2 (4) NOT NULL ,propertyid SMALLINT NOT NULL ,sequencenumber SMALLINT NOT NULL ,propertyvalue VARCHAR2 (255) NULL );
ALTER TABLE fdb_ext_vocab_ext_link_value ADD CONSTRAINT pkfdbextvocabextlinkvalue PRIMARY KEY (extvocabid1,extvocabtypecode1,extvocabid2,extvocabtypecode2,propertyid,sequencenumber);

REM DROP TABLE fdb_ext_vocab_fdb_link PURGE;
CREATE TABLE fdb_ext_vocab_fdb_link (fdbunivid VARCHAR2 (50) NOT NULL ,extvocabid VARCHAR2 (50) NOT NULL ,extvocabtypecode VARCHAR2 (4) NOT NULL ,extvocabsourcecode INTEGER NULL ,extvocablinktypecode INTEGER NULL ,fdbtoextvocabbestfitind SMALLINT NOT NULL ,extvocabtofdbbestfitind SMALLINT NOT NULL );
ALTER TABLE fdb_ext_vocab_fdb_link ADD CONSTRAINT pkfdbextvocabfdblink PRIMARY KEY (fdbunivid,extvocabid,extvocabtypecode);

REM DROP TABLE fdb_ext_vocab_fdb_link_value PURGE;
CREATE TABLE fdb_ext_vocab_fdb_link_value (fdbunivid VARCHAR2 (50) NOT NULL ,extvocabid VARCHAR2 (50) NOT NULL ,extvocabtypecode VARCHAR2 (4) NOT NULL ,propertyid SMALLINT NOT NULL ,sequencenumber SMALLINT NOT NULL ,propertyvalue VARCHAR2 (255) NULL );
ALTER TABLE fdb_ext_vocab_fdb_link_value ADD CONSTRAINT pkfdbextvocabfdblinkvalue PRIMARY KEY (fdbunivid,extvocabid,extvocabtypecode,propertyid,sequencenumber);

REM DROP TABLE fdb_ext_vocab_replacement PURGE;
CREATE TABLE fdb_ext_vocab_replacement (replacedextvocabid VARCHAR2 (50) NOT NULL ,replacementextvocabid VARCHAR2 (50) NOT NULL ,extvocabtypecode VARCHAR2 (4) NOT NULL );
ALTER TABLE fdb_ext_vocab_replacement ADD CONSTRAINT pkfdbextvocabreplacement PRIMARY KEY (replacedextvocabid,replacementextvocabid,extvocabtypecode);

REM DROP TABLE fdb_ext_vocab_type_cd PURGE;
CREATE TABLE fdb_ext_vocab_type_cd (extvocabtypecode VARCHAR2 (4) NOT NULL ,extvocabtypecodedesc VARCHAR2 (50) NOT NULL ,ext_source_id VARCHAR2 (4) NOT NULL );
ALTER TABLE fdb_ext_vocab_type_cd ADD CONSTRAINT key1 PRIMARY KEY (extvocabtypecode);

REM DROP TABLE fdb_ext_vocab_value PURGE;
CREATE TABLE fdb_ext_vocab_value (extvocabid VARCHAR2 (50) NOT NULL ,extvocabtypecode VARCHAR2 (4) NOT NULL ,propertyid SMALLINT NOT NULL ,sequencenumber SMALLINT NOT NULL ,propertyvalue VARCHAR2 (255) NULL );
ALTER TABLE fdb_ext_vocab_value ADD CONSTRAINT pkfdbextvocabvalue PRIMARY KEY (extvocabid,extvocabtypecode,propertyid,sequencenumber);

REM DROP TABLE fdb_fcs_assoc_scheduledea PURGE;
CREATE TABLE fdb_fcs_assoc_scheduledea (schedule_cd VARCHAR2 (2) NOT NULL ,script_dea_id INTEGER NOT NULL );
ALTER TABLE fdb_fcs_assoc_scheduledea ADD CONSTRAINT pkfdbfcsassocscheduledea PRIMARY KEY (schedule_cd,script_dea_id);

REM DROP TABLE fdb_fcs_assoc_univfedsched PURGE;
CREATE TABLE fdb_fcs_assoc_univfedsched (drugunivid VARCHAR2 (50) NOT NULL ,federalschedule_cd VARCHAR2 (2) NOT NULL ,startdate VARCHAR2 (8) NOT NULL ,enddate VARCHAR2 (8) NULL );
ALTER TABLE fdb_fcs_assoc_univfedsched ADD CONSTRAINT pkfdbfcsassocunivfedsched PRIMARY KEY (drugunivid,federalschedule_cd,startdate);

REM DROP TABLE fdb_fcs_assoc_univstate PURGE;
CREATE TABLE fdb_fcs_assoc_univstate (drugunivid VARCHAR2 (50) NOT NULL ,state_cd VARCHAR2 (2) NOT NULL ,startdate VARCHAR2 (8) NOT NULL ,stateschedule_cd VARCHAR2 (2) NOT NULL ,enddate VARCHAR2 (8) NULL ,statefederaldiff_cd VARCHAR2 (2) NULL );
ALTER TABLE fdb_fcs_assoc_univstate ADD CONSTRAINT pkfdbfcsassocunivstate PRIMARY KEY (drugunivid,state_cd,startdate);

REM DROP TABLE fdb_fcs_assoc_univstatepdmp PURGE;
CREATE TABLE fdb_fcs_assoc_univstatepdmp (drugunivid VARCHAR2 (50) NOT NULL ,state_cd VARCHAR2 (2) NOT NULL ,startdate VARCHAR2 (8) NOT NULL ,pdmplisttype_cd VARCHAR2 (2) NOT NULL ,pdmpsource_cd VARCHAR2 (2) NULL ,enddate VARCHAR2 (8) NULL );
ALTER TABLE fdb_fcs_assoc_univstatepdmp ADD CONSTRAINT pkfdbfcsassocunivstatepdmp PRIMARY KEY (drugunivid,state_cd,startdate,pdmplisttype_cd);

REM DROP TABLE fdb_fcs_deamaster PURGE;
CREATE TABLE fdb_fcs_deamaster (script_dea_id INTEGER NOT NULL ,script_dea_cd VARCHAR2 (10) NOT NULL ,script_dea_cd_desc VARCHAR2 (50) NOT NULL ,script_dea_subset_id INTEGER NOT NULL ,script_dea_obsolete_dt INTEGER NULL );
ALTER TABLE fdb_fcs_deamaster ADD CONSTRAINT pkfdbfcsdeamaster PRIMARY KEY (script_dea_id);

REM DROP TABLE fdb_fcs_statemulticode PURGE;
CREATE TABLE fdb_fcs_statemulticode (drugunivid VARCHAR2 (50) NOT NULL ,state_cd VARCHAR2 (2) NOT NULL ,multitype_cd INTEGER NOT NULL );
ALTER TABLE fdb_fcs_statemulticode ADD CONSTRAINT pkfdbfcsstatemulticode PRIMARY KEY (drugunivid,state_cd,multitype_cd);

REM DROP TABLE fdb_fda_app_relationship PURGE;
CREATE TABLE fdb_fda_app_relationship (appl_relationship_id INTEGER NOT NULL ,appl_relationship_type_id SMALLINT NOT NULL ,appl_nbr1 VARCHAR2 (20) NOT NULL ,appl_type_id1 SMALLINT NOT NULL ,appl_nbr2 VARCHAR2 (20) NOT NULL ,appl_type_id2 SMALLINT NOT NULL ,appl_relationship_start_date VARCHAR2 (8) NOT NULL ,appl_relationship_end_date VARCHAR2 (8) NULL );
ALTER TABLE fdb_fda_app_relationship ADD CONSTRAINT pkfdbfdaapprelationship PRIMARY KEY (appl_relationship_id);

REM DROP TABLE fdb_frequency_interval PURGE;
CREATE TABLE fdb_frequency_interval (freq_int_id INTEGER NOT NULL ,freq_int_text_short VARCHAR2 (50) NULL ,freq_int_text_long VARCHAR2 (50) NULL ,freq_amount SMALLINT NULL ,freq_amount_upper SMALLINT NULL ,int_amount SMALLINT NULL ,int_amount_upper SMALLINT NULL ,int_amount_uom_id INTEGER NULL ,alternative_expression_id INTEGER NULL ,doses_per_day_amount decimal(19,6)  NULL ,univid VARCHAR2 (50) NULL );
ALTER TABLE fdb_frequency_interval ADD CONSTRAINT pkfdbfrequencyinterval PRIMARY KEY (freq_int_id);

REM DROP TABLE fdb_gen_disp_ingstr_type PURGE;
CREATE TABLE fdb_gen_disp_ingstr_type (strength_typ_code INTEGER NOT NULL ,strength_typ_desc VARCHAR2 (100) NULL );
ALTER TABLE fdb_gen_disp_ingstr_type ADD CONSTRAINT pkfdbgendispingstrtype PRIMARY KEY (strength_typ_code);

REM DROP TABLE fdb_gen_dispensable PURGE;
CREATE TABLE fdb_gen_dispensable (gcnseqno INTEGER NOT NULL ,description VARCHAR2 (255) NOT NULL ,rtid INTEGER NOT NULL ,dfid INTEGER NOT NULL ,strengthdesc VARCHAR2 (60) NULL ,strengthabbrev VARCHAR2 (10) NULL ,rtdfgenid INTEGER NOT NULL ,rtgenid INTEGER NOT NULL ,hiclseqno INTEGER NOT NULL ,genderspecificdrugcode VARCHAR2 (1) NOT NULL ,genericmedid INTEGER NULL ,singleingredientind SMALLINT NOT NULL ,medicaldeviceind SMALLINT NOT NULL ,haspackdrugsind SMALLINT NOT NULL ,piececount SMALLINT NULL ,piececountsourcecode VARCHAR2 (4) NULL ,statuscode VARCHAR2 (1) NOT NULL ,univid VARCHAR2 (50) NULL ,consumeravailabilitycode VARCHAR2 (1) NULL );
ALTER TABLE fdb_gen_dispensable ADD CONSTRAINT pkfdbgendispensable PRIMARY KEY (gcnseqno);

REM DROP TABLE fdb_gen_dispensable_ing_str PURGE;
CREATE TABLE fdb_gen_dispensable_ing_str (gcnseqno INTEGER NOT NULL ,hicseqno INTEGER NOT NULL ,strengthstatuscode VARCHAR2 (1) NULL ,strength decimal(19,6)  NOT NULL ,strengthuomid INTEGER NULL ,strengthtypecode VARCHAR2 (1) NULL ,volume decimal(19,6)  NOT NULL ,volumeuomid INTEGER NULL ,altstrength decimal(19,6)  NOT NULL ,altstrengthuomid INTEGER NULL ,altstrengthtypecode VARCHAR2 (1) NULL ,timevalue decimal(19,6)  NOT NULL ,timeuomid INTEGER NULL ,rangemax decimal(19,6)  NOT NULL ,rangemin decimal(19,6)  NOT NULL );
ALTER TABLE fdb_gen_dispensable_ing_str ADD CONSTRAINT pkfdbgendispensableingstr PRIMARY KEY (gcnseqno,hicseqno);

REM DROP TABLE fdb_gen_dispensable_link PURGE;
CREATE TABLE fdb_gen_dispensable_link (gcnseqno INTEGER NOT NULL ,sequencenumber INTEGER NOT NULL ,drugunivid VARCHAR2 (50) NOT NULL );
ALTER TABLE fdb_gen_dispensable_link ADD CONSTRAINT pkfdbgendispensablelink PRIMARY KEY (gcnseqno,sequencenumber,drugunivid);

REM DROP TABLE fdb_gen_dispensable_search PURGE;
CREATE TABLE fdb_gen_dispensable_search (gcnseqno INTEGER NOT NULL ,nametypecode VARCHAR2 (1) NOT NULL ,sequencenumber SMALLINT NOT NULL ,descsearch VARCHAR2 (255) NULL ,descdisplay VARCHAR2 (255) NULL ,regioncode VARCHAR2 (2) NULL ,altdescsearch VARCHAR2 (255) NULL );
ALTER TABLE fdb_gen_dispensable_search ADD CONSTRAINT pkfdbgendispensablesearch PRIMARY KEY (gcnseqno,nametypecode,sequencenumber);

REM DROP TABLE fdb_gen_dispensable_value PURGE;
CREATE TABLE fdb_gen_dispensable_value (gcnseqno INTEGER NOT NULL ,propertyid SMALLINT NOT NULL ,sequencenumber SMALLINT NOT NULL ,propertyvalue VARCHAR2 (255) NULL );
ALTER TABLE fdb_gen_dispensable_value ADD CONSTRAINT pkfdbgendispensablevalue PRIMARY KEY (gcnseqno,propertyid,sequencenumber);

REM DROP TABLE fdb_gen_drugname PURGE;
CREATE TABLE fdb_gen_drugname (hiclseqno INTEGER NOT NULL ,description VARCHAR2 (60) NOT NULL ,singleingredientind SMALLINT NOT NULL ,medicaldeviceind SMALLINT NOT NULL ,haspackdrugsind SMALLINT NOT NULL ,compid VARCHAR2 (6) NULL ,statuscode VARCHAR2 (1) NOT NULL ,univid VARCHAR2 (50) NULL ,consumeravailabilitycode VARCHAR2 (1) NULL );
ALTER TABLE fdb_gen_drugname ADD CONSTRAINT pkfdbgendrugname PRIMARY KEY (hiclseqno);

REM DROP TABLE fdb_gen_drugname_ingred PURGE;
CREATE TABLE fdb_gen_drugname_ingred (hiclseqno INTEGER NOT NULL ,hicseqno INTEGER NOT NULL );
ALTER TABLE fdb_gen_drugname_ingred ADD CONSTRAINT pkfdbgendrugnameingred PRIMARY KEY (hiclseqno,hicseqno);

REM DROP TABLE fdb_gen_drugname_link PURGE;
CREATE TABLE fdb_gen_drugname_link (hiclseqno INTEGER NOT NULL ,sequencenumber INTEGER NOT NULL ,drugunivid VARCHAR2 (50) NOT NULL );
ALTER TABLE fdb_gen_drugname_link ADD CONSTRAINT pkfdbgendrugnamelink PRIMARY KEY (hiclseqno,sequencenumber,drugunivid);

REM DROP TABLE fdb_gen_drugname_search PURGE;
CREATE TABLE fdb_gen_drugname_search (hiclseqno INTEGER NOT NULL ,nametypecode VARCHAR2 (1) NOT NULL ,sequencenumber SMALLINT NOT NULL ,descsearch VARCHAR2 (120) NULL ,descdisplay VARCHAR2 (120) NULL ,regioncode VARCHAR2 (2) NULL ,altdescsearch VARCHAR2 (120) NULL );
ALTER TABLE fdb_gen_drugname_search ADD CONSTRAINT pkfdbgendrugnamesearch PRIMARY KEY (hiclseqno,nametypecode,sequencenumber);

REM DROP TABLE fdb_gen_drugname_value PURGE;
CREATE TABLE fdb_gen_drugname_value (hiclseqno INTEGER NOT NULL ,propertyid SMALLINT NOT NULL ,sequencenumber SMALLINT NOT NULL ,propertyvalue VARCHAR2 (255) NULL );
ALTER TABLE fdb_gen_drugname_value ADD CONSTRAINT pkfdbgendrugnamevalue PRIMARY KEY (hiclseqno,propertyid,sequencenumber);

REM DROP TABLE fdb_gen_routeddfdrug PURGE;
CREATE TABLE fdb_gen_routeddfdrug (rtdfgenid INTEGER NOT NULL ,description VARCHAR2 (195) NOT NULL ,rtid INTEGER NOT NULL ,dfid INTEGER NOT NULL ,rtgenid INTEGER NOT NULL ,hiclseqno INTEGER NOT NULL ,singleingredientind SMALLINT NOT NULL ,medicaldeviceind SMALLINT NOT NULL ,haspackdrugsind SMALLINT NOT NULL ,statuscode VARCHAR2 (1) NOT NULL ,univid VARCHAR2 (50) NULL ,consumeravailabilitycode VARCHAR2 (1) NULL );
ALTER TABLE fdb_gen_routeddfdrug ADD CONSTRAINT pkfdbgenrouteddfdrug PRIMARY KEY (rtdfgenid);

REM DROP TABLE fdb_gen_routeddfdrug_link PURGE;
CREATE TABLE fdb_gen_routeddfdrug_link (rtdfgenid INTEGER NOT NULL ,sequencenumber INTEGER NOT NULL ,drugunivid VARCHAR2 (50) NOT NULL );
ALTER TABLE fdb_gen_routeddfdrug_link ADD CONSTRAINT pkfdbgenrouteddfdruglink PRIMARY KEY (rtdfgenid,sequencenumber,drugunivid);

REM DROP TABLE fdb_gen_routeddfdrug_search PURGE;
CREATE TABLE fdb_gen_routeddfdrug_search (rtdfgenid INTEGER NOT NULL ,nametypecode VARCHAR2 (1) NOT NULL ,sequencenumber SMALLINT NOT NULL ,descsearch VARCHAR2 (255) NULL ,descdisplay VARCHAR2 (255) NULL ,regioncode VARCHAR2 (2) NULL ,altdescsearch VARCHAR2 (255) NULL );
ALTER TABLE fdb_gen_routeddfdrug_search ADD CONSTRAINT pkfdbgenrouteddfdrugsearch PRIMARY KEY (rtdfgenid,nametypecode,sequencenumber);

REM DROP TABLE fdb_gen_routeddfdrug_value PURGE;
CREATE TABLE fdb_gen_routeddfdrug_value (rtdfgenid INTEGER NOT NULL ,propertyid SMALLINT NOT NULL ,sequencenumber SMALLINT NOT NULL ,propertyvalue VARCHAR2 (255) NULL );
ALTER TABLE fdb_gen_routeddfdrug_value ADD CONSTRAINT pkfdbgenrouteddfdrugvalue PRIMARY KEY (rtdfgenid,propertyid,sequencenumber);

REM DROP TABLE fdb_gen_routeddrug PURGE;
CREATE TABLE fdb_gen_routeddrug (rtgenid INTEGER NOT NULL ,description VARCHAR2 (155) NOT NULL ,rtid INTEGER NOT NULL ,hiclseqno INTEGER NOT NULL ,singleingredientind SMALLINT NOT NULL ,medicaldeviceind SMALLINT NOT NULL ,haspackdrugsind SMALLINT NOT NULL ,statuscode VARCHAR2 (1) NOT NULL ,univid VARCHAR2 (50) NULL ,consumeravailabilitycode VARCHAR2 (1) NULL );
ALTER TABLE fdb_gen_routeddrug ADD CONSTRAINT pkfdbgenrouteddrug PRIMARY KEY (rtgenid);

REM DROP TABLE fdb_gen_routeddrug_link PURGE;
CREATE TABLE fdb_gen_routeddrug_link (rtgenid INTEGER NOT NULL ,sequencenumber INTEGER NOT NULL ,drugunivid VARCHAR2 (50) NOT NULL );
ALTER TABLE fdb_gen_routeddrug_link ADD CONSTRAINT pkfdbgenrouteddruglink PRIMARY KEY (rtgenid,sequencenumber,drugunivid);

REM DROP TABLE fdb_gen_routeddrug_search PURGE;
CREATE TABLE fdb_gen_routeddrug_search (rtgenid INTEGER NOT NULL ,nametypecode VARCHAR2 (1) NOT NULL ,sequencenumber SMALLINT NOT NULL ,descsearch VARCHAR2 (255) NULL ,descdisplay VARCHAR2 (255) NULL ,regioncode VARCHAR2 (2) NULL ,altdescsearch VARCHAR2 (255) NULL );
ALTER TABLE fdb_gen_routeddrug_search ADD CONSTRAINT pkfdbgenrouteddrugsearch PRIMARY KEY (rtgenid,nametypecode,sequencenumber);

REM DROP TABLE fdb_gen_routeddrug_value PURGE;
CREATE TABLE fdb_gen_routeddrug_value (rtgenid INTEGER NOT NULL ,propertyid SMALLINT NOT NULL ,sequencenumber SMALLINT NOT NULL ,propertyvalue VARCHAR2 (255) NULL );
ALTER TABLE fdb_gen_routeddrug_value ADD CONSTRAINT pkfdbgenrouteddrugvalue PRIMARY KEY (rtgenid,propertyid,sequencenumber);

REM DROP TABLE fdb_hr_action PURGE;
CREATE TABLE fdb_hr_action (actioncd INTEGER NOT NULL ,actioncdparent INTEGER NULL ,actiondesc VARCHAR2 (200) NOT NULL );
ALTER TABLE fdb_hr_action ADD CONSTRAINT pkfdbhraction PRIMARY KEY (actioncd);

REM DROP TABLE fdb_hr_additionaltext PURGE;
CREATE TABLE fdb_hr_additionaltext (additionaltextid INTEGER NOT NULL ,additionaltext VARCHAR2 (500) NOT NULL );
ALTER TABLE fdb_hr_additionaltext ADD CONSTRAINT pkfdbhradditionaltext PRIMARY KEY (additionaltextid);

REM DROP TABLE fdb_hr_assoc_infobyte_action PURGE;
CREATE TABLE fdb_hr_assoc_infobyte_action (riskid INTEGER NOT NULL ,infobyteid INTEGER NOT NULL ,actioncd INTEGER NOT NULL ,sequencenumber INTEGER NOT NULL ,actorcd INTEGER NULL ,medcyclecd INTEGER NULL );
ALTER TABLE fdb_hr_assoc_infobyte_action ADD CONSTRAINT pkfdbhrassocriskinfobyteaction PRIMARY KEY (riskid,infobyteid,actioncd,sequencenumber);

REM DROP TABLE fdb_hr_assoc_risk_infobyte PURGE;
CREATE TABLE fdb_hr_assoc_risk_infobyte (riskid INTEGER NOT NULL ,infobyteid INTEGER NOT NULL ,infobytesequencenumber INTEGER NOT NULL ,categorycd INTEGER NOT NULL ,infobytestartdate VARCHAR2 (8) NOT NULL ,infobyteenddate VARCHAR2 (8) NULL ,infobyteversiondate VARCHAR2 (8) NOT NULL ,typecd INTEGER NOT NULL );
ALTER TABLE fdb_hr_assoc_risk_infobyte ADD CONSTRAINT pkfdbhrassocriskinfobyte PRIMARY KEY (riskid,infobyteid);

REM DROP TABLE fdb_hr_assoc_risk_mitigation PURGE;
CREATE TABLE fdb_hr_assoc_risk_mitigation (riskid INTEGER NOT NULL ,actioncd INTEGER NOT NULL ,mitigationsequencenumber INTEGER NOT NULL ,actorcd INTEGER NOT NULL ,medcyclecd INTEGER NULL ,additionaltextid INTEGER NULL ,typecd INTEGER NOT NULL );
ALTER TABLE fdb_hr_assoc_risk_mitigation ADD CONSTRAINT pkfdbhrassocriskactionmit PRIMARY KEY (riskid,actioncd,mitigationsequencenumber);

REM DROP TABLE fdb_hr_assoc_risk_monograph PURGE;
CREATE TABLE fdb_hr_assoc_risk_monograph (riskid INTEGER NOT NULL ,monographid INTEGER NOT NULL );
ALTER TABLE fdb_hr_assoc_risk_monograph ADD CONSTRAINT pkhrxriskmono PRIMARY KEY (riskid,monographid);

REM DROP TABLE fdb_hr_assoc_univid PURGE;
CREATE TABLE fdb_hr_assoc_univid (drugunivid VARCHAR2 (50) NOT NULL ,riskid INTEGER NOT NULL );
ALTER TABLE fdb_hr_assoc_univid ADD CONSTRAINT pkfdbhrunivid PRIMARY KEY (drugunivid,riskid);

REM DROP TABLE fdb_hr_infobyte PURGE;
CREATE TABLE fdb_hr_infobyte (infobyteid INTEGER NOT NULL ,infobytedesc VARCHAR2 (500) NOT NULL );
ALTER TABLE fdb_hr_infobyte ADD CONSTRAINT pkfdbhrinfobyte PRIMARY KEY (infobyteid);

REM DROP TABLE fdb_hr_monograph PURGE;
CREATE TABLE fdb_hr_monograph (monographid INTEGER NOT NULL ,monographtypecd INTEGER NOT NULL );
ALTER TABLE fdb_hr_monograph ADD CONSTRAINT pkfdbhrmonograph PRIMARY KEY (monographid);

REM DROP TABLE fdb_hr_monographdetail PURGE;
CREATE TABLE fdb_hr_monographdetail (monographid INTEGER NOT NULL ,sequencenumber INTEGER NOT NULL ,iscontinuation INTEGER NOT NULL ,monographtext VARCHAR2 (500) NULL );
ALTER TABLE fdb_hr_monographdetail ADD CONSTRAINT pkfdbhrmonographdetail PRIMARY KEY (monographid,sequencenumber);

REM DROP TABLE fdb_hr_replacement PURGE;
CREATE TABLE fdb_hr_replacement (riskidreplacement INTEGER NOT NULL ,riskidprevious INTEGER NOT NULL ,replacementeffectivedate VARCHAR2 (8) NOT NULL );
ALTER TABLE fdb_hr_replacement ADD CONSTRAINT pkfdbhrreplacement PRIMARY KEY (riskidreplacement,riskidprevious);

REM DROP TABLE fdb_hr_risk PURGE;
CREATE TABLE fdb_hr_risk (riskid INTEGER NOT NULL ,typecd INTEGER NOT NULL ,statuscd INTEGER NOT NULL ,groupdesc VARCHAR2 (100) NOT NULL ,urltxt VARCHAR2 (500) NULL ,startdate VARCHAR2 (8) NOT NULL ,enddate VARCHAR2 (8) NULL ,versiondate VARCHAR2 (8) NOT NULL );
ALTER TABLE fdb_hr_risk ADD CONSTRAINT pkfdbhrrisk PRIMARY KEY (riskid);

REM DROP TABLE fdb_imprint PURGE;
CREATE TABLE fdb_imprint (ipt_uniq_id VARCHAR2 (10) NOT NULL ,ipt_start_date VARCHAR2 (8) NOT NULL ,ipt_ndc VARCHAR2 (20) NOT NULL ,ipt_stop_date VARCHAR2 (8) NULL ,ipt_image VARCHAR2 (10) NULL ,ipt_doseform_cd VARCHAR2 (5) NULL ,ipt_shape_cd VARCHAR2 (5) NULL ,ipt_scoring_cd VARCHAR2 (5) NULL ,ipt_coating_cd VARCHAR2 (5) NULL ,ipt_flavor_cd VARCHAR2 (5) NULL ,ipt_clarity_cd VARCHAR2 (5) NULL ,ipt_side1 VARCHAR2 (40) NULL ,ipt_side2 VARCHAR2 (40) NULL ,ipt_color_palette_list VARCHAR2 (32) NULL ,ipt_search_description VARCHAR2 (85) NULL ,ipt_mfr_cd VARCHAR2 (10) NULL ,ipt_label_cd VARCHAR2 (7) NULL );
ALTER TABLE fdb_imprint ADD CONSTRAINT pkfdbimprint PRIMARY KEY (ipt_uniq_id,ipt_start_date);

REM DROP TABLE fdb_imprint_clarity_list PURGE;
CREATE TABLE fdb_imprint_clarity_list (ipt_clarity_cd VARCHAR2 (5) NOT NULL ,ipt_clarity_desc VARCHAR2 (30) NULL );
ALTER TABLE fdb_imprint_clarity_list ADD CONSTRAINT pkfdbimprintclaritylist PRIMARY KEY (ipt_clarity_cd);

REM DROP TABLE fdb_imprint_coating_list PURGE;
CREATE TABLE fdb_imprint_coating_list (ipt_coating_cd VARCHAR2 (5) NOT NULL ,ipt_coating_desc VARCHAR2 (30) NULL );
ALTER TABLE fdb_imprint_coating_list ADD CONSTRAINT pkfdbimprintcoatinglist PRIMARY KEY (ipt_coating_cd);

REM DROP TABLE fdb_imprint_color_list PURGE;
CREATE TABLE fdb_imprint_color_list (ipt_color_cd VARCHAR2 (5) NOT NULL ,ipt_color_desc VARCHAR2 (30) NULL ,ipt_color_palette_cd VARCHAR2 (5) NULL );
ALTER TABLE fdb_imprint_color_list ADD CONSTRAINT pkfdbimprintcolorlist PRIMARY KEY (ipt_color_cd);

REM DROP TABLE fdb_imprint_color_palette PURGE;
CREATE TABLE fdb_imprint_color_palette (ipt_color_palette_cd VARCHAR2 (5) NOT NULL ,ipt_color_palette_desc VARCHAR2 (30) NULL );
ALTER TABLE fdb_imprint_color_palette ADD CONSTRAINT pkfdbimprintcolorpalette PRIMARY KEY (ipt_color_palette_cd);

REM DROP TABLE fdb_imprint_color_xref PURGE;
CREATE TABLE fdb_imprint_color_xref (ipt_uniq_id VARCHAR2 (10) NOT NULL ,ipt_start_date VARCHAR2 (8) NOT NULL ,ipt_color_cd VARCHAR2 (5) NOT NULL );
ALTER TABLE fdb_imprint_color_xref ADD CONSTRAINT pkfdbimprintcolorxref PRIMARY KEY (ipt_uniq_id,ipt_start_date,ipt_color_cd);

REM DROP TABLE fdb_imprint_doseform_list PURGE;
CREATE TABLE fdb_imprint_doseform_list (ipt_doseform_cd VARCHAR2 (5) NOT NULL ,ipt_doseform_desc VARCHAR2 (30) NULL );
ALTER TABLE fdb_imprint_doseform_list ADD CONSTRAINT pkfdbimprintdoseformlist PRIMARY KEY (ipt_doseform_cd);

REM DROP TABLE fdb_imprint_flavor_list PURGE;
CREATE TABLE fdb_imprint_flavor_list (ipt_flavor_cd VARCHAR2 (5) NOT NULL ,ipt_flavor_desc VARCHAR2 (30) NULL );
ALTER TABLE fdb_imprint_flavor_list ADD CONSTRAINT pkfdbimprintflavorlist PRIMARY KEY (ipt_flavor_cd);

REM DROP TABLE fdb_imprint_image PURGE;
CREATE TABLE fdb_imprint_image (ipt_image VARCHAR2 (10) NOT NULL ,ipt_image_filename VARCHAR2 (20) NULL );
ALTER TABLE fdb_imprint_image ADD CONSTRAINT pkfdbimprintimage PRIMARY KEY (ipt_image);

REM DROP TABLE fdb_imprint_mfr_list PURGE;
CREATE TABLE fdb_imprint_mfr_list (ipt_mfr_cd VARCHAR2 (10) NOT NULL ,ipt_mfr_desc VARCHAR2 (30) NULL );
ALTER TABLE fdb_imprint_mfr_list ADD CONSTRAINT pkfdbimprintmfrlist PRIMARY KEY (ipt_mfr_cd);

REM DROP TABLE fdb_imprint_scoring_list PURGE;
CREATE TABLE fdb_imprint_scoring_list (ipt_scoring_cd VARCHAR2 (5) NOT NULL ,ipt_scoring_desc VARCHAR2 (30) NULL );
ALTER TABLE fdb_imprint_scoring_list ADD CONSTRAINT pkfdbimprintscoringlist PRIMARY KEY (ipt_scoring_cd);

REM DROP TABLE fdb_imprint_shape_list PURGE;
CREATE TABLE fdb_imprint_shape_list (ipt_shape_cd VARCHAR2 (5) NOT NULL ,ipt_shape_desc VARCHAR2 (30) NULL ,ipt_shape_palette_cd VARCHAR2 (5) NULL );
ALTER TABLE fdb_imprint_shape_list ADD CONSTRAINT pkfdbimprintshapelist PRIMARY KEY (ipt_shape_cd);

REM DROP TABLE fdb_imprint_shape_palette PURGE;
CREATE TABLE fdb_imprint_shape_palette (ipt_shape_palette_cd VARCHAR2 (5) NOT NULL ,ipt_shape_palette_desc VARCHAR2 (30) NULL );
ALTER TABLE fdb_imprint_shape_palette ADD CONSTRAINT pkfdbimprintshapepalette PRIMARY KEY (ipt_shape_palette_cd);

REM DROP TABLE fdb_imprint_text PURGE;
CREATE TABLE fdb_imprint_text (ipt_text_cd VARCHAR2 (10) NOT NULL ,ipt_text_lineno VARCHAR2 (3) NOT NULL ,ipt_text_desc VARCHAR2 (70) NULL );
ALTER TABLE fdb_imprint_text ADD CONSTRAINT pkfdbimprinttext PRIMARY KEY (ipt_text_cd,ipt_text_lineno);

REM DROP TABLE fdb_imprint_text_xref PURGE;
CREATE TABLE fdb_imprint_text_xref (ipt_uniq_id VARCHAR2 (10) NOT NULL ,ipt_start_date VARCHAR2 (8) NOT NULL ,ipt_text_cd VARCHAR2 (10) NOT NULL );
ALTER TABLE fdb_imprint_text_xref ADD CONSTRAINT pkfdbimprinttextxref PRIMARY KEY (ipt_uniq_id,ipt_start_date,ipt_text_cd);

REM DROP TABLE fdb_ind PURGE;
CREATE TABLE fdb_ind (indcts INTEGER NOT NULL ,dxid INTEGER NOT NULL ,sequencenumber SMALLINT NOT NULL ,drugdesc VARCHAR2 (100) NOT NULL ,diseasedesc VARCHAR2 (100) NOT NULL ,labeledcode VARCHAR2 (1) NULL ,proxyind VARCHAR2 (1) NULL ,predictorcode VARCHAR2 (1) NULL );
ALTER TABLE fdb_ind ADD CONSTRAINT pkfdbind PRIMARY KEY (indcts,dxid);

REM DROP TABLE fdb_ingred_allergengroup PURGE;
CREATE TABLE fdb_ingred_allergengroup (hicseqno INTEGER NOT NULL ,allergengroupid INTEGER NOT NULL );
ALTER TABLE fdb_ingred_allergengroup ADD CONSTRAINT pkfdbingredallergengroup PRIMARY KEY (hicseqno,allergengroupid);

REM DROP TABLE fdb_ingredient PURGE;
CREATE TABLE fdb_ingredient (hicseqno INTEGER NOT NULL ,descdisplay VARCHAR2 (50) NULL ,descsearch VARCHAR2 (50) NULL ,baseingredientid INTEGER NULL ,potentiallyinactivecode VARCHAR2 (1) NULL ,statuscode VARCHAR2 (1) NULL ,altdescsearch VARCHAR2 (50) NULL ,univid VARCHAR2 (50) NULL );
ALTER TABLE fdb_ingredient ADD CONSTRAINT pkfdbingredient PRIMARY KEY (hicseqno);

REM DROP TABLE fdb_labeler PURGE;
CREATE TABLE fdb_labeler (labelerid VARCHAR2 (6) NOT NULL ,description VARCHAR2 (100) NULL );
ALTER TABLE fdb_labeler ADD CONSTRAINT pkfdblabeler PRIMARY KEY (labelerid);

REM DROP TABLE fdb_lblw_link PURGE;
CREATE TABLE fdb_lblw_link (drugunivid VARCHAR2 (50) NOT NULL ,lblwid VARCHAR2 (4) NOT NULL ,priority SMALLINT NULL );
ALTER TABLE fdb_lblw_link ADD CONSTRAINT pkfdblblwlink PRIMARY KEY (drugunivid,lblwid);

REM DROP TABLE fdb_lblw_text PURGE;
CREATE TABLE fdb_lblw_text (languageid SMALLINT NOT NULL ,lblwid VARCHAR2 (4) NOT NULL ,sequencenumber SMALLINT NOT NULL ,warningtext VARCHAR2 (56) NULL );
ALTER TABLE fdb_lblw_text ADD CONSTRAINT pkfdblblwtext PRIMARY KEY (languageid,lblwid,sequencenumber);

REM DROP TABLE fdb_lblw_vendor PURGE;
CREATE TABLE fdb_lblw_vendor (lblwid VARCHAR2 (4) NOT NULL ,vendorversioncode VARCHAR2 (3) NOT NULL ,vendorcode VARCHAR2 (10) NULL );
ALTER TABLE fdb_lblw_vendor ADD CONSTRAINT pkfdblblwvendor PRIMARY KEY (lblwid,vendorversioncode);

REM DROP TABLE fdb_master_dosage_form PURGE;
CREATE TABLE fdb_master_dosage_form (dosage_form_id INTEGER NOT NULL ,dosage_form_desc_long VARCHAR2 (75) NULL ,dosage_form_desc_short VARCHAR2 (40) NULL ,dosage_form_retire_dt VARCHAR2 (8) NULL ,uom_mstr_id INTEGER NULL ,univid VARCHAR2 (50) NULL );
ALTER TABLE fdb_master_dosage_form ADD CONSTRAINT pkfdbmasterdosageform PRIMARY KEY (dosage_form_id);

REM DROP TABLE fdb_master_dosage_form_gendf PURGE;
CREATE TABLE fdb_master_dosage_form_gendf (dosage_form_id INTEGER NOT NULL ,gcdf VARCHAR2 (2) NOT NULL );
ALTER TABLE fdb_master_dosage_form_gendf ADD CONSTRAINT pkfdbmasterdosageformgendf PRIMARY KEY (dosage_form_id,gcdf);

REM DROP TABLE fdb_master_dosage_form_meddf PURGE;
CREATE TABLE fdb_master_dosage_form_meddf (dosage_form_id INTEGER NOT NULL ,med_dosage_form_id INTEGER NOT NULL );
ALTER TABLE fdb_master_dosage_form_meddf ADD CONSTRAINT pkfdbmasterdosageformmeddf PRIMARY KEY (dosage_form_id,med_dosage_form_id);

REM DROP TABLE fdb_master_route PURGE;
CREATE TABLE fdb_master_route (rt_id INTEGER NOT NULL ,rt_desc_short VARCHAR2 (50) NULL ,rt_desc_long VARCHAR2 (50) NULL ,rt_adverb VARCHAR2 (50) NULL ,drcm_rt_id VARCHAR2 (3) NULL ,drcm_screen_rt_id VARCHAR2 (3) NULL ,poem_rt_id SMALLINT NULL ,med_route_id INTEGER NULL ,ovw_clinical_rt_id INTEGER NULL ,gcrt VARCHAR2 (1) NULL ,disc_rt_code VARCHAR2 (1) NULL ,disc_rt_admin_text VARCHAR2 (80) NULL ,valid_cns_rt_code VARCHAR2 (1) NULL ,univid VARCHAR2 (50) NULL );
ALTER TABLE fdb_master_route ADD CONSTRAINT pkfdbmasterroute PRIMARY KEY (rt_id);

REM DROP TABLE fdb_master_route_dosage_form PURGE;
CREATE TABLE fdb_master_route_dosage_form (clinical_rt_id INTEGER NOT NULL ,dosage_form_id INTEGER NOT NULL ,verb VARCHAR2 (50) NULL ,prepositional_phrase VARCHAR2 (50) NULL );
ALTER TABLE fdb_master_route_dosage_form ADD CONSTRAINT pkfdbmasterroutedosageform PRIMARY KEY (clinical_rt_id,dosage_form_id);

REM DROP TABLE fdb_master_route_single_route PURGE;
CREATE TABLE fdb_master_route_single_route (disc_clinical_rt_id INTEGER NOT NULL ,single_clinical_rt_id INTEGER NOT NULL );
ALTER TABLE fdb_master_route_single_route ADD CONSTRAINT pkfdbmasterroutesingleroute PRIMARY KEY (disc_clinical_rt_id,single_clinical_rt_id);

REM DROP TABLE fdb_master_unit PURGE;
CREATE TABLE fdb_master_unit (uom_mstr_id INTEGER NOT NULL ,uom_mstr_desc VARCHAR2 (80) NULL ,uom_mstr_plural_desc VARCHAR2 (80) NULL ,uom_mstr_abbr VARCHAR2 (80) NULL ,uom_mstr_plural_abbr VARCHAR2 (80) NULL ,uom_mstr_preferred_desc VARCHAR2 (80) NULL ,uom_mstr_plural_preferred_desc VARCHAR2 (80) NULL ,uom_stds_org_desc VARCHAR2 (80) NULL ,uom_stds_org_abbr VARCHAR2 (80) NULL ,uom_plural_stds_org_desc VARCHAR2 (80) NULL ,uom_plural_stds_org_abbr VARCHAR2 (80) NULL ,uom_mstr_component1_id INTEGER NULL ,uom_mstr_component2_id INTEGER NULL ,uom_mstr_component3_id INTEGER NULL ,uom_type_cd VARCHAR2 (4) NULL ,ratio_ind SMALLINT NOT NULL ,rate_ind SMALLINT NOT NULL ,dose_ind SMALLINT NOT NULL ,interval_ind SMALLINT NOT NULL ,patient_param_req_cd VARCHAR2 (4) NULL ,param_incorp_uom_id INTEGER NULL ,pediatric_dose_text_ind SMALLINT NOT NULL ,comparison_uom_id INTEGER NULL ,dr2_units VARCHAR2 (2) NULL ,poeunitcde SMALLINT NULL ,ingredient_strength_uom_id INTEGER NULL ,ovw_uom_id INTEGER NULL ,dosing_unit_type_cd VARCHAR2 (4) NULL ,univid VARCHAR2 (50) NULL );
ALTER TABLE fdb_master_unit ADD CONSTRAINT pkfdbmasterunit PRIMARY KEY (uom_mstr_id);

REM DROP TABLE fdb_mc_inclusion_reason PURGE;
CREATE TABLE fdb_mc_inclusion_reason (fdb_inclusion_reason_cd SMALLINT NOT NULL ,fdb_inclusion_reason_desc VARCHAR2 (50) NOT NULL ,fdb_inclusion_reason_def VARCHAR2 (2000) NULL );
ALTER TABLE fdb_mc_inclusion_reason ADD CONSTRAINT pkfdbmcinclusionreason PRIMARY KEY (fdb_inclusion_reason_cd);

REM DROP TABLE fdb_mc_measure PURGE;
CREATE TABLE fdb_mc_measure (mc_measure_id INTEGER NOT NULL ,mc_measure_desc VARCHAR2 (255) NOT NULL ,mc_measure_definition VARCHAR2 (2000) NULL );
ALTER TABLE fdb_mc_measure ADD CONSTRAINT pkfdbmcmeasure PRIMARY KEY (mc_measure_id);

REM DROP TABLE fdb_mc_measure_timeframe PURGE;
CREATE TABLE fdb_mc_measure_timeframe (mc_measure_timeframe_id INTEGER NOT NULL ,mc_measure_timeframe_desc VARCHAR2 (255) NOT NULL ,mc_measure_timeframe_def VARCHAR2 (2000) NULL );
ALTER TABLE fdb_mc_measure_timeframe ADD CONSTRAINT pkfdbmcmeasuretimeframe PRIMARY KEY (mc_measure_timeframe_id);

REM DROP TABLE fdb_mc_product_attr PURGE;
CREATE TABLE fdb_mc_product_attr (fdb_product_id INTEGER NOT NULL ,mc_measure_id INTEGER NOT NULL ,mc_measure_timeframe_id INTEGER NOT NULL ,attribute_id INTEGER NOT NULL ,attr_sequence_number SMALLINT NOT NULL ,attr_value_sequence_number SMALLINT NOT NULL ,fdb_inclusion_reason_cd SMALLINT NOT NULL ,property_value VARCHAR2 (255) NOT NULL );
ALTER TABLE fdb_mc_product_attr ADD CONSTRAINT pkfdbmcproductattr PRIMARY KEY (fdb_product_id,mc_measure_id,mc_measure_timeframe_id,attribute_id,attr_sequence_number,attr_value_sequence_number);

REM DROP TABLE fdb_mc_product_attr_desc PURGE;
CREATE TABLE fdb_mc_product_attr_desc (attribute_id INTEGER NOT NULL ,description VARCHAR2 (100) NOT NULL ,attribute_type_id INTEGER NULL );
ALTER TABLE fdb_mc_product_attr_desc ADD CONSTRAINT pkfdbmcproductattrdesc PRIMARY KEY (attribute_id);

REM DROP TABLE fdb_mc_product_attr_type PURGE;
CREATE TABLE fdb_mc_product_attr_type (attribute_type_id INTEGER NOT NULL ,description VARCHAR2 (100) NOT NULL ,type_length INTEGER NOT NULL ,type_precision INTEGER NOT NULL );
ALTER TABLE fdb_mc_product_attr_type ADD CONSTRAINT pkfdbmcproductattrtype PRIMARY KEY (attribute_type_id);

REM DROP TABLE fdb_mc_product_attr_value PURGE;
CREATE TABLE fdb_mc_product_attr_value (attribute_id INTEGER NOT NULL ,property_value VARCHAR2 (255) NOT NULL ,description VARCHAR2 (500) NOT NULL );
ALTER TABLE fdb_mc_product_attr_value ADD CONSTRAINT pkfdbmcproductattrvalue PRIMARY KEY (attribute_id,property_value);

REM DROP TABLE fdb_mc_product_dose PURGE;
CREATE TABLE fdb_mc_product_dose (fdb_product_id INTEGER NOT NULL ,mc_measure_id INTEGER NOT NULL ,mc_measure_timeframe_id INTEGER NOT NULL ,strength decimal(19, 7)  NULL ,strength_uom_id INTEGER NOT NULL ,dosage_unit VARCHAR2 (255) NOT NULL ,fdb_inclusion_reason_cd SMALLINT NOT NULL );
ALTER TABLE fdb_mc_product_dose ADD CONSTRAINT pkfdbmcproductdose PRIMARY KEY (fdb_product_id,mc_measure_id,mc_measure_timeframe_id);

REM DROP TABLE fdb_medcond PURGE;
CREATE TABLE fdb_medcond (dxid INTEGER NOT NULL ,descriptionshort VARCHAR2 (56) NOT NULL ,descriptionlong VARCHAR2 (100) NOT NULL ,statuscode VARCHAR2 (1) NOT NULL ,fdbdx VARCHAR2 (9) NOT NULL ,diseasedurcode VARCHAR2 (1) NOT NULL ,descsearchshort VARCHAR2 (56) NOT NULL ,descsearchlong VARCHAR2 (100) NOT NULL ,altdescsearchshort VARCHAR2 (56) NOT NULL ,altdescsearchlong VARCHAR2 (100) NOT NULL ,haschildind SMALLINT NOT NULL ,toplevelind SMALLINT NOT NULL ,hasdrugsthatcauseind SMALLINT NOT NULL ,hasdrugsthattreatind SMALLINT NOT NULL ,hasdrugstoavoidind SMALLINT NOT NULL );
ALTER TABLE fdb_medcond ADD CONSTRAINT pkfdb_medcond PRIMARY KEY (dxid);

REM DROP TABLE fdb_medcond_ext PURGE;
CREATE TABLE fdb_medcond_ext (vocabtypeid VARCHAR2 (2) NOT NULL ,vocabid VARCHAR2 (50) NOT NULL ,descriptionshort VARCHAR2 (500) NULL ,descriptionlong VARCHAR2 (500) NOT NULL ,descsearchshort VARCHAR2 (500) NULL ,descsearchlong VARCHAR2 (500) NOT NULL ,altdescsearchshort VARCHAR2 (500) NULL ,altdescsearchlong VARCHAR2 (500) NOT NULL ,clinicallinkind SMALLINT NOT NULL ,hasdrugsthatcauseind SMALLINT NOT NULL ,hasdrugsthattreatind SMALLINT NOT NULL ,hasdrugstoavoidind SMALLINT NOT NULL ,haschildind SMALLINT NOT NULL ,toplevelind SMALLINT NOT NULL ,statuscode VARCHAR2 (1) NOT NULL ,vocabidsearch VARCHAR2 (50) NOT NULL ,firstdate VARCHAR2 (8) NULL ,lastdate VARCHAR2 (8) NULL );
ALTER TABLE fdb_medcond_ext ADD CONSTRAINT pkfdb_medcond_ext PRIMARY KEY (vocabtypeid,vocabid);

REM DROP TABLE fdb_medcond_ext_best_fit PURGE;
CREATE TABLE fdb_medcond_ext_best_fit (dxid INTEGER NOT NULL ,vocabtypeid VARCHAR2 (2) NOT NULL ,vocabid VARCHAR2 (50) NOT NULL ,linkfirstactivedate VARCHAR2 (8) NOT NULL ,linkind SMALLINT NOT NULL ,linklastactivedate VARCHAR2 (8) NULL );
ALTER TABLE fdb_medcond_ext_best_fit ADD CONSTRAINT pkfdbmedcondextbestfit PRIMARY KEY (dxid,vocabtypeid,vocabid,linkfirstactivedate);

REM DROP TABLE fdb_medcond_ext_billable_hist PURGE;
CREATE TABLE fdb_medcond_ext_billable_hist (vocabtypeid VARCHAR2 (2) NOT NULL ,vocabid VARCHAR2 (50) NOT NULL ,firstbillabledate VARCHAR2 (8) NOT NULL ,lastbillabledate VARCHAR2 (8) NULL );
ALTER TABLE fdb_medcond_ext_billable_hist ADD CONSTRAINT pkfdbmedcondextbillhist PRIMARY KEY (vocabtypeid,vocabid,firstbillabledate);

REM DROP TABLE fdb_medcond_ext_exclusion PURGE;
CREATE TABLE fdb_medcond_ext_exclusion (vocabtypeid VARCHAR2 (2) NOT NULL ,vocabid VARCHAR2 (50) NOT NULL ,dxid INTEGER NOT NULL ,clinicalcode VARCHAR2 (2) NOT NULL ,clinicalmoduleid INTEGER NOT NULL );
ALTER TABLE fdb_medcond_ext_exclusion ADD CONSTRAINT pkfdb_medcond_ext_exclusion PRIMARY KEY (vocabtypeid,vocabid,dxid,clinicalcode,clinicalmoduleid);

REM DROP TABLE fdb_medcond_ext_hierarchy PURGE;
CREATE TABLE fdb_medcond_ext_hierarchy (vocabtypeid VARCHAR2 (2) NOT NULL ,vocabid VARCHAR2 (50) NOT NULL ,broadervocabid VARCHAR2 (50) NOT NULL ,toplevelrelind SMALLINT NOT NULL );
ALTER TABLE fdb_medcond_ext_hierarchy ADD CONSTRAINT pkfdb_medcond_ext_hierarchy PRIMARY KEY (vocabtypeid,vocabid,broadervocabid,toplevelrelind);

REM DROP TABLE fdb_medcond_ext_link PURGE;
CREATE TABLE fdb_medcond_ext_link (vocabtypeid VARCHAR2 (2) NOT NULL ,vocabid VARCHAR2 (50) NOT NULL ,dxid INTEGER NOT NULL ,clinicalcode VARCHAR2 (2) NOT NULL ,navcode VARCHAR2 (2) NOT NULL );
ALTER TABLE fdb_medcond_ext_link ADD CONSTRAINT pkfdb_medcond_ext_link PRIMARY KEY (vocabtypeid,vocabid,dxid,clinicalcode);

REM DROP TABLE fdb_medcond_ext_value PURGE;
CREATE TABLE fdb_medcond_ext_value (vocabtypeid VARCHAR2 (2) NOT NULL ,vocabid VARCHAR2 (50) NOT NULL ,propertyid INTEGER NOT NULL ,sequencenumber SMALLINT NOT NULL ,propertyvalue VARCHAR2 (255) NULL );
ALTER TABLE fdb_medcond_ext_value ADD CONSTRAINT pkfdb_medcond_ext_value PRIMARY KEY (vocabtypeid,vocabid,propertyid,sequencenumber);

REM DROP TABLE fdb_medcond_hierarchy PURGE;
CREATE TABLE fdb_medcond_hierarchy (dxid INTEGER NOT NULL ,broaderdxid INTEGER NOT NULL ,toplevelrelind SMALLINT NOT NULL );
ALTER TABLE fdb_medcond_hierarchy ADD CONSTRAINT pkfdb_medcond_hierarchy PRIMARY KEY (dxid,broaderdxid,toplevelrelind);

REM DROP TABLE fdb_medcond_related PURGE;
CREATE TABLE fdb_medcond_related (dxid INTEGER NOT NULL ,relateddxid INTEGER NOT NULL ,clinicalcode VARCHAR2 (2) NOT NULL ,navcode VARCHAR2 (2) NULL );
ALTER TABLE fdb_medcond_related ADD CONSTRAINT pkfdb_medcond_related PRIMARY KEY (dxid,relateddxid,clinicalcode);

REM DROP TABLE fdb_medcond_replacement PURGE;
CREATE TABLE fdb_medcond_replacement (replaceddxid INTEGER NOT NULL ,replacementdxid INTEGER NOT NULL ,replacementdate VARCHAR2 (8) NULL );
ALTER TABLE fdb_medcond_replacement ADD CONSTRAINT pkfdb_medcond_replacement PRIMARY KEY (replaceddxid,replacementdxid);

REM DROP TABLE fdb_medcond_synonym PURGE;
CREATE TABLE fdb_medcond_synonym (synid INTEGER NOT NULL ,dxid INTEGER NOT NULL ,nametypecode VARCHAR2 (2) NOT NULL ,descriptionshort VARCHAR2 (56) NOT NULL ,descriptionlong VARCHAR2 (100) NOT NULL ,statuscode VARCHAR2 (1) NOT NULL ,descsearchshort VARCHAR2 (56) NOT NULL ,descsearchlong VARCHAR2 (100) NOT NULL ,altdescsearchshort VARCHAR2 (56) NOT NULL ,altdescsearchlong VARCHAR2 (100) NOT NULL );
ALTER TABLE fdb_medcond_synonym ADD CONSTRAINT pkfdb_medcond_synonym PRIMARY KEY (synid);

REM DROP TABLE fdb_medcond_value PURGE;
CREATE TABLE fdb_medcond_value (dxid INTEGER NOT NULL ,propertyid SMALLINT NOT NULL ,sequencenumber SMALLINT NOT NULL ,propertyvalue VARCHAR2 (255) NULL );
ALTER TABLE fdb_medcond_value ADD CONSTRAINT pkfdb_medcond_value PRIMARY KEY (dxid,propertyid,sequencenumber);

REM DROP TABLE fdb_monograph_ddim PURGE;
CREATE TABLE fdb_monograph_ddim (languageid SMALLINT NOT NULL ,versioncode VARCHAR2 (1) NOT NULL ,monographid INTEGER NOT NULL ,sequencenumber SMALLINT NOT NULL ,sectioncode VARCHAR2 (1) NOT NULL ,formatcode VARCHAR2 (1) NOT NULL ,linetext VARCHAR2 (255) NOT NULL ,referencecategorycode VARCHAR2 (1) NULL ,univid VARCHAR2 (50) NULL );
ALTER TABLE fdb_monograph_ddim ADD CONSTRAINT pkfdbmonographddim PRIMARY KEY (languageid,versioncode,monographid,sequencenumber);

REM DROP TABLE fdb_monograph_dfim PURGE;
CREATE TABLE fdb_monograph_dfim (languageid SMALLINT NOT NULL ,versioncode VARCHAR2 (1) NOT NULL ,monographid INTEGER NOT NULL ,sequencenumber SMALLINT NOT NULL ,sectioncode VARCHAR2 (1) NULL ,formatcode VARCHAR2 (1) NULL ,linetext VARCHAR2 (255) NULL ,univid VARCHAR2 (50) NULL );
ALTER TABLE fdb_monograph_dfim ADD CONSTRAINT pkfdbmonographdfim PRIMARY KEY (languageid,versioncode,monographid,sequencenumber);

REM DROP TABLE fdb_monograph_dosing PURGE;
CREATE TABLE fdb_monograph_dosing (languageid SMALLINT NOT NULL ,monographid INTEGER NOT NULL ,sequencenumber INTEGER NOT NULL ,sectioncode VARCHAR2 (4) NULL ,formatcode VARCHAR2 (1) NULL ,linetext VARCHAR2 (255) NULL ,univid VARCHAR2 (50) NULL );
ALTER TABLE fdb_monograph_dosing ADD CONSTRAINT pkfdbmonographdosing PRIMARY KEY (languageid,monographid,sequencenumber);

REM DROP TABLE fdb_monograph_pem PURGE;
CREATE TABLE fdb_monograph_pem (languageid SMALLINT NOT NULL ,monographid INTEGER NOT NULL ,sequencenumber SMALLINT NOT NULL ,sectioncode VARCHAR2 (1) NULL ,formatcode VARCHAR2 (1) NULL ,linetext VARCHAR2 (255) NULL ,univid VARCHAR2 (50) NULL );
ALTER TABLE fdb_monograph_pem ADD CONSTRAINT pkfdbmonographpem PRIMARY KEY (languageid,monographid,sequencenumber);

REM DROP TABLE fdb_packageddrug PURGE;
CREATE TABLE fdb_packageddrug (pdid VARCHAR2 (20) NOT NULL ,description VARCHAR2 (100) NOT NULL ,brandname VARCHAR2 (60) NOT NULL ,labelerid VARCHAR2 (6) NOT NULL ,gcnseqno INTEGER NOT NULL ,rtdfgenid INTEGER NOT NULL ,rtgenid INTEGER NOT NULL ,hiclseqno INTEGER NOT NULL ,medid INTEGER NOT NULL ,rdfmid INTEGER NOT NULL ,rmid INTEGER NOT NULL ,mnid INTEGER NOT NULL ,genericmedid INTEGER NOT NULL ,rtid INTEGER NOT NULL ,dfid INTEGER NOT NULL ,strength VARCHAR2 (15) NULL ,strengthunits VARCHAR2 (15) NULL ,adddate VARCHAR2 (8) NOT NULL ,nametypecode VARCHAR2 (1) NOT NULL ,singleingredientind SMALLINT NOT NULL ,medicaldeviceind SMALLINT NOT NULL ,statuscode VARCHAR2 (1) NOT NULL ,univid VARCHAR2 (50) NULL ,authorizedgenericind SMALLINT NOT NULL ,ndcfoundinavlblappsourcesind SMALLINT NOT NULL ,fdaregisteredndcind SMALLINT NOT NULL ,fdbmntndfdaregisteredndcind SMALLINT NOT NULL ,reasonnotpricedcode SMALLINT NULL ,conprice1crrntsourcereasoncode SMALLINT NULL ,conprice2crrntsourcereasoncode SMALLINT NULL ,otherfdasourcecode SMALLINT NULL ,fdacurrentnsdemrktngstartdate VARCHAR2 (8) NULL ,fdacrntarchvnsdemrktngstrtdate VARCHAR2 (8) NULL ,fdacurrentnsdemarketingenddate VARCHAR2 (8) NULL ,fdacrntarchvdnsdemrktngenddate VARCHAR2 (8) NULL ,repackagedoriginalndc VARCHAR2 (20) NULL ,lastpriceverificationdate VARCHAR2 (8) NULL ,obsoletereasoncode SMALLINT NULL ,fdarepackagedoriginalcore9 VARCHAR2 (9) NULL ,nadacclassforratesetting VARCHAR2 (50) NULL ,federallegendcode VARCHAR2 (1) NULL ,obsoletedate VARCHAR2 (8) NULL ,federaldeaclasscode VARCHAR2 (1) NULL ,gennameddrugcode VARCHAR2 (1) NULL ,gentherequivcode VARCHAR2 (1) NULL ,innovatorind SMALLINT NOT NULL ,multisourcecode VARCHAR2 (1) NULL ,privlabeledprodind SMALLINT NOT NULL ,repackagerind SMALLINT NOT NULL ,adddescriptor VARCHAR2 (20) NULL ,hcfadrugcategorycode VARCHAR2 (1) NULL ,hcfadrugtypecode VARCHAR2 (1) NULL ,hcfafdaapprovaldate VARCHAR2 (8) NULL);
alter table fdb_packageddrug add (
hcfafdatheraequivcode VARCHAR2 (2) NULL ,hcfamarketentrydate VARCHAR2 (8) NULL ,hcfaterminationdate VARCHAR2 (8) NULL ,cmsreactivationdate VARCHAR2 (8) NULL ,hcfaunitsperpackage decimal(11, 3)  NOT NULL ,hcfaunittypecode VARCHAR2 (3) NULL ,fdalistingsequencenumber INTEGER NULL ,genmfgcode VARCHAR2 (1) NULL ,inactiveingredientreviewind SMALLINT NOT NULL ,innerpackind SMALLINT NOT NULL ,labelname25gennamecode VARCHAR2 (1) NOT NULL ,labelname VARCHAR2 (30) NOT NULL ,maintenancedrugind VARCHAR2 (1) NOT NULL ,ndc VARCHAR2 (13) NULL ,formatcode VARCHAR2 (1) NULL ,ndcformatted VARCHAR2 (13) NULL ,needlegauge decimal(5, 3)  NULL ,needlelength decimal(5, 3)  NULL ,outerpackind SMALLINT NOT NULL ,packagedescription VARCHAR2 (10) NULL ,packagequantity INTEGER NULL ,packagesize decimal(11, 3)  NULL ,packagesizeequiv decimal(11, 3)  NULL ,packagesizeunitscode VARCHAR2 (1) NULL ,patientpkginsertind SMALLINT NOT NULL ,previousndc VARCHAR2 (20) NULL ,replacementndc VARCHAR2 (20) NULL ,syringecapacity decimal(5, 3)  NULL ,thirdpartyrestrictioncode VARCHAR2 (1) NULL ,top200rank VARCHAR2 (3) NULL ,top50genrank VARCHAR2 (2) NULL ,tradename VARCHAR2 (125) NULL ,unitdosepackagingind SMALLINT NOT NULL ,unitofusepackagingind SMALLINT NOT NULL ,codstatuscode VARCHAR2 (2) NULL ,codstatuseffectivedate VARCHAR2 (8) NULL ,preservativefreecode VARCHAR2 (1) NULL ,sugarfreecode VARCHAR2 (1) NULL ,latexfreecode VARCHAR2 (1) NULL ,alcoholfreecode VARCHAR2 (1) NULL ,storagecode VARCHAR2 (1) NULL ,mostrecentadddate VARCHAR2 (8) NULL ,hasndaind SMALLINT NOT NULL ,hasandaind SMALLINT NOT NULL ,hasblaind SMALLINT NOT NULL ,hasotcmonographind SMALLINT NOT NULL ,listedmanufacturername VARCHAR2 (50) NULL ,descriptiontm VARCHAR2 (100) NULL ,descriptiontmsourcecode SMALLINT NULL ,brandnametm VARCHAR2 (60) NULL ,brandnametmsourcecode SMALLINT NULL ,labelnametm VARCHAR2 (30) NULL ,labelnametmsourcecode SMALLINT NULL ,bulkchemicalind SMALLINT NOT NULL ,fdacurrentnsdemrktngcat VARCHAR2 (2000) NULL ,fdacurrentarchvdnsdemrktngcat VARCHAR2 (2000) NULL ,morphineequivcode VARCHAR2 (1) NULL );
ALTER TABLE fdb_packageddrug ADD CONSTRAINT pkfdbpackageddrug PRIMARY KEY (pdid);

REM DROP TABLE fdb_packageddrug_clncl_qty PURGE;
CREATE TABLE fdb_packageddrug_clncl_qty (pdid VARCHAR2 (20) NOT NULL ,medid INTEGER NOT NULL ,clnqtysubunitqty decimal(18, 7)  NULL ,clnqtysubuomdesc VARCHAR2 (70) NOT NULL ,clnqtypkgdesc VARCHAR2 (50) NULL ,clnqtydesc VARCHAR2 (255) NOT NULL ,erxqty decimal(18, 7)  NOT NULL ,erxscriptuomdesc VARCHAR2 (50) NOT NULL ,erxscriptpotunitcd VARCHAR2 (10) NOT NULL );
ALTER TABLE fdb_packageddrug_clncl_qty ADD CONSTRAINT pkfdbpackageddrugclnclqty PRIMARY KEY (pdid,medid);

REM DROP TABLE fdb_packageddrug_disp_hist PURGE;
CREATE TABLE fdb_packageddrug_disp_hist (pdid VARCHAR2 (20) NOT NULL ,movetypecode VARCHAR2 (1) NOT NULL ,productiondate VARCHAR2 (8) NOT NULL ,prevmedid INTEGER NULL ,prevmedidnamesourcecode VARCHAR2 (1) NULL ,prevmedidoldstatuscode VARCHAR2 (1) NULL ,prevmedidnewstatuscode VARCHAR2 (1) NULL ,prevmediddescription VARCHAR2 (70) NULL ,currmedid INTEGER NULL ,currmedidnamesourcecode VARCHAR2 (1) NULL ,currmedidoldstatuscode VARCHAR2 (1) NULL ,currmedidnewstatuscode VARCHAR2 (1) NULL ,currmediddescription VARCHAR2 (70) NULL );
ALTER TABLE fdb_packageddrug_disp_hist ADD CONSTRAINT pkfdbpackageddrugdisphist PRIMARY KEY (pdid,movetypecode,productiondate);

REM DROP TABLE fdb_packageddrug_disp_hist_rsn PURGE;
CREATE TABLE fdb_packageddrug_disp_hist_rsn (pdid VARCHAR2 (20) NOT NULL ,movetypecode VARCHAR2 (1) NOT NULL ,productiondate VARCHAR2 (8) NOT NULL ,movereasoncode VARCHAR2 (4) NOT NULL );
ALTER TABLE fdb_packageddrug_disp_hist_rsn ADD CONSTRAINT pkfdbpackageddrugdisphistrsn PRIMARY KEY (pdid,movetypecode,productiondate,movereasoncode);

REM DROP TABLE fdb_packageddrug_price PURGE;
CREATE TABLE fdb_packageddrug_price (pdid VARCHAR2 (20) NOT NULL ,pricetypecode VARCHAR2 (2) NOT NULL ,effectivedate VARCHAR2 (8) NOT NULL ,price decimal(19,6)  NOT NULL ,currentpriceind SMALLINT NOT NULL );
ALTER TABLE fdb_packageddrug_price ADD CONSTRAINT pkfdbpackageddrugprice PRIMARY KEY (pdid,pricetypecode,effectivedate);

REM DROP TABLE fdb_packageddrug_search PURGE;
CREATE TABLE fdb_packageddrug_search (pdid VARCHAR2 (20) NOT NULL ,sequencenumber SMALLINT NOT NULL ,descsearch VARCHAR2 (100) NULL ,descdisplay VARCHAR2 (100) NULL ,altdescsearch VARCHAR2 (100) NULL );
ALTER TABLE fdb_packageddrug_search ADD CONSTRAINT pkfdbpackageddrugsearch PRIMARY KEY (pdid,sequencenumber);

REM DROP TABLE fdb_packageddrug_value PURGE;
CREATE TABLE fdb_packageddrug_value (pdid VARCHAR2 (20) NOT NULL ,propertyid SMALLINT NOT NULL ,sequencenumber SMALLINT NOT NULL ,propertyvalue VARCHAR2 (255) NULL );
ALTER TABLE fdb_packageddrug_value ADD CONSTRAINT pkfdbpackageddrugvalue PRIMARY KEY (pdid,propertyid,sequencenumber);

REM DROP TABLE fdb_pediatric_weight PURGE;
CREATE TABLE fdb_pediatric_weight (lowagedays SMALLINT NOT NULL ,highagedays SMALLINT NOT NULL ,agerangedescription VARCHAR2 (30) NULL ,male5thpctweight decimal(19,6)  NULL ,male25thpctweight decimal(19,6)  NULL ,male50thpctweight decimal(19,6)  NULL ,male75thpctweight decimal(19,6)  NULL ,male95thpctweight decimal(19,6)  NULL ,female5thpctweight decimal(19,6)  NULL ,female25thpctweight decimal(19,6)  NULL ,female50thpctweight decimal(19,6)  NULL ,female75thpctweight decimal(19,6)  NULL ,female95thpctweight decimal(19,6)  NULL );
ALTER TABLE fdb_pediatric_weight ADD CONSTRAINT pkfdbpediatricweight PRIMARY KEY (lowagedays,highagedays);

REM DROP TABLE fdb_precgeri PURGE;
CREATE TABLE fdb_precgeri (gericode INTEGER NOT NULL ,description VARCHAR2 (41) NULL ,severitylevelcode VARCHAR2 (1) NULL ,sysrenalcode VARCHAR2 (1) NULL ,syshepaticcode VARCHAR2 (1) NULL ,syscardiocode VARCHAR2 (1) NULL ,syspulmcode VARCHAR2 (1) NULL ,sysneurcode VARCHAR2 (1) NULL ,sysendocode VARCHAR2 (1) NULL ,beerslistcode VARCHAR2 (1) NULL ,hedislistcode VARCHAR2 (1) NULL ,stopplistcode VARCHAR2 (1) NULL ,narrative VARCHAR2 (500) NULL ,univid VARCHAR2 (50) NOT NULL );
ALTER TABLE fdb_precgeri ADD CONSTRAINT pkfdbprecgeri PRIMARY KEY (gericode);

REM DROP TABLE fdb_preclact PURGE;
CREATE TABLE fdb_preclact (lactcode INTEGER NOT NULL ,description VARCHAR2 (40) NULL ,severitylevelcode VARCHAR2 (1) NULL ,excreffectcode VARCHAR2 (1) NULL ,lacteffectcode VARCHAR2 (1) NULL ,narrative VARCHAR2 (500) NULL ,univid VARCHAR2 (50) NOT NULL );
ALTER TABLE fdb_preclact ADD CONSTRAINT pkfdbpreclact PRIMARY KEY (lactcode);

REM DROP TABLE fdb_precpedi PURGE;
CREATE TABLE fdb_precpedi (pedicode INTEGER NOT NULL ,description VARCHAR2 (34) NULL ,severitylevelcode VARCHAR2 (1) NULL ,ageindayslow SMALLINT NULL ,ageindayshigh SMALLINT NULL ,narrative VARCHAR2 (500) NULL ,univid VARCHAR2 (50) NOT NULL );
ALTER TABLE fdb_precpedi ADD CONSTRAINT pkfdbprecpedi PRIMARY KEY (pedicode);

REM DROP TABLE fdb_precpreg PURGE;
CREATE TABLE fdb_precpreg (pregcode INTEGER NOT NULL ,description VARCHAR2 (41) NOT NULL ,severitylevelcode VARCHAR2 (1) NOT NULL ,boxedwarningind SMALLINT NOT NULL ,univid VARCHAR2 (50) NOT NULL );
ALTER TABLE fdb_precpreg ADD CONSTRAINT pkfdbprecpreg PRIMARY KEY (pregcode);

REM DROP TABLE fdb_precpreg_mono PURGE;
CREATE TABLE fdb_precpreg_mono (monographid INTEGER NOT NULL ,monographsectioncd INTEGER NOT NULL ,monographslsn INTEGER NOT NULL ,pregcode INTEGER NOT NULL ,monographtext VARCHAR2 (500) NOT NULL );
ALTER TABLE fdb_precpreg_mono ADD CONSTRAINT pkfdbprecpregmono PRIMARY KEY (monographid,monographsectioncd,monographslsn);

REM DROP TABLE fdb_precpreg_reference PURGE;
CREATE TABLE fdb_precpreg_reference (pregcode INTEGER NOT NULL ,reference_id INTEGER NOT NULL );
ALTER TABLE fdb_precpreg_reference ADD CONSTRAINT pkfdbprecpregreference PRIMARY KEY (pregcode,reference_id);

REM DROP TABLE fdb_product PURGE;
CREATE TABLE fdb_product (fdb_product_id INTEGER NOT NULL ,fdb_product_status_code VARCHAR2 (8) NOT NULL ,gcnseqno INTEGER NOT NULL ,labelerid VARCHAR2 (6) NOT NULL ,description VARCHAR2 (255) NOT NULL ,fdb_product_first_delivered_dt VARCHAR2 (8) NOT NULL ,fdb_product_obsolete_date VARCHAR2 (8) NULL ,desc_search VARCHAR2 (255) NOT NULL ,alt_desc_search VARCHAR2 (255) NULL );
ALTER TABLE fdb_product ADD CONSTRAINT pkfdbproduct PRIMARY KEY (fdb_product_id);

REM DROP TABLE fdb_product_price PURGE;
CREATE TABLE fdb_product_price (fdb_product_id INTEGER NOT NULL ,price_type_id INTEGER NOT NULL ,price_effective_date VARCHAR2 (8) NOT NULL ,price decimal(18, 7)  NOT NULL ,price_quantity decimal(18, 7)  NOT NULL ,price_uom_id INTEGER NOT NULL ,currency_code VARCHAR2 (3) NOT NULL );
ALTER TABLE fdb_product_price ADD CONSTRAINT pkfdbproductprice PRIMARY KEY (fdb_product_id,price_type_id,price_effective_date);

REM DROP TABLE fdb_product_price_attr_desc PURGE;
CREATE TABLE fdb_product_price_attr_desc (attribute_code VARCHAR2 (8) NOT NULL ,description VARCHAR2 (100) NOT NULL ,attribute_type_code VARCHAR2 (8) NOT NULL ,attribute_group_code VARCHAR2 (8) NULL );
ALTER TABLE fdb_product_price_attr_desc ADD CONSTRAINT pkfdbproductpriceattrdesc PRIMARY KEY (attribute_code);

REM DROP TABLE fdb_product_price_attr_type PURGE;
CREATE TABLE fdb_product_price_attr_type (attribute_type_code VARCHAR2 (8) NOT NULL ,description VARCHAR2 (50) NOT NULL ,type_length INTEGER NOT NULL ,type_precision INTEGER NULL );
ALTER TABLE fdb_product_price_attr_type ADD CONSTRAINT pkfdbproductpriceattrtype PRIMARY KEY (attribute_type_code);

REM DROP TABLE fdb_product_price_attribute PURGE;
CREATE TABLE fdb_product_price_attribute (fdb_product_id INTEGER NOT NULL ,price_type_id SMALLINT NOT NULL ,price_effective_date VARCHAR2 (8) NOT NULL ,attribute_code VARCHAR2 (8) NOT NULL ,attr_sequence_number INTEGER NOT NULL ,attr_value_sequence_number INTEGER NOT NULL ,property_value VARCHAR2 (255) NOT NULL );
ALTER TABLE fdb_product_price_attribute ADD CONSTRAINT pkfdbproductpriceattribute PRIMARY KEY (fdb_product_id,price_type_id,price_effective_date,attribute_code,attr_sequence_number,attr_value_sequence_number);

REM DROP TABLE fdb_product_price_type PURGE;
CREATE TABLE fdb_product_price_type (price_type_id INTEGER NOT NULL ,short_description VARCHAR2 (10) NOT NULL ,long_description VARCHAR2 (50) NOT NULL ,pricetypecode VARCHAR2 (2) NULL ,price_type_definition VARCHAR2 (2000) NOT NULL );
ALTER TABLE fdb_product_price_type ADD CONSTRAINT pkfdbproductpricetype PRIMARY KEY (price_type_id);

REM DROP TABLE fdb_property_name PURGE;
CREATE TABLE fdb_property_name (propertyid SMALLINT NOT NULL ,description VARCHAR2 (255) NULL ,groupcode SMALLINT NULL ,codedefinitiontype SMALLINT NULL ,concatenationind SMALLINT NOT NULL );
ALTER TABLE fdb_property_name ADD CONSTRAINT pkfdbpropertyname PRIMARY KEY (propertyid);

REM DROP TABLE fdb_property_value PURGE;
CREATE TABLE fdb_property_value (univid VARCHAR2 (50) NOT NULL ,propertyid SMALLINT NOT NULL ,sequencenumber SMALLINT NOT NULL ,propertyvalue VARCHAR2 (255) NULL );
ALTER TABLE fdb_property_value ADD CONSTRAINT pkfdbpropertyvalue PRIMARY KEY (univid,propertyid,sequencenumber);

REM DROP TABLE fdb_reference PURGE;
CREATE TABLE fdb_reference (reference_id INTEGER NOT NULL ,reference_type_id INTEGER NOT NULL ,title VARCHAR2 (255) NOT NULL ,author VARCHAR2 (255) NULL ,name VARCHAR2 (255) NULL ,issue_date VARCHAR2 (25) NULL ,volume VARCHAR2 (80) NULL ,issue VARCHAR2 (80) NULL ,page VARCHAR2 (80) NULL ,pubmed_id VARCHAR2 (50) NULL ,url_text VARCHAR2 (500) NULL );
ALTER TABLE fdb_reference ADD CONSTRAINT pkfdbreference PRIMARY KEY (reference_id);

REM DROP TABLE fdb_related_route PURGE;
CREATE TABLE fdb_related_route (continuous_rt_id INTEGER NOT NULL ,intermittent_rt_id INTEGER NOT NULL );
ALTER TABLE fdb_related_route ADD CONSTRAINT pkfdbrelatedroute PRIMARY KEY (continuous_rt_id,intermittent_rt_id);

REM DROP TABLE fdb_replacement PURGE;
CREATE TABLE fdb_replacement (replacedunivid VARCHAR2 (50) NOT NULL ,replacementunivid VARCHAR2 (50) NOT NULL );
ALTER TABLE fdb_replacement ADD CONSTRAINT pkfdbreplacement PRIMARY KEY (replacedunivid,replacementunivid);

REM DROP TABLE fdb_routeddfdrug PURGE;
CREATE TABLE fdb_routeddfdrug (rdfmid INTEGER NOT NULL ,description VARCHAR2 (60) NOT NULL ,descriptiontm VARCHAR2 (70) NULL ,mnid INTEGER NOT NULL ,rtid INTEGER NOT NULL ,dfid INTEGER NOT NULL ,rmid INTEGER NOT NULL ,nametypecode VARCHAR2 (1) NOT NULL ,singleingredientind SMALLINT NOT NULL ,medicaldeviceind SMALLINT NOT NULL ,haspackdrugsind SMALLINT NOT NULL ,hasequivpackdrugsind SMALLINT NOT NULL ,statuscode VARCHAR2 (1) NULL ,univid VARCHAR2 (50) NULL ,reffederallegendcode VARCHAR2 (1) NULL ,obsoletedate VARCHAR2 (8) NULL ,tm_sourcecode VARCHAR2 (1) NULL );
ALTER TABLE fdb_routeddfdrug ADD CONSTRAINT pkfdbrouteddfdrug PRIMARY KEY (rdfmid);

REM DROP TABLE fdb_routeddfdrug_gen_link PURGE;
CREATE TABLE fdb_routeddfdrug_gen_link (rdfmid INTEGER NOT NULL ,rtdfgenid INTEGER NOT NULL );
ALTER TABLE fdb_routeddfdrug_gen_link ADD CONSTRAINT pkfdbrouteddfdruggenlink PRIMARY KEY (rdfmid,rtdfgenid);

REM DROP TABLE fdb_routeddfdrug_search PURGE;
CREATE TABLE fdb_routeddfdrug_search (rdfmid INTEGER NOT NULL ,sequencenumber SMALLINT NOT NULL ,descsearch VARCHAR2 (60) NOT NULL ,descdisplay VARCHAR2 (60) NOT NULL ,altdescsearch VARCHAR2 (60) NULL );
ALTER TABLE fdb_routeddfdrug_search ADD CONSTRAINT pkfdbrouteddfdrugsearch PRIMARY KEY (rdfmid,sequencenumber);

REM DROP TABLE fdb_routeddfdrug_value PURGE;
CREATE TABLE fdb_routeddfdrug_value (rdfmid INTEGER NOT NULL ,propertyid SMALLINT NOT NULL ,sequencenumber SMALLINT NOT NULL ,propertyvalue VARCHAR2 (255) NULL );
ALTER TABLE fdb_routeddfdrug_value ADD CONSTRAINT pkfdbrouteddfdrugvalue PRIMARY KEY (rdfmid,propertyid,sequencenumber);

REM DROP TABLE fdb_routeddrug PURGE;
CREATE TABLE fdb_routeddrug (rmid INTEGER NOT NULL ,description VARCHAR2 (60) NOT NULL ,descriptiontm VARCHAR2 (70) NULL ,mnid INTEGER NOT NULL ,rtid INTEGER NOT NULL ,nametypecode VARCHAR2 (1) NOT NULL ,singleingredientind SMALLINT NOT NULL ,medicaldeviceind SMALLINT NOT NULL ,haspackdrugsind SMALLINT NOT NULL ,hasequivpackdrugsind SMALLINT NOT NULL ,statuscode VARCHAR2 (1) NOT NULL ,univid VARCHAR2 (50) NULL ,reffederallegendcode VARCHAR2 (1) NULL ,obsoletedate VARCHAR2 (8) NULL ,tm_sourcecode VARCHAR2 (1) NULL );
ALTER TABLE fdb_routeddrug ADD CONSTRAINT pkfdbrouteddrug PRIMARY KEY (rmid);

REM DROP TABLE fdb_routeddrug_gen_link PURGE;
CREATE TABLE fdb_routeddrug_gen_link (rmid INTEGER NOT NULL ,rtgenid INTEGER NOT NULL );
ALTER TABLE fdb_routeddrug_gen_link ADD CONSTRAINT pkfdbrouteddruggenlink PRIMARY KEY (rmid,rtgenid);

REM DROP TABLE fdb_routeddrug_search PURGE;
CREATE TABLE fdb_routeddrug_search (rmid INTEGER NOT NULL ,sequencenumber SMALLINT NOT NULL ,descsearch VARCHAR2 (60) NOT NULL ,descdisplay VARCHAR2 (60) NOT NULL ,altdescsearch VARCHAR2 (60) NULL );
ALTER TABLE fdb_routeddrug_search ADD CONSTRAINT pkfdbrouteddrugsearch PRIMARY KEY (rmid,sequencenumber);

REM DROP TABLE fdb_routeddrug_value PURGE;
CREATE TABLE fdb_routeddrug_value (rmid INTEGER NOT NULL ,propertyid SMALLINT NOT NULL ,sequencenumber SMALLINT NOT NULL ,propertyvalue VARCHAR2 (255) NULL );
ALTER TABLE fdb_routeddrug_value ADD CONSTRAINT pkfdbrouteddrugvalue PRIMARY KEY (rmid,propertyid,sequencenumber);

REM DROP TABLE fdb_rxnorm_concept PURGE;
CREATE TABLE fdb_rxnorm_concept (rxcui VARCHAR2 (50) NOT NULL ,rxn_sab VARCHAR2 (20) NOT NULL ,rxn_tty VARCHAR2 (20) NOT NULL ,rxn_code VARCHAR2 (50) NOT NULL ,rxn_code_no INTEGER NULL ,rxn_suppress VARCHAR2 (1) NOT NULL ,fdb_exclude_rxcui_ind SMALLINT NOT NULL ,evd_shared_rxcui_ind SMALLINT NOT NULL ,evd_prescribable_rxcui_ind SMALLINT NOT NULL ,unii_code VARCHAR2 (20) NULL );
ALTER TABLE fdb_rxnorm_concept ADD CONSTRAINT pkfdbrxnormconcept PRIMARY KEY (rxcui,rxn_sab,rxn_tty,rxn_code);

REM DROP TABLE fdb_rxnorm_cs_exception PURGE;
CREATE TABLE fdb_rxnorm_cs_exception (rxn_rxcui_screened VARCHAR2 (8) NOT NULL ,rxn_rxcui_unscreened VARCHAR2 (8) NOT NULL ,rxn_rxcui_unscreened_desc VARCHAR2 (255) NOT NULL );
ALTER TABLE fdb_rxnorm_cs_exception ADD CONSTRAINT pkfdbrxnormfdbcsexception PRIMARY KEY (rxn_rxcui_screened,rxn_rxcui_unscreened);

REM DROP TABLE fdb_rxnorm_cs_link PURGE;
CREATE TABLE fdb_rxnorm_cs_link (extvocabid VARCHAR2 (50) NOT NULL ,extvocabtypecode VARCHAR2 (4) NOT NULL ,fdbunivid VARCHAR2 (50) NOT NULL ,preferred_ind SMALLINT NOT NULL ,partial_ind SMALLINT NOT NULL ,link_add_date VARCHAR2 (8) NOT NULL ,link_inactive_date VARCHAR2 (8) NULL );
ALTER TABLE fdb_rxnorm_cs_link ADD CONSTRAINT pkfdbrxnormfdbcslink PRIMARY KEY (extvocabid,extvocabtypecode,fdbunivid);

REM DROP TABLE fdb_rxnorm_term PURGE;
CREATE TABLE fdb_rxnorm_term (rxn_term_id INTEGER NOT NULL ,rxcui VARCHAR2 (50) NOT NULL ,rxn_sab VARCHAR2 (20) NOT NULL ,rxn_tty VARCHAR2 (20) NOT NULL ,rxn_code VARCHAR2 (50) NOT NULL ,description VARCHAR2 (4000) NOT NULL ,search_desc VARCHAR2 (4000) NOT NULL ,alt_search_desc VARCHAR2 (4000) NULL );
ALTER TABLE fdb_rxnorm_term ADD CONSTRAINT pkfdbrxnormterm PRIMARY KEY (rxn_term_id);

REM DROP TABLE fdb_rxnorm_term_desc PURGE;
CREATE TABLE fdb_rxnorm_term_desc (rxn_term_id INTEGER NOT NULL ,rxn_seq_sn SMALLINT NOT NULL ,rxn_string VARCHAR2 (255) NOT NULL );
ALTER TABLE fdb_rxnorm_term_desc ADD CONSTRAINT pkfdbrxnormtermdesc PRIMARY KEY (rxn_term_id,rxn_seq_sn);

REM DROP TABLE fdb_sct_link PURGE;
CREATE TABLE fdb_sct_link (snomed_value_set_id SMALLINT NOT NULL ,extvocabid VARCHAR2 (50) NOT NULL ,extvocabtypecode VARCHAR2 (4) NOT NULL ,fdbunivid VARCHAR2 (50) NOT NULL ,preferred_ind SMALLINT NOT NULL ,related_ind SMALLINT NOT NULL ,link_add_date VARCHAR2 (8) NOT NULL ,link_inactive_date VARCHAR2 (8) NULL );
ALTER TABLE fdb_sct_link ADD CONSTRAINT pkfdbsctfdblink PRIMARY KEY (snomed_value_set_id,extvocabid,extvocabtypecode,fdbunivid);

REM DROP TABLE fdb_sct_value_set PURGE;
CREATE TABLE fdb_sct_value_set (snomed_value_set_id SMALLINT NOT NULL ,extvocabid VARCHAR2 (50) NOT NULL ,extvocabtypecode VARCHAR2 (4) NOT NULL ,sct_description_id VARCHAR2 (50) NOT NULL ,sct_type_id SMALLINT NOT NULL ,term VARCHAR2 (255) NOT NULL ,term_search VARCHAR2 (255) NOT NULL ,alt_term_search VARCHAR2 (255) NOT NULL ,add_date VARCHAR2 (8) NOT NULL ,inactive_date VARCHAR2 (8) NULL );
ALTER TABLE fdb_sct_value_set ADD CONSTRAINT pkfdbsctvalueset PRIMARY KEY (snomed_value_set_id,extvocabid,extvocabtypecode,sct_description_id);

REM DROP TABLE fdb_sct_value_set_desc PURGE;
CREATE TABLE fdb_sct_value_set_desc (snomed_value_set_id SMALLINT NOT NULL ,description VARCHAR2 (255) NOT NULL ,comments VARCHAR2 (255) NULL ,extvocabtypecode VARCHAR2 (4) NOT NULL ,add_date VARCHAR2 (8) NOT NULL ,inactive_date VARCHAR2 (8) NULL );
ALTER TABLE fdb_sct_value_set_desc ADD CONSTRAINT pkfdbsctvaluesetdesc PRIMARY KEY (snomed_value_set_id);

REM DROP TABLE fdb_side PURGE;
CREATE TABLE fdb_side (sideid INTEGER NOT NULL ,dxid INTEGER NOT NULL ,drugdesc VARCHAR2 (100) NOT NULL ,diseasedesc VARCHAR2 (100) NOT NULL ,sequencenumber SMALLINT NOT NULL ,frequencycode VARCHAR2 (1) NOT NULL ,severitylevelcode VARCHAR2 (1) NOT NULL ,visibilitycode VARCHAR2 (1) NOT NULL ,labcode VARCHAR2 (1) NOT NULL ,physiciancode VARCHAR2 (1) NOT NULL ,hypersensitivityind VARCHAR2 (1) NULL );
ALTER TABLE fdb_side ADD CONSTRAINT pkfdbside PRIMARY KEY (sideid,dxid);

REM DROP TABLE fdb_uom_conversion PURGE;
CREATE TABLE fdb_uom_conversion (from_uom_id INTEGER NOT NULL ,to_uom_id INTEGER NOT NULL ,uom_conversion_factor decimal(19,6)  NULL );
ALTER TABLE fdb_uom_conversion ADD CONSTRAINT pkfdbuomconversion PRIMARY KEY (from_uom_id,to_uom_id);

REM DROP TABLE fdb_uom_type_description PURGE;
CREATE TABLE fdb_uom_type_description (uom_type_cd SMALLINT NOT NULL ,uom_type_cd_desc VARCHAR2 (50) NULL ,univid VARCHAR2 (50) NULL );
ALTER TABLE fdb_uom_type_description ADD CONSTRAINT pkfdbuomtypedescription PRIMARY KEY (uom_type_cd);

REM DROP TABLE fdb_ushik PURGE;
CREATE TABLE fdb_ushik (ushik_measure_identifier decimal(8)  NOT NULL ,ushik_quality_data_element VARCHAR2 (255) NOT NULL ,ushik_value_set_oid VARCHAR2 (100) NOT NULL ,ushik_code_system VARCHAR2 (50) NOT NULL ,ushik_code_system_version VARCHAR2 (50) NOT NULL ,ushik_concept VARCHAR2 (50) NOT NULL ,ushik_measure_title VARCHAR2 (255) NOT NULL ,ushik_nqf_id VARCHAR2 (50) NOT NULL ,ushik_version decimal(8)  NOT NULL ,ushik_eligibility VARCHAR2 (100) NOT NULL ,ushik_category VARCHAR2 (100) NULL ,ushik_value_set_name VARCHAR2 (255) NOT NULL ,ushik_value_set_version decimal(8)  NOT NULL ,ushik_concept_description VARCHAR2 (1000) NOT NULL );
ALTER TABLE fdb_ushik ADD CONSTRAINT pkushik PRIMARY KEY (ushik_measure_identifier,ushik_quality_data_element,ushik_value_set_oid,ushik_code_system,ushik_code_system_version,ushik_concept);

REM DROP TABLE fdb_version PURGE;
CREATE TABLE fdb_version (versionkey SMALLINT NOT NULL ,dbversion VARCHAR2 (10) NULL ,country VARCHAR2 (10) NULL ,frequency VARCHAR2 (1) NULL ,productiondate VARCHAR2 (8) NULL ,versioncomment VARCHAR2 (80) NULL );
ALTER TABLE fdb_version ADD CONSTRAINT pkfdbversion PRIMARY KEY (versionkey);
spool off;
exit;