Created
February 23, 2026 02:01
-
-
Save tu-trinh-scale/e800f3d5f4b87da1e220d97190e74545 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| WITH threshold_calc AS ( | |
| SELECT AVG("aCL IgM") + AVG("aCL IgM") * 0.2 as acl_igm_threshold | |
| FROM Examination | |
| WHERE "aCL IgM" IS NOT NULL | |
| ), | |
| core_patients AS ( | |
| SELECT DISTINCT ID | |
| FROM Examination | |
| ) | |
| SELECT DISTINCT e.Symptoms | |
| FROM Examination e | |
| CROSS JOIN threshold_calc t | |
| WHERE e.ID IN (SELECT ID FROM core_patients) | |
| AND e."Examination Date" >= '1995-01-01' | |
| AND e."Examination Date" <= '1999-12-31' | |
| AND e.Thrombosis IN ('limited', 'partial', 'segmental', 'non-occlusive', '2') | |
| AND e."ANA Pattern" LIKE '%S%' | |
| AND e."aCL IgM" < t.acl_igm_threshold | |
| AND e.Symptoms IS NOT NULL; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment