Skip to content

Instantly share code, notes, and snippets.

@vagmi
Created September 23, 2010 14:12
Show Gist options
  • Save vagmi/593665 to your computer and use it in GitHub Desktop.
Save vagmi/593665 to your computer and use it in GitHub Desktop.
select preg.first_name,preg.family_name,
ios.Service_Name, ios.Service_code, ios.Report_Type,
invsam.lab_regno, preg.registration_no, text_report = case ios.Report_Type
WHEN 'T' then (select itr.formatstr from investigation_typical_result_op itr where lab_regno=invsam.lab_regno and itr.service_code=invsam.service_code)
ELSE 'NA'
END
from investigation_sample_op invsam inner join patient_registration preg on invsam.Registration_No = preg.registration_no
inner join item_of_service ios on invsam.service_code = ios.Service_code
where invsam.Registration_No='10712'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment