Note: We no longer publish the latest version of our code here. We primarily use a kumc-bmi github organization. The heron ETL repository, in particular, is not public. Peers in the informatics community should see MultiSiteDev for details on requesting access.

source: heron_load/report_dup_fullnames.sql @ 0:42ad7288920a

heron-michigan tip
Last change on this file since 0:42ad7288920a was 0:42ad7288920a, checked in by Matt Hoag <mhoag@…>, 6 years ago

Merge with demo_concepts_3800

File size: 1.1 KB
1/* report_dup_fullnames -- Report on duplicate fullnames in the terms tree
3Copyright (c) 2015 University of Kansas Medical Center
4part of the HERON* open source codebase; see NOTICE file for license details.
8insert into etl_test_values (test_value, test_domain, test_name, result_id, result_date)
9with test_key as (
10  select 'Terms' test_domain,
11  'duplicate_active_term_fullnames' test_name from dual
12  )
14  num_dups test_value, test_key.*,
15  sq_result_id.nextval result_id, sysdate
16from test_key, (
17  select count(*) num_dups from (
18    select dups.qty, dups.c_fullname, ht.c_name, ht.c_visualattributes, ht.c_basecode from (
19      select count(*) qty, c_fullname from blueheronmetadata.heron_terms group by c_fullname having count(*) > 1
20      ) dups
21    join blueheronmetadata.heron_terms ht on ht.c_fullname = dups.c_fullname
22    -- Ignore modifiers, leaves, and non-active terms
23    where ht.c_visualattributes like '_A%' and ht.c_visualattributes not like 'L%' and m_applied_path = '@'
24    order by dups.qty desc
25    )
26  );
Note: See TracBrowser for help on using the repository browser.