-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
53 changed files
with
23,327 additions
and
10,049 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
SELECT | ||
condition_occurrence_id, | ||
person_id, | ||
visit_occurrence_id, | ||
condition_concept_id, | ||
c_condition.concept_name AS condition_concept_name, | ||
condition_start_datetime, | ||
condition_status_concept_id, | ||
c_status.concept_name AS status_concept_name | ||
FROM | ||
condition_occurrence c_o | ||
LEFT JOIN concept c_condition ON | ||
c_condition.concept_id = c_o.condition_concept_id | ||
LEFT JOIN concept c_status ON | ||
c_status.concept_id = c_o.condition_status_concept_id | ||
WHERE | ||
condition_status_concept_id IN | ||
( | ||
32901, --Primary admission diagnosis | ||
32907 --Secondary admission diagnosis | ||
) | ||
AND condition_concept_id IN | ||
(SELECT | ||
descendant_concept_id | ||
FROM | ||
concept_ancestor | ||
WHERE | ||
ancestor_concept_id IN | ||
( | ||
4256374 -- Cardiorespiratory arrest | ||
)) | ||
ORDER BY | ||
person_id, visit_occurrence_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
SELECT | ||
procedure_occurrence_id, | ||
po.person_id, | ||
po.visit_occurrence_id, | ||
procedure_concept_id, | ||
c.concept_name AS procedure_concept_name, | ||
procedure_datetime | ||
FROM | ||
procedure_occurrence po | ||
LEFT JOIN visit_occurrence visit ON | ||
visit.visit_occurrence_id = po.visit_occurrence_id | ||
LEFT JOIN concept c ON | ||
c.concept_id = po.procedure_concept_id | ||
LEFT JOIN provider p ON | ||
p.provider_id = visit.provider_id | ||
WHERE | ||
procedure_datetime < visit.visit_start_datetime | ||
AND procedure_datetime >= visit.visit_start_datetime - INTERVAL '8 HOUR' | ||
AND (p.specialty_concept_id = 38004497 -- Cardiac Surgery | ||
OR procedure_concept_id IN | ||
(SELECT | ||
descendant_concept_id | ||
FROM | ||
concept_ancestor | ||
WHERE | ||
ancestor_concept_id IN | ||
( | ||
4275564, -- Cardiac surgery procedure | ||
44783222, -- Aortic arch replacement | ||
4049406, -- Operation on the pulmonary trunk and arteries | ||
44782479, -- Repair of ascending aorta | ||
4339824, -- Aortic valve replacement and replacement of ascending aorta | ||
4049406, -- Operation on the pulmonary trunk and arteries | ||
44783314 -- Repair of dissection of proximal thoracic aorta | ||
)) | ||
) | ||
AND NOT po.provider_id IS NULL | ||
|
46 changes: 46 additions & 0 deletions
46
amsterdamumcdb/sql/diagnosis/gastro_intestinal_surgery.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
SELECT | ||
procedure_occurrence_id, | ||
po.person_id, | ||
po.visit_occurrence_id, | ||
procedure_concept_id, | ||
c.concept_name AS procedure_concept_name, | ||
procedure_datetime | ||
FROM | ||
procedure_occurrence po | ||
LEFT JOIN visit_occurrence visit ON | ||
visit.visit_occurrence_id = po.visit_occurrence_id | ||
LEFT JOIN concept c ON | ||
c.concept_id = po.procedure_concept_id | ||
LEFT JOIN provider p ON | ||
p.provider_id = visit.provider_id | ||
WHERE | ||
procedure_datetime < visit.visit_start_datetime | ||
AND procedure_datetime >= visit.visit_start_datetime - INTERVAL '8 HOUR' | ||
AND (p.specialty_concept_id = 38004447 -- General Surgery | ||
OR procedure_concept_id IN | ||
(SELECT | ||
descendant_concept_id | ||
FROM | ||
concept_ancestor | ||
WHERE | ||
ancestor_concept_id IN | ||
( | ||
--4314251, -- Laparotomy | ||
4293032 --Procedure on gastrointestinal tract | ||
)) | ||
) | ||
AND NOT procedure_concept_id IN | ||
(SELECT | ||
descendant_concept_id | ||
FROM | ||
concept_ancestor | ||
WHERE | ||
ancestor_concept_id IN | ||
( | ||
4042641, --Procedure on cardiovascular system | ||
4030781 --Operative procedure on male genitourinary system (procedure) | ||
)) | ||
AND NOT po.provider_id IS NULL | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
SELECT | ||
condition_occurrence_id, | ||
person_id, | ||
visit_occurrence_id, | ||
condition_concept_id, | ||
c_condition.concept_name AS condition_concept_name, | ||
condition_start_datetime, | ||
condition_status_concept_id, | ||
c_status.concept_name AS status_concept_name | ||
FROM | ||
condition_occurrence c_o | ||
LEFT JOIN concept c_condition ON | ||
c_condition.concept_id = c_o.condition_concept_id | ||
LEFT JOIN concept c_status ON | ||
c_status.concept_id = c_o.condition_status_concept_id | ||
WHERE | ||
condition_status_concept_id IN | ||
( | ||
32901, --Primary admission diagnosis | ||
32907 --Secondary admission diagnosis | ||
) | ||
AND condition_concept_id IN | ||
(SELECT | ||
descendant_concept_id | ||
FROM | ||
concept_ancestor | ||
WHERE | ||
ancestor_concept_id IN | ||
( | ||
4181063 --Inflammation of specific body organs (disorder) | ||
)) | ||
ORDER BY | ||
person_id, visit_occurrence_id |
Oops, something went wrong.