You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.3 KiB
SQL
42 lines
1.3 KiB
SQL
drop table if exists "DiseaseBurden".trial_to_icd10;
|
|
|
|
CREATE TABLE "DiseaseBurden".trial_to_icd10 (
|
|
id integer NOT NULL GENERATED ALWAYS AS IDENTITY,
|
|
nct_id varchar NOT NULL,
|
|
"condition" varchar NOT NULL,
|
|
ui varchar NULL,
|
|
uri varchar NULL,
|
|
rootsource varchar NULL,
|
|
"name" varchar NULL,
|
|
CONSTRAINT trial_to_icd10_pk PRIMARY KEY (id)
|
|
);
|
|
|
|
|
|
|
|
|
|
DROP TABLE if exists "DiseaseBurden".icd10_to_cause;
|
|
|
|
CREATE TABLE "DiseaseBurden".icd10_to_cause (
|
|
id SERIAL NOT NULL ,
|
|
code varchar NOT NULL,
|
|
cause_text varchar NOT NULL,
|
|
CONSTRAINT icd10_to_cause_pk PRIMARY KEY (id)
|
|
);
|
|
|
|
|
|
|
|
drop table if exists "DiseaseBurden".match_status;
|
|
|
|
create type "DiseaseBurden".validation_type as enum ('accepted', 'rejected', 'unmatched');
|
|
comment on type "DiseaseBurden".validation_type is 'This is used to record interactions with each type. It can be accepted (yes this should be used), rejected (no this doesn`t match), or unmatched (where non of the proposed options match)';
|
|
|
|
|
|
CREATE TABLE "DiseaseBurden".match_status (
|
|
id serial4 NOT NULL,
|
|
approved "DiseaseBurden".validation_type NOT NULL,
|
|
approval_timestamp timestamp NOT NULL,
|
|
CONSTRAINT match_status_pk PRIMARY KEY (id, approval_timestamp)
|
|
);
|
|
COMMENT ON TABLE "DiseaseBurden".match_status IS 'This allows me to record if a particular proposed match is approved or not.';
|
|
|