Advertisement
Guest User

Untitled

a guest
Jul 26th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. (Select DISTINCT a.conditions from
  2. (select CASE
  3. WHEN medication like 'caduet'
  4. THEN 'Hypertension and Cholesterol'
  5. WHEN medication like '%actoplus%'
  6. OR medication like '%actos%'
  7. OR medication like '%amaryl%'
  8. THEN 'Diabetes'
  9. WHEN medication like '%altocor%'
  10. OR medication like '%altoprev%'
  11. OR medication like '%zocor%'
  12. THEN 'Cholesterol'
  13. WHEN medication like '%-nitro%'
  14. OR medication like '%accupril%'
  15. OR medication like '%zosin%'
  16. THEN 'Hypertension'
  17. ELSE NULL
  18. END as Conditions
  19. from prescriptions
  20. where patientid = @contactid
  21. and status = 'Active'
  22. ) a
  23. where a.conditions is not null) as 'Conditions'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement