From: <gun...@us...> - 2010-03-29 12:22:05
|
Revision: 13011 http://dcm4che.svn.sourceforge.net/dcm4che/?rev=13011&view=rev Author: gunterze Date: 2010-03-29 12:21:57 +0000 (Mon, 29 Mar 2010) Log Message: ----------- pretty format Modified Paths: -------------- dcm4chee/dcm4chee-arc/trunk/dcm4jboss-ejb/src/etc/db2/sql/create.db2sql dcm4chee/dcm4chee-arc/trunk/dcm4jboss-ejb/src/etc/firebird/sql/create.fsql dcm4chee/dcm4chee-arc/trunk/dcm4jboss-ejb/src/etc/hsql/sql/create.hsql dcm4chee/dcm4chee-arc/trunk/dcm4jboss-ejb/src/etc/mssql/sql/create.mssql Modified: dcm4chee/dcm4chee-arc/trunk/dcm4jboss-ejb/src/etc/db2/sql/create.db2sql =================================================================== --- dcm4chee/dcm4chee-arc/trunk/dcm4jboss-ejb/src/etc/db2/sql/create.db2sql 2010-03-29 10:22:30 UTC (rev 13010) +++ dcm4chee/dcm4chee-arc/trunk/dcm4jboss-ejb/src/etc/db2/sql/create.db2sql 2010-03-29 12:21:57 UTC (rev 13011) @@ -4,15 +4,15 @@ SET CURRENT SCHEMA pacsdb; CREATE TABLE ae ( - pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT ae_pk PRIMARY KEY, - aet VARCHAR(254) NOT NULL, - hostname VARCHAR(254) NOT NULL, - port INTEGER NOT NULL, - cipher_suites VARCHAR(254), - pat_id_issuer VARCHAR(254), - user_id VARCHAR(254), - passwd VARCHAR(254), - fs_group_id VARCHAR(254), + pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT ae_pk PRIMARY KEY, + aet VARCHAR(254) NOT NULL, + hostname VARCHAR(254) NOT NULL, + port INTEGER NOT NULL, + cipher_suites VARCHAR(254), + pat_id_issuer VARCHAR(254), + user_id VARCHAR(254), + passwd VARCHAR(254), + fs_group_id VARCHAR(254), ae_desc VARCHAR(254), wado_url VARCHAR(254), station_name VARCHAR(254), @@ -24,30 +24,30 @@ CREATE UNIQUE INDEX aet ON ae(aet); CREATE TABLE code ( - pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT code_pk PRIMARY KEY, - code_value VARCHAR(254) NOT NULL, - code_designator VARCHAR(254) NOT NULL, - code_version VARCHAR(254), - code_meaning VARCHAR(254) + pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT code_pk PRIMARY KEY, + code_value VARCHAR(254) NOT NULL, + code_designator VARCHAR(254) NOT NULL, + code_version VARCHAR(254), + code_meaning VARCHAR(254) ); CREATE UNIQUE INDEX code_value ON code(code_value,code_designator,code_version); CREATE TABLE patient ( - pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT patient_pk PRIMARY KEY, - merge_fk BIGINT, - pat_id VARCHAR(254), - pat_id_issuer VARCHAR(254), - pat_name VARCHAR(254), - pat_i_name VARCHAR(254), - pat_p_name VARCHAR(254), - pat_birthdate VARCHAR(254), - pat_sex VARCHAR(254), - pat_custom1 VARCHAR(254), - pat_custom2 VARCHAR(254), - pat_custom3 VARCHAR(254), - created_time TIMESTAMP, - updated_time TIMESTAMP, - pat_attrs BLOB(16384), + pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT patient_pk PRIMARY KEY, + merge_fk BIGINT, + pat_id VARCHAR(254), + pat_id_issuer VARCHAR(254), + pat_name VARCHAR(254), + pat_i_name VARCHAR(254), + pat_p_name VARCHAR(254), + pat_birthdate VARCHAR(254), + pat_sex VARCHAR(254), + pat_custom1 VARCHAR(254), + pat_custom2 VARCHAR(254), + pat_custom3 VARCHAR(254), + created_time TIMESTAMP, + updated_time TIMESTAMP, + pat_attrs BLOB(16384), FOREIGN KEY (merge_fk) REFERENCES patient(pk) ); CREATE INDEX pat_merge_fk ON patient(merge_fk); @@ -62,15 +62,15 @@ CREATE INDEX pat_custom3 ON patient(pat_custom3); CREATE TABLE other_pid ( - pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT other_pid_pk PRIMARY KEY, - pat_id VARCHAR(254) NOT NULL, - pat_id_issuer VARCHAR(254) NOT NULL + pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT other_pid_pk PRIMARY KEY, + pat_id VARCHAR(254) NOT NULL, + pat_id_issuer VARCHAR(254) NOT NULL ); CREATE UNIQUE INDEX other_pat_id ON other_pid(pat_id, pat_id_issuer); CREATE TABLE rel_pat_other_pid ( - patient_fk BIGINT, - other_pid_fk BIGINT, + patient_fk BIGINT, + other_pid_fk BIGINT, FOREIGN KEY (patient_fk) REFERENCES patient(pk), FOREIGN KEY (other_pid_fk) REFERENCES other_pid(pk) ); @@ -78,34 +78,34 @@ CREATE INDEX pat_other_pid_fk ON rel_pat_other_pid(other_pid_fk); CREATE TABLE study ( - pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT study_pk PRIMARY KEY, - patient_fk BIGINT, - study_iuid VARCHAR(254) NOT NULL, - study_id VARCHAR(254), - study_datetime TIMESTAMP, - accession_no VARCHAR(254), - ref_physician VARCHAR(254), - ref_phys_i_name VARCHAR(254), - ref_phys_p_name VARCHAR(254), - study_desc VARCHAR(254), - study_custom1 VARCHAR(254), - study_custom2 VARCHAR(254), - study_custom3 VARCHAR(254), - study_status_id VARCHAR(254), - mods_in_study VARCHAR(254), + pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT study_pk PRIMARY KEY, + patient_fk BIGINT, + study_iuid VARCHAR(254) NOT NULL, + study_id VARCHAR(254), + study_datetime TIMESTAMP, + accession_no VARCHAR(254), + ref_physician VARCHAR(254), + ref_phys_i_name VARCHAR(254), + ref_phys_p_name VARCHAR(254), + study_desc VARCHAR(254), + study_custom1 VARCHAR(254), + study_custom2 VARCHAR(254), + study_custom3 VARCHAR(254), + study_status_id VARCHAR(254), + mods_in_study VARCHAR(254), cuids_in_study VARCHAR(254), - num_series INTEGER NOT NULL, - num_instances INTEGER NOT NULL, - ext_retr_aet VARCHAR(254), - retrieve_aets VARCHAR(254), - fileset_iuid VARCHAR(254), - fileset_id VARCHAR(254), - availability INTEGER NOT NULL, - study_status INTEGER NOT NULL, - checked_time TIMESTAMP, - created_time TIMESTAMP, - updated_time TIMESTAMP, - study_attrs BLOB(16384), + num_series INTEGER NOT NULL, + num_instances INTEGER NOT NULL, + ext_retr_aet VARCHAR(254), + retrieve_aets VARCHAR(254), + fileset_iuid VARCHAR(254), + fileset_id VARCHAR(254), + availability INTEGER NOT NULL, + study_status INTEGER NOT NULL, + checked_time TIMESTAMP, + created_time TIMESTAMP, + updated_time TIMESTAMP, + study_attrs BLOB(16384), FOREIGN KEY (patient_fk) REFERENCES patient(pk) ); CREATE INDEX patient_fk ON study(patient_fk); @@ -127,8 +127,8 @@ CREATE INDEX study_status ON study(study_status); CREATE TABLE rel_study_pcode ( - study_fk BIGINT, - pcode_fk BIGINT, + study_fk BIGINT, + pcode_fk BIGINT, FOREIGN KEY (study_fk) REFERENCES study(pk), FOREIGN KEY (pcode_fk) REFERENCES code(pk) ); @@ -136,26 +136,26 @@ CREATE INDEX study_pcode_fk ON rel_study_pcode(pcode_fk); CREATE TABLE study_permission ( - pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT sty_permission_pk PRIMARY KEY, - study_iuid VARCHAR(254) NOT NULL, - action VARCHAR(254) NOT NULL, - roles VARCHAR(254) NOT NULL + pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT sty_permission_pk PRIMARY KEY, + study_iuid VARCHAR(254) NOT NULL, + action VARCHAR(254) NOT NULL, + roles VARCHAR(254) NOT NULL ); CREATE UNIQUE INDEX study_perm_idx ON study_permission(study_iuid, action, roles); CREATE TABLE mpps ( - pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT mpps_pk PRIMARY KEY, - patient_fk BIGINT, - drcode_fk BIGINT, - mpps_iuid VARCHAR(254) NOT NULL, - pps_start TIMESTAMP, - station_aet VARCHAR(254), - modality VARCHAR(254), - accession_no VARCHAR(254), - mpps_status INTEGER NOT NULL, - created_time TIMESTAMP, - updated_time TIMESTAMP, - mpps_attrs BLOB(262144), + pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT mpps_pk PRIMARY KEY, + patient_fk BIGINT, + drcode_fk BIGINT, + mpps_iuid VARCHAR(254) NOT NULL, + pps_start TIMESTAMP, + station_aet VARCHAR(254), + modality VARCHAR(254), + accession_no VARCHAR(254), + mpps_status INTEGER NOT NULL, + created_time TIMESTAMP, + updated_time TIMESTAMP, + mpps_attrs BLOB(262144), FOREIGN KEY (patient_fk) REFERENCES patient(pk), FOREIGN KEY (drcode_fk) REFERENCES code(pk) ); @@ -165,40 +165,40 @@ CREATE INDEX mpps_pps_start ON mpps (pps_start); CREATE INDEX mpps_station_aet ON mpps (station_aet); CREATE INDEX mpps_modality ON mpps (modality); -CREATE INDEX mpps_accession_no ON mpps (accession_no); +CREATE INDEX mpps_accession_no ON mpps (accession_no); CREATE TABLE series ( - pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT series_pk PRIMARY KEY, - study_fk BIGINT, - mpps_fk BIGINT, - series_iuid VARCHAR(254) NOT NULL, - series_no VARCHAR(254), - modality VARCHAR(254), - body_part VARCHAR(254), - laterality VARCHAR(254), - series_desc VARCHAR(254), - institution VARCHAR(254), - station_name VARCHAR(254), - department VARCHAR(254), - perf_physician VARCHAR(254), - perf_phys_i_name VARCHAR(254), - perf_phys_p_name VARCHAR(254), - pps_start TIMESTAMP, - pps_iuid VARCHAR(254), - series_custom1 VARCHAR(254), - series_custom2 VARCHAR(254), - series_custom3 VARCHAR(254), - num_instances INTEGER, - src_aet VARCHAR(254), - ext_retr_aet VARCHAR(254), - retrieve_aets VARCHAR(254), - fileset_iuid VARCHAR(254), - fileset_id VARCHAR(254), - availability INTEGER NOT NULL, - series_status INTEGER NOT NULL, - created_time TIMESTAMP, - updated_time TIMESTAMP, - series_attrs BLOB(16384), + pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT series_pk PRIMARY KEY, + study_fk BIGINT, + mpps_fk BIGINT, + series_iuid VARCHAR(254) NOT NULL, + series_no VARCHAR(254), + modality VARCHAR(254), + body_part VARCHAR(254), + laterality VARCHAR(254), + series_desc VARCHAR(254), + institution VARCHAR(254), + station_name VARCHAR(254), + department VARCHAR(254), + perf_physician VARCHAR(254), + perf_phys_i_name VARCHAR(254), + perf_phys_p_name VARCHAR(254), + pps_start TIMESTAMP, + pps_iuid VARCHAR(254), + series_custom1 VARCHAR(254), + series_custom2 VARCHAR(254), + series_custom3 VARCHAR(254), + num_instances INTEGER, + src_aet VARCHAR(254), + ext_retr_aet VARCHAR(254), + retrieve_aets VARCHAR(254), + fileset_iuid VARCHAR(254), + fileset_id VARCHAR(254), + availability INTEGER NOT NULL, + series_status INTEGER NOT NULL, + created_time TIMESTAMP, + updated_time TIMESTAMP, + series_attrs BLOB(16384), FOREIGN KEY (study_fk) REFERENCES study(pk), FOREIGN KEY (mpps_fk) REFERENCES mpps(pk) ); @@ -228,66 +228,66 @@ CREATE TABLE series_req ( - pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT series_req_pk PRIMARY KEY, - series_fk BIGINT, - study_iuid VARCHAR(254), - req_proc_id VARCHAR(254), - sps_id VARCHAR(254), - req_service VARCHAR(254), - req_physician VARCHAR(254), - req_phys_i_name VARCHAR(254), - req_phys_p_name VARCHAR(254), + pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT series_req_pk PRIMARY KEY, + series_fk BIGINT, + study_iuid VARCHAR(254), + req_proc_id VARCHAR(254), + sps_id VARCHAR(254), + req_service VARCHAR(254), + req_physician VARCHAR(254), + req_phys_i_name VARCHAR(254), + req_phys_p_name VARCHAR(254), FOREIGN KEY (series_fk) REFERENCES series(pk) ); CREATE INDEX ser_req_series_fk ON series_req(series_fk); CREATE INDEX ser_rq_study_iuid ON series_req(study_iuid); CREATE INDEX ser_req_proc_id ON series_req(req_proc_id); -CREATE INDEX ser_req_sps_id ON series_req(sps_id); +CREATE INDEX ser_req_sps_id ON series_req(sps_id); CREATE INDEX ser_req_service ON series_req(req_service); CREATE INDEX ser_req_phys ON series_req(req_physician); CREATE INDEX ser_req_phys_i ON series_req(req_phys_i_name); CREATE INDEX ser_req_phys_p ON series_req(req_phys_p_name); CREATE TABLE media ( - pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT media_pk PRIMARY KEY, - fileset_iuid VARCHAR(254) NOT NULL, - fileset_id VARCHAR(254), - media_rq_iuid VARCHAR(254), - media_status INTEGER NOT NULL, - media_status_info VARCHAR(254), - media_usage BIGINT NOT NULL, - created_time TIMESTAMP, - updated_time TIMESTAMP + pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT media_pk PRIMARY KEY, + fileset_iuid VARCHAR(254) NOT NULL, + fileset_id VARCHAR(254), + media_rq_iuid VARCHAR(254), + media_status INTEGER NOT NULL, + media_status_info VARCHAR(254), + media_usage BIGINT NOT NULL, + created_time TIMESTAMP, + updated_time TIMESTAMP ); CREATE UNIQUE INDEX fileset_iuid ON media(fileset_iuid); CREATE INDEX media_status ON media(media_status); CREATE TABLE instance ( - pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT instance_pk PRIMARY KEY, - series_fk BIGINT, - srcode_fk BIGINT, - media_fk BIGINT, - sop_iuid VARCHAR(254) NOT NULL, - sop_cuid VARCHAR(254) NOT NULL, - inst_no VARCHAR(254), - content_datetime TIMESTAMP, - sr_complete VARCHAR(254), - sr_verified VARCHAR(254), - inst_custom1 VARCHAR(254), - inst_custom2 VARCHAR(254), - inst_custom3 VARCHAR(254), - ext_retr_aet VARCHAR(254), - retrieve_aets VARCHAR(254), - availability INTEGER NOT NULL, - inst_status INTEGER NOT NULL, - all_attrs SMALLINT NOT NULL, - commitment SMALLINT NOT NULL, - created_time TIMESTAMP, - updated_time TIMESTAMP, - inst_attrs BLOB(262144), -FOREIGN KEY (series_fk) REFERENCES series(pk), -FOREIGN KEY (srcode_fk) REFERENCES code(pk), -FOREIGN KEY (media_fk) REFERENCES media(pk) + pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT instance_pk PRIMARY KEY, + series_fk BIGINT, + srcode_fk BIGINT, + media_fk BIGINT, + sop_iuid VARCHAR(254) NOT NULL, + sop_cuid VARCHAR(254) NOT NULL, + inst_no VARCHAR(254), + content_datetime TIMESTAMP, + sr_complete VARCHAR(254), + sr_verified VARCHAR(254), + inst_custom1 VARCHAR(254), + inst_custom2 VARCHAR(254), + inst_custom3 VARCHAR(254), + ext_retr_aet VARCHAR(254), + retrieve_aets VARCHAR(254), + availability INTEGER NOT NULL, + inst_status INTEGER NOT NULL, + all_attrs SMALLINT NOT NULL, + commitment SMALLINT NOT NULL, + created_time TIMESTAMP, + updated_time TIMESTAMP, + inst_attrs BLOB(262144), +FOREIGN KEY (series_fk) REFERENCES series(pk), +FOREIGN KEY (srcode_fk) REFERENCES code(pk), +FOREIGN KEY (media_fk) REFERENCES media(pk) ); CREATE INDEX series_fk ON instance(series_fk); CREATE INDEX srcode_fk ON instance(srcode_fk); @@ -306,12 +306,12 @@ CREATE INDEX commitment ON instance(commitment); CREATE TABLE verify_observer ( - pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT verify_observer_pk PRIMARY KEY, - instance_fk BIGINT, - verify_datetime TIMESTAMP, - observer_name VARCHAR(254), - observer_i_name VARCHAR(254), - observer_p_name VARCHAR(254), + pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT verify_observer_pk PRIMARY KEY, + instance_fk BIGINT, + verify_datetime TIMESTAMP, + observer_name VARCHAR(254), + observer_i_name VARCHAR(254), + observer_p_name VARCHAR(254), FOREIGN KEY (instance_fk) REFERENCES instance(pk) ); CREATE INDEX observer_inst_fk ON verify_observer(instance_fk); @@ -321,14 +321,14 @@ CREATE INDEX observer_p_name ON verify_observer(observer_p_name); CREATE TABLE filesystem ( - pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT filesystem_pk PRIMARY KEY, - next_fk BIGINT, - dirpath VARCHAR(254) NOT NULL, - fs_group_id VARCHAR(254) NOT NULL, - retrieve_aet VARCHAR(254) NOT NULL, - availability INTEGER NOT NULL, - fs_status INTEGER NOT NULL, - user_info VARCHAR(254), + pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT filesystem_pk PRIMARY KEY, + next_fk BIGINT, + dirpath VARCHAR(254) NOT NULL, + fs_group_id VARCHAR(254) NOT NULL, + retrieve_aet VARCHAR(254) NOT NULL, + availability INTEGER NOT NULL, + fs_status INTEGER NOT NULL, + user_info VARCHAR(254), FOREIGN KEY (next_fk) REFERENCES filesystem(pk) ); CREATE UNIQUE INDEX fs_dirpath ON filesystem(dirpath); @@ -339,10 +339,10 @@ CREATE INDEX fs_status ON filesystem(fs_status); CREATE TABLE study_on_fs ( - pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT study_on_fs_pk PRIMARY KEY, - study_fk BIGINT, - filesystem_fk BIGINT, - access_time TIMESTAMP NOT NULL, + pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT study_on_fs_pk PRIMARY KEY, + study_fk BIGINT, + filesystem_fk BIGINT, + access_time TIMESTAMP NOT NULL, FOREIGN KEY (study_fk) REFERENCES study(pk), FOREIGN KEY (filesystem_fk) REFERENCES filesystem(pk) ); @@ -352,18 +352,18 @@ CREATE TABLE files ( - pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT files_pk PRIMARY KEY, - instance_fk BIGINT, - filesystem_fk BIGINT, - filepath VARCHAR(254) NOT NULL, - file_tsuid VARCHAR(254) NOT NULL, - file_md5 VARCHAR(254), - file_size BIGINT, - file_status INTEGER, - md5_check_time TIMESTAMP, - created_time TIMESTAMP, -FOREIGN KEY (instance_fk) REFERENCES instance(pk), -FOREIGN KEY (filesystem_fk) REFERENCES filesystem(pk) + pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT files_pk PRIMARY KEY, + instance_fk BIGINT, + filesystem_fk BIGINT, + filepath VARCHAR(254) NOT NULL, + file_tsuid VARCHAR(254) NOT NULL, + file_md5 VARCHAR(254), + file_size BIGINT, + file_status INTEGER, + md5_check_time TIMESTAMP, + created_time TIMESTAMP, +FOREIGN KEY (instance_fk) REFERENCES instance(pk), +FOREIGN KEY (filesystem_fk) REFERENCES filesystem(pk) ); CREATE INDEX instance_fk ON files(instance_fk); CREATE INDEX filesystem_fk ON files(filesystem_fk); @@ -373,23 +373,23 @@ CREATE INDEX file_status ON files(file_status); CREATE TABLE mwl_item ( - pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT mwl_item_pk PRIMARY KEY, - patient_fk BIGINT, - sps_status INTEGER, - sps_id VARCHAR(254), - start_datetime TIMESTAMP NOT NULL, - station_aet VARCHAR(254) NOT NULL, - station_name VARCHAR(254), - modality VARCHAR(254) NOT NULL, - perf_physician VARCHAR(254), - perf_phys_i_name VARCHAR(254), - perf_phys_p_name VARCHAR(254), - req_proc_id VARCHAR(254) NOT NULL, - accession_no VARCHAR(254), - study_iuid VARCHAR(254) NOT NULL, - created_time TIMESTAMP, - updated_time TIMESTAMP, - item_attrs BLOB(16384), + pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT mwl_item_pk PRIMARY KEY, + patient_fk BIGINT, + sps_status INTEGER, + sps_id VARCHAR(254), + start_datetime TIMESTAMP NOT NULL, + station_aet VARCHAR(254) NOT NULL, + station_name VARCHAR(254), + modality VARCHAR(254) NOT NULL, + perf_physician VARCHAR(254), + perf_phys_i_name VARCHAR(254), + perf_phys_p_name VARCHAR(254), + req_proc_id VARCHAR(254) NOT NULL, + accession_no VARCHAR(254), + study_iuid VARCHAR(254) NOT NULL, + created_time TIMESTAMP, + updated_time TIMESTAMP, + item_attrs BLOB(16384), FOREIGN KEY (patient_fk) REFERENCES patient(pk) ); CREATE INDEX mwl_patient_fk ON mwl_item(patient_fk); @@ -408,17 +408,17 @@ CREATE TABLE gpsps ( - pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT gpsps_pk PRIMARY KEY, - patient_fk BIGINT, - code_fk BIGINT, - gpsps_iuid VARCHAR(254) NOT NULL, - gpsps_tuid VARCHAR(254), - start_datetime TIMESTAMP NOT NULL, - end_datetime TIMESTAMP, - gpsps_status INTEGER, - gpsps_prior INTEGER, - in_availability INTEGER, - item_attrs BLOB(262144), + pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT gpsps_pk PRIMARY KEY, + patient_fk BIGINT, + code_fk BIGINT, + gpsps_iuid VARCHAR(254) NOT NULL, + gpsps_tuid VARCHAR(254), + start_datetime TIMESTAMP NOT NULL, + end_datetime TIMESTAMP, + gpsps_status INTEGER, + gpsps_prior INTEGER, + in_availability INTEGER, + item_attrs BLOB(262144), FOREIGN KEY (patient_fk) REFERENCES patient(pk), FOREIGN KEY (code_fk) REFERENCES code(pk) ); @@ -433,8 +433,8 @@ CREATE INDEX in_availability ON gpsps(in_availability); CREATE TABLE rel_gpsps_appcode ( - gpsps_fk BIGINT, - appcode_fk BIGINT, + gpsps_fk BIGINT, + appcode_fk BIGINT, FOREIGN KEY (gpsps_fk) REFERENCES gpsps(pk), FOREIGN KEY (appcode_fk) REFERENCES code(pk) ); @@ -442,8 +442,8 @@ CREATE INDEX gpsps_appcode_fk ON rel_gpsps_appcode(appcode_fk); CREATE TABLE rel_gpsps_devname ( - gpsps_fk BIGINT, - devname_fk BIGINT, + gpsps_fk BIGINT, + devname_fk BIGINT, FOREIGN KEY (gpsps_fk) REFERENCES gpsps(pk), FOREIGN KEY (devname_fk) REFERENCES code(pk) ); @@ -451,8 +451,8 @@ CREATE INDEX gpsps_devname_fk ON rel_gpsps_devname(devname_fk); CREATE TABLE rel_gpsps_devclass ( - gpsps_fk BIGINT, - devclass_fk BIGINT, + gpsps_fk BIGINT, + devclass_fk BIGINT, FOREIGN KEY (gpsps_fk) REFERENCES gpsps(pk), FOREIGN KEY (devclass_fk) REFERENCES code(pk) ); @@ -460,8 +460,8 @@ CREATE INDEX gpsps_devclass_fk ON rel_gpsps_devclass(devclass_fk); CREATE TABLE rel_gpsps_devloc ( - gpsps_fk BIGINT, - devloc_fk BIGINT, + gpsps_fk BIGINT, + devloc_fk BIGINT, FOREIGN KEY (gpsps_fk) REFERENCES gpsps(pk), FOREIGN KEY (devloc_fk) REFERENCES code(pk) ); @@ -469,12 +469,12 @@ CREATE INDEX gpsps_devloc_fk ON rel_gpsps_devloc(devloc_fk); CREATE TABLE gpsps_perf ( - pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT gpsps_perf_pk PRIMARY KEY, - gpsps_fk BIGINT, - code_fk BIGINT, - human_perf_name VARCHAR(254), - hum_perf_i_name VARCHAR(254), - hum_perf_p_name VARCHAR(254), + pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT gpsps_perf_pk PRIMARY KEY, + gpsps_fk BIGINT, + code_fk BIGINT, + human_perf_name VARCHAR(254), + hum_perf_i_name VARCHAR(254), + hum_perf_p_name VARCHAR(254), FOREIGN KEY (gpsps_fk) REFERENCES gpsps(pk), FOREIGN KEY (code_fk) REFERENCES code(pk) ); @@ -485,25 +485,25 @@ CREATE INDEX gpsps_perf_p_name ON gpsps_perf(hum_perf_p_name); CREATE TABLE gpsps_req ( - pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT gpsps_req_pk PRIMARY KEY, - gpsps_fk BIGINT, - req_proc_id VARCHAR(254), - accession_no VARCHAR(254), + pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT gpsps_req_pk PRIMARY KEY, + gpsps_fk BIGINT, + req_proc_id VARCHAR(254), + accession_no VARCHAR(254), FOREIGN KEY (gpsps_fk) REFERENCES gpsps(pk) ); CREATE INDEX gpsps_req_gpsps_fk ON gpsps_req(gpsps_fk); CREATE INDEX gpsps_req_proc_id ON gpsps_req(req_proc_id); -CREATE INDEX gpsps_req_acc_no ON gpsps_req(accession_no); +CREATE INDEX gpsps_req_acc_no ON gpsps_req(accession_no); CREATE TABLE gppps ( - pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT gppps_pk PRIMARY KEY, - patient_fk BIGINT, - pps_iuid VARCHAR(254) NOT NULL, - pps_start TIMESTAMP, - pps_status INTEGER NOT NULL, - created_time TIMESTAMP, - updated_time TIMESTAMP, - pps_attrs BLOB(16384), + pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT gppps_pk PRIMARY KEY, + patient_fk BIGINT, + pps_iuid VARCHAR(254) NOT NULL, + pps_start TIMESTAMP, + pps_status INTEGER NOT NULL, + created_time TIMESTAMP, + updated_time TIMESTAMP, + pps_attrs BLOB(16384), FOREIGN KEY (patient_fk) REFERENCES patient(pk) ); CREATE UNIQUE INDEX gppps_iuid ON gppps (pps_iuid); @@ -511,8 +511,8 @@ CREATE INDEX gppps_pps_start ON gppps (pps_start); CREATE TABLE rel_gpsps_gppps ( - gpsps_fk BIGINT, - gppps_fk BIGINT, + gpsps_fk BIGINT, + gppps_fk BIGINT, FOREIGN KEY (gpsps_fk) REFERENCES gpsps(pk), FOREIGN KEY (gppps_fk) REFERENCES gppps(pk) ); @@ -520,16 +520,16 @@ CREATE INDEX gpsps_gppps_fk ON rel_gpsps_gppps(gppps_fk); CREATE TABLE hp ( - pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT hp_pk PRIMARY KEY, - user_fk BIGINT, - hp_iuid VARCHAR(254) NOT NULL, - hp_cuid VARCHAR(254), - hp_name VARCHAR(254), - hp_group VARCHAR(254), - hp_level INTEGER, - num_priors INTEGER, - num_screens INTEGER, - hp_attrs BLOB(16384), + pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT hp_pk PRIMARY KEY, + user_fk BIGINT, + hp_iuid VARCHAR(254) NOT NULL, + hp_cuid VARCHAR(254), + hp_name VARCHAR(254), + hp_group VARCHAR(254), + hp_level INTEGER, + num_priors INTEGER, + num_screens INTEGER, + hp_attrs BLOB(16384), FOREIGN KEY (user_fk) REFERENCES code(pk) ); CREATE INDEX hp_user_fk ON hp(user_fk); @@ -541,10 +541,10 @@ CREATE INDEX num_screens ON hp(num_screens); CREATE TABLE hpdef ( - pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT hpdef_pk PRIMARY KEY, - hp_fk BIGINT, - modality VARCHAR(254), - laterality VARCHAR(254), + pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT hpdef_pk PRIMARY KEY, + hp_fk BIGINT, + modality VARCHAR(254), + laterality VARCHAR(254), FOREIGN KEY (hp_fk) REFERENCES hp(pk) ); CREATE INDEX hp_fk ON hpdef(hp_fk); @@ -552,8 +552,8 @@ CREATE INDEX hpdef_laterality ON hpdef(laterality); CREATE TABLE rel_hpdef_region ( - hpdef_fk BIGINT, - region_fk BIGINT, + hpdef_fk BIGINT, + region_fk BIGINT, FOREIGN KEY (hpdef_fk) REFERENCES hpdef(pk), FOREIGN KEY (region_fk) REFERENCES code(pk) ); @@ -561,8 +561,8 @@ CREATE INDEX hpdef_region_fk ON rel_hpdef_region(region_fk); CREATE TABLE rel_hpdef_proc ( - hpdef_fk BIGINT, - proc_fk BIGINT, + hpdef_fk BIGINT, + proc_fk BIGINT, FOREIGN KEY (hpdef_fk) REFERENCES hpdef(pk), FOREIGN KEY (proc_fk) REFERENCES code(pk) ); @@ -570,8 +570,8 @@ CREATE INDEX hpdef_proc_fk ON rel_hpdef_proc(proc_fk); CREATE TABLE rel_hpdef_reason ( - hpdef_fk BIGINT, - reason_fk BIGINT, + hpdef_fk BIGINT, + reason_fk BIGINT, FOREIGN KEY (hpdef_fk) REFERENCES hpdef(pk), FOREIGN KEY (reason_fk) REFERENCES code(pk) ); @@ -579,24 +579,24 @@ CREATE INDEX hpdef_reason_fk ON rel_hpdef_reason(reason_fk); CREATE TABLE priv_patient ( - pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT priv_patient_pk PRIMARY KEY, - priv_type INTEGER NOT NULL, - pat_id VARCHAR(254), - pat_id_issuer VARCHAR(254), - pat_name VARCHAR(254), - pat_attrs BLOB(16384) + pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT priv_patient_pk PRIMARY KEY, + priv_type INTEGER NOT NULL, + pat_id VARCHAR(254), + pat_id_issuer VARCHAR(254), + pat_name VARCHAR(254), + pat_attrs BLOB(16384) ); CREATE INDEX priv_pat_id ON priv_patient(pat_id, pat_id_issuer); CREATE INDEX priv_pat_type ON priv_patient(priv_type); CREATE INDEX priv_pat_name ON priv_patient(pat_name); CREATE TABLE priv_study ( - pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT priv_study_pk PRIMARY KEY, - patient_fk BIGINT, - priv_type INTEGER NOT NULL, - study_iuid VARCHAR(254) NOT NULL, - accession_no VARCHAR(254), - study_attrs BLOB(16384), + pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT priv_study_pk PRIMARY KEY, + patient_fk BIGINT, + priv_type INTEGER NOT NULL, + study_iuid VARCHAR(254) NOT NULL, + accession_no VARCHAR(254), + study_attrs BLOB(16384), FOREIGN KEY (patient_fk) REFERENCES priv_patient(pk) ); CREATE INDEX priv_patient_fk ON priv_study(patient_fk); @@ -605,12 +605,12 @@ CREATE INDEX priv_study_accs_no ON priv_study(accession_no); CREATE TABLE priv_series ( - pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT priv_series_pk PRIMARY KEY, - study_fk BIGINT, - priv_type INTEGER NOT NULL, - series_iuid VARCHAR(254) NOT NULL, - src_aet VARCHAR(254), - series_attrs BLOB(16384), + pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT priv_series_pk PRIMARY KEY, + study_fk BIGINT, + priv_type INTEGER NOT NULL, + series_iuid VARCHAR(254) NOT NULL, + src_aet VARCHAR(254), + series_attrs BLOB(16384), FOREIGN KEY (study_fk) REFERENCES priv_study(pk) ); CREATE INDEX priv_study_fk ON priv_series(study_fk); @@ -620,11 +620,11 @@ CREATE TABLE priv_instance ( - pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT priv_instance_pk PRIMARY KEY, - series_fk BIGINT, - priv_type INTEGER NOT NULL, - sop_iuid VARCHAR(254) NOT NULL, - inst_attrs BLOB(262144), + pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT priv_instance_pk PRIMARY KEY, + series_fk BIGINT, + priv_type INTEGER NOT NULL, + sop_iuid VARCHAR(254) NOT NULL, + inst_attrs BLOB(262144), FOREIGN KEY (series_fk) REFERENCES priv_series(pk) ); CREATE INDEX priv_series_fk ON priv_instance(series_fk); @@ -632,31 +632,31 @@ CREATE INDEX priv_sop_iuid ON priv_instance(sop_iuid); CREATE TABLE priv_file ( - pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT priv_file_pk PRIMARY KEY, - instance_fk BIGINT, - filesystem_fk BIGINT, - filepath VARCHAR(254) NOT NULL, - file_tsuid VARCHAR(254) NOT NULL, - file_md5 VARCHAR(254), - file_size BIGINT, - file_status INTEGER, -FOREIGN KEY (instance_fk) REFERENCES priv_instance(pk), -FOREIGN KEY (filesystem_fk) REFERENCES filesystem(pk) + pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT priv_file_pk PRIMARY KEY, + instance_fk BIGINT, + filesystem_fk BIGINT, + filepath VARCHAR(254) NOT NULL, + file_tsuid VARCHAR(254) NOT NULL, + file_md5 VARCHAR(254), + file_size BIGINT, + file_status INTEGER, +FOREIGN KEY (instance_fk) REFERENCES priv_instance(pk), +FOREIGN KEY (filesystem_fk) REFERENCES filesystem(pk) ); CREATE INDEX priv_instance_fk ON priv_file(instance_fk); CREATE INDEX priv_fs_fk ON priv_file(filesystem_fk); CREATE TABLE device ( - pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT device_pk PRIMARY KEY, - station_name VARCHAR(254) NOT NULL, - station_aet VARCHAR(254) NOT NULL, - modality VARCHAR(254) NOT NULL + pk BIGINT GENERATED BY DEFAULT AS IDENTITY CONSTRAINT device_pk PRIMARY KEY, + station_name VARCHAR(254) NOT NULL, + station_aet VARCHAR(254) NOT NULL, + modality VARCHAR(254) NOT NULL ); CREATE UNIQUE INDEX dev_station_name ON device(station_name); CREATE TABLE rel_dev_proto ( - device_fk BIGINT, - prcode_fk BIGINT, + device_fk BIGINT, + prcode_fk BIGINT, FOREIGN KEY (device_fk) REFERENCES device(pk), FOREIGN KEY (prcode_fk) REFERENCES code(pk) ); @@ -664,12 +664,12 @@ CREATE INDEX prcode_fk ON rel_dev_proto(prcode_fk); CREATE TABLE users( - user_id VARCHAR(254) NOT NULL CONSTRAINT user_pk PRIMARY KEY, - passwd VARCHAR(254) + user_id VARCHAR(254) NOT NULL CONSTRAINT user_pk PRIMARY KEY, + passwd VARCHAR(254) ); CREATE TABLE roles( - user_id VARCHAR(254) NOT NULL, - roles VARCHAR(254), + user_id VARCHAR(254) NOT NULL, + roles VARCHAR(254), FOREIGN KEY (user_id) REFERENCES users(user_id) ); CREATE INDEX user_id ON roles(user_id); @@ -688,9 +688,9 @@ INSERT INTO roles VALUES('user','Doctor'); INSERT INTO ae (aet,hostname,port,pat_id_issuer,ae_desc,installed) - VALUES('DCM4CHEE','localhost',11112,'DCM4CHEE','This dcm4chee archive instance',1); + VALUES('DCM4CHEE','localhost',11112,'DCM4CHEE','This dcm4chee archive instance',1); INSERT INTO ae (aet,hostname,port,ae_desc,installed) - VALUES('CDRECORD','localhost',10104,'Media Creation Server (part of dcm4chee)',1); + VALUES('CDRECORD','localhost',10104,'Media Creation Server (part of dcm4chee)',1); GRANT ALL PRIVILEGES ON TABLE ae TO USER pacs; GRANT ALL PRIVILEGES ON TABLE code TO USER pacs; Modified: dcm4chee/dcm4chee-arc/trunk/dcm4jboss-ejb/src/etc/firebird/sql/create.fsql =================================================================== --- dcm4chee/dcm4chee-arc/trunk/dcm4jboss-ejb/src/etc/firebird/sql/create.fsql 2010-03-29 10:22:30 UTC (rev 13010) +++ dcm4chee/dcm4chee-arc/trunk/dcm4jboss-ejb/src/etc/firebird/sql/create.fsql 2010-03-29 12:21:57 UTC (rev 13011) @@ -1,14 +1,14 @@ CREATE SEQUENCE ae_pk_seq; CREATE TABLE ae ( - pk NUMERIC(18,0) NOT NULL CONSTRAINT ae_pk PRIMARY KEY, - aet VARCHAR(255) NOT NULL, - hostname VARCHAR(255) NOT NULL, - port INTEGER NOT NULL, - cipher_suites VARCHAR(255), - pat_id_issuer VARCHAR(255), - user_id VARCHAR(255), - passwd VARCHAR(255), - fs_group_id VARCHAR(255), + pk NUMERIC(18,0) NOT NULL CONSTRAINT ae_pk PRIMARY KEY, + aet VARCHAR(255) NOT NULL, + hostname VARCHAR(255) NOT NULL, + port INTEGER NOT NULL, + cipher_suites VARCHAR(255), + pat_id_issuer VARCHAR(255), + user_id VARCHAR(255), + passwd VARCHAR(255), + fs_group_id VARCHAR(255), ae_desc VARCHAR(255), wado_url VARCHAR(255), station_name VARCHAR(255), @@ -21,31 +21,31 @@ CREATE SEQUENCE code_pk_seq; CREATE TABLE code ( - pk NUMERIC(18,0) NOT NULL CONSTRAINT code_pk PRIMARY KEY, - code_value VARCHAR(255) NOT NULL, - code_designator VARCHAR(255) NOT NULL, - code_version VARCHAR(255), - code_meaning VARCHAR(255) + pk NUMERIC(18,0) NOT NULL CONSTRAINT code_pk PRIMARY KEY, + code_value VARCHAR(255) NOT NULL, + code_designator VARCHAR(255) NOT NULL, + code_version VARCHAR(255), + code_meaning VARCHAR(255) ); CREATE UNIQUE INDEX code_value ON code(code_value,code_designator,code_version); CREATE SEQUENCE patient_pk_seq; CREATE TABLE patient ( - pk NUMERIC(18,0) NOT NULL CONSTRAINT patient_pk PRIMARY KEY, - merge_fk NUMERIC(18,0), - pat_id VARCHAR(255), - pat_id_issuer VARCHAR(255), - pat_name VARCHAR(255), - pat_i_name VARCHAR(255), - pat_p_name VARCHAR(255), - pat_birthdate VARCHAR(255), - pat_sex VARCHAR(255), - pat_custom1 VARCHAR(255), - pat_custom2 VARCHAR(255), - pat_custom3 VARCHAR(255), - created_time TIMESTAMP, - updated_time TIMESTAMP, - pat_attrs BLOB, + pk NUMERIC(18,0) NOT NULL CONSTRAINT patient_pk PRIMARY KEY, + merge_fk NUMERIC(18,0), + pat_id VARCHAR(255), + pat_id_issuer VARCHAR(255), + pat_name VARCHAR(255), + pat_i_name VARCHAR(255), + pat_p_name VARCHAR(255), + pat_birthdate VARCHAR(255), + pat_sex VARCHAR(255), + pat_custom1 VARCHAR(255), + pat_custom2 VARCHAR(255), + pat_custom3 VARCHAR(255), + created_time TIMESTAMP, + updated_time TIMESTAMP, + pat_attrs BLOB, FOREIGN KEY (merge_fk) REFERENCES patient(pk) ); CREATE INDEX pat_merge_fk ON patient(merge_fk); @@ -61,15 +61,15 @@ CREATE SEQUENCE other_pid_pk_seq; CREATE TABLE other_pid ( - pk NUMERIC(18,0) NOT NULL CONSTRAINT other_pid_pk PRIMARY KEY, - pat_id VARCHAR(255) NOT NULL, - pat_id_issuer VARCHAR(255) NOT NULL + pk NUMERIC(18,0) NOT NULL CONSTRAINT other_pid_pk PRIMARY KEY, + pat_id VARCHAR(255) NOT NULL, + pat_id_issuer VARCHAR(255) NOT NULL ); CREATE UNIQUE INDEX other_pat_id ON other_pid(pat_id, pat_id_issuer); CREATE TABLE rel_pat_other_pid ( - patient_fk NUMERIC(18,0), - other_pid_fk NUMERIC(18,0), + patient_fk NUMERIC(18,0), + other_pid_fk NUMERIC(18,0), FOREIGN KEY (patient_fk) REFERENCES patient(pk), FOREIGN KEY (other_pid_fk) REFERENCES other_pid(pk) ); @@ -78,34 +78,34 @@ CREATE SEQUENCE study_pk_seq; CREATE TABLE study ( - pk NUMERIC(18,0) NOT NULL CONSTRAINT study_pk PRIMARY KEY, - patient_fk NUMERIC(18,0), - study_iuid VARCHAR(255) NOT NULL, - study_id VARCHAR(255), - study_datetime TIMESTAMP, - accession_no VARCHAR(255), - ref_physician VARCHAR(255), - ref_phys_i_name VARCHAR(255), - ref_phys_p_name VARCHAR(255), - study_desc VARCHAR(255), - study_custom1 VARCHAR(255), - study_custom2 VARCHAR(255), - study_custom3 VARCHAR(255), - study_status_id VARCHAR(255), - mods_in_study VARCHAR(255), + pk NUMERIC(18,0) NOT NULL CONSTRAINT study_pk PRIMARY KEY, + patient_fk NUMERIC(18,0), + study_iuid VARCHAR(255) NOT NULL, + study_id VARCHAR(255), + study_datetime TIMESTAMP, + accession_no VARCHAR(255), + ref_physician VARCHAR(255), + ref_phys_i_name VARCHAR(255), + ref_phys_p_name VARCHAR(255), + study_desc VARCHAR(255), + study_custom1 VARCHAR(255), + study_custom2 VARCHAR(255), + study_custom3 VARCHAR(255), + study_status_id VARCHAR(255), + mods_in_study VARCHAR(255), cuids_in_study VARCHAR(255), - num_series INTEGER NOT NULL, - num_instances INTEGER NOT NULL, - ext_retr_aet VARCHAR(255), - retrieve_aets VARCHAR(255), - fileset_iuid VARCHAR(255), - fileset_id VARCHAR(255), - availability INTEGER NOT NULL, - study_status INTEGER NOT NULL, - checked_time TIMESTAMP, - created_time TIMESTAMP, - updated_time TIMESTAMP, - study_attrs BLOB, + num_series INTEGER NOT NULL, + num_instances INTEGER NOT NULL, + ext_retr_aet VARCHAR(255), + retrieve_aets VARCHAR(255), + fileset_iuid VARCHAR(255), + fileset_id VARCHAR(255), + availability INTEGER NOT NULL, + study_status INTEGER NOT NULL, + checked_time TIMESTAMP, + created_time TIMESTAMP, + updated_time TIMESTAMP, + study_attrs BLOB, FOREIGN KEY (patient_fk) REFERENCES patient(pk) ); CREATE INDEX patient_fk ON study(patient_fk); @@ -127,8 +127,8 @@ CREATE INDEX study_status ON study(study_status); CREATE TABLE rel_study_pcode ( - study_fk NUMERIC(18,0), - pcode_fk NUMERIC(18,0), + study_fk NUMERIC(18,0), + pcode_fk NUMERIC(18,0), FOREIGN KEY (study_fk) REFERENCES study(pk), FOREIGN KEY (pcode_fk) REFERENCES code(pk) ); @@ -137,27 +137,27 @@ CREATE SEQUENCE study_permission_pk_seq; CREATE TABLE study_permission ( - pk NUMERIC(18,0) NOT NULL CONSTRAINT study_permission_pk PRIMARY KEY, - study_iuid VARCHAR(255) NOT NULL, - action VARCHAR(255) NOT NULL, - roles VARCHAR(255) NOT NULL + pk NUMERIC(18,0) NOT NULL CONSTRAINT study_permission_pk PRIMARY KEY, + study_iuid VARCHAR(255) NOT NULL, + action VARCHAR(255) NOT NULL, + roles VARCHAR(255) NOT NULL ); CREATE UNIQUE INDEX study_perm_idx ON study_permission(study_iuid, action, roles); CREATE SEQUENCE mpps_pk_seq; CREATE TABLE mpps ( - pk NUMERIC(18,0) NOT NULL CONSTRAINT mpps_pk PRIMARY KEY, - patient_fk NUMERIC(18,0), - drcode_fk NUMERIC(18,0), - mpps_iuid VARCHAR(255) NOT NULL, - pps_start TIMESTAMP, - station_aet VARCHAR(255), - modality VARCHAR(255), - accession_no VARCHAR(255), - mpps_status INTEGER NOT NULL, - created_time TIMESTAMP, - updated_time TIMESTAMP, - mpps_attrs BLOB, + pk NUMERIC(18,0) NOT NULL CONSTRAINT mpps_pk PRIMARY KEY, + patient_fk NUMERIC(18,0), + drcode_fk NUMERIC(18,0), + mpps_iuid VARCHAR(255) NOT NULL, + pps_start TIMESTAMP, + station_aet VARCHAR(255), + modality VARCHAR(255), + accession_no VARCHAR(255), + mpps_status INTEGER NOT NULL, + created_time TIMESTAMP, + updated_time TIMESTAMP, + mpps_attrs BLOB, FOREIGN KEY (patient_fk) REFERENCES patient(pk), FOREIGN KEY (drcode_fk) REFERENCES code(pk) ); @@ -167,41 +167,41 @@ CREATE INDEX mpps_pps_start ON mpps (pps_start); CREATE INDEX mpps_station_aet ON mpps (station_aet); CREATE INDEX mpps_modality ON mpps (modality); -CREATE INDEX mpps_accession_no ON mpps (accession_no); +CREATE INDEX mpps_accession_no ON mpps (accession_no); CREATE SEQUENCE series_pk_seq; CREATE TABLE series ( - pk NUMERIC(18,0) NOT NULL CONSTRAINT series_pk PRIMARY KEY, - study_fk NUMERIC(18,0), - mpps_fk NUMERIC(18,0), - series_iuid VARCHAR(255) NOT NULL, - series_no VARCHAR(255), - modality VARCHAR(255), - body_part VARCHAR(255), - laterality VARCHAR(255), - series_desc VARCHAR(255), - institution VARCHAR(255), - station_name VARCHAR(255), - department VARCHAR(255), - perf_physician VARCHAR(255), - perf_phys_i_name VARCHAR(255), - perf_phys_p_name VARCHAR(255), - pps_start TIMESTAMP, - pps_iuid VARCHAR(255), - series_custom1 VARCHAR(255), - series_custom2 VARCHAR(255), - series_custom3 VARCHAR(255), - num_instances INTEGER NOT NULL, - src_aet VARCHAR(255), - ext_retr_aet VARCHAR(255), - retrieve_aets VARCHAR(255), - fileset_iuid VARCHAR(255), - fileset_id VARCHAR(255), - availability INTEGER NOT NULL, - series_status INTEGER NOT NULL, - created_time TIMESTAMP, - updated_time TIMESTAMP, - series_attrs BLOB, + pk NUMERIC(18,0) NOT NULL CONSTRAINT series_pk PRIMARY KEY, + study_fk NUMERIC(18,0), + mpps_fk NUMERIC(18,0), + series_iuid VARCHAR(255) NOT NULL, + series_no VARCHAR(255), + modality VARCHAR(255), + body_part VARCHAR(255), + laterality VARCHAR(255), + series_desc VARCHAR(255), + institution VARCHAR(255), + station_name VARCHAR(255), + department VARCHAR(255), + perf_physician VARCHAR(255), + perf_phys_i_name VARCHAR(255), + perf_phys_p_name VARCHAR(255), + pps_start TIMESTAMP, + pps_iuid VARCHAR(255), + series_custom1 VARCHAR(255), + series_custom2 VARCHAR(255), + series_custom3 VARCHAR(255), + num_instances INTEGER NOT NULL, + src_aet VARCHAR(255), + ext_retr_aet VARCHAR(255), + retrieve_aets VARCHAR(255), + fileset_iuid VARCHAR(255), + fileset_id VARCHAR(255), + availability INTEGER NOT NULL, + series_status INTEGER NOT NULL, + created_time TIMESTAMP, + updated_time TIMESTAMP, + series_attrs BLOB, FOREIGN KEY (study_fk) REFERENCES study(pk), FOREIGN KEY (mpps_fk) REFERENCES mpps(pk) ); @@ -231,21 +231,21 @@ CREATE SEQUENCE series_req_pk_seq; CREATE TABLE series_req ( - pk NUMERIC(18,0) NOT NULL CONSTRAINT series_req_pk PRIMARY KEY, - series_fk NUMERIC(18,0), - study_iuid VARCHAR(255), - req_proc_id VARCHAR(255), - sps_id VARCHAR(255), - req_service VARCHAR(255), - req_physician VARCHAR(255), - req_phys_i_name VARCHAR(255), - req_phys_p_name VARCHAR(255), + pk NUMERIC(18,0) NOT NULL CONSTRAINT series_req_pk PRIMARY KEY, + series_fk NUMERIC(18,0), + study_iuid VARCHAR(255), + req_proc_id VARCHAR(255), + sps_id VARCHAR(255), + req_service VARCHAR(255), + req_physician VARCHAR(255), + req_phys_i_name VARCHAR(255), + req_phys_p_name VARCHAR(255), FOREIGN KEY (series_fk) REFERENCES series(pk) ); CREATE INDEX ser_req_series_fk ON series_req(series_fk); CREATE INDEX ser_rq_study_iuid ON series_req(study_iuid); CREATE INDEX ser_req_proc_id ON series_req(req_proc_id); -CREATE INDEX ser_req_sps_id ON series_req(sps_id); +CREATE INDEX ser_req_sps_id ON series_req(sps_id); CREATE INDEX ser_req_service ON series_req(req_service); CREATE INDEX ser_req_phys ON series_req(req_physician); CREATE INDEX ser_req_phys_i ON series_req(req_phys_i_name); @@ -253,43 +253,43 @@ CREATE SEQUENCE media_pk_seq; CREATE TABLE media ( - pk NUMERIC(18,0) NOT NULL CONSTRAINT media_pk PRIMARY KEY, - fileset_iuid VARCHAR(255) NOT NULL, - fileset_id VARCHAR(255), - media_rq_iuid VARCHAR(255), - media_status INTEGER NOT NULL, - media_status_info VARCHAR(255), - media_usage NUMERIC(18,0) NOT NULL, - created_time TIMESTAMP, - updated_time TIMESTAMP + pk NUMERIC(18,0) NOT NULL CONSTRAINT media_pk PRIMARY KEY, + fileset_iuid VARCHAR(255) NOT NULL, + fileset_id VARCHAR(255), + media_rq_iuid VARCHAR(255), + media_status INTEGER NOT NULL, + media_status_info VARCHAR(255), + media_usage NUMERIC(18,0) NOT NULL, + created_time TIMESTAMP, + updated_time TIMESTAMP ); CREATE UNIQUE INDEX fileset_iuid ON media(fileset_iuid); CREATE INDEX media_status ON media(media_status); CREATE SEQUENCE instance_pk_seq; CREATE TABLE instance ( - pk NUMERIC(18,0) NOT NULL CONSTRAINT instance_pk PRIMARY KEY, - series_fk NUMERIC(18,0), - srcode_fk NUMERIC(18,0), - media_fk NUMERIC(18,0), - sop_iuid VARCHAR(255) NOT NULL, - sop_cuid VARCHAR(255) NOT NULL, - inst_no VARCHAR(255), - content_datetime TIMESTAMP, - sr_complete VARCHAR(255), - sr_verified VARCHAR(255), - inst_custom1 VARCHAR(255), - inst_custom2 VARCHAR(255), - inst_custom3 VARCHAR(255), - ext_retr_aet VARCHAR(255), - retrieve_aets VARCHAR(255), - availability INTEGER NOT NULL, - inst_status INTEGER NOT NULL, - all_attrs NUMERIC(1) NOT NULL, - commitment NUMERIC(1) NOT NULL, - created_time TIMESTAMP, - updated_time TIMESTAMP, - inst_attrs BLOB, + pk NUMERIC(18,0) NOT NULL CONSTRAINT instance_pk PRIMARY KEY, + series_fk NUMERIC(18,0), + srcode_fk NUMERIC(18,0), + media_fk NUMERIC(18,0), + sop_iuid VARCHAR(255) NOT NULL, + sop_cuid VARCHAR(255) NOT NULL, + inst_no VARCHAR(255), + content_datetime TIMESTAMP, + sr_complete VARCHAR(255), + sr_verified VARCHAR(255), + inst_custom1 VARCHAR(255), + inst_custom2 VARCHAR(255), + inst_custom3 VARCHAR(255), + ext_retr_aet VARCHAR(255), + retrieve_aets VARCHAR(255), + availability INTEGER NOT NULL, + inst_status INTEGER NOT NULL, + all_attrs NUMERIC(1) NOT NULL, + commitment NUMERIC(1) NOT NULL, + created_time TIMESTAMP, + updated_time TIMESTAMP, + inst_attrs BLOB, FOREIGN KEY (series_fk) REFERENCES series(pk), FOREIGN KEY (srcode_fk) REFERENCES code(pk), FOREIGN KEY (media_fk) REFERENCES media(pk) @@ -312,12 +312,12 @@ CREATE SEQUENCE verify_observer_pk_seq; CREATE TABLE verify_observer ( - pk NUMERIC(18,0) NOT NULL CONSTRAINT verify_observer_pk PRIMARY KEY, - instance_fk NUMERIC(18,0), - verify_datetime TIMESTAMP, - observer_name VARCHAR(255), - observer_i_name VARCHAR(255), - observer_p_name VARCHAR(255), + pk NUMERIC(18,0) NOT NULL CONSTRAINT verify_observer_pk PRIMARY KEY, + instance_fk NUMERIC(18,0), + verify_datetime TIMESTAMP, + observer_name VARCHAR(255), + observer_i_name VARCHAR(255), + observer_p_name VARCHAR(255), FOREIGN KEY (instance_fk) REFERENCES instance(pk) ); CREATE INDEX observer_inst_fk ON verify_observer(instance_fk); @@ -328,14 +328,14 @@ CREATE SEQUENCE filesystem_pk_seq; CREATE TABLE filesystem ( - pk NUMERIC(18,0) NOT NULL CONSTRAINT filesystem_pk PRIMARY KEY, - next_fk NUMERIC(18,0), - dirpath VARCHAR(255) NOT NULL, - fs_group_id VARCHAR(255) NOT NULL, - retrieve_aet VARCHAR(255) NOT NULL, - availability INTEGER NOT NULL, - fs_status INTEGER NOT NULL, - user_info VARCHAR(255), + pk NUMERIC(18,0) NOT NULL CONSTRAINT filesystem_pk PRIMARY KEY, + next_fk NUMERIC(18,0), + dirpath VARCHAR(255) NOT NULL, + fs_group_id VARCHAR(255) NOT NULL, + retrieve_aet VARCHAR(255) NOT NULL, + availability INTEGER NOT NULL, + fs_status INTEGER NOT NULL, + user_info VARCHAR(255), FOREIGN KEY (next_fk) REFERENCES filesystem(pk) ); CREATE UNIQUE INDEX fs_dirpath ON filesystem(dirpath); @@ -347,18 +347,18 @@ CREATE SEQUENCE files_pk_seq; CREATE TABLE files ( - pk NUMERIC(18,0) NOT NULL CONSTRAINT files_pk PRIMARY KEY, - instance_fk NUMERIC(18,0), - filesystem_fk NUMERIC(18,0), - filepath VARCHAR(255) NOT NULL, - file_tsuid VARCHAR(255) NOT NULL, - file_md5 VARCHAR(255), - file_size NUMERIC(18,0), - file_status INTEGER NOT NULL, - md5_check_time TIMESTAMP, - created_time TIMESTAMP, -FOREIGN KEY (instance_fk) REFERENCES instance(pk), -FOREIGN KEY (filesystem_fk) REFERENCES filesystem(pk) + pk NUMERIC(18,0) NOT NULL CONSTRAINT files_pk PRIMARY KEY, + instance_fk NUMERIC(18,0), + filesystem_fk NUMERIC(18,0), + filepath VARCHAR(255) NOT NULL, + file_tsuid VARCHAR(255) NOT NULL, + file_md5 VARCHAR(255), + file_size NUMERIC(18,0), + file_status INTEGER NOT NULL, + md5_check_time TIMESTAMP, + created_time TIMESTAMP, +FOREIGN KEY (instance_fk) REFERENCES instance(pk), +FOREIGN KEY (filesystem_fk) REFERENCES filesystem(pk) ); CREATE INDEX instance_fk ON files(instance_fk); CREATE INDEX filesystem_fk ON files(filesystem_fk); @@ -369,10 +369,10 @@ CREATE SEQUENCE study_on_fs_pk_seq; CREATE TABLE study_on_fs ( - pk NUMERIC(18,0) NOT NULL CONSTRAINT study_on_fs_pk PRIMARY KEY, - study_fk NUMERIC(18,0), - filesystem_fk NUMERIC(18,0), - access_time TIMESTAMP NOT NULL, + pk NUMERIC(18,0) NOT NULL CONSTRAINT study_on_fs_pk PRIMARY KEY, + study_fk NUMERIC(18,0), + filesystem_fk NUMERIC(18,0), + access_time TIMESTAMP NOT NULL, FOREIGN KEY (study_fk) REFERENCES study(pk), FOREIGN KEY (filesystem_fk) REFERENCES filesystem(pk) ); @@ -382,23 +382,23 @@ CREATE SEQUENCE mwl_item_pk_seq; CREATE TABLE mwl_item ( - pk NUMERIC(18,0) NOT NULL CONSTRAINT mwl_item_pk PRIMARY KEY, - patient_fk NUMERIC(18,0), - sps_status INTEGER NOT NULL, - sps_id VARCHAR(255), - start_datetime TIMESTAMP NOT NULL, - station_aet VARCHAR(255) NOT NULL, - station_name VARCHAR(255), - modality VARCHAR(255) NOT NULL, - perf_physician VARCHAR(255), - perf_phys_i_name VARCHAR(255), - perf_phys_p_name VARCHAR(255), - req_proc_id VARCHAR(255) NOT NULL, - accession_no VARCHAR(255), - study_iuid VARCHAR(255) NOT NULL, - created_time TIMESTAMP, - updated_time TIMESTAMP, - item_attrs BLOB, + pk NUMERIC(18,0) NOT NULL CONSTRAINT mwl_item_pk PRIMARY KEY, + patient_fk NUMERIC(18,0), + sps_status INTEGER NOT NULL, + sps_id VARCHAR(255), + start_datetime TIMESTAMP NOT NULL, + station_aet VARCHAR(255) NOT NULL, + station_name VARCHAR(255), + modality VARCHAR(255) NOT NULL, + perf_physician VARCHAR(255), + perf_phys_i_name VARCHAR(255), + perf_phys_p_name VARCHAR(255), + req_proc_id VARCHAR(255) NOT NULL, + accession_no VARCHAR(255), + study_iuid VARCHAR(255) NOT NULL, + created_time TIMESTAMP, + updated_time TIMESTAMP, + item_attrs BLOB, FOREIGN KEY (patient_fk) REFERENCES patient(pk) ); CREATE INDEX mwl_patient_fk ON mwl_item(patient_fk); @@ -417,17 +417,17 @@ CREATE SEQUENCE gpsps_pk_seq; CREATE TABLE gpsps ( - pk NUMERIC(18,0) NOT NULL CONSTRAINT gpsps_pk PRIMARY KEY, - patient_fk NUMERIC(18,0), - code_fk NUMERIC(18,0), - gpsps_iuid VARCHAR(255) NOT NULL, - gpsps_tuid VARCHAR(255), - start_datetime TIMESTAMP NOT NULL, - end_datetime TIMESTAMP, - gpsps_status INTEGER NOT NULL, - gpsps_prior INTEGER NOT NULL, - in_availability INTEGER NOT NULL, - item_attrs BLOB, + pk NUMERIC(18,0) NOT NULL CONSTRAINT gpsps_pk PRIMARY KEY, + patient_fk NUMERIC(18,0), + code_fk NUMERIC(18,0), + gpsps_iuid VARCHAR(255) NOT NULL, + gpsps_tuid VARCHAR(255), + start_datetime TIMESTAMP NOT NULL, + end_datetime TIMESTAMP, + gpsps_status INTEGER NOT NULL, + gpsps_prior INTEGER NOT NULL, + in_availability INTEGER NOT NULL, + item_attrs BLOB, FOREIGN KEY (patient_fk) REFERENCES patient(pk), FOREIGN KEY (code_fk) REFERENCES code(pk) ); @@ -442,8 +442,8 @@ CREATE INDEX in_availability ON gpsps(in_availability); CREATE TABLE rel_gpsps_appcode ( - gpsps_fk NUMERIC(18,0), - appcode_fk NUMERIC(18,0), + gpsps_fk NUMERIC(18,0), + appcode_fk NUMERIC(18,0), FOREIGN KEY (gpsps_fk) REFERENCES gpsps(pk), FOREIGN KEY (appcode_fk) REFERENCES code(pk) ); @@ -451,8 +451,8 @@ CREATE INDEX gpsps_appcode_fk ON rel_gpsps_appcode(appcode_fk); CREATE TABLE rel_gpsps_devname ( - gpsps_fk NUMERIC(18,0), - devname_fk NUMERIC(18,0), + gpsps_fk NUMERIC(18,0), + devname_fk NUMERIC(18,0), FOREIGN KEY (gpsps_fk) REFERENCES gpsps(pk), FOREIGN KEY (devname_fk) REFERENCES code(pk) ); @@ -460,8 +460,8 @@ CREATE INDEX gpsps_devname_fk ON rel_gpsps_devname(devname_fk); CREATE TABLE rel_gpsps_devclass ( - gpsps_fk NUMERIC(18,0), - devclass_fk NUMERIC(18,0), + gpsps_fk NUMERIC(18,0), + devclass_fk NUMERIC(18,0), FOREIGN KEY (gpsps_fk) REFERENCES gpsps(pk), FOREIGN KEY (devclass_fk) REFERENCES code(pk) ); @@ -469,8 +469,8 @@ CREATE INDEX gpsps_devclass_fk ON rel_gpsps_devclass(devclass_fk); CREATE TABLE rel_gpsps_devloc ( - gpsps_fk NUMERIC(18,0), - devloc_fk NUMERIC(18,0), + gpsps_fk NUMERIC(18,0), + devloc_fk NUMERIC(18,0), FOREIGN KEY (gpsps_fk) REFERENCES gpsps(pk), FOREIGN KEY (devloc_fk) REFERENCES code(pk) ); @@ -479,12 +479,12 @@ CREATE SEQUENCE gpsps_perf_pk_seq; CREATE TABLE gpsps_perf ( - pk NUMERIC(18,0) NOT NULL CONSTRAINT gpsps_perf_pk PRIMARY KEY, - gpsps_fk NUMERIC(18,0), - code_fk NUMERIC(18,0), - human_perf_name VARCHAR(255), - hum_perf_i_name VARCHAR(255), - hum_perf_p_name VARCHAR(255), + pk NUMERIC(18,0) NOT NULL CONSTRAINT gpsps_perf_pk PRIMARY KEY, + gpsps_fk NUMERIC(18,0), + code_fk NUMERIC(18,0), + human_perf_name VARCHAR(255), + hum_perf_i_name VARCHAR(255), + hum_perf_p_name VARCHAR(255), FOREIGN KEY (gpsps_fk) REFERENCES gpsps(pk), FOREIGN KEY (code_fk) REFERENCES code(pk) ); @@ -496,26 +496,26 @@ CREATE SEQUENCE gpsps_req_pk_seq; CREATE TABLE gpsps_req ( - pk NUMERIC(18,0) NOT NULL CONSTRAINT gpsps_req_pk PRIMARY KEY, - gpsps_fk NUMERIC(18,0), - req_proc_id VARCHAR(255), - accession_no VARCHAR(255), + pk NUMERIC(18,0) NOT NULL CONSTRAINT gpsps_req_pk PRIMARY KEY, + gpsps_fk NUMERIC(18,0), + req_proc_id VARCHAR(255), + accession_no VARCHAR(255), FOREIGN KEY (gpsps_fk) REFERENCES gpsps(pk) ); CREATE INDEX gpsps_req_gpsps_fk ON gpsps_req(gpsps_fk); CREATE INDEX gpsps_req_proc_id ON gpsps_req(req_proc_id); -CREATE INDEX gpsps_req_acc_no ON gpsps_req(accession_no); +CREATE INDEX gpsps_req_acc_no ON gpsps_req(accession_no); CREATE SEQUENCE gppps_pk_seq; CREATE TABLE gppps ( - pk NUMERIC(18,0) NOT NULL CONSTRAINT gppps_pk PRIMARY KEY, - patient_fk NUMERIC(18,0), - pps_iuid VARCHAR(255) NOT NULL, - pps_start TIMESTAMP, - pps_status INTEGER NOT NULL, - created_time TIMESTAMP, - updated_time TIMESTAMP, - pps_attrs BLOB, + pk NUMERIC(18,0) NOT NULL CONSTRAINT gppps_pk PRIMARY KEY, + patient_fk NUMERIC(18,0), + pps_iuid VARCHAR(255) NOT NULL, + pps_start TIMESTAMP, + pps_status INTEGER NOT NULL, + created_time TIMESTAMP, + updated_time TIMESTAMP, + pps_attrs BLOB, FOREIGN KEY (patient_fk) REFERENCES patient(pk) ); CREATE UNIQUE INDEX gppps_iuid ON gppps (pps_iuid); @@ -523,8 +523,8 @@ CREATE INDEX gppps_pps_start ON gppps (pps_start); CREATE TABLE rel_gpsps_gppps ( - gpsps_fk NUMERIC(18,0), - gppps_fk NUMERIC(18,0), + gpsps_fk NUMERIC(18,0), + gppps_fk NUMERIC(18,0), FOREIGN KEY (gpsps_fk) REFERENCES gpsps(pk), FOREIGN KEY (gppps_fk) REFERENCES gppps(pk) ); @@ -533,16 +533,16 @@ CREATE SEQUENCE hp_pk_seq; CREATE TABLE hp ( - pk NUMERIC(18,0) NOT NULL CONSTRAINT hp_pk PRIMARY KEY, - user_fk NUMERIC(18,0), - hp_iuid VARCHAR(255) NOT NULL, - hp_cuid VARCHAR(255), - hp_name VARCHAR(255), - hp_group VARCHAR(255), - hp_level INTEGER NOT NULL, - num_priors INTEGER NOT NULL, - num_screens INTEGER NOT NULL, - hp_attrs BLOB, + pk NUMERIC(18,0) NOT NULL CONSTRAINT hp_pk PRIMARY KEY, + user_fk NUMERIC(18,0), + hp_iuid VARCHAR(255) NOT NULL, + hp_cuid VARCHAR(255), + hp_name VARCHAR(255), + hp_group VARCHAR(255), + hp_level INTEGER NOT NULL, + num_priors INTEGER NOT NULL, + num_screens INTEGER NOT NULL, + hp_attrs BLOB, FOREIGN KEY (user_fk) REFERENCES code(pk) ); CREATE INDEX hp_user_fk ON hp(user_fk); @@ -555,10 +555,10 @@ CREATE SEQUENCE hpdef_pk_seq; CREATE TABLE hpdef ( - pk NUMERIC(18,0) NOT NULL CONSTRAINT hpdef_pk PRIMARY KEY, - hp_fk NUMERIC(18,0), - modality VARCHAR(255), - laterality VARCHAR(255), + pk NUMERIC(18,0) NOT NULL CONSTRAINT hpdef_pk PRIMARY KEY, + hp_fk NUMERIC(18,0), + modality VARCHAR(255), + laterality VARCHAR(255), FOREIGN KEY (hp_fk) REFERENCES hp(pk) ); CREATE INDEX hp_fk ON hpdef(hp_fk); @@ -566,8 +566,8 @@ CREATE INDEX hpdef_laterality ON hpdef(laterality); CREATE TABLE rel_hpdef_region ( - hpdef_fk NUMERIC(18,0), - region_fk NUMERIC(18,0), + hpdef_fk NUMERIC(18,0), + region_fk NUMERIC(18,0), FOREIGN KEY (hpdef_fk) REFERENCES hpdef(pk), FOREIGN KEY (region_fk) REFERENCES code(pk) ); @@ -575,8 +575,8 @@ CREATE INDEX hpdef_region_fk ON rel_hpdef_region(region_fk); CREATE TABLE rel_hpdef_proc ( - hpdef_fk NUMERIC(18,0), - proc_fk NUMERIC(18,0), + hpdef_fk NUMERIC(18,0), + proc_fk NUMERIC(18,0), FOREIGN KEY (hpdef_fk) REFERENCES hpdef(pk), FOREIGN KEY (proc_fk) REFERENCES code(pk) ); @@ -584,8 +584,8 @@ CREATE INDEX hpdef_proc_fk ON rel_hpdef_proc(proc_fk); CREATE TABLE rel_hpdef_reason ( - hpdef_fk NUMERIC(18,0), - reason_fk NUMERIC(18,0), + hpdef_fk NUMERIC(18,0), + reason_fk NUMERIC(18,0), FOREIGN KEY (hpdef_fk) REFERENCES hpdef(pk), FOREIGN KEY (reason_fk) REFERENCES code(pk) ); @@ -595,12 +595,12 @@ CREATE SEQUENCE priv_patient_pk_seq; CREATE TABLE priv_patient ( - pk NUMERIC(18,0) NOT NULL CONSTRAINT priv_patient_pk PRIMARY KEY, - priv_type INTEGER NOT NULL, - pat_id VARCHAR(255), - pat_id_issuer VARCHAR(255), - pat_name VARCHAR(255), - pat_attrs BLOB + pk NUMERIC(18,0) NOT NULL CONSTRAINT priv_patient_pk PRIMARY KEY, + priv_type INTEGER NOT NULL, + pat_id VARCHAR(255), + pat_id_issuer VARCHAR(255), + pat_name VARCHAR(255), + pat_attrs BLOB ); CREATE INDEX priv_pat_id ON priv_patient(pat_id, pat_id_is... [truncated message content] |