forked from IHTSDO/snomed-database-loader
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIE0X_WebinarE_Query6.sql
More file actions
21 lines (21 loc) · 1.07 KB
/
IE0X_WebinarE_Query6.sql
File metadata and controls
21 lines (21 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--
-- QUERY 6
-- Find the clinical findings with a finding site of pulmonary valve (or subtype) and an associated morphology of stenosis (or subtype)
-- Expression Constraint: < 404684003 |clinical finding|:
-- 363698007 |finding site| = << 39057004 |pulmonary valve|,
-- 116676008 |associated morphology| = << 415582006 |stenosis|
--
SELECT tc.subtypeId, pt.term
FROM snomedct.ss_transclose as tc, snomedct.sva_pref as pt
WHERE tc.supertypeId = 404684003 AND pt.conceptId = tc.subtypeId
AND tc.subtypeId IN (SELECT sourceId FROM snomedct.sva_relationship as r
WHERE r.active = 1 AND r.typeId = 363698007
AND (r.destinationId = 39057004 OR r.destinationId IN
(SELECT tc2.subtypeID FROM snomedct.ss_transclose as tc2
WHERE tc2.supertypeId = 39057004 )))
AND tc.subtypeId IN (SELECT sourceId FROM snomedct.sva_relationship as r
WHERE r.active = 1 AND r.typeId = 116676008
AND (r.destinationId = 415582006 OR r.destinationId IN
(SELECT tc2.subtypeID FROM snomedct.ss_transclose as tc2
WHERE tc2.supertypeId = 415582006 )))
ORDER BY pt.term