Hi Pei,
I can't see any issues with LookupDesc_Db, so I am attaching both it
and DictionaryLookupAnnotatorDB.xml. I only modified the
username/password in the second file to "myusername" and "mypassword" for
security purposes. They were correct before, I checked it many times.
Thank you so much for your help,
Natalia
On Fri, Jul 25, 2014 at 1:34 PM, Chen, Pei <[email protected]>
wrote:
> Natalia,
> That is strange. It sounds like it isn't configured to use the right
> resource.
> Could you double check the mappings, in particular: in your
> LookupDesc_Db.xml:
> externalResourceKey="DbConnection" to ensure it's using the right resource
> that was added in your DictionaryLookupAnnotatorDB.xml?
> If it still doesn't work, would you mind attaching the xml config files?
>
> --Pei
>
> > -----Original Message-----
> > From: John Green [mailto:[email protected]]
> > Sent: Friday, July 25, 2014 1:06 PM
> > To: [email protected]; [email protected]
> > Subject: Re: Fwd: UMLS integration with cTAKES 3.1
> >
> > This sounds just like jira ctakes-306.
> >
> >
> > JG
> > —
> >
> > On Fri, Jul 25, 2014 at 1:04 PM, John Green <[email protected]
> >
> > wrote:
> >
> > > —
> > > ---------- Forwarded message ----------
> > > From: "Natalia Connolly" <[email protected]>
> > > Date: Fri, Jul 25, 2014 at 12:35 PM
> > > Subject: UMLS integration with cTAKES 3.1
> > > To: "[email protected]" <[email protected]>
> > >> Hello,
> > >> I am trying to supplement the basic cTAKES dictionary with the
> > >> latest UMLS release. Following the instructions here (
> > >> https://cabig-
> > kc.nci.nih.gov/Vocab/forums/viewtopic.php?f=28&t=80#p25
> > >> 8), I built a mysql database and imported UMLS data into it as two
> tables,
> > >> umls_ms_2013 and umls_snomed_map. I then modified
> > >> DictionaryLookupAnnotatorDB.xml as follows:
> > >> <name>URL</name>
> > >> <value>
> > >> <string>jdbc:mysql://localhost:3306/umls</string>
> > >> </value>
> > >> and I also changed LookupDesc_Db.xml to reflect my two table names.
> > >> After I added DictionaryLookupAnnotatorDB.xml to my analysis
> > >> engines in runctakesCPE.sh, I got the following error:
> > >> org.apache.uima.analysis_engine.AnalysisEngineProcessException
> > CausedBY:
> > >> org.apache.ctakes.dictionary.lookup.DictionaryException:
> > >> java.sql.SQLException: Table not found in statement [SELECT tui,
> > >> text, cui from UMLS_MS_2013 where fword =?]
> > >> This is strange because the table does exist and it's not empty:
> > >> mysql> SELECT tui, text, cui from UMLS_MS_2013 limit 2;
> > >> +------+--------+----------+
> > >> | tui | text | cui |
> > >> +------+--------+----------+
> > >> | T121 | MSH | C0000005 |
> > >> | T121 | MSHFRE | C0000005 |
> > >> +------+--------+----------+
> > >> 2 rows in set (0.00 sec)
> > >> Can someone please help?
> > >> Thank you,
> > >> Natalia Connolly
>
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<taeDescription xmlns="http://uima.apache.org/resourceSpecifier">
<frameworkImplementation>org.apache.uima.java</frameworkImplementation>
<primitive>true</primitive>
<annotatorImplementationName>org.apache.ctakes.dictionary.lookup.ae.DictionaryLookupAnnotator</annotatorImplementationName>
<analysisEngineMetaData>
<name>DictionaryLookupAnnotator</name>
<description/>
<version/>
<vendor/>
<configurationParameters>
<configurationParameter>
<name>maxListSize</name>
<description>Specifies the maximum number of items to be returned from an lucene query.</description>
<type>Integer</type>
<multiValued>false</multiValued>
<mandatory>false</mandatory>
</configurationParameter>
</configurationParameters>
<configurationParameterSettings>
<nameValuePair>
<name>maxListSize</name>
<value>
<integer>2147483647</integer>
</value>
</nameValuePair>
</configurationParameterSettings>
<typeSystemDescription>
<imports>
</imports>
</typeSystemDescription>
<typePriorities/>
<fsIndexCollection/>
<capabilities>
<capability>
<inputs>
<type allAnnotatorFeatures="true">org.apache.ctakes.typesystem.type.syntax.BaseToken</type>
<type allAnnotatorFeatures="true">org.apache.ctakes.typesystem.type.textspan.LookupWindowAnnotation</type>
</inputs>
<outputs>
<type allAnnotatorFeatures="true">org.apache.ctakes.typesystem.type.textsem.IdentifiedAnnotation</type>
</outputs>
<languagesSupported/>
</capability>
</capabilities>
<operationalProperties>
<modifiesCas>true</modifiesCas>
<multipleDeploymentAllowed>true</multipleDeploymentAllowed>
<outputsNewCASes>false</outputsNewCASes>
</operationalProperties>
</analysisEngineMetaData>
<externalResourceDependencies>
<externalResourceDependency>
<key>LookupDescriptor</key>
<description/>
<interfaceName>org.apache.ctakes.core.resource.FileResource</interfaceName>
<optional>false</optional>
</externalResourceDependency>
<externalResourceDependency>
<key>DbConnection</key>
<description/>
<interfaceName>org.apache.ctakes.core.resource.JdbcConnectionResource</interfaceName>
<optional>false</optional>
</externalResourceDependency>
<externalResourceDependency>
<key>RxnormIndexReader</key>
<description/>
<interfaceName>org.apache.ctakes.core.resource.LuceneIndexReaderResource</interfaceName>
<optional>false</optional>
</externalResourceDependency>
<externalResourceDependency>
<key>OrangeBookIndexReader</key>
<description/>
<interfaceName>org.apache.ctakes.core.resource.LuceneIndexReaderResource</interfaceName>
<optional>false</optional>
</externalResourceDependency>
</externalResourceDependencies>
<resourceManagerConfiguration>
<externalResources>
<externalResource>
<name>LookupDescriptorFile</name>
<description/>
<fileResourceSpecifier>
<fileUrl>file:org/apache/ctakes/dictionary/lookup/LookupDesc_Db.xml</fileUrl>
</fileResourceSpecifier>
<implementationName>org.apache.ctakes.core.resource.FileResourceImpl</implementationName>
</externalResource>
<externalResource>
<name>DbConnectionResrc</name>
<description/>
<configurableDataResourceSpecifier>
<url/>
<resourceMetaData>
<name/>
<configurationParameters>
<configurationParameter>
<name>DriverClassName</name>
<type>String</type>
<multiValued>false</multiValued>
<mandatory>true</mandatory>
</configurationParameter>
<configurationParameter>
<name>URL</name>
<type>String</type>
<multiValued>false</multiValued>
<mandatory>true</mandatory>
</configurationParameter>
<configurationParameter>
<name>Username</name>
<type>String</type>
<multiValued>false</multiValued>
<mandatory>true</mandatory>
</configurationParameter>
<configurationParameter>
<name>Password</name>
<type>String</type>
<multiValued>false</multiValued>
<mandatory>true</mandatory>
</configurationParameter>
</configurationParameters>
<configurationParameterSettings>
<nameValuePair>
<name>DriverClassName</name>
<value>
<string>com.mysql.jdbc.Driver</string>
</value>
</nameValuePair>
<nameValuePair>
<name>URL</name>
<value>
<string>jdbc:mysql://localhost:3306/umls</string>
</value>
</nameValuePair>
<nameValuePair>
<name>Username</name>
<value>
<string>myusername</string>
</value>
</nameValuePair>
<nameValuePair>
<name>Password</name>
<value>
<string>mypassword</string>
</value>
</nameValuePair>
</configurationParameterSettings>
</resourceMetaData>
</configurableDataResourceSpecifier>
<implementationName>org.apache.ctakes.core.resource.JdbcConnectionResourceImpl</implementationName>
</externalResource>
<externalResource>
<name>RxnormIndex</name>
<description/>
<configurableDataResourceSpecifier>
<url/>
<resourceMetaData>
<name/>
<configurationParameters>
<configurationParameter>
<name>UseMemoryIndex</name>
<type>Boolean</type>
<multiValued>false</multiValued>
<mandatory>true</mandatory>
</configurationParameter>
<configurationParameter>
<name>IndexDirectory</name>
<type>String</type>
<multiValued>false</multiValued>
<mandatory>true</mandatory>
</configurationParameter>
</configurationParameters>
<configurationParameterSettings>
<nameValuePair>
<name>UseMemoryIndex</name>
<value>
<boolean>true</boolean>
</value>
</nameValuePair>
<nameValuePair>
<name>IndexDirectory</name>
<value>
<string>org/apache/ctakes/dictionary/lookup/drug_index</string>
</value>
</nameValuePair>
</configurationParameterSettings>
</resourceMetaData>
</configurableDataResourceSpecifier>
<implementationName>org.apache.ctakes.core.resource.LuceneIndexReaderResourceImpl</implementationName>
</externalResource>
<externalResource>
<name>OrangeBookIndex</name>
<description/>
<configurableDataResourceSpecifier>
<url/>
<resourceMetaData>
<name/>
<configurationParameters>
<configurationParameter>
<name>UseMemoryIndex</name>
<type>Boolean</type>
<multiValued>false</multiValued>
<mandatory>true</mandatory>
</configurationParameter>
<configurationParameter>
<name>IndexDirectory</name>
<type>String</type>
<multiValued>false</multiValued>
<mandatory>true</mandatory>
</configurationParameter>
</configurationParameters>
<configurationParameterSettings>
<nameValuePair>
<name>UseMemoryIndex</name>
<value>
<boolean>true</boolean>
</value>
</nameValuePair>
<nameValuePair>
<name>IndexDirectory</name>
<value>
<string>org/apache/ctakes/dictionary/lookup/OrangeBook</string>
</value>
</nameValuePair>
</configurationParameterSettings>
</resourceMetaData>
</configurableDataResourceSpecifier>
<implementationName>org.apache.ctakes.core.resource.LuceneIndexReaderResourceImpl</implementationName>
</externalResource>
</externalResources>
<externalResourceBindings>
<externalResourceBinding>
<key>LookupDescriptor</key>
<resourceName>LookupDescriptorFile</resourceName>
</externalResourceBinding>
<externalResourceBinding>
<key>DbConnection</key>
<resourceName>DbConnectionResrc</resourceName>
</externalResourceBinding>
<externalResourceBinding>
<key>RxnormIndexReader</key>
<resourceName>RxnormIndex</resourceName>
</externalResourceBinding>
<externalResourceBinding>
<key>OrangeBookIndexReader</key>
<resourceName>OrangeBookIndex</resourceName>
</externalResourceBinding>
</externalResourceBindings>
</resourceManagerConfiguration>
</taeDescription>
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<lookupSpecification>
<!-- Defines what dictionaries will be used in terms of implementation specifics and metaField configuration. -->
<dictionaries>
<dictionary id="DICT_UMLS_MS" externalResourceKey="DbConnection" caseSensitive="false">
<implementation>
<jdbcImpl tableName="UMLS_MS_2013"/>
</implementation>
<lookupField fieldName="fword"/>
<metaFields>
<metaField fieldName="cui"/>
<metaField fieldName="tui"/>
<metaField fieldName="text"/>
</metaFields>
</dictionary>
<dictionary id="DICT_RXNORM" externalResourceKey="RxnormIndexReader" caseSensitive="false">
<implementation>
<luceneImpl/>
</implementation>
<lookupField fieldName="first_word"/>
<metaFields>
<metaField fieldName="code"/>
<metaField fieldName="codeRxNorm"/>
<metaField fieldName="preferred_designation"/>
<metaField fieldName="other_designation"/>
</metaFields>
</dictionary>
</dictionaries>
<!-- Binds together the components necessary to perform the complete lookup logic start to end. -->
<lookupBindings>
<lookupBinding>
<dictionaryRef idRef="DICT_UMLS_MS"/>
<lookupInitializer className="org.apache.ctakes.dictionary.lookup.ae.FirstTokenPermLookupInitializerImpl">
<properties>
<property key="textMetaFields" value="text"/>
<property key="maxPermutationLevel" value="7"/>
<!-- <property key="windowAnnotations" value="org.apache.ctakes.typesystem.type.textspan.Sentence"/> -->
<property key="windowAnnotations" value="org.apache.ctakes.typesystem.type.textspan.LookupWindowAnnotation"/>
<property key="exclusionTags" value="VB,VBD,VBG,VBN,VBP,VBZ,CC,CD,DT,EX,IN,LS,MD,PDT,POS,PP,PP$,PRP,PRP$,RP,TO,WDT,WP,WPS,WRB"/>
</properties>
</lookupInitializer>
<lookupConsumer className="org.apache.ctakes.dictionary.lookup.ae.UmlsToSnomedDbConsumerImpl">
<properties>
<property key="codingScheme" value="SNOMED"/>
<property key="cuiMetaField" value="cui"/>
<property key="tuiMetaField" value="tui"/>
<property key="anatomicalSiteTuis" value="T021,T022,T023,T024,T025,T026,T029,T030"/>
<property key="procedureTuis" value="T059,T060,T061"/>
<property key="disorderTuis" value="T019,T020,T037,T046,T047,T048,T049,T050,T190,T191"/>
<property key="findingTuis" value="T033,T034,T040,T041,T042,T043,T044,T045,T046,T056,T057,T184"/>
<property key="dbConnExtResrcKey" value="DbConnection"/>
<property key="mapPrepStmt" value="select code from umls_snomed_map where cui=?"/>
</properties>
</lookupConsumer>
</lookupBinding>
<lookupBinding>
<dictionaryRef idRef="DICT_RXNORM"/>
<lookupInitializer className="org.apache.ctakes.dictionary.lookup.ae.FirstTokenPermLookupInitializerImpl">
<properties>
<property key="textMetaFields" value="preferred_designation|other_designation"/>
<property key="maxPermutationLevel" value="7"/>
<!-- <property key="windowAnnotations" value="org.apache.ctakes.typesystem.type.textspan.Sentence"/> -->
<property key="windowAnnotations" value="org.apache.ctakes.typesystem.type.textspan.LookupWindowAnnotation"/>
<property key="exclusionTags" value="VB,VBD,VBG,VBN,VBP,VBZ,CC,CD,DT,EX,LS,MD,PDT,POS,PP,PP$,RP,TO,WDT,WP,WPS,WRB"/>
</properties>
</lookupInitializer>
<lookupConsumer className="org.apache.ctakes.dictionary.lookup.ae.OrangeBookFilterConsumerImpl">
<properties>
<property key="codingScheme" value="RXNORM"/>
<property key="codeMetaField" value="codeRxNorm"/> <!-- Use value="code" for UMLS CUIs -->
<property key="luceneFilterExtResrcKey" value="OrangeBookIndexReader"/>
</properties>
</lookupConsumer>
</lookupBinding>
</lookupBindings>
</lookupSpecification>