ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vjapa...@apache.org
Subject svn commit: r1551254 [9/26] - in /ctakes/branches/ytex: ctakes-ytex-res/ ctakes-ytex-res/.settings/ ctakes-ytex-res/src/ ctakes-ytex-res/src/main/ ctakes-ytex-res/src/main/resources/ ctakes-ytex-res/src/main/resources/org/ ctakes-ytex-res/src/main/reso...
Date Mon, 16 Dec 2013 16:30:40 GMT
Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/uima/create_document.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/uima/create_document.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/uima/create_document.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/uima/create_document.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,255 @@
+
+
+CREATE TABLE $(db_schema).[document](
+	[document_id] [int] /* IDENTITY(1,1) */ NOT NULL primary key,
+	instance_id bigint not null default 0,
+	instance_key varchar(256) null,
+	[analysis_batch] [varchar](50) NOT NULL,
+	[cas] [varbinary](max) NULL,
+	[doc_text] [nvarchar](max) NULL
+)
+;
+
+
+CREATE NONCLUSTERED INDEX [IX_document_analysis_batch] ON $(db_schema).[document] 
+(
+	[document_id],
+	[analysis_batch]
+)
+;
+
+CREATE NONCLUSTERED INDEX [IX_uid] ON $(db_schema).[document] 
+(
+	[instance_id]
+)
+;
+
+CREATE NONCLUSTERED INDEX [IX_instance_key] ON $(db_schema).[document] 
+(
+	[instance_key]
+)
+;
+
+create table $(db_schema).anno_base (
+	anno_base_id int /* identity */ not null, 
+	document_id int not null, 
+	span_begin int,
+	span_end int,
+	uima_type_id int not null
+	primary key (anno_base_id),
+	foreign key (document_id) references $(db_schema).document (document_id) ON DELETE CASCADE,
+	foreign key (uima_type_id) references $(db_schema).ref_uima_type (uima_type_id)
+)
+;
+
+CREATE INDEX IX_docanno_doc ON $(db_schema).anno_base (document_id)
+;
+
+create table $(db_schema).anno_sentence (
+	anno_base_id int not null,
+	sentenceNumber int,
+	segmentId varchar(20),
+	primary key (anno_base_id),
+	foreign key (anno_base_id) references $(db_schema).anno_base(anno_base_id)  ON DELETE CASCADE
+);
+
+create table $(db_schema).anno_named_entity (
+	anno_base_id int not null, 
+	discoveryTechnique int,
+	status int,
+	polarity int,
+	uncertainty int,
+	conditional bit,
+	generic bit,
+	typeID int,
+	confidence float,
+	segmentID varchar(20),
+	primary key (anno_base_id),
+	foreign key (anno_base_id) references $(db_schema).anno_base(anno_base_id)  ON DELETE CASCADE
+);
+
+create table $(db_schema).anno_med_event (
+	anno_base_id int not null,
+	discoveryTechnique int,
+	status int,
+	polarity int,
+	uncertainty int,
+	conditional bit,
+	generic bit,
+	typeID int,
+	confidence float,
+	segmentID varchar(20),
+	freqNumber varchar(10),
+	freqUnit varchar(10),
+	strengthNumber varchar(10),
+	strengthUnit varchar(10),
+	[change] varchar(10),
+	dosage varchar(10),
+	primary key (anno_base_id),
+	foreign key (anno_base_id) references $(db_schema).anno_base(anno_base_id)  ON DELETE CASCADE
+);
+
+
+create table $(db_schema).anno_ontology_concept (
+	anno_ontology_concept_id int identity not null, 
+	anno_base_id int not null,
+	code varchar(20),
+	cui char(8),
+	disambiguated bit not null default 0,
+	primary key (anno_ontology_concept_id),
+	foreign key (anno_base_id) references $(db_schema).anno_base(anno_base_id)  ON DELETE CASCADE
+);
+
+create index IX_onto_concept_code on $(db_schema).anno_ontology_concept (code);
+create index IX_onto_concept_anno_cui on $(db_schema).anno_ontology_concept (anno_base_id, cui);
+create index IX_onto_concept_anno_code on $(db_schema).anno_ontology_concept (anno_base_id, code);
+
+CREATE TABLE $(db_schema).[anno_segment](
+	[anno_base_id] [int] NOT NULL,
+	id varchar(20) NULL,
+PRIMARY KEY CLUSTERED 
+(
+	[anno_base_id] ASC
+)
+)
+;
+
+ALTER TABLE $(db_schema).[anno_segment]  WITH CHECK ADD FOREIGN KEY([anno_base_id])
+REFERENCES $(db_schema).[anno_base] ([anno_base_id])
+ON DELETE CASCADE
+;
+
+CREATE NONCLUSTERED INDEX [IX_segment_anno_seg] ON $(db_schema).[anno_segment] 
+(
+	[anno_base_id] ASC,
+	[id] ASC
+)
+;
+
+
+-- mapped to BaseToken
+create table $(db_schema).anno_token (
+	[anno_base_id] [int] NOT NULL,
+	tokenNumber int NOT NULL default 0,
+	normalizedForm nvarchar(20),
+	partofSpeech varchar(5),
+	coveredText nvarchar(20) null,
+	capitalization int not null default 0,
+	numPosition int not null default 0,
+	suggestion varchar(20),
+	canonicalForm nvarchar(20),
+	negated bit not null default 0,
+	possible bit not null default 0,
+	PRIMARY KEY CLUSTERED 
+	(
+		[anno_base_id] ASC
+	),
+	foreign key (anno_base_id) 
+		references $(db_schema).anno_base(anno_base_id)  
+		ON DELETE CASCADE
+);
+
+
+create index IX_word_stem on $(db_schema).anno_token (canonicalForm);
+create index IX_coveredText on $(db_schema).anno_token (coveredText);
+
+create table $(db_schema).anno_date (
+	anno_base_id int not null,
+	tstamp datetime,
+	primary key (anno_base_id),
+	foreign key (anno_base_id) references $(db_schema).anno_base(anno_base_id) ON DELETE CASCADE
+);
+
+create table $(db_schema).anno_markable (
+	anno_base_id int not null primary key ,
+	id int default 0,
+	anaphoric_prob float default 0,
+	content int default 0,
+	foreign key (anno_base_id) references $(db_schema).anno_base(anno_base_id) ON DELETE CASCADE
+);
+
+create table $(db_schema).anno_treebank_node (
+	anno_base_id int not null primary key ,
+	parent int default 0,
+	nodeType varchar(10),
+	nodeValue varchar(10),
+	leaf bit default 0,
+	headIndex int default 0,
+	[index] int default 0,
+	tokenIndex int default 0,
+	foreign key (anno_base_id) references $(db_schema).anno_base(anno_base_id) ON DELETE CASCADE
+);
+
+create table $(db_schema).anno_link (
+	anno_link_id int IDENTITY not null primary key,
+	parent_anno_base_id int not null,
+	child_anno_base_id int not null,
+	feature varchar(20),
+	foreign key (parent_anno_base_id) references $(db_schema).anno_base(anno_base_id) ON DELETE CASCADE
+);
+create index IX_link on $(db_schema).anno_link (parent_anno_base_id, child_anno_base_id, feature);
+create index IX_parent on $(db_schema).anno_link (parent_anno_base_id);
+
+-- we run into deadlocks if we have a clustered index and foreign key constraint
+-- on anno_contain.  use a nonclustered primary key and throw out the fk.
+create table $(db_schema).anno_contain (
+  parent_anno_base_id int not null,
+  parent_uima_type_id int not null,
+  child_anno_base_id int not null,
+  child_uima_type_id int not null,
+  primary key nonclustered (parent_anno_base_id, child_anno_base_id)
+);
+
+create index ix_child_id on $(db_schema).anno_contain(child_anno_base_id);
+create index ix_parent_id on $(db_schema).anno_contain(parent_anno_base_id);
+create index IX_parent_id_child_type on $(db_schema).anno_contain(parent_anno_base_id, child_uima_type_id);
+create index IX_child_id_parent_type on $(db_schema).anno_contain(child_anno_base_id, parent_uima_type_id);
+
+
+
+CREATE TABLE $(db_schema).fracture_demo(
+	note_id int IDENTITY(1,1) NOT NULL primary key,
+	site_id varchar(10) NULL,
+	note_text varchar(max) NULL,
+	fracture varchar(20) NULL,
+	note_set varchar(10) NULL
+);
+
+
+-- metamap tables
+create table $(db_schema).anno_mm_candidate (
+	anno_base_id int primary key,
+	cui char(8),
+	score int default 0,
+	head bit default 0,
+	overmatch bit default 0,
+	foreign key (anno_base_id) references $(db_schema).anno_base(anno_base_id) ON DELETE CASCADE
+);
+
+create table $(db_schema).anno_mm_acronym (
+	anno_base_id int primary key,
+	acronym varchar(10),
+    [expansion] varchar(30),
+	foreign key (anno_base_id) references $(db_schema).anno_base(anno_base_id) ON DELETE CASCADE
+);
+
+create table $(db_schema).anno_mm_utterance (
+	anno_base_id int primary key,
+	pmid varchar(10),
+    location varchar(30),
+	foreign key (anno_base_id) references $(db_schema).anno_base(anno_base_id) ON DELETE CASCADE
+);
+
+create table $(db_schema).anno_mm_cuiconcept (
+    anno_mm_cuiconcept_id int identity primary key,
+    anno_base_id int,
+    negExCui char(8),
+	foreign key (anno_base_id) references $(db_schema).anno_base(anno_base_id) ON DELETE CASCADE
+);
+
+create table $(db_schema).anno_mm_negation (
+    anno_base_id int primary key,
+    negType varchar(10),
+    negTrigger varchar(10),
+	foreign key (anno_base_id) references $(db_schema).anno_base(anno_base_id) ON DELETE CASCADE
+);
\ No newline at end of file

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/uima/create_reference.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/uima/create_reference.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/uima/create_reference.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/uima/create_reference.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,46 @@
+create table $(db_schema).hibernate_sequences (
+	sequence_name varchar(100) not null primary key,
+	next_val int not null default 1
+);
+insert into $(db_schema).hibernate_sequences(sequence_name, next_val) values ('document_id_sequence', 1);
+
+create table $(db_schema).anno_base_sequence (
+	sequence_name varchar(100) not null primary key,
+	next_val int not null default 1
+);
+insert into $(db_schema).anno_base_sequence(sequence_name, next_val) values ('anno_base_id_sequence', 1);
+
+
+create table $(db_schema).ref_named_entity_regex (
+	named_entity_regex_id int IDENTITY(1,1) NOT NULL,
+	regex varchar(512) not null,
+	coding_scheme varchar(20) not null,
+	code varchar(20) not null,
+	oid varchar(10),
+	context varchar(256),
+	primary key (named_entity_regex_id)
+);
+
+create table $(db_schema).ref_segment_regex (
+	segment_regex_id int IDENTITY(1,1) NOT NULL,
+	regex varchar(256) not null,
+	segment_id varchar(256),
+	limit_to_regex bit null default 0, 
+	primary key (segment_regex_id)
+);
+
+create table $(db_schema).ref_uima_type (
+	uima_type_id int not null,
+	uima_type_name varchar(256) not null,
+	table_name varchar(100) null,
+	CONSTRAINT PK_ref_uima_type PRIMARY KEY  
+	(
+		uima_type_id ASC
+	)
+)
+;
+
+CREATE TABLE $(db_schema).ref_stopword (
+	stopword varchar(50) not null primary key
+)
+;
\ No newline at end of file

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/uima/create_view.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/uima/create_view.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/uima/create_view.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/uima/create_view.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,59 @@
+create view $(db_schema).v_document as
+-- We assume the metadata about documents (patient id, date) come from
+-- some table in your database.  modify this view to join with that table
+-- and get this info
+select analysis_batch, document_id, doc_text, instance_id, cast(null as int) patient_id, cast(null as datetime) doc_date, cast(null as varchar(256)) doc_title, cast(null as varchar(256)) document_type_name
+from $(db_schema).document;
+go
+
+create view $(db_schema).[v_annotation]
+AS
+SELECT anno.*, ur.uima_type_name, substring(doc.doc_text, anno.span_begin+1, anno.span_end-anno.span_begin) anno_text, doc.analysis_batch
+FROM $(db_schema).anno_base AS anno 
+INNER JOIN $(db_schema).v_document AS doc ON doc.document_id = anno.document_id
+INNER JOIN $(db_schema).REF_UIMA_TYPE AS ur on ur.uima_type_id = anno.uima_type_id
+;
+GO
+
+create view $(db_schema).v_document_cui_sent
+as
+-- this view gives the document info, cui info, and sentence info in which a cui is found
+SELECT 
+  da.anno_base_id,
+  d.analysis_batch,
+  da.document_id, 
+  ne.polarity, 
+  o.code, 
+  substring(d.doc_text, da.span_begin+1, da.span_end-da.span_begin) cui_text, 
+  substring(d.doc_text, s.span_begin+1, s.span_end-s.span_begin) sentence_text,
+  o.disambiguated,
+  d.patient_id,
+  d.doc_date,
+  d.doc_title,
+  d.document_type_name
+FROM $(db_schema).anno_base da 
+INNER JOIN $(db_schema).anno_named_entity  ne ON da.anno_base_id = ne.anno_base_id 
+INNER JOIN $(db_schema).anno_ontology_concept  o ON o.anno_base_id = ne.anno_base_id 
+left join 
+( 
+  --  get the sentence that contains the cui
+  select ac.child_anno_base_id, s.span_begin, s.span_end
+  from $(db_schema).anno_contain ac 
+  INNER join $(db_schema).anno_base s on ac.parent_anno_base_id = s.anno_base_id
+  where s.uima_type_id in (select uima_type_id from $(db_schema).ref_uima_type where uima_type_name = 'edu.mayo.bmi.uima.core.type.textspan.Sentence')
+  and ac.child_uima_type_id in (select uima_type_id from $(db_schema).ref_uima_type where uima_type_name = 'edu.mayo.bmi.uima.core.type.textsem.EntityMention')
+) s on da.anno_base_id = s.child_anno_base_id
+INNER JOIN $(db_schema).v_document d on da.document_id = d.document_id
+;
+go
+
+CREATE VIEW $(db_schema).[v_document_ontoanno]
+AS
+SELECT d.document_id, da.span_begin, da.span_end, ne.polarity, o.code, o.cui, d.analysis_batch, substring(d.doc_text, da.span_begin+1, da.span_end-da.span_begin) cui_text, o.disambiguated
+FROM $(db_schema).v_document AS d INNER JOIN
+$(db_schema).anno_base AS da ON d.document_id = da.document_id INNER JOIN
+$(db_schema).anno_named_entity AS ne ON da.anno_base_id = ne.anno_base_id INNER JOIN
+$(db_schema).anno_ontology_concept AS o ON o.anno_base_id = ne.anno_base_id
+;
+GO
+

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/uima/drop_document.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/uima/drop_document.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/uima/drop_document.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/uima/drop_document.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,77 @@
+-- legacy
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[document_class]') AND type in (N'U'))
+	drop table $(db_schema).document_class
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[anno_source_doc_info]') AND type in (N'U'))
+	drop table $(db_schema).anno_source_doc_info
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[anno_num_token]') AND type in (N'U'))
+	drop table $(db_schema).anno_num_token
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[anno_word_token]') AND type in (N'U'))
+	drop table $(db_schema).anno_word_token
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[anno_base_token]') AND type in (N'U'))
+	drop table $(db_schema).anno_base_token
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[anno_umls_concept]') AND type in (N'U'))
+	drop table $(db_schema).anno_umls_concept
+;
+-- drop 'operational' data
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[fracture_demo]') AND type in (N'U'))
+	drop table $(db_schema).fracture_demo
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[anno_contain]') AND type in (N'U'))
+	drop table $(db_schema).anno_contain
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[anno_link]') AND type in (N'U'))
+	drop table $(db_schema).anno_link
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[anno_mm_cuiconcept]') AND type in (N'U'))
+	drop table $(db_schema).anno_mm_cuiconcept
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[anno_mm_candidate]') AND type in (N'U'))
+	drop table $(db_schema).anno_mm_candidate
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[anno_mm_acronym]') AND type in (N'U'))
+	drop table $(db_schema).anno_mm_acronym
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[anno_mm_utterance]') AND type in (N'U'))
+	drop table $(db_schema).anno_mm_utterance
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[anno_mm_negation]') AND type in (N'U'))
+	drop table $(db_schema).anno_mm_negation
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[anno_token]') AND type in (N'U'))
+	drop table $(db_schema).anno_token
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[anno_segment]') AND type in (N'U'))
+	drop table $(db_schema).anno_segment
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[anno_ontology_concept]') AND type in (N'U'))
+	drop table $(db_schema).anno_ontology_concept
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[anno_named_entity]') AND type in (N'U'))
+	drop table $(db_schema).anno_named_entity
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[anno_med_event]') AND type in (N'U'))
+	drop table $(db_schema).anno_med_event
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[anno_sentence]') AND type in (N'U'))
+	drop table $(db_schema).anno_sentence
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[anno_date]') AND type in (N'U'))
+	drop table $(db_schema).anno_date
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[anno_markable]') AND type in (N'U'))
+	drop table $(db_schema).anno_markable
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[anno_treebank_node]') AND type in (N'U'))
+	drop table $(db_schema).anno_treebank_node
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[anno_base]') AND type in (N'U'))
+	drop table $(db_schema).anno_base
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[document]') AND type in (N'U'))
+	drop table $(db_schema).document
+;

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/uima/drop_reference.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/uima/drop_reference.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/uima/drop_reference.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/uima/drop_reference.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,27 @@
+-- drop 'reference' data
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[hibernate_sequences]') AND type in (N'U'))
+	drop table $(db_schema).hibernate_sequences
+;
+
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[anno_base_sequence]') AND type in (N'U'))
+	drop table $(db_schema).anno_base_sequence
+;
+
+
+
+
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[ref_uima_type]') AND type in (N'U'))
+	drop table $(db_schema).ref_uima_type
+;
+
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[ref_named_entity_regex]') AND type in (N'U'))
+	drop table $(db_schema).ref_named_entity_regex
+;
+
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[ref_segment_regex]') AND type in (N'U'))
+	drop table $(db_schema).ref_segment_regex
+;
+
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[ref_stopword]') AND type in (N'U'))
+	drop table $(db_schema).ref_stopword
+;

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/uima/drop_view.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/uima/drop_view.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/uima/drop_view.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/uima/drop_view.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,16 @@
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[V_DOCUMENT]') AND type in (N'V'))
+	drop view $(db_schema).[V_DOCUMENT]
+;
+
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[V_ANNOTATION]') AND type in (N'V'))
+	drop view $(db_schema).[V_ANNOTATION]
+;
+
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[v_document_cui_sent]') AND type in (N'V'))
+	drop view $(db_schema).v_document_cui_sent
+;
+
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[V_DOCUMENT_ONTOANNO]') AND type in (N'V'))
+	drop VIEW $(db_schema).[V_DOCUMENT_ONTOANNO]
+;
+

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/uima/fracture_demo.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/uima/fracture_demo.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/uima/fracture_demo.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/uima/fracture_demo.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1 @@
+update $(db_schema).fracture_demo set note_text = replace(note_text, '<br/>', CHAR(10));
\ No newline at end of file

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/create_indices.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/create_indices.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/create_indices.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/create_indices.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,3 @@
+create index IX_fword on $(db_schema).umls_aui_fword (fword);
+create index IX_fstem on $(db_schema).umls_aui_fword (fstem);
+

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/create_tables.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/create_tables.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/create_tables.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/create_tables.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,7 @@
+create table $(db_schema).umls_aui_fword (
+	aui varchar(9) not null primary key,
+	fword nvarchar(70) not null,
+	fstem nvarchar(70) null,
+	tok_str nvarchar(250) not null,
+	stem_str nvarchar(250) null
+);
\ No newline at end of file

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/create_view.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/create_view.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/create_view.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/create_view.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,9 @@
+create table $(db_schema).v_snomed_fword_lookup (
+	cui char(8), 
+	tui char(4), 
+	fword nvarchar(70), 
+	fstem nvarchar(70), 
+	tok_str nvarchar(250), 
+	stem_str nvarchar(250)
+)
+;

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/drop_tables.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/drop_tables.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/drop_tables.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/drop_tables.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,4 @@
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[umls_aui_fword]') AND type in (N'U'))
+	drop table $(db_schema).[umls_aui_fword]
+;
+

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/drop_view.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/drop_view.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/drop_view.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/drop_view.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,7 @@
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[v_snomed_fword_lookup]') AND type in (N'V'))
+	drop view $(db_schema).v_snomed_fword_lookup
+;
+
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).[v_snomed_fword_lookup]') AND type in (N'U'))
+	drop table $(db_schema).v_snomed_fword_lookup
+;

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/import_umls.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/import_umls.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/import_umls.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/import_umls.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,40 @@
+-- this is only executed if you don't have umls installed in your db 
+-- load the umls mrconso table from a dump file.
+-- the following was copied directly from the umls load script.
+
+-- intentionally do not drop MRCONSO - if it exists then we should use it 
+-- instead of overwriting it
+CREATE TABLE  $(db_schema).MRCONSO (
+    CUI	char(8) NOT NULL,
+    LAT	char(3) NOT NULL,
+    TS	char(1) NOT NULL,
+    LUI	varchar(10) NOT NULL,
+    STT	varchar(3) NOT NULL,
+    SUI	varchar(10) NOT NULL,
+    ISPREF	char(1) NOT NULL,
+    AUI	varchar(9) NOT NULL,
+    SAUI	varchar(50),
+    SCUI	varchar(50),
+    SDUI	varchar(50),
+    SAB	varchar(20) NOT NULL,
+    TTY	varchar(20) NOT NULL,
+    CODE	varchar(50) NOT NULL,
+    STR	nvarchar(max) NOT NULL,
+    SRL	int  NOT NULL,
+    SUPPRESS	char(1) NOT NULL,
+    CVF	int 
+);
+
+ALTER TABLE $(db_schema).MRCONSO ADD CONSTRAINT X_MRCONSO_PK  PRIMARY KEY (AUI);
+
+CREATE TABLE  $(db_schema).MRSTY (
+    CUI	char(8) NOT NULL,
+    TUI	char(4) NOT NULL,
+    STN	varchar(100) NOT NULL,
+    STY	varchar(50) NOT NULL,
+    ATUI	varchar(11) NOT NULL,
+    CVF	int 
+);
+
+ALTER TABLE $(db_schema).MRSTY ADD CONSTRAINT X_MRSTY_PK  PRIMARY KEY (ATUI);
+

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/index_umls.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/index_umls.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/index_umls.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/index_umls.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,17 @@
+CREATE INDEX X_MRCONSO_CUI ON $(db_schema).MRCONSO(CUI);
+
+CREATE INDEX X_MRCONSO_SUI ON $(db_schema).MRCONSO(SUI);
+
+CREATE INDEX X_MRCONSO_LUI ON $(db_schema).MRCONSO(LUI);
+
+CREATE INDEX X_MRCONSO_CODE ON $(db_schema).MRCONSO(CODE);
+
+CREATE INDEX X_MRCONSO_SAB_TTY ON $(db_schema).MRCONSO(SAB,TTY);
+
+CREATE INDEX X_MRCONSO_SCUI ON $(db_schema).MRCONSO(SCUI);
+
+CREATE INDEX X_MRCONSO_SDUI ON $(db_schema).MRCONSO(SDUI);
+
+CREATE INDEX X_MRSTY_CUI ON $(db_schema).MRSTY(CUI);
+
+CREATE INDEX X_MRSTY_STY ON $(db_schema).MRSTY(STY);

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/index_view.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/index_view.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/index_view.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/index_view.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,2 @@
+create index IX_fword on $(db_schema).v_snomed_fword_lookup(fword);
+create index IX_fstem on $(db_schema).v_snomed_fword_lookup(fstem);

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/insert_view.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/insert_view.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/insert_view.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/insert_view.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,35 @@
+insert into $(db_schema).v_snomed_fword_lookup
+select mrc.cui, t.tui, c.fword, c.fstem, c.tok_str, c.stem_str
+from $(db_schema).umls_aui_fword c
+inner join $(umls_catalog).$(umls_schema).MRCONSO mrc 
+	on c.aui = mrc.aui
+	and mrc.sab in ( 'SNOMEDCT','RXNORM' )
+inner join 
+(
+	select cui, min(tui) tui
+	from $(umls_catalog).$(umls_schema).MRSTY sty
+	where sty.tui in
+	(
+    /* diseasesAndDisordersTuis */
+    'T019', 'T020', 'T037', 'T046', 'T047', 'T048', 'T049', 'T050', 
+      'T190', 'T191', 'T033',
+    /* signAndSymptomTuis */
+    'T184',
+    /* anatomicalSitesTuis */
+    'T017', 'T029', 'T023', 'T030', 'T031', 'T022', 'T025', 'T026',
+        'T018', 'T021', 'T024',
+    /* medicationsAndDrugsTuis */
+     'T116', 'T195', 'T123', 'T122', 'T118', 'T103', 'T120', 'T104',
+        'T200', 'T111', 'T196', 'T126', 'T131', 'T125', 'T129', 'T130',
+        'T197', 'T119', 'T124', 'T114', 'T109', 'T115', 'T121', 'T192',
+        'T110', 'T127',
+	/* proceduresTuis */
+    'T060', 'T065', 'T058', 'T059', 'T063', 'T062', 'T061',
+    /* deviceTuis */
+    'T074', 'T075',
+    /* laboratoryTuis */
+    'T059'
+	)
+	group by cui
+) t on t.cui = mrc.cui
+;

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/mssql_drop.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/mssql_drop.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/mssql_drop.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/mssql_drop.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,159 @@
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRCOC') AND type in (N'U'))
+drop table $(db_schema).MRCOC
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRCOLS') AND type in (N'U'))
+drop table $(db_schema).MRCOLS
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRCONSO') AND type in (N'U'))
+drop table $(db_schema).MRCONSO
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRCUI') AND type in (N'U'))
+drop table $(db_schema).MRCUI
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRCXT') AND type in (N'U'))
+drop table $(db_schema).MRCXT
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRDEF') AND type in (N'U'))
+drop table $(db_schema).MRDEF
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRDOC') AND type in (N'U'))
+drop table $(db_schema).MRDOC
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRFILES') AND type in (N'U'))
+drop table $(db_schema).MRFILES
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRHIER') AND type in (N'U'))
+drop table $(db_schema).MRHIER
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRHIST') AND type in (N'U'))
+drop table $(db_schema).MRHIST
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRMAP') AND type in (N'U'))
+drop table $(db_schema).MRMAP
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRRANK') AND type in (N'U'))
+drop table $(db_schema).MRRANK
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRREL') AND type in (N'U'))
+drop table $(db_schema).MRREL
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRSAB') AND type in (N'U'))
+drop table $(db_schema).MRSAB
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRSAT') AND type in (N'U'))
+drop table $(db_schema).MRSAT
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRSMAP') AND type in (N'U'))
+drop table $(db_schema).MRSMAP
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRSTY') AND type in (N'U'))
+drop table $(db_schema).MRSTY
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRXNS_ENG') AND type in (N'U'))
+drop table $(db_schema).MRXNS_ENG
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRXNW_ENG') AND type in (N'U'))
+drop table $(db_schema).MRXNW_ENG
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRAUI') AND type in (N'U'))
+drop table $(db_schema).MRAUI
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRXW_BAQ') AND type in (N'U'))
+drop table $(db_schema).MRXW_BAQ
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRXW_CZE') AND type in (N'U'))
+drop table $(db_schema).MRXW_CZE
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRXW_DAN') AND type in (N'U'))
+drop table $(db_schema).MRXW_DAN
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRXW_DUT') AND type in (N'U'))
+drop table $(db_schema).MRXW_DUT
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRXW_ENG') AND type in (N'U'))
+drop table $(db_schema).MRXW_ENG
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRXW_FIN') AND type in (N'U'))
+drop table $(db_schema).MRXW_FIN
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRXW_FRE') AND type in (N'U'))
+drop table $(db_schema).MRXW_FRE
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRXW_GER') AND type in (N'U'))
+drop table $(db_schema).MRXW_GER
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRXW_HEB') AND type in (N'U'))
+drop table $(db_schema).MRXW_HEB
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRXW_HUN') AND type in (N'U'))
+drop table $(db_schema).MRXW_HUN
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRXW_ITA') AND type in (N'U'))
+drop table $(db_schema).MRXW_ITA
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRXW_JPN') AND type in (N'U'))
+drop table $(db_schema).MRXW_JPN
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRXW_KOR') AND type in (N'U'))
+drop table $(db_schema).MRXW_KOR
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRXW_LAV') AND type in (N'U'))
+drop table $(db_schema).MRXW_LAV
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRXW_NOR') AND type in (N'U'))
+drop table $(db_schema).MRXW_NOR
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRXW_POR') AND type in (N'U'))
+drop table $(db_schema).MRXW_POR
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRXW_RUS') AND type in (N'U'))
+drop table $(db_schema).MRXW_RUS
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRXW_SCR') AND type in (N'U'))
+drop table $(db_schema).MRXW_SCR
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRXW_SPA') AND type in (N'U'))
+drop table $(db_schema).MRXW_SPA
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MRXW_SWE') AND type in (N'U'))
+drop table $(db_schema).MRXW_SWE
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).AMBIGSUI') AND type in (N'U'))
+drop table $(db_schema).AMBIGSUI
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).AMBIGLUI') AND type in (N'U'))
+drop table $(db_schema).AMBIGLUI
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).DELETEDCUI') AND type in (N'U'))
+drop table $(db_schema).DELETEDCUI
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).DELETEDLUI') AND type in (N'U'))
+drop table $(db_schema).DELETEDLUI
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).DELETEDSUI') AND type in (N'U'))
+drop table $(db_schema).DELETEDSUI
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MERGEDCUI') AND type in (N'U'))
+drop table $(db_schema).MERGEDCUI
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).MERGEDLUI') AND type in (N'U'))
+drop table $(db_schema).MERGEDLUI
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).SRDEF') AND type in (N'U'))
+drop table $(db_schema).SRDEF
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).SRFIL') AND type in (N'U'))
+drop table $(db_schema).SRFIL
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).SRFLD') AND type in (N'U'))
+drop table $(db_schema).SRFLD
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).SRSTR') AND type in (N'U'))
+drop table $(db_schema).SRSTR
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).SRSTRE1') AND type in (N'U'))
+drop table $(db_schema).SRSTRE1
+;
+IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'$(db_schema).SRSTRE2') AND type in (N'U'))
+drop table $(db_schema).SRSTRE2
+;

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/mssql_indexes.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/mssql_indexes.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/mssql_indexes.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/mssql_indexes.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,149 @@
+/* adapted from oracle/mysql umls load scripts */
+
+CREATE INDEX X_MRCOC_CUI1 ON $(db_schema).MRCOC(CUI1);
+
+CREATE INDEX X_MRCOC_AUI1 ON $(db_schema).MRCOC(AUI1);
+
+CREATE INDEX X_MRCOC_CUI2 ON $(db_schema).MRCOC(CUI2);
+
+CREATE INDEX X_MRCOC_AUI2 ON $(db_schema).MRCOC(AUI2);
+
+CREATE INDEX X_MRCOC_SAB ON $(db_schema).MRCOC(SAB);
+
+CREATE INDEX X_MRCONSO_CUI ON $(db_schema).MRCONSO(CUI);
+
+ALTER TABLE $(db_schema).MRCONSO ADD CONSTRAINT X_MRCONSO_PK  PRIMARY KEY (AUI);
+
+CREATE INDEX X_MRCONSO_SUI ON $(db_schema).MRCONSO(SUI);
+
+CREATE INDEX X_MRCONSO_LUI ON $(db_schema).MRCONSO(LUI);
+
+CREATE INDEX X_MRCONSO_CODE ON $(db_schema).MRCONSO(CODE);
+
+CREATE INDEX X_MRCONSO_SAB_TTY ON $(db_schema).MRCONSO(SAB,TTY);
+
+CREATE INDEX X_MRCONSO_SCUI ON $(db_schema).MRCONSO(SCUI);
+
+CREATE INDEX X_MRCONSO_SDUI ON $(db_schema).MRCONSO(SDUI);
+
+-- CREATE INDEX X_MRCONSO_STR ON $(db_schema).MRCONSO(STR);
+
+CREATE INDEX X_MRCXT_CUI ON $(db_schema).MRCXT(CUI);
+
+CREATE INDEX X_MRCXT_AUI ON $(db_schema).MRCXT(AUI);
+
+CREATE INDEX X_MRCXT_SAB ON $(db_schema).MRCXT(SAB);
+
+CREATE INDEX X_MRDEF_CUI ON $(db_schema).MRDEF(CUI);
+
+CREATE INDEX X_MRDEF_AUI ON $(db_schema).MRDEF(AUI);
+
+ALTER TABLE $(db_schema).MRDEF ADD CONSTRAINT X_MRDEF_PK  PRIMARY KEY (ATUI);
+
+CREATE INDEX X_MRDEF_SAB ON $(db_schema).MRDEF(SAB);
+
+CREATE INDEX X_MRHIER_CUI ON $(db_schema).MRHIER(CUI);
+
+CREATE INDEX X_MRHIER_AUI ON $(db_schema).MRHIER(AUI);
+
+CREATE INDEX X_MRHIER_SAB ON $(db_schema).MRHIER(SAB);
+
+-- field to big to index
+-- CREATE INDEX X_MRHIER_PTR ON $(db_schema).MRHIER(PTR);
+
+CREATE INDEX X_MRHIER_PAUI ON $(db_schema).MRHIER(PAUI);
+
+CREATE INDEX X_MRHIST_CUI ON $(db_schema).MRHIST(CUI);
+
+CREATE INDEX X_MRHIST_SOURCEUI ON $(db_schema).MRHIST(SOURCEUI);
+
+CREATE INDEX X_MRHIST_SAB ON $(db_schema).MRHIST(SAB);
+
+ALTER TABLE $(db_schema).MRRANK ADD CONSTRAINT X_MRRANK_PK  PRIMARY KEY (SAB,TTY);
+
+CREATE INDEX X_MRREL_CUI1 ON $(db_schema).MRREL(CUI1);
+
+CREATE INDEX X_MRREL_AUI1 ON $(db_schema).MRREL(AUI1);
+
+CREATE INDEX X_MRREL_CUI2 ON $(db_schema).MRREL(CUI2);
+
+CREATE INDEX X_MRREL_AUI2 ON $(db_schema).MRREL(AUI2);
+
+ALTER TABLE $(db_schema).MRREL ADD CONSTRAINT X_MRREL_PK  PRIMARY KEY (RUI);
+
+CREATE INDEX X_MRREL_SAB ON $(db_schema).MRREL(SAB);
+
+ALTER TABLE $(db_schema).MRSAB ADD CONSTRAINT X_MRSAB_PK  PRIMARY KEY (VSAB);
+
+CREATE INDEX X_MRSAB_RSAB ON $(db_schema).MRSAB(RSAB);
+
+CREATE INDEX X_MRSAT_CUI ON $(db_schema).MRSAT(CUI);
+
+CREATE INDEX X_MRSAT_METAUI ON $(db_schema).MRSAT(METAUI);
+
+ALTER TABLE $(db_schema).MRSAT ADD CONSTRAINT X_MRSAT_PK  PRIMARY KEY (ATUI);
+
+CREATE INDEX X_MRSAT_SAB ON $(db_schema).MRSAT(SAB);
+
+CREATE INDEX X_MRSAT_ATN ON $(db_schema).MRSAT(ATN);
+
+CREATE INDEX X_MRSTY_CUI ON $(db_schema).MRSTY(CUI);
+
+ALTER TABLE $(db_schema).MRSTY ADD CONSTRAINT X_MRSTY_PK  PRIMARY KEY (ATUI);
+
+CREATE INDEX X_MRSTY_STY ON $(db_schema).MRSTY(STY);
+
+-- field to large to index
+-- CREATE INDEX X_MRXNS_ENG_NSTR ON $(db_schema).MRXNS_ENG(NSTR);
+
+CREATE INDEX X_MRXNW_ENG_NWD ON $(db_schema).MRXNW_ENG(NWD);
+
+CREATE INDEX X_MRXW_BAQ_WD ON $(db_schema).MRXW_BAQ(WD);
+
+CREATE INDEX X_MRXW_CZE_WD ON $(db_schema).MRXW_CZE(WD);
+
+CREATE INDEX X_MRXW_DAN_WD ON $(db_schema).MRXW_DAN(WD);
+
+CREATE INDEX X_MRXW_DUT_WD ON $(db_schema).MRXW_DUT(WD);
+
+CREATE INDEX X_MRXW_ENG_WD ON $(db_schema).MRXW_ENG(WD);
+
+CREATE INDEX X_MRXW_FIN_WD ON $(db_schema).MRXW_FIN(WD);
+
+CREATE INDEX X_MRXW_FRE_WD ON $(db_schema).MRXW_FRE(WD);
+
+CREATE INDEX X_MRXW_GER_WD ON $(db_schema).MRXW_GER(WD);
+
+CREATE INDEX X_MRXW_HEB_WD ON $(db_schema).MRXW_HEB(WD);
+
+CREATE INDEX X_MRXW_HUN_WD ON $(db_schema).MRXW_HUN(WD);
+
+CREATE INDEX X_MRXW_ITA_WD ON $(db_schema).MRXW_ITA(WD);
+
+CREATE INDEX X_MRXW_JPN_WD ON $(db_schema).MRXW_JPN(WD);
+
+CREATE INDEX X_MRXW_KOR_WD ON $(db_schema).MRXW_KOR(WD);
+
+CREATE INDEX X_MRXW_LAV_WD ON $(db_schema).MRXW_LAV(WD);
+
+CREATE INDEX X_MRXW_NOR_WD ON $(db_schema).MRXW_NOR(WD);
+
+CREATE INDEX X_MRXW_POR_WD ON $(db_schema).MRXW_POR(WD);
+
+CREATE INDEX X_MRXW_RUS_WD ON $(db_schema).MRXW_RUS(WD);
+
+CREATE INDEX X_MRXW_SCR_WD ON $(db_schema).MRXW_SCR(WD);
+
+CREATE INDEX X_MRXW_SPA_WD ON $(db_schema).MRXW_SPA(WD);
+
+CREATE INDEX X_MRXW_SWE_WD ON $(db_schema).MRXW_SWE(WD);
+
+CREATE INDEX X_AMBIGSUI_SUI ON $(db_schema).AMBIGSUI(SUI);
+
+CREATE INDEX X_AMBIGLUI_LUI ON $(db_schema).AMBIGLUI(LUI);
+
+CREATE INDEX X_MRAUI_CUI2 ON $(db_schema).MRAUI(CUI2);
+
+CREATE INDEX X_MRCUI_CUI2 ON $(db_schema).MRCUI(CUI2);
+
+CREATE INDEX X_MRMAP_MAPSETCUI ON $(db_schema).MRMAP(MAPSETCUI);

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/mssql_net_tables.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/mssql_net_tables.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/mssql_net_tables.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/mssql_net_tables.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,54 @@
+
+CREATE TABLE  $(db_schema).SRDEF (
+	RT	VARCHAR (3)  NOT NULL,
+	UI	CHAR (4)  NOT NULL,
+	STY_RL	VARCHAR (41)  NOT NULL,
+	STN_RTN	VARCHAR (14)  NOT NULL,
+	DEF	NVARCHAR(4000)	NOT NULL,
+	EX	VARCHAR (185) ,
+	UN	NVARCHAR(4000),
+	NH	VARCHAR (1) ,
+	ABR	VARCHAR (4)  NOT NULL,
+	RIN	VARCHAR (23) 
+) ;
+
+
+CREATE TABLE  $(db_schema).SRFIL (
+	FIL	VARCHAR (7)  NOT NULL,
+	DES	VARCHAR (56)  NOT NULL,
+	FMT	VARCHAR (41)  NOT NULL,
+	CLS	VARCHAR (2)  NOT NULL,
+	RWS	VARCHAR (4)  NOT NULL,
+	BTS	VARCHAR (6)  NOT NULL
+) ;
+
+
+
+CREATE TABLE  $(db_schema).SRFLD (
+	COL	VARCHAR (3)  NOT NULL,
+	DES	VARCHAR (32)  NOT NULL,
+	REF	VARCHAR (3)  NOT NULL,
+	FIL	VARCHAR (19)  NOT NULL
+) ;
+
+
+CREATE TABLE  $(db_schema).SRSTR (
+	STY_RL1	VARCHAR (41)  NOT NULL,
+	RL	VARCHAR (23)  NOT NULL,
+	STY_RL2	VARCHAR (39) ,
+	LS	VARCHAR (3)  NOT NULL
+) ;
+
+
+CREATE TABLE  $(db_schema).SRSTRE1 (
+	UI1	CHAR (4)  NOT NULL,
+	UI2	CHAR (4)  NOT NULL,
+	UI3	CHAR (4)  NOT NULL
+) ;
+
+
+CREATE TABLE  $(db_schema).SRSTRE2 (
+	STY1	VARCHAR (41)  NOT NULL,
+	RL	VARCHAR (23)  NOT NULL,
+	STY2	VARCHAR (41)  NOT NULL
+) ;

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/mssql_tables.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/mssql_tables.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/mssql_tables.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/mssql_tables.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,514 @@
+CREATE TABLE  $(db_schema).MRCOC (
+    CUI1	char(8) NOT NULL,
+    AUI1	varchar(9) NOT NULL,
+    CUI2	char(8),
+    AUI2	varchar(9),
+    SAB	varchar(20) NOT NULL,
+    COT	varchar(3) NOT NULL,
+    COF	int ,
+    COA	varchar(300),
+    CVF	int 
+);
+
+
+CREATE TABLE  $(db_schema).MRCOLS (
+    COL	varchar(20),
+    DES	varchar(200),
+    REF	varchar(20),
+    MIN	int ,
+    AV	numeric(5,2),
+    MAX	int ,
+    FIL	varchar(50),
+    DTY	varchar(20)
+);
+
+
+CREATE TABLE  $(db_schema).MRCONSO (
+    CUI	char(8) NOT NULL,
+    LAT	char(3) NOT NULL,
+    TS	char(1) NOT NULL,
+    LUI	varchar(10) NOT NULL,
+    STT	varchar(3) NOT NULL,
+    SUI	varchar(10) NOT NULL,
+    ISPREF	char(1) NOT NULL,
+    AUI	varchar(9) NOT NULL,
+    SAUI	varchar(50),
+    SCUI	varchar(50),
+    SDUI	varchar(50),
+    SAB	varchar(20) NOT NULL,
+    TTY	varchar(20) NOT NULL,
+    CODE	varchar(50) NOT NULL,
+    STR	nvarchar(max) NOT NULL,
+    SRL	int  NOT NULL,
+    SUPPRESS	char(1) NOT NULL,
+    CVF	int 
+);
+
+
+CREATE TABLE  $(db_schema).MRCUI (
+    CUI1	char(8) NOT NULL,
+    VER	varchar(10) NOT NULL,
+    REL	varchar(4) NOT NULL,
+    RELA	varchar(100),
+    MAPREASON	nvarchar(4000),
+    CUI2	char(8),
+    MAPIN	char(1)
+);
+
+
+CREATE TABLE  $(db_schema).MRCXT (
+    CUI	char(8),
+    SUI	varchar(10),
+    AUI	varchar(9),
+    SAB	varchar(20),
+    CODE	varchar(50),
+    CXN	int ,
+    CXL	char(3),
+    RANK	int ,
+    CXS	varchar(3000),
+    CUI2	char(8),
+    AUI2	varchar(9),
+    HCD	varchar(50),
+    RELA	varchar(100),
+    XC	varchar(1),
+    CVF	int 
+);
+
+
+CREATE TABLE  $(db_schema).MRDEF (
+    CUI	char(8) NOT NULL,
+    AUI	varchar(9) NOT NULL,
+    ATUI	varchar(11) NOT NULL,
+    SATUI	varchar(50),
+    SAB	varchar(20) NOT NULL,
+    DEF	nvarchar(4000) NOT NULL,
+    SUPPRESS	char(1) NOT NULL,
+    CVF	int 
+);
+
+
+CREATE TABLE  $(db_schema).MRDOC (
+    DOCKEY	varchar(50) NOT NULL,
+    VALUE	varchar(200),
+    TYPE	varchar(50) NOT NULL,
+    EXPL	varchar(max)
+);
+
+
+CREATE TABLE  $(db_schema).MRFILES (
+    FIL	varchar(50),
+    DES	varchar(200),
+    FMT	varchar(300),
+    CLS	int ,
+    RWS	int ,
+    BTS	bigint
+);
+
+
+CREATE TABLE  $(db_schema).MRHIER (
+    CUI	char(8) NOT NULL,
+    AUI	varchar(9) NOT NULL,
+    CXN	int  NOT NULL,
+    PAUI	varchar(10),
+    SAB	varchar(20) NOT NULL,
+    RELA	varchar(100),
+    PTR	varchar(1000),
+    HCD	varchar(50),
+    CVF	int 
+);
+
+
+CREATE TABLE  $(db_schema).MRHIST (
+    CUI	char(8),
+    SOURCEUI	varchar(50),
+    SAB	varchar(20),
+    SVER	varchar(20),
+    CHANGETYPE	nvarchar(1000),
+    CHANGEKEY	nvarchar(1000),
+    CHANGEVAL	nvarchar(1000),
+    REASON	nvarchar(1000),
+    CVF	int 
+);
+
+
+CREATE TABLE  $(db_schema).MRMAP (
+    MAPSETCUI	char(8) NOT NULL,
+    MAPSETSAB	varchar(20) NOT NULL,
+    MAPSUBSETID	varchar(10),
+    MAPRANK	int ,
+    MAPID	varchar(50) NOT NULL,
+    MAPSID	varchar(50),
+    FROMID	varchar(50) NOT NULL,
+    FROMSID	varchar(50),
+    FROMEXPR	nvarchar(4000) NOT NULL,
+    FROMTYPE	varchar(50) NOT NULL,
+    FROMRULE	nvarchar(4000),
+    FROMRES	varchar(4000),
+    REL	varchar(4) NOT NULL,
+    RELA	varchar(100),
+    TOID	varchar(50),
+    TOSID	varchar(50),
+    TOEXPR	nvarchar(4000),
+    TOTYPE	varchar(50),
+    TORULE	nvarchar(4000),
+    TORES	nvarchar(4000),
+    MAPRULE	nvarchar(4000),
+    MAPRES	nvarchar(4000),
+    MAPTYPE	varchar(50),
+    MAPATN	varchar(20),
+    MAPATV	nvarchar(4000),
+    CVF	int 
+);
+
+
+CREATE TABLE  $(db_schema).MRRANK (
+    RANK	int  NOT NULL,
+    SAB	varchar(20) NOT NULL,
+    TTY	varchar(20) NOT NULL,
+    SUPPRESS	char(1) NOT NULL
+);
+
+
+CREATE TABLE  $(db_schema).MRREL (
+    CUI1	char(8) NOT NULL,
+    AUI1	varchar(9),
+    STYPE1	varchar(50) NOT NULL,
+    REL	varchar(4) NOT NULL,
+    CUI2	char(8) NOT NULL,
+    AUI2	varchar(9),
+    STYPE2	varchar(50) NOT NULL,
+    RELA	varchar(100),
+    RUI	varchar(10) NOT NULL,
+    SRUI	varchar(50),
+    SAB	varchar(20) NOT NULL,
+    SL	varchar(20) NOT NULL,
+    RG	varchar(10),
+    DIR	varchar(1),
+    SUPPRESS	char(1) NOT NULL,
+    CVF	int 
+);
+
+
+CREATE TABLE  $(db_schema).MRSAB (
+    VCUI	char(8),
+    RCUI	char(8),
+    VSAB	varchar(20) NOT NULL,
+    RSAB	varchar(20) NOT NULL,
+    SON	nvarchar(max) NOT NULL,
+    SF	varchar(20) NOT NULL,
+    SVER	varchar(20),
+    VSTART	char(8),
+    VEND	char(8),
+    IMETA	varchar(10) NOT NULL,
+    RMETA	varchar(10),
+    SLC	nvarchar(max),
+    SCC	nvarchar(max),
+    SRL	int  NOT NULL,
+    TFR	int ,
+    CFR	int ,
+    CXTY	varchar(50),
+    TTYL	nvarchar(max),
+    ATNL	nvarchar(max),
+    LAT	char(3),
+    CENC	varchar(20) NOT NULL,
+    CURVER	char(1) NOT NULL,
+    SABIN	char(1) NOT NULL,
+    SSN	nvarchar(max) NOT NULL,
+    SCIT	nvarchar(max) NOT NULL
+);
+
+
+CREATE TABLE  $(db_schema).MRSAT (
+    CUI	char(8) NOT NULL,
+    LUI	varchar(10),
+    SUI	varchar(10),
+    METAUI	varchar(50),
+    STYPE	varchar(50) NOT NULL,
+    CODE	varchar(50),
+    ATUI	varchar(11) NOT NULL,
+    SATUI	varchar(50),
+    ATN	varchar(50) NOT NULL,
+    SAB	varchar(20) NOT NULL,
+    ATV	varchar(4000),
+    SUPPRESS	char(1) NOT NULL,
+    CVF	int 
+);
+
+
+CREATE TABLE  $(db_schema).MRSMAP (
+    MAPSETCUI	char(8) NOT NULL,
+    MAPSETSAB	varchar(20) NOT NULL,
+    MAPID	varchar(50) NOT NULL,
+    MAPSID	varchar(50),
+    FROMEXPR	nvarchar(4000) NOT NULL,
+    FROMTYPE	varchar(50) NOT NULL,
+    REL	varchar(4) NOT NULL,
+    RELA	varchar(100),
+    TOEXPR	nvarchar(4000),
+    TOTYPE	varchar(50),
+    CVF	int 
+);
+
+
+CREATE TABLE  $(db_schema).MRSTY (
+    CUI	char(8) NOT NULL,
+    TUI	char(4) NOT NULL,
+    STN	varchar(100) NOT NULL,
+    STY	varchar(50) NOT NULL,
+    ATUI	varchar(11) NOT NULL,
+    CVF	int 
+);
+
+
+CREATE TABLE  $(db_schema).MRXNS_ENG (
+    LAT	char(3) NOT NULL,
+    NSTR	nvarchar(3000) NOT NULL,
+    CUI	char(8) NOT NULL,
+    LUI	varchar(10) NOT NULL,
+    SUI	varchar(10) NOT NULL
+);
+
+
+CREATE TABLE  $(db_schema).MRXNW_ENG (
+    LAT	char(3) NOT NULL,
+    NWD	nvarchar(100) NOT NULL,
+    CUI	char(8) NOT NULL,
+    LUI	varchar(10) NOT NULL,
+    SUI	varchar(10) NOT NULL
+);
+
+
+CREATE TABLE  $(db_schema).MRAUI (
+    AUI1	varchar(9) NOT NULL,
+    CUI1	char(8) NOT NULL,
+    VER	varchar(10) NOT NULL,
+    REL	varchar(4),
+    RELA	varchar(100),
+    MAPREASON	nvarchar(4000) NOT NULL,
+    AUI2	varchar(9) NOT NULL,
+    CUI2	char(8) NOT NULL,
+    MAPIN	char(1) NOT NULL
+);
+
+
+CREATE TABLE  $(db_schema).MRXW_BAQ (
+    LAT	char(3) NOT NULL,
+    WD	nvarchar(200) NOT NULL,
+    CUI	char(8) NOT NULL,
+    LUI	varchar(10) NOT NULL,
+    SUI	varchar(10) NOT NULL
+);
+
+
+CREATE TABLE  $(db_schema).MRXW_CZE (
+    LAT	char(3) NOT NULL,
+    WD	nvarchar(200) NOT NULL,
+    CUI	char(8) NOT NULL,
+    LUI	varchar(10) NOT NULL,
+    SUI	varchar(10) NOT NULL
+);
+
+
+CREATE TABLE  $(db_schema).MRXW_DAN (
+    LAT	char(3) NOT NULL,
+    WD	nvarchar(200) NOT NULL,
+    CUI	char(8) NOT NULL,
+    LUI	varchar(10) NOT NULL,
+    SUI	varchar(10) NOT NULL
+);
+
+
+CREATE TABLE  $(db_schema).MRXW_DUT (
+    LAT	char(3) NOT NULL,
+    WD	nvarchar(200) NOT NULL,
+    CUI	char(8) NOT NULL,
+    LUI	varchar(10) NOT NULL,
+    SUI	varchar(10) NOT NULL
+);
+
+
+CREATE TABLE  $(db_schema).MRXW_ENG (
+    LAT	char(3) NOT NULL,
+    WD	nvarchar(200) NOT NULL,
+    CUI	char(8) NOT NULL,
+    LUI	varchar(10) NOT NULL,
+    SUI	varchar(10) NOT NULL
+);
+
+
+CREATE TABLE  $(db_schema).MRXW_FIN (
+    LAT	char(3) NOT NULL,
+    WD	nvarchar(200) NOT NULL,
+    CUI	char(8) NOT NULL,
+    LUI	varchar(10) NOT NULL,
+    SUI	varchar(10) NOT NULL
+);
+
+
+CREATE TABLE  $(db_schema).MRXW_FRE (
+    LAT	char(3) NOT NULL,
+    WD	nvarchar(200) NOT NULL,
+    CUI	char(8) NOT NULL,
+    LUI	varchar(10) NOT NULL,
+    SUI	varchar(10) NOT NULL
+);
+
+
+CREATE TABLE  $(db_schema).MRXW_GER (
+    LAT	char(3) NOT NULL,
+    WD	nvarchar(200) NOT NULL,
+    CUI	char(8) NOT NULL,
+    LUI	varchar(10) NOT NULL,
+    SUI	varchar(10) NOT NULL
+);
+
+
+CREATE TABLE  $(db_schema).MRXW_HEB (
+    LAT	char(3) NOT NULL,
+    WD	nvarchar(200) NOT NULL,
+    CUI	char(8) NOT NULL,
+    LUI	varchar(10) NOT NULL,
+    SUI	varchar(10) NOT NULL
+);
+
+
+CREATE TABLE  $(db_schema).MRXW_HUN (
+    LAT	char(3) NOT NULL,
+    WD	nvarchar(200) NOT NULL,
+    CUI	char(8) NOT NULL,
+    LUI	varchar(10) NOT NULL,
+    SUI	varchar(10) NOT NULL
+);
+
+
+CREATE TABLE  $(db_schema).MRXW_ITA (
+    LAT	char(3) NOT NULL,
+    WD	nvarchar(200) NOT NULL,
+    CUI	char(8) NOT NULL,
+    LUI	varchar(10) NOT NULL,
+    SUI	varchar(10) NOT NULL
+);
+
+
+CREATE TABLE  $(db_schema).MRXW_JPN (
+    LAT char(3) NOT NULL,
+    WD  nvarchar(500) NOT NULL,
+    CUI char(8) NOT NULL,
+    LUI varchar(10) NOT NULL,
+    SUI varchar(10) NOT NULL
+);
+
+
+CREATE TABLE  $(db_schema).MRXW_KOR (
+    LAT char(3) NOT NULL,
+    WD  nvarchar(500) NOT NULL,
+    CUI char(8) NOT NULL,
+    LUI varchar(10) NOT NULL,
+    SUI varchar(10) NOT NULL
+);
+
+
+CREATE TABLE  $(db_schema).MRXW_LAV (
+    LAT char(3) NOT NULL,
+    WD  nvarchar(200) NOT NULL,
+    CUI char(8) NOT NULL,
+    LUI varchar(10) NOT NULL,
+    SUI varchar(10) NOT NULL
+);
+
+
+CREATE TABLE  $(db_schema).MRXW_NOR (
+    LAT	char(3) NOT NULL,
+    WD	nvarchar(200) NOT NULL,
+    CUI	char(8) NOT NULL,
+    LUI	varchar(10) NOT NULL,
+    SUI	varchar(10) NOT NULL
+);
+
+
+CREATE TABLE  $(db_schema).MRXW_POR (
+    LAT	char(3) NOT NULL,
+    WD	nvarchar(200) NOT NULL,
+    CUI	char(8) NOT NULL,
+    LUI	varchar(10) NOT NULL,
+    SUI	varchar(10) NOT NULL
+);
+
+
+CREATE TABLE  $(db_schema).MRXW_RUS (
+    LAT char(3) NOT NULL,
+    WD  nvarchar(200) NOT NULL,
+    CUI char(8) NOT NULL,
+    LUI varchar(10) NOT NULL,
+    SUI varchar(10) NOT NULL
+);
+
+
+CREATE TABLE  $(db_schema).MRXW_SCR (
+    LAT char(3) NOT NULL,
+    WD  nvarchar(200) NOT NULL,
+    CUI char(8) NOT NULL,
+    LUI varchar(10) NOT NULL,
+    SUI varchar(10) NOT NULL
+);
+
+
+CREATE TABLE  $(db_schema).MRXW_SPA (
+    LAT	char(3) NOT NULL,
+    WD	nvarchar(200) NOT NULL,
+    CUI	char(8) NOT NULL,
+    LUI	varchar(10) NOT NULL,
+    SUI	varchar(10) NOT NULL
+);
+
+
+CREATE TABLE  $(db_schema).MRXW_SWE (
+    LAT	char(3) NOT NULL,
+    WD	nvarchar(200) NOT NULL,
+    CUI	char(8) NOT NULL,
+    LUI	varchar(10) NOT NULL,
+    SUI	varchar(10) NOT NULL
+);
+
+
+CREATE TABLE  $(db_schema).AMBIGSUI (
+    SUI	varchar(10) NOT NULL,
+    CUI	char(8) NOT NULL
+);
+
+
+CREATE TABLE  $(db_schema).AMBIGLUI (
+    LUI	varchar(10) NOT NULL,
+    CUI	char(8) NOT NULL
+);
+
+
+CREATE TABLE  $(db_schema).DELETEDCUI (
+    PCUI	char(8) NOT NULL,
+    PSTR	varchar(3000) NOT NULL
+);
+
+
+CREATE TABLE  $(db_schema).DELETEDLUI (
+    PLUI	varchar(10) NOT NULL,
+    PSTR	varchar(3000) NOT NULL
+);
+
+
+CREATE TABLE  $(db_schema).DELETEDSUI (
+    PSUI	varchar(10) NOT NULL,
+    LAT	char(3) NOT NULL,
+    PSTR	varchar(3000) NOT NULL
+);
+
+
+CREATE TABLE  $(db_schema).MERGEDCUI (
+    PCUI	char(8) NOT NULL,
+    CUI	char(8) NOT NULL
+);
+
+
+CREATE TABLE  $(db_schema).MERGEDLUI (
+    PLUI	varchar(10),
+    LUI	varchar(10)
+);

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/readme.txt
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/readme.txt?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/readme.txt (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/mssql/umls/readme.txt Mon Dec 16 16:30:30 2013
@@ -0,0 +1,13 @@
+@rem export snomed, rxnorm subset using this:
+rmdir /s /q E:\projects\ytex-umls\mssql
+mkdir E:\projects\ytex-umls\mssql
+cd /d E:\projects\ytex-umls\mssql
+bcp "select * from umls..MRCONSO where SAB in ('SNOMEDCT', 'RXNORM', 'SRC') and LAT = 'ENG'" queryout MRCONSO.bcp -S localhost -T -n
+bcp "select * from umls..MRSTY where CUI in (select distinct CUI from umls..MRCONSO where SAB in ('SNOMEDCT', 'RXNORM', 'SRC'))" queryout MRSTY.bcp -S localhost -T -n
+bcp "select * from YTEX_TEST.dbo.umls_aui_fword where aui in (select distinct AUI from umls..MRCONSO where SAB in ('SNOMEDCT', 'RXNORM', 'SRC'))" queryout umls_aui_fword.bcp -S localhost -T -n
+
+@rem export examples using this:
+cd E:\projects\ytex\data\mssql\umls
+bcp "select * from umls..MRCONSO where CUI in (select distinct code from YTEX_TEST.dbo.anno_ontology_concept) and SAB in ('SNOMEDCT', 'RXNORM', 'SRC') and LAT = 'ENG'" queryout MRCONSO.bcp -S localhost -T -n
+bcp "select * from umls..MRSTY where CUI in (select distinct code from YTEX_TEST.dbo.anno_ontology_concept)" queryout MRSTY.bcp -S localhost -T -n
+bcp "select * from YTEX_TEST.dbo.umls_aui_fword where aui in (select AUI from umls..MRCONSO m inner join (select distinct code from YTEX_TEST.dbo.anno_ontology_concept) c on m.cui = c.code where SAB='SNOMEDCT')" queryout umls_aui_fword.bcp -S localhost -T -n

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/kernel/create_tables.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/kernel/create_tables.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/kernel/create_tables.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/kernel/create_tables.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,233 @@
+
+CREATE TABLE  kernel_eval (
+	kernel_eval_id int(11) NOT NULL AUTO_INCREMENT,
+	corpus_name varchar(50) NOT NULL DEFAULT '' comment 'corpus name',
+	experiment varchar(50) not null comment 'experiment - type of kernel',
+	label varchar(50) not NULL default '' comment 'class label',
+	cv_fold_id int not null default 0 comment 'fk cv_fold',
+	param1 double not null default 0,
+	param2 varchar(50) not null default '',
+	PRIMARY KEY (kernel_eval_id),
+	UNIQUE KEY NK_kernel_eval (corpus_name, experiment, label, cv_fold_id, param1, param2)
+) ENGINE=MyISAM comment 'set of all kernel evaluations';
+
+create table kernel_eval_instance (
+	kernel_eval_instance int not null auto_increment primary key,
+	kernel_eval_id int not null comment 'fk kernel_eval',
+	instance_id1 bigint NOT NULL,
+	instance_id2 bigint NOT NULL,
+	similarity double NOT NULL,
+	KEY IX_kernel_eval1 (kernel_eval_id, instance_id1),
+	KEY IX_kernel_eval2 (kernel_eval_id, instance_id2),
+	UNIQUE KEY NK_kernel_eval (kernel_eval_id, instance_id1, instance_id2)
+) ENGINE=MyISAM comment 'kernel instance evaluation';
+
+create table classifier_eval (
+	classifier_eval_id int AUTO_INCREMENT not null primary key,
+	name varchar(50) not null,
+	experiment varchar(50) null default "",
+	fold int null,
+	run int null,
+	algorithm varchar(50) null default "",
+	label varchar(50) null default "",
+	options varchar(1000) null default "",
+	model longblob null,
+	param1 double NULL,
+	param2 varchar(50) NULL
+) engine=myisam comment 'evaluation of a classifier on a dataset';
+
+create table classifier_eval_svm (
+	classifier_eval_id int not null comment 'fk classifier_eval' primary key,
+	cost double DEFAULT '0',
+  	weight varchar(50),
+	degree int DEFAULT '0',
+	gamma double DEFAULT '0',
+	kernel int DEFAULT NULL,
+	supportVectors int default null,
+	vcdim double null
+) engine=myisam comment 'evaluation of a libsvm classifier on a dataset';
+
+create table classifier_eval_semil (
+	classifier_eval_id int not null comment 'fk classifier_eval' primary key,
+	distance varchar(50),
+	degree int not null default 0,
+	gamma double not null default 0,
+	soft_label bit not null default 0,
+	norm_laplace bit not null default 0,
+	mu double not null default 0,
+	lambda double not null default 0,
+	pct_labeled double not null default 0
+) engine=myisam comment 'evaluation of a semil classifier on a dataset';
+
+create table classifier_eval_ir (
+	classifier_eval_ir_id int not null auto_increment primary key,
+	classifier_eval_id int not null comment 'fk classifier_eval',
+	ir_type varchar(5) not null comment 'type of ir stats, e.g. zv' default '',
+	ir_class varchar(5) not null comment 'class for ir stats' default '',
+	ir_class_id int null comment 'class id for ir stats',
+	tp int not null,
+	tn int not null,
+	fp int not null,
+	fn int not null,
+	ppv double not null default 0,
+	npv double not null default 0,
+	sens double not null default 0,
+	spec double not null default 0,
+	f1 double not null default 0,
+	unique key NK_classifier_eval_ircls (classifier_eval_id, ir_type, ir_class),
+	key IX_classifier_eval_id (classifier_eval_id)
+) engine=myisam comment 'ir statistics of a classifier on a dataset';
+
+create table classifier_instance_eval (
+	classifier_instance_eval_id int not null auto_increment primary key,
+	classifier_eval_id int not null comment 'fk classifier_eval',
+	instance_id bigint not null,
+	pred_class_id int not null,
+	target_class_id int null,
+	unique key nk_result (classifier_eval_id, instance_id)
+) engine=myisam comment 'instance classification result';
+
+create table classifier_instance_eval_prob (
+	classifier_eval_result_prob_id int not null auto_increment primary key,
+	classifier_instance_eval_id int comment 'fk classifier_instance_eval',
+	class_id int not null,
+	probability double not null,
+	unique key nk_result_prob (classifier_instance_eval_id, class_id)
+) engine=myisam comment 'probability of belonging to respective class';
+
+
+create table cv_fold (
+  cv_fold_id int auto_increment not null primary key,
+  corpus_name varchar(50) not null comment 'corpus name',
+  split_name varchar(50) not null default '' comment 'split/subset name',
+  label varchar(50) not null default '' ,
+  run int not null default 0,
+  fold int not null default 0,
+  unique index nk_cv_fold (corpus_name, split_name, label, run, fold)
+)engine=myisam ;
+
+create table cv_fold_instance (
+  cv_fold_instance_id int auto_increment not null primary key,
+  cv_fold_id int not null,
+  instance_id bigint not null,
+  train bit not null default 0,
+  unique index nk_cv_fold_instance (cv_fold_id, instance_id, train)
+) engine=myisam ;
+
+create table cv_best_svm (
+  corpus_name varchar(50) NOT NULL,
+  label varchar(50) NOT NULL,
+  experiment varchar(50) NOT NULL DEFAULT '',
+  f1 double DEFAULT NULL,
+  kernel int DEFAULT NULL,
+  cost double DEFAULT NULL,
+  weight varchar(50) DEFAULT NULL,
+  param1 double DEFAULT NULL,
+  param2 varchar(50) DEFAULT NULL,
+  PRIMARY KEY (corpus_name,label,experiment)
+) ENGINE=MyISAM comment 'best svm params based on cv';
+
+create table feature_eval (
+  feature_eval_id int auto_increment not null primary key,
+  corpus_name varchar(50) not null comment 'corpus name',
+  featureset_name varchar(50) not null default '' comment 'feature set name',
+  label varchar(50) not null default ''  comment 'label wrt features evaluated',
+  cv_fold_id int not null default 0 comment 'fold wrt features evaluated',
+  param1 double not null default 0 comment 'meta-parameter for feature evaluation',
+  param2 varchar(50) not null default '' comment 'meta-parameter for feature evaluation',
+  type varchar(50) not null comment 'metric used to evaluate features',
+  unique index nk_feature_eval(corpus_name, featureset_name, label, cv_fold_id, param1, param2, type),
+  index ix_feature_eval(corpus_name, cv_fold_id, type)
+) engine=myisam comment 'evaluation of a set of features in a corpus';
+
+create table feature_rank (
+  feature_rank_id int auto_increment not null primary key,
+  feature_eval_id int not null comment 'fk feature_eval',
+  feature_name varchar(50) not null comment 'name of feature',
+  evaluation double not null default 0 comment 'measurement of feature worth',
+  rank int not null default 0 comment 'rank among all features',
+  unique index nk_feature_name(feature_eval_id, feature_name),
+  index ix_feature_rank(feature_eval_id, rank),
+  index ix_feature_evaluation(feature_eval_id, evaluation),
+  index fk_feature_eval(feature_eval_id)
+) engine=myisam comment 'evaluation of a feature in a corpus';
+
+CREATE TABLE feature_parchd (
+  feature_parchd_id int(11) NOT NULL AUTO_INCREMENT,
+  par_feature_rank_id int(11) NOT NULL COMMENT 'fk feature_rank propagated',
+  chd_feature_rank_id int(11) NOT NULL COMMENT 'fk feature_rank imputed',
+  PRIMARY KEY (feature_parchd_id),
+  UNIQUE KEY NK_feature_parent (par_feature_rank_id,chd_feature_rank_id)
+) ENGINE=MyISAM COMMENT='link between propagated parent and raw child feature rank';
+
+CREATE TABLE tfidf_doclength (
+  tfidf_doclength_id int(11) NOT NULL AUTO_INCREMENT,
+  feature_eval_id int(11) NOT NULL COMMENT 'fk feature_eval',
+  instance_id bigint(20) NOT NULL,
+  length int(11) NOT NULL DEFAULT '0',
+  PRIMARY KEY (tfidf_doclength_id),
+  UNIQUE KEY nk_instance_id (feature_eval_id,instance_id)
+) ENGINE=MyISAM COMMENT='doc length for calculating tf-idf'
+;
+
+create table hotspot (
+  hotspot_id int auto_increment not null primary key,
+  instance_id int not null comment 'fk cv_fold_instance',
+  anno_base_id int not null comment 'fk anno_base_id',
+  feature_rank_id int not null comment 'fk feature_rank',
+  unique index NK_hotspot (instance_id, anno_base_id, feature_rank_id)
+) engine=myisam ;
+ALTER TABLE `hotspot` ADD INDEX `ix_instance_id`(`instance_id`),
+ ADD INDEX `ix_anno_base_id`(`anno_base_id`),
+ ADD INDEX `ix_feature_rank_id`(`feature_rank_id`);
+
+create table hotspot_instance (
+    hotspot_instance_id int auto_increment primary key,
+    corpus_name varchar(50) not null,
+    experiment varchar(50) not null default '',
+    label varchar(50) not null default '',
+    instance_id int not null,
+    max_evaluation double not null default 0,
+    min_rank int not null default 0,
+    unique index NK_hotspot_instance (corpus_name, experiment, label, instance_id)
+) engine=myisam comment 'hotspot features for an instance';
+
+create table hotspot_sentence (
+    hotspot_sentence_id int auto_increment not null primary key,
+    hotspot_instance_id int not null comment 'fk hotspot_instance',
+    anno_base_id int not null comment 'fk anno_sentence',
+    evaluation double not null default 0 comment 'max eval from hotspot',
+    rank int not null default 0 comment 'min rank from hotspot',
+    unique index NK_hotspot_sentence (hotspot_instance_id, anno_base_id),
+    index FK_hotspot_instance_id (hotspot_instance_id),
+	index FK_anno_base_id (anno_base_id),
+    INDEX IX_evaluation (hotspot_instance_id, evaluation),
+    INDEX IX_rank (hotspot_instance_id, rank)
+) engine = myisam comment 'sentences that contain hotspots at specified threshold';
+
+create table corpus_doc (
+	corpus_name varchar(50) not null comment 'corpus name',
+	instance_id bigint not null comment 'doc id',
+	doc_text longtext,
+	doc_group varchar(50) DEFAULT NULL COMMENT 'train/test',
+	primary key (corpus_name, instance_id),
+	index IX_doc_group (corpus_name, doc_group)
+)  engine = myisam comment 'documents';
+
+create table corpus_label (
+	corpus_name varchar(50) not null comment 'corpus name',
+	instance_id bigint not null comment 'doc id',
+	label varchar(20) not null default '',
+	class varchar(5) not null default '',
+	primary key (corpus_name, instance_id, label),
+	index FK_corpus_doc (corpus_name, instance_id)
+) engine = myisam comment 'document labels'; 
+
+create view v_corpus_group_class
+as
+select distinct d.corpus_name, l.label, doc_group, class
+from corpus_doc d
+inner join corpus_label l 
+    on d.corpus_name = l.corpus_name 
+    and d.instance_id = l.instance_id
+;

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/kernel/drop_tables.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/kernel/drop_tables.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/kernel/drop_tables.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/kernel/drop_tables.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,21 @@
+drop table if exists hotspot_sentence;
+drop table if exists hotspot_instance;
+drop table if exists hotspot;
+drop table if exists feature_parchd;
+drop table if exists feature_rank;
+drop table if exists feature_eval;
+drop table if exists tfidf_doclength; 
+drop table if exists cv_fold;
+drop table if exists cv_fold_instance;
+drop table if exists cv_best_svm;
+drop table if exists classifier_instance_eval_prob;
+drop table if exists classifier_instance_eval;
+drop table if exists classifier_eval_svm;
+drop table if exists classifier_eval_semil;
+drop table if exists classifier_eval_ir;
+drop table if exists classifier_eval;
+DROP TABLE IF EXISTS kernel_eval;
+DROP TABLE IF EXISTS kernel_eval_instance;
+drop table if exists corpus_label;
+drop table if exists corpus_doc;
+drop view if exists v_corpus_group_class;

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/kernel/ic_copy.template.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/kernel/ic_copy.template.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/kernel/ic_copy.template.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/kernel/ic_copy.template.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,21 @@
+-- create a feature_eval record for the concept graph
+delete r
+from feature_eval e inner join feature_rank r on e.feature_eval_id = r.feature_eval_id
+where param2 = '@ytex.conceptGraphName@' 
+and type = 'intrinsic-infocontent';
+
+delete e
+from feature_eval e
+where param2 = '@ytex.conceptGraphName@' 
+and type = 'intrinsic-infocontent';
+
+insert into feature_eval (corpus_name, param2, type) values ('', '@ytex.conceptGraphName@', 'intrinsic-infocontent');
+
+-- copy the feature_rank records from tmp_ic
+insert into feature_rank (feature_eval_id, feature_name, evaluation, rank)
+select feature_eval_id, feature_name, evaluation, rank
+from feature_eval, tmp_ic
+where param2 = '@ytex.conceptGraphName@' and type = 'intrinsic-infocontent';
+
+-- cleanup
+drop table tmp_ic;
\ No newline at end of file

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/kernel/ic_create.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/kernel/ic_create.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/kernel/ic_create.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/kernel/ic_create.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,8 @@
+-- create temporary table to hold feature_rank records
+drop TABLE if exists tmp_ic
+;
+create table tmp_ic(
+  feature_name varchar(50) not null,
+  evaluation double not null,
+  rank int not null
+);

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/snomedct/create_tables.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/snomedct/create_tables.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/snomedct/create_tables.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/snomedct/create_tables.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,44 @@
+-- table definitions taken from SNOMED CT Technical Implementation Guide July 2011, section 7.2.1.3.2.
+-- modified active flag to use bit instead of tinyint
+-- modified effectiveTime to use date instead of datetime
+
+drop table if exists sct2_concept;
+drop table if exists sct2_description;
+drop table if exists sct2_relationship;
+
+CREATE TABLE `sct2_concept` (
+	`id` BIGINT NOT NULL DEFAULT 0,
+	`effectiveTime` DATE NOT NULL DEFAULT '0000-00-00',
+	`active` bit NOT NULL DEFAULT 0,
+	`moduleId` BIGINT NOT NULL DEFAULT 0,
+	`definitionStatusId` BIGINT NOT NULL DEFAULT 0,
+	PRIMARY KEY (`id`,`effectiveTime`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+
+CREATE TABLE `sct2_description` (
+	`id` BIGINT NOT NULL DEFAULT 0,
+	`effectiveTime` DATE NOT NULL DEFAULT '0000-00-00',
+	`active` bit NOT NULL DEFAULT 0,
+	`moduleId` BIGINT NOT NULL DEFAULT 0,
+	`conceptId` BIGINT NOT NULL DEFAULT 0,
+	`languageCode` VARCHAR(3) NOT NULL DEFAULT '',
+	`typeId` BIGINT NOT NULL DEFAULT 0,
+	`term` VARCHAR(255) NOT NULL DEFAULT '',
+	`caseSignificanceId` BIGINT NOT NULL DEFAULT 0,
+	PRIMARY KEY (`id`,`effectiveTime`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE `sct2_relationship` (
+	`id` BIGINT NOT NULL DEFAULT 0,
+	`effectiveTime` DATE NOT NULL DEFAULT '0000-00-00',
+	`active` bit NOT NULL DEFAULT 0,
+	`moduleId` BIGINT NOT NULL DEFAULT 0,
+	`sourceId` BIGINT NOT NULL DEFAULT 0,
+	`destinationId` BIGINT NOT NULL DEFAULT 0,
+	`relationshipGroup` INT NOT NULL DEFAULT 0,
+	`typeId` BIGINT NOT NULL DEFAULT 0,
+	`characteristicTypeId` BIGINT NOT NULL DEFAULT 0,
+	`modifierId` BIGINT NOT NULL DEFAULT 0,
+	PRIMARY KEY (`id`,`effectiveTime`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/snomedct/create_tables_full.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/snomedct/create_tables_full.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/snomedct/create_tables_full.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/snomedct/create_tables_full.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,44 @@
+-- table definitions taken from SNOMED CT Technical Implementation Guide July 2011, section 7.2.1.3.2.
+-- modified active flag to use bit instead of tinyint
+-- modified effectiveTime to use date instead of datetime
+drop table if exists sct2f_concept;
+drop table if exists sct2f_description;
+drop table if exists sct2f_relationship;
+
+CREATE TABLE `sct2f_concept` (
+	`id` BIGINT NOT NULL DEFAULT 0,
+	`effectiveTime` DATE NOT NULL DEFAULT '0000-00-00',
+	`active` bit NOT NULL DEFAULT 0,
+	`moduleId` BIGINT NOT NULL DEFAULT 0,
+	`definitionStatusId` BIGINT NOT NULL DEFAULT 0,
+	PRIMARY KEY (`id`,`effectiveTime`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+
+CREATE TABLE `sct2f_description` (
+	`id` BIGINT NOT NULL DEFAULT 0,
+	`effectiveTime` DATE NOT NULL DEFAULT '0000-00-00',
+	`active` bit NOT NULL DEFAULT 0,
+	`moduleId` BIGINT NOT NULL DEFAULT 0,
+	`conceptId` BIGINT NOT NULL DEFAULT 0,
+	`languageCode` VARCHAR(3) NOT NULL DEFAULT '',
+	`typeId` BIGINT NOT NULL DEFAULT 0,
+	`term` VARCHAR(255) NOT NULL DEFAULT '',
+	`caseSignificanceId` BIGINT NOT NULL DEFAULT 0,
+	PRIMARY KEY (`id`,`effectiveTime`),
+	KEY `sct2f_description_concept` (`conceptId`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE `sct2f_relationship` (
+	`id` BIGINT NOT NULL DEFAULT 0,
+	`effectiveTime` DATE NOT NULL DEFAULT '0000-00-00',
+	`active` bit NOT NULL DEFAULT 0,
+	`moduleId` BIGINT NOT NULL DEFAULT 0,
+	`sourceId` BIGINT NOT NULL DEFAULT 0,
+	`destinationId` BIGINT NOT NULL DEFAULT 0,
+	`relationshipGroup` INT NOT NULL DEFAULT 0,
+	`typeId` BIGINT NOT NULL DEFAULT 0,
+	`characteristicTypeId` BIGINT NOT NULL DEFAULT 0,
+	`modifierId` BIGINT NOT NULL DEFAULT 0,
+	PRIMARY KEY (`id`,`effectiveTime`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/snomedct/index_tables.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/snomedct/index_tables.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/snomedct/index_tables.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/snomedct/index_tables.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,11 @@
+alter table sct2_description
+add KEY `sct2_description_concept` (`conceptId`);
+
+alter table sct2_description 
+add KEY `sct2_description_term` (`term`);
+
+alter table sct2_relationship 
+add KEY `sct2_relationship_source` (`sourceId`,`characteristicTypeId`,`typeId`,`destinationId`);
+
+alter table sct2_relationship 
+add KEY `sct2_relationship_dest` (`destinationId`,`characteristicTypeId`,`typeId`);

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/snomedct/index_tables_full.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/snomedct/index_tables_full.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/snomedct/index_tables_full.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/snomedct/index_tables_full.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,11 @@
+alter table sct2_description_full
+add KEY `sct2_description_concept` (`conceptId`);
+
+alter table sct2_description_full
+add KEY `sct2_description_term` (`term`);
+
+alter table sct2_relationship_full
+add KEY `sct2_relationship_source` (`sourceId`,`characteristicTypeId`,`typeId`,`destinationId`);
+
+alter table sct2_relationship_full
+add KEY `sct2_relationship_dest` (`destinationId`,`characteristicTypeId`,`typeId`);

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/uima/create_document.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/uima/create_document.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/uima/create_document.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/uima/create_document.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,226 @@
+CREATE TABLE document(
+	document_id int /* AUTO_INCREMENT */ NOT NULL,
+	instance_id bigint not null default 0,
+	instance_key varchar(256) null comment 'mapped to DocumentID.DocumentID',
+	analysis_batch varchar(50) NOT NULL,
+	cas longblob NULL,
+	doc_text text NULL,
+	CONSTRAINT PK_document PRIMARY KEY
+	(
+		document_id
+	)
+) engine=myisam
+;
+
+CREATE INDEX IX_document_analysis_batch ON document 
+(
+	analysis_batch,
+	document_id
+)
+;
+
+CREATE INDEX IX_instance_id ON document 
+(
+	instance_id
+)
+;
+
+CREATE INDEX IX_instance_key ON document 
+(
+	instance_key
+)
+;
+create table anno_base (
+	anno_base_id int /* AUTO_INCREMENT */  not null,
+	document_id int not null  comment 'fk document',
+	span_begin int,
+	span_end int,
+	uima_type_id int not null comment 'fk ref_uima_type',
+	primary key (anno_base_id)
+)engine=myisam
+;
+
+ALTER TABLE `anno_base` 
+	ADD INDEX `IX_type_span`(`document_id`, `span_begin`, `span_end`, `uima_type_id`),
+	ADD INDEX `IX_type`(`document_id`, `uima_type_id`);
+ 
+CREATE INDEX IX_docanno_doc ON anno_base (document_id)
+;
+
+create table anno_sentence (
+	anno_base_id int not null comment 'fk anno_base',
+	sentenceNumber int,
+	segmentId varchar(20),
+	primary key (anno_base_id)
+)engine=myisam;
+
+create table anno_named_entity (
+	anno_base_id int not null comment 'fk anno_base',
+	discoveryTechnique int,
+	status int,
+	polarity int,
+	uncertainty int,
+	conditional bit,
+	generic bit,
+	typeID int,
+	confidence float,
+	segmentID varchar(20),
+	primary key (anno_base_id)
+)engine=myisam;
+
+create table anno_med_event (
+	anno_base_id int not null comment 'fk anno_base',
+	discoveryTechnique int,
+	status int,
+	polarity int,
+	uncertainty int,
+	conditional bit,
+	generic bit,
+	typeID int,
+	confidence float,
+	segmentID varchar(20),
+	freqNumber varchar(10) comment 'MedicationFrequency.number',
+	freqUnit varchar(10) comment 'MedicationFrequency.unit',
+	strengthNumber varchar(10) comment 'MedicationStrength.number',
+	strengthUnit varchar(10) comment 'MedicationStrength.unit',
+	`change` varchar(10),
+	dosage varchar(10),
+	primary key (anno_base_id)
+)engine=myisam;
+
+
+create table anno_ontology_concept (
+	anno_ontology_concept_id int auto_increment not null,
+	anno_base_id int not null comment 'fk anno_base',
+	code varchar(20) comment 'OntologyConcept.code',
+	cui char(8) comment 'UmlsConcept.cui',
+	disambiguated bit not null default 0 comment 'ytex OntologyConcept.disambiguated',
+	primary key (anno_ontology_concept_id),
+	KEY `IX_anno_base_id` (`anno_base_id`),
+	KEY `IX_code` (`code`),
+	KEY `IX_anno_code` (`anno_base_id`,`code`),
+	KEY `IX_anno_cui` (`anno_base_id`,`cui`)
+)engine=myisam;
+
+CREATE TABLE anno_segment(
+	anno_base_id int NOT NULL  comment 'fk anno_base',
+	id varchar(20) NULL,
+PRIMARY KEY
+(
+	anno_base_id ASC
+)
+)engine=myisam
+;
+
+CREATE INDEX IX_segment_anno_seg ON anno_segment
+(
+	anno_base_id ASC,
+	id ASC
+)
+;
+
+-- mapped to BaseToken, WordToken
+create table anno_token (
+	anno_base_id int NOT NULL  comment 'fk anno_base',
+	tokenNumber int NOT NULL default 0 comment 'BaseToken',
+	normalizedForm varchar(20) comment 'BaseToken',
+	partofSpeech varchar(5) comment 'BaseToken',
+	coveredText varchar(20) null,
+	capitalization int not null default 0 comment 'ctakes WordToken',
+	numPosition int not null default 0 comment 'ctakes WordToken',
+	suggestion varchar(20) comment 'ctakes WordToken',
+	canonicalForm varchar(20) comment 'ctakes WordToken',
+	negated bit not null default 0 comment 'ytex WordToken',
+	possible bit not null default 0  comment 'ytex WordToken',
+	PRIMARY KEY
+	(
+		anno_base_id ASC
+	),
+	KEY `IX_coveredText` (`coveredText`),
+	KEY `IX_canonicalForm` (`canonicalForm`)
+) engine=myisam;
+
+create table anno_date (
+	anno_base_id int not null  comment 'fk anno_base',
+	tstamp datetime,
+	primary key (anno_base_id) 
+) engine=myisam;
+
+create table anno_markable (
+	anno_base_id int not null primary key comment 'fk anno_base',
+	id int default 0,
+	anaphoric_prob double default 0,
+	content int default 0
+) engine=myisam;
+
+create table anno_treebank_node (
+	anno_base_id int not null primary key comment 'fk anno_base',
+	parent int default 0,
+	nodeType varchar(10),
+	nodeValue varchar(10),
+	leaf bit default 0,
+	headIndex int default 0,
+	`index` int default 0,
+	tokenIndex int default 0
+) engine=myisam;
+
+create table anno_link (
+	anno_link_id int auto_increment not null primary key,
+	parent_anno_base_id int not null comment 'parent anno fk anno_base',
+	child_anno_base_id int not null comment 'child anno fk anno_base',
+	feature varchar(20),
+	key IX_link (parent_anno_base_id, child_anno_base_id, feature)
+) engine=myisam;
+
+create table anno_contain (
+  parent_anno_base_id int not null comment 'parent anno fk anno_base',
+  parent_uima_type_id int not null comment 'parent type',
+  child_anno_base_id int not null comment 'child anno fk anno_base',
+  child_uima_type_id int not null comment 'child type',
+  primary key (parent_anno_base_id, child_anno_base_id),
+  key IX_parent_id_child_type (parent_anno_base_id, child_uima_type_id),
+  key IX_child_id_parent_type (child_anno_base_id, parent_uima_type_id)
+) engine=myisam, comment 'containment relationships between annotations';
+
+CREATE TABLE fracture_demo(
+	note_id int auto_increment NOT NULL primary key,
+	site_id varchar(10) NULL,
+	note_text text NULL,
+	fracture varchar(20) NULL,
+	note_set varchar(10) NULL
+) engine=myisam, comment 'demo data';
+
+
+-- metamap tables
+create table anno_mm_candidate (
+	anno_base_id int primary key,
+	cui char(8),
+	score int default 0,
+	head bit default 0,
+	overmatch bit default 0
+) engine=myisam comment 'org.metamap.uima.ts.Candidate';
+
+create table anno_mm_acronym (
+	anno_base_id int primary key,
+	acronym varchar(10),
+    `expansion` varchar(30)    
+) engine=myisam comment 'gov.nih.nlm.nls.metamap.uima.ts.AcronymAbbrev';
+
+create table anno_mm_utterance (
+	anno_base_id int primary key,
+	pmid varchar(10),
+    location varchar(30)    
+) engine=myisam comment 'org.metamap.uima.ts.Utterance';
+
+
+create table anno_mm_cuiconcept (
+    anno_mm_cuiconcept_id int auto_increment primary key,
+    anno_base_id int,
+    negExCui char(8)
+) engine=myisam comment 'org.metamap.uima.ts.CuiConcept';
+
+create table anno_mm_negation (
+    anno_base_id int primary key,
+    negType varchar(10),
+    negTrigger varchar(10)
+) engine=myisam comment 'org.metamap.uima.ts.Negation';
\ No newline at end of file

Added: ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/uima/create_reference.sql
URL: http://svn.apache.org/viewvc/ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/uima/create_reference.sql?rev=1551254&view=auto
==============================================================================
--- ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/uima/create_reference.sql (added)
+++ ctakes/branches/ytex/ctakes-ytex/scripts/data/mysql/uima/create_reference.sql Mon Dec 16 16:30:30 2013
@@ -0,0 +1,51 @@
+create table hibernate_sequences (
+	sequence_name varchar(100) not null primary key,
+	next_val int not null default 1
+);
+insert into hibernate_sequences(sequence_name, next_val) values ('document_id_sequence', 1);
+
+create table anno_base_sequence (
+	sequence_name varchar(100) not null primary key,
+	next_val int not null default 1
+);
+insert into anno_base_sequence(sequence_name, next_val) values ('anno_base_id_sequence', 1);
+
+
+create table ref_named_entity_regex (
+	named_entity_regex_id int auto_increment NOT NULL,
+	regex varchar(512) not null,
+	coding_scheme varchar(20) not null,
+	code varchar(20) not null,
+	oid varchar(10),
+	context varchar(256),
+	primary key (named_entity_regex_id)
+) engine=myisam;
+
+create table ref_segment_regex (
+	segment_regex_id int auto_increment NOT NULL,
+	regex varchar(256) not null,
+	segment_id varchar(20),
+	limit_to_regex bit null default 0, 
+	primary key (segment_regex_id)
+) engine=myisam;
+
+create table ref_uima_type (
+	uima_type_id int not null,
+	uima_type_name varchar(256) not null,
+	table_name varchar(100) null,
+	CONSTRAINT PK_ref_uima_type PRIMARY KEY  
+	(
+		uima_type_id ASC
+	)
+) engine=myisam;
+
+CREATE UNIQUE  INDEX NK_ref_uima_type ON ref_uima_type
+(
+	uima_type_name
+)
+;
+
+CREATE TABLE ref_stopword (
+	stopword varchar(50) not null primary key
+) engine=myisam
+;



Mime
View raw message