Skip to content

Commit

Permalink
chore: #1294: SQL for selecting out homework subjects with missing HLA.
Browse files Browse the repository at this point in the history
  • Loading branch information
zabeen committed Apr 30, 2024
1 parent 207619e commit 4ad5f67
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* SELECT SUBJECTS WITH MISSING REQUIRED HLA
*/

-- Patients
SELECT DISTINCT hs.SetName, pdp.PatientId
FROM HomeworkSets hs
JOIN PatientDonorPairs pdp
ON hs.Id = pdp.HomeworkSet_Id
WHERE pdp.DidPatientHaveMissingHla = 1
ORDER BY hs.SetName, pdp.PatientId

-- Donors
SELECT DISTINCT hs.SetName, pdp.DonorId
FROM HomeworkSets hs
JOIN PatientDonorPairs pdp
ON hs.Id = pdp.HomeworkSet_Id
WHERE pdp.DidDonorHaveMissingHla = 1
ORDER BY hs.SetName, pdp.DonorId

0 comments on commit 4ad5f67

Please sign in to comment.