CREATE SCHEMA PUBLIC AUTHORIZATION DBA
CREATE CACHED TABLE PATIENT(LOCALPRIMARYKEY VARCHAR NOT NULL PRIMARY KEY,RECORDINSERTIONTIME BIGINT,PATIENTNAME VARCHAR,PM_PATIENTNAME_CANONICAL VARCHAR,PM_PATIENTNAME_PHONETICCANONICAL VARCHAR,PATIENTID VARCHAR,PATIENTBIRTHDATE VARCHAR,PATIENTSEX VARCHAR)
CREATE INDEX PATIENT_PM_PATIENTNAME_CANONICAL_IDX ON PATIENT(PM_PATIENTNAME_CANONICAL)
CREATE INDEX PATIENT_PM_PATIENTNAME_PHONETICCANONICAL_IDX ON PATIENT(PM_PATIENTNAME_PHONETICCANONICAL)
CREATE CACHED TABLE STUDY(LOCALPRIMARYKEY VARCHAR NOT NULL PRIMARY KEY,LOCALPARENTREFERENCE VARCHAR,RECORDINSERTIONTIME BIGINT,STUDYDATE VARCHAR,STUDYINSTANCEUID VARCHAR,STUDYID VARCHAR,PM_STUDYDATETIME TIMESTAMP,PM_STUDYHASBEENPROCESSED BOOLEAN)
CREATE INDEX STUDY_PREFIDX ON STUDY(LOCALPARENTREFERENCE)
CREATE INDEX STUDY_UID_IDX ON STUDY(STUDYINSTANCEUID)
CREATE CACHED TABLE SERIES(LOCALPRIMARYKEY VARCHAR NOT NULL PRIMARY KEY,LOCALPARENTREFERENCE VARCHAR,RECORDINSERTIONTIME BIGINT,MANUFACTURER VARCHAR,SERIESINSTANCEUID VARCHAR,SERIESNUMBER INTEGER,PM_SERIESDATETIME TIMESTAMP)
CREATE INDEX SERIES_PREFIDX ON SERIES(LOCALPARENTREFERENCE)
CREATE CACHED TABLE INSTANCE(LOCALPRIMARYKEY VARCHAR NOT NULL PRIMARY KEY,LOCALPARENTREFERENCE VARCHAR,RECORDINSERTIONTIME BIGINT,LOCALFILENAME VARCHAR,LOCALFILEREFERENCETYPE CHAR(1),TRANSFERSYNTAXUID VARCHAR,SOURCEAPPLICATIONENTITYTITLE VARCHAR,SPECIFICCHARACTERSET VARCHAR,IMAGETYPE VARCHAR,INSTANCECREATORUID VARCHAR,SOPCLASSUID VARCHAR,SOPINSTANCEUID VARCHAR,PM_CONTENTDATETIME TIMESTAMP,PM_ACQUISITIONDATETIME TIMESTAMP,PM_LOSSYIMAGECOMPRESSION INTEGER,PM_INSTANCEHASBEENSENTTOREGISTRY BOOLEAN,PM_ISRADIATIONDOSESR BOOLEAN,PM_ISRADIATIONDOSESCREEN BOOLEAN,PM_ISEXPOSUREDOSESEQUENCE BOOLEAN)
CREATE INDEX INSTANCE_PREFIDX ON INSTANCE(LOCALPARENTREFERENCE)
CREATE INDEX INSTANCE_UID_IDX ON INSTANCE(SOPINSTANCEUID)
SET TABLE PATIENT INDEX'4 4 4 0'
SET TABLE STUDY INDEX'269 269 269 0'
SET TABLE SERIES INDEX'249 249 0'
SET TABLE INSTANCE INDEX'175 175 175 0'
CREATE USER SA PASSWORD ""
GRANT DBA TO SA
SET WRITE_DELAY 10
