ctakes-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Green" <john.travis.gr...@gmail.com>
Subject Re: Change from SNOMEDCT to SNOMEDCT_US affecting v_snomed_fword_lookup
Date Sat, 16 Aug 2014 16:07:23 GMT
Great catch!—
Sent from Mailbox for iPhone

On Sat, Aug 16, 2014 at 2:53 AM, Tim O'Connell <tim.oconnell@gmail.com>
wrote:

> Hi folks,
> I was having an issue with the current build (from svn) of ctakes/ytex not
> identifying any annotations as some folks on this board.  I traced it to
> the fact that the UMLS database has at sometime in the relatively recent
> past changed the SAB tag in the MRCONSO table for SNOMED terms from
> SNOMEDCT to SNOMEDCT_US.  I just had a newer version of UMLS that uses
> SNOMEDCT_US.  Thus when the install script tried to create the
> v_snomed_fword_lookup table, it wasn't finding any of the SNOMEDCT terms,
> thus nothing was getting annotated.
> The ytex install script was just looking for things in MRCONSO with the
> SNOMEDCT SAB tag when it created the ytex lookup table - so, by changing
> this to SNOMEDCT_US in the file
> CTAKES_HOME/bin/ctakes-ytex/scripts/data/mysql/umls/insert_view_template.sql
> it now works (for mysql users) to find the annotations. You can just re-run
> the ytex setup script, but that takes hours - instead, I just deleted all
> the data from the v_snomed_fword_lookup table and basically ran the sql
> command to repopulate the table and it worked fine. Here's the code, n.b.
> my schema name for my umls database is 'umls' - change the code below if
> yours is different.
> delete from v_snomed_fword_lookup;
> insert into v_snomed_fword_lookup (cui, tui, fword, fstem, tok_str,
> stem_str)
> select mrc.cui, t.tui, c.fword, c.fstem, c.tok_str, c.stem_str
> from umls_aui_fword c
> inner join umls.MRCONSO mrc on c.aui = mrc.aui and mrc.SAB in (
> 'SNOMEDCT_US', 'RXNORM')
> inner join
> (
> select cui, min(tui) tui
> from umls.MRSTY sty
> where sty.tui in
> (
>    'T019', 'T020', 'T037', 'T046', 'T047', 'T048', 'T049', 'T050',
>      'T190', 'T191', 'T033',
>    'T184',
>    'T017', 'T029', 'T023', 'T030', 'T031', 'T022', 'T025', 'T026',
>        'T018', 'T021', 'T024',
>     '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',
>    'T060', 'T065', 'T058', 'T059', 'T063', 'T062', 'T061',
>    'T074', 'T075',
>    'T059'
> )
> group by cui
> ) t on t.cui = mrc.cui
> ;
> Hope it helps - cheers,
> Tim
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message