forked from mmarifat/dmd_postgres_parser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dmd_structure.sql
103 lines (94 loc) · 16.4 KB
/
dmd_structure.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
DROP TABLE IF EXISTS lookup_availability_restriction CASCADE;
DROP TABLE IF EXISTS lookup_basis_of_name CASCADE;
DROP TABLE IF EXISTS lookup_basis_of_strnth CASCADE;
DROP TABLE IF EXISTS lookup_colour CASCADE;
DROP TABLE IF EXISTS lookup_combination_pack_ind CASCADE;
DROP TABLE IF EXISTS lookup_combination_prod_ind CASCADE;
DROP TABLE IF EXISTS lookup_control_drug_category CASCADE;
DROP TABLE IF EXISTS lookup_df_indicator CASCADE;
DROP TABLE IF EXISTS lookup_discontinued_ind CASCADE;
DROP TABLE IF EXISTS lookup_dnd CASCADE;
DROP TABLE IF EXISTS lookup_dt_payment_category CASCADE;
DROP TABLE IF EXISTS lookup_flavour CASCADE;
DROP TABLE IF EXISTS lookup_form CASCADE;
DROP TABLE IF EXISTS lookup_legal_category CASCADE;
DROP TABLE IF EXISTS lookup_licensing_authority CASCADE;
DROP TABLE IF EXISTS lookup_licensing_authority_change_reason CASCADE;
DROP TABLE IF EXISTS lookup_namechange_reason CASCADE;
DROP TABLE IF EXISTS lookup_ont_form_route CASCADE;
DROP TABLE IF EXISTS lookup_price_basis CASCADE;
DROP TABLE IF EXISTS lookup_reimbursement_status CASCADE;
DROP TABLE IF EXISTS lookup_route CASCADE;
DROP TABLE IF EXISTS lookup_spec_cont CASCADE;
DROP TABLE IF EXISTS lookup_supplier CASCADE;
DROP TABLE IF EXISTS lookup_unit_of_measure CASCADE;
DROP TABLE IF EXISTS lookup_virtual_product_non_avail CASCADE;
DROP TABLE IF EXISTS lookup_virtual_product_pres_status CASCADE;
DROP TABLE IF EXISTS ingredient_ingredient_substances CASCADE;
DROP TABLE IF EXISTS vmp_control_drug_info CASCADE;
DROP TABLE IF EXISTS vmp_drug_form CASCADE;
DROP TABLE IF EXISTS vmp_drug_route CASCADE;
DROP TABLE IF EXISTS vmp_ont_drug_form CASCADE;
DROP TABLE IF EXISTS vmp_virtual_product_ingredient CASCADE;
DROP TABLE IF EXISTS vmp_vmps CASCADE;
DROP TABLE IF EXISTS vmpp_comb_content CASCADE;
DROP TABLE IF EXISTS vmpp_drug_tariff_info CASCADE;
DROP TABLE IF EXISTS vmpp_vmpps CASCADE;
DROP TABLE IF EXISTS vtm_virtual_therapeutic_moieties CASCADE;
DROP TABLE IF EXISTS amp_amps CASCADE;
DROP TABLE IF EXISTS ampp_ampps CASCADE;
DROP TABLE IF EXISTS amp_ap_information CASCADE;
DROP TABLE IF EXISTS amp_ap_ingredient CASCADE;
DROP TABLE IF EXISTS ampp_appliance_pack_info CASCADE;
DROP TABLE IF EXISTS amp_licensed_route CASCADE;
DROP TABLE IF EXISTS ampp_comb_content CASCADE;
DROP TABLE IF EXISTS ampp_drug_product_prescrib_info CASCADE;
DROP TABLE IF EXISTS ampp_medicinal_product_price CASCADE;
DROP TABLE IF EXISTS ampp_reimbursement_info CASCADE;
CREATE TABLE lookup_availability_restriction ("CD" BIGINT NOT NULL, "DESC" VARCHAR(60) NOT NULL, PRIMARY KEY ("CD"));
CREATE TABLE lookup_basis_of_name ("CD" BIGINT NOT NULL, "DESC" VARCHAR(150) NOT NULL, PRIMARY KEY ("CD"));
CREATE TABLE lookup_basis_of_strnth ("CD" BIGINT NOT NULL, "DESC" VARCHAR(150) NOT NULL, PRIMARY KEY ("CD"));
CREATE TABLE lookup_colour ("CD" BIGINT NOT NULL, "DESC" VARCHAR(60) NOT NULL, PRIMARY KEY ("CD"));
CREATE TABLE lookup_combination_pack_ind ("CD" BIGINT NOT NULL, "DESC" VARCHAR(60) NOT NULL, PRIMARY KEY ("CD"));
CREATE TABLE lookup_combination_prod_ind ("CD" BIGINT NOT NULL, "DESC" VARCHAR(60) NOT NULL, PRIMARY KEY ("CD"));
CREATE TABLE lookup_control_drug_category ("CD" BIGINT NOT NULL, "DESC" VARCHAR(60) NOT NULL, PRIMARY KEY ("CD"));
CREATE TABLE lookup_df_indicator ("CD" BIGINT NOT NULL, "DESC" VARCHAR(20) NOT NULL, PRIMARY KEY ("CD"));
CREATE TABLE lookup_discontinued_ind ("CD" BIGINT NOT NULL, "DESC" VARCHAR(60) NOT NULL, PRIMARY KEY ("CD"));
CREATE TABLE lookup_dnd ("CD" BIGINT NOT NULL, "DESC" VARCHAR(60) NOT NULL, PRIMARY KEY ("CD"));
CREATE TABLE lookup_dt_payment_category ("CD" BIGINT NOT NULL, "DESC" VARCHAR(60) NOT NULL, PRIMARY KEY ("CD"));
CREATE TABLE lookup_flavour ("CD" BIGINT NOT NULL, "DESC" VARCHAR(60) NOT NULL, PRIMARY KEY ("CD"));
CREATE TABLE lookup_form ("CD" BIGINT NOT NULL, "CDDT" CHAR(10) DEFAULT NULL, "CDPREV" TEXT DEFAULT NULL, "DESC" VARCHAR(60) NOT NULL, "isSynchronized" BOOLEAN DEFAULT FALSE, PRIMARY KEY ("CD"));
CREATE TABLE lookup_legal_category ("CD" BIGINT NOT NULL, "DESC" VARCHAR(60) NOT NULL, PRIMARY KEY ("CD"));
CREATE TABLE lookup_licensing_authority ("CD" BIGINT NOT NULL, "DESC" VARCHAR(60) NOT NULL, PRIMARY KEY ("CD"));
CREATE TABLE lookup_licensing_authority_change_reason ("CD" BIGINT NOT NULL, "DESC" VARCHAR(60) NOT NULL, PRIMARY KEY ("CD"));
CREATE TABLE lookup_namechange_reason ("CD" BIGINT NOT NULL, "DESC" VARCHAR(150) NOT NULL, PRIMARY KEY ("CD"));
CREATE TABLE lookup_ont_form_route ("CD" BIGINT NOT NULL, "DESC" VARCHAR(60) NOT NULL, "isSynchronized" BOOLEAN DEFAULT FALSE, PRIMARY KEY ("CD"));
CREATE TABLE lookup_price_basis ("CD" BIGINT NOT NULL, "DESC" VARCHAR(60) NOT NULL, PRIMARY KEY ("CD"));
CREATE TABLE lookup_reimbursement_status ("CD" BIGINT NOT NULL, "DESC" VARCHAR(60) NOT NULL, PRIMARY KEY ("CD"));
CREATE TABLE lookup_route ("CD" BIGINT NOT NULL, "CDDT" CHAR(10) DEFAULT NULL, "CDPREV" TEXT DEFAULT NULL, "DESC" VARCHAR(60) NOT NULL, "isSynchronized" BOOLEAN DEFAULT FALSE, PRIMARY KEY ("CD"));
CREATE TABLE lookup_spec_cont ("CD" BIGINT NOT NULL, "DESC" VARCHAR(60) NOT NULL, PRIMARY KEY ("CD"));
CREATE TABLE lookup_supplier ("CD" BIGINT NOT NULL, "CDDT" CHAR(10) DEFAULT NULL, "CDPREV" TEXT DEFAULT NULL, "INVALID" TEXT DEFAULT NULL, "DESC" VARCHAR(80) NOT NULL, "isSynchronized" BOOLEAN DEFAULT FALSE, PRIMARY KEY ("CD"));
CREATE TABLE lookup_unit_of_measure ("CD" BIGINT NOT NULL, "CDDT" CHAR(10) DEFAULT NULL, "CDPREV" TEXT DEFAULT NULL, "DESC" VARCHAR(150) NOT NULL, "isSynchronized" BOOLEAN DEFAULT FALSE, PRIMARY KEY ("CD"));
CREATE TABLE lookup_virtual_product_non_avail ("CD" BIGINT NOT NULL, "DESC" VARCHAR(60) NOT NULL, PRIMARY KEY ("CD"));
CREATE TABLE lookup_virtual_product_pres_status ("CD" BIGINT NOT NULL, "DESC" VARCHAR(60) NOT NULL, PRIMARY KEY ("CD"));
CREATE TABLE ingredient_ingredient_substances ("ISID" BIGINT NOT NULL, "ISIDDT" CHAR(10) DEFAULT NULL, "ISIDPREV" TEXT DEFAULT NULL, "INVALID" TEXT DEFAULT NULL, "NM" VARCHAR(255) NOT NULL, PRIMARY KEY ("ISID"));
CREATE TABLE vtm_virtual_therapeutic_moieties ("VTMID" BIGINT NOT NULL, "INVALID" TEXT DEFAULT NULL, "NM" VARCHAR(255) NOT NULL, "ABBREVNM" VARCHAR(60) DEFAULT NULL, "VTMIDPREV" TEXT DEFAULT NULL, "VTMIDDT" CHAR(10) DEFAULT NULL, "isSynchronized" BOOLEAN DEFAULT FALSE, PRIMARY KEY ("VTMID"));
CREATE TABLE vmp_vmps ("VPID" BIGINT NOT NULL, "VPIDDT" CHAR(10) DEFAULT NULL, "VPIDPREV" TEXT DEFAULT NULL, "VTMID" BIGINT DEFAULT NULL, "INVALID" TEXT DEFAULT NULL, "NM" VARCHAR(255) NOT NULL, "ABBREVNM" VARCHAR(60) DEFAULT NULL, "BASISCD" BIGINT NOT NULL, "NMDT" CHAR(10) DEFAULT NULL, "NMPREV" VARCHAR(255) DEFAULT NULL, "BASIS_PREVCD" BIGINT DEFAULT NULL, "NMCHANGECD" BIGINT DEFAULT NULL, "COMBPRODCD" BIGINT DEFAULT NULL, "PRES_STATCD" BIGINT NOT NULL, "SUG_F" TEXT DEFAULT NULL, "GLU_F" TEXT DEFAULT NULL, "PRES_F" TEXT DEFAULT NULL, "CFC_F" TEXT DEFAULT NULL, "NON_AVAILCD" BIGINT DEFAULT NULL, "NON_AVAILDT" CHAR(10) DEFAULT NULL, "DF_INDCD" BIGINT DEFAULT NULL, "UDFS" DECIMAL(10,3) DEFAULT NULL, "UDFS_UOMCD" BIGINT DEFAULT NULL, "UNIT_DOSE_UOMCD" BIGINT DEFAULT NULL, "isSynchronized" BOOLEAN DEFAULT FALSE, PRIMARY KEY ("VPID"), CONSTRAINT FK_vmp_vmps_vtmid_vtm_virtual_therapeutic_moieties_vtmid FOREIGN KEY ("VTMID") REFERENCES vtm_virtual_therapeutic_moieties ("VTMID"), CONSTRAINT LU_vmp_vmps_basis_prevcd_basis_of_name FOREIGN KEY ("BASIS_PREVCD") REFERENCES lookup_basis_of_name ("CD"), CONSTRAINT LU_vmp_vmps_basiscd_basis_of_name FOREIGN KEY ("BASISCD") REFERENCES lookup_basis_of_name ("CD"), CONSTRAINT LU_vmp_vmps_combprodcd_combinaton_prod_ind FOREIGN KEY ("COMBPRODCD") REFERENCES lookup_combination_prod_ind ("CD"), CONSTRAINT LU_vmp_vmps_df_indcd_df_indicator FOREIGN KEY ("DF_INDCD") REFERENCES lookup_df_indicator ("CD"), CONSTRAINT LU_vmp_vmps_nmchangecd_namechange_reason FOREIGN KEY ("NMCHANGECD") REFERENCES lookup_namechange_reason ("CD"), CONSTRAINT LU_vmp_vmps_non_availcd_virtual_product_non_avail FOREIGN KEY ("NON_AVAILCD") REFERENCES lookup_virtual_product_non_avail ("CD"), CONSTRAINT LU_vmp_vmps_pres_statcd_virtual_product_pres_status FOREIGN KEY ("PRES_STATCD") REFERENCES lookup_virtual_product_pres_status ("CD"), CONSTRAINT LU_vmp_vmps_udfs_uomcd_unit_of_measure FOREIGN KEY ("UDFS_UOMCD") REFERENCES lookup_unit_of_measure ("CD"), CONSTRAINT LU_vmp_vmps_unit_dose_uomcd_unit_of_measure FOREIGN KEY ("UNIT_DOSE_UOMCD") REFERENCES lookup_unit_of_measure ("CD"));
CREATE TABLE vmpp_vmpps ("VPPID" BIGINT NOT NULL, "INVALID" TEXT DEFAULT NULL, "NM" VARCHAR(420) NOT NULL, "VPID" BIGINT NOT NULL, "QTYVAL" DECIMAL(10,2) DEFAULT NULL, "QTY_UOMCD" BIGINT DEFAULT NULL, "COMBPACKCD" BIGINT DEFAULT NULL, PRIMARY KEY ("VPPID"), CONSTRAINT FK_vmpp_vmpps_vpid_vmp_vmps_vpid FOREIGN KEY ("VPID") REFERENCES vmp_vmps ("VPID"), CONSTRAINT LU_vmpp_vmpps_qty_uomcd_unit_of_measure FOREIGN KEY ("QTY_UOMCD") REFERENCES lookup_unit_of_measure ("CD"), CONSTRAINT LU_vmpp_vmpps_combpackcd_combination_pack_ind FOREIGN KEY ("COMBPACKCD") REFERENCES lookup_combination_pack_ind ("CD"));
CREATE TABLE vmp_control_drug_info ("VPID" BIGINT NOT NULL, "CATCD" BIGINT NOT NULL, "CATDT" CHAR(10) DEFAULT NULL, "CAT_PREVCD" BIGINT DEFAULT NULL, CONSTRAINT FK_vmp_cdi_vpid_vmp_vmps_vpid FOREIGN KEY ("VPID") REFERENCES vmp_vmps ("VPID"), CONSTRAINT LU_vmp_cdi_cat_prevcd_control_drug_category FOREIGN KEY ("CAT_PREVCD") REFERENCES lookup_control_drug_category ("CD"), CONSTRAINT LU_vmp_cdi_catcd_control_drug_category FOREIGN KEY ("CATCD") REFERENCES lookup_control_drug_category ("CD"));
CREATE TABLE vmp_drug_form ("VPID" BIGINT NOT NULL, "FORMCD" BIGINT NOT NULL, "isSynchronized" BOOLEAN DEFAULT FALSE, CONSTRAINT FK_vmp_df_vpid_vmp_vmps_vpid FOREIGN KEY ("VPID") REFERENCES vmp_vmps ("VPID"), CONSTRAINT LU_vmp_df_formcd_form FOREIGN KEY ("FORMCD") REFERENCES lookup_form ("CD"));
CREATE TABLE vmp_drug_route ("VPID" BIGINT NOT NULL, "ROUTECD" BIGINT NOT NULL, "isSynchronized" BOOLEAN DEFAULT FALSE, CONSTRAINT FK_vmp_dr_vpid_vmp_vmps_vpid FOREIGN KEY ("VPID") REFERENCES vmp_vmps ("VPID"), CONSTRAINT LU_vmp_dr_routecd_route FOREIGN KEY ("ROUTECD") REFERENCES lookup_route ("CD"));
CREATE TABLE vmp_ont_drug_form ("VPID" BIGINT NOT NULL, "FORMCD" BIGINT NOT NULL, "isSynchronized" BOOLEAN DEFAULT FALSE, CONSTRAINT FK_vmp_odf_vpid_vmp_vmps_vpid FOREIGN KEY ("VPID") REFERENCES vmp_vmps ("VPID"), CONSTRAINT LU_vmp_odf_formcd_ont_form_route FOREIGN KEY ("FORMCD") REFERENCES lookup_ont_form_route ("CD"));
CREATE TABLE vmp_virtual_product_ingredient ("VPID" BIGINT NOT NULL, "ISID" BIGINT NOT NULL, "BASIS_STRNTCD" BIGINT DEFAULT NULL, "BS_SUBID" BIGINT DEFAULT NULL, "STRNT_NMRTR_VAL" DECIMAL(10,3) DEFAULT NULL, "STRNT_NMRTR_UOMCD" BIGINT DEFAULT NULL, "STRNT_DNMTR_VAL" DECIMAL(10,3) DEFAULT NULL, "STRNT_DNMTR_UOMCD" BIGINT DEFAULT NULL, CONSTRAINT FK_vmp_vpi_vpid_vmp_vmps_vpid FOREIGN KEY ("VPID") REFERENCES vmp_vmps ("VPID"), CONSTRAINT LU_vmp_vpi_basis_strntcd_basis_of_name FOREIGN KEY ("BASIS_STRNTCD") REFERENCES lookup_basis_of_name ("CD"), CONSTRAINT FK_vmp_vpi_bs_subid_ingredient_is_isid FOREIGN KEY ("BS_SUBID") REFERENCES ingredient_ingredient_substances ("ISID"), CONSTRAINT FK_vmp_vpi_isid_ingredient_is_isid FOREIGN KEY ("ISID") REFERENCES ingredient_ingredient_substances ("ISID"), CONSTRAINT LU_vmp_vpi_strnt_dmrtr_uomcd_unit_of_measure FOREIGN KEY ("STRNT_DNMTR_UOMCD") REFERENCES lookup_unit_of_measure ("CD"), CONSTRAINT LU_vmp_vpi_strnt_nmrtr_uomcd_unit_of_measure FOREIGN KEY ("STRNT_NMRTR_UOMCD") REFERENCES lookup_unit_of_measure ("CD"));
CREATE TABLE vmpp_comb_content ("PRNTVPPID" BIGINT NOT NULL, "CHLDVPPID" BIGINT NOT NULL, CONSTRAINT FK_vmpp_cc_prntvppid_vmpp_vmpps_vppid FOREIGN KEY ("PRNTVPPID") REFERENCES vmpp_vmpps ("VPPID"), CONSTRAINT FK_vmpp_cc_chldvppid_vmpp_vmpps_vppid FOREIGN KEY ("CHLDVPPID") REFERENCES vmpp_vmpps ("VPPID"));
CREATE TABLE vmpp_drug_tariff_info ("VPPID" BIGINT NOT NULL, "PAY_CATCD" BIGINT NOT NULL, "PRICE" INTEGER DEFAULT NULL, "DT" CHAR(10) DEFAULT NULL, "PREVPRICE" INTEGER DEFAULT NULL, CONSTRAINT FK_vmpp_dti_vppid_vmpp_vmpps_vppid FOREIGN KEY ("VPPID") REFERENCES vmpp_vmpps ("VPPID"), CONSTRAINT LU_vmpp_dti_pay_catcd_dt_payment_category FOREIGN KEY ("PAY_CATCD") REFERENCES lookup_dt_payment_category ("CD"));
CREATE TABLE amp_amps ("APID" BIGINT NOT NULL, "INVALID" TEXT, "VPID" BIGINT NOT NULL, "NM" varchar(255) NOT NULL, "ABBREVNM" varchar(60), "DESC" text NOT NULL, "NMDT" char(10), "NM_PREV" varchar(255), "SUPPCD" BIGINT NOT NULL, "LIC_AUTHCD" BIGINT NOT NULL, "LIC_AUTH_PREVCD" BIGINT, "LIC_AUTHCHANGECD" BIGINT, "LIC_AUTHCHANGEDT" char(10), "COMBPRODCD" BIGINT, "FLAVOURCD" BIGINT, "EMA" TEXT, "PARALLEL_IMPORT" INT, "AVAIL_RESTRICTCD" BIGINT NOT NULL, "isSynchronized" BOOLEAN DEFAULT FALSE, PRIMARY KEY ("APID"), UNIQUE ("APID"), FOREIGN KEY ("VPID") REFERENCES vmp_vmps ("VPID"), FOREIGN KEY ("AVAIL_RESTRICTCD") REFERENCES lookup_availability_restriction ("CD"), FOREIGN KEY ("COMBPRODCD") REFERENCES lookup_combination_prod_ind ("CD"), FOREIGN KEY ("FLAVOURCD") REFERENCES lookup_flavour ("CD"), FOREIGN KEY ("LIC_AUTH_PREVCD") REFERENCES lookup_licensing_authority ("CD"), FOREIGN KEY ("LIC_AUTHCD") REFERENCES lookup_licensing_authority ("CD"), FOREIGN KEY ("LIC_AUTHCHANGECD") REFERENCES lookup_licensing_authority_change_reason ("CD"), FOREIGN KEY ("SUPPCD") REFERENCES lookup_supplier ("CD")) WITH (OIDS=FALSE);
CREATE TABLE amp_ap_information ("APID" BIGINT NOT NULL, "SZ_WEIGHT" varchar(100), "COLOURCD" BIGINT, "PROD_ORDER_NO" varchar(20), FOREIGN KEY ("APID") REFERENCES amp_amps ("APID"), FOREIGN KEY ("COLOURCD") REFERENCES lookup_colour ("CD")) WITH (OIDS=FALSE);
CREATE TABLE amp_ap_ingredient ("APID" BIGINT NOT NULL, "ISID" BIGINT NOT NULL, STRNTH numeric(10,3), "UOMCD" BIGINT, FOREIGN KEY ("APID") REFERENCES amp_amps ("APID"), FOREIGN KEY ("ISID") REFERENCES ingredient_ingredient_substances ("ISID"), FOREIGN KEY ("UOMCD") REFERENCES lookup_unit_of_measure ("CD")) WITH (OIDS=FALSE);
CREATE TABLE amp_licensed_route ("APID" BIGINT NOT NULL, "ROUTECD" BIGINT NOT NULL, FOREIGN KEY ("APID") REFERENCES amp_amps ("APID"), FOREIGN KEY ("ROUTECD") REFERENCES lookup_route ("CD")) WITH (OIDS=FALSE);
CREATE TABLE ampp_ampps ("APPID" BIGINT, "INVALID" TEXT, "NM" varchar(774) NOT NULL, "ABBREVNM" varchar(60), "VPPID" BIGINT NOT NULL, "APID" BIGINT NOT NULL, "COMBPACKCD" BIGINT, "LEGAL_CATCD" BIGINT NOT NULL, "SUBP" varchar(30), "DISCCD" BIGINT, "DISCDT" char(10), UNIQUE ("APPID"), FOREIGN KEY ("APID") REFERENCES amp_amps ("APID"), FOREIGN KEY ("VPPID") REFERENCES vmpp_vmpps ("VPPID"), FOREIGN KEY ("COMBPACKCD") REFERENCES lookup_combination_pack_ind ("CD"), FOREIGN KEY ("DISCCD") REFERENCES lookup_discontinued_ind ("CD"), FOREIGN KEY ("LEGAL_CATCD") REFERENCES lookup_legal_category ("CD")) WITH (OIDS=FALSE);
CREATE TABLE ampp_appliance_pack_info ("APPID" BIGINT NOT NULL, "REIMB_STATCD" BIGINT NOT NULL, "REIMB_STATDT" char(10), "REIMB_STATPREVCD" BIGINT, "PACK_ORDER_NO" varchar(20), FOREIGN KEY ("APPID") REFERENCES ampp_ampps ("APPID"), FOREIGN KEY ("REIMB_STATCD") REFERENCES lookup_reimbursement_status ("CD"), FOREIGN KEY ("REIMB_STATPREVCD") REFERENCES lookup_reimbursement_status ("CD")) WITH (OIDS=FALSE);
CREATE TABLE ampp_comb_content ("PRNTAPPID" BIGINT NOT NULL, "CHLDAPPID" BIGINT NOT NULL, FOREIGN KEY ("CHLDAPPID") REFERENCES ampp_ampps ("APPID"), FOREIGN KEY ("PRNTAPPID") REFERENCES ampp_ampps ("APPID")) WITH (OIDS=FALSE);
CREATE TABLE ampp_drug_product_prescrib_info ("APPID" BIGINT NOT NULL, "SCHED_2" TEXT DEFAULT NULL, "ACBS" TEXT DEFAULT NULL, "PADM" TEXT DEFAULT NULL, "FP10_MDA" TEXT DEFAULT NULL, "SCHED_1" TEXT DEFAULT NULL, "HOSP" TEXT DEFAULT NULL, "NURSE_F" TEXT DEFAULT NULL, "ENURSE_F" TEXT DEFAULT NULL, "DENT_F" TEXT DEFAULT NULL, CONSTRAINT FK_ampp_dppi_appid_ampp_ampps_appid FOREIGN KEY ("APPID") REFERENCES ampp_ampps ("APPID"));
CREATE TABLE ampp_medicinal_product_price ("APPID" BIGINT NOT NULL, "PRICE" INTEGER DEFAULT NULL, "PRICEDT" CHAR(10) DEFAULT NULL, "PRICE_PREV" INTEGER DEFAULT NULL, "PRICE_BASISCD" BIGINT NOT NULL, CONSTRAINT FK_ampp_mpp_appid_ampp_ampps_appid FOREIGN KEY ("APPID") REFERENCES ampp_ampps ("APPID"), CONSTRAINT LU_ampp_mpp_price_basiscd_price_basis FOREIGN KEY ("PRICE_BASISCD") REFERENCES lookup_price_basis ("CD"));
CREATE TABLE ampp_reimbursement_info ("APPID" BIGINT NOT NULL, "PX_CHRGS" TEXT DEFAULT NULL, "DISP_FEES" TEXT DEFAULT NULL, "BB" TEXT DEFAULT NULL, "LTD_STAB" VARCHAR(45) DEFAULT NULL, "CAL_PACK" TEXT DEFAULT NULL, "SPEC_CONTCD" BIGINT DEFAULT NULL, "DND" BIGINT DEFAULT NULL, "FP34D" TEXT DEFAULT NULL, CONSTRAINT FK_ampp_ri_appid_ampp_ampps_appid FOREIGN KEY ("APPID") REFERENCES ampp_ampps ("APPID"), CONSTRAINT LU_ampp_ri_spec_contcd_spec_cont FOREIGN KEY ("SPEC_CONTCD") REFERENCES lookup_spec_cont ("CD"), CONSTRAINT LU_ampp_ri_dnd_dnd FOREIGN KEY ("DND") REFERENCES lookup_dnd ("CD"));