Advertisement
Guest User

Untitled

a guest
Nov 29th, 2015
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. -- Display patients with unusual results of urea test and their doctor
  3. SELECT Patient.FName, Patient.LName,LabName, LabExamName,TestDate,TestResult,Units,TestIndicator,DFName,DLName,DSpecialty FROM
  4. Patient JOIN LabTest ON LabTest.PatientID = Patient.PatientID
  5. JOIN Doctor ON LabTest.DoctorID = Doctor.DoctorID
  6. JOIN  LabTestResult ON LabTestResult.LabTestID = LabTest.LabTestID
  7. JOIN  TestType ON LabTestResult.TestTypeID = TestType.TestTypeID
  8. WHERE TestType.TestIndicator = 'Urea' AND (LabTestResult.TestResult >TestType.MaxRefValues OR LabTestResult.TestResult < TestType.MinRefValue) ORDER BY Patient.FName
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement