Search Lab Results for Abnormal values



  • Version
  • 2 Download
  • 0.00 KB File Size
  • 0 File Count
  • November 29, 2018 Create Date
  • November 29, 2018 Last Updated
  • Download

This Report By Template will search the measurements for abnormal values (that you can enter).

<report title="Latest lab result <=> ?" description="Dr. Pun Searches for patients by recent LAB result  A1C , ie HB, PSA .CALC > 6.0 , use % for wildcard or and dataField for range value" active="1">
<query>


select * from
(
select * from (
select  l.demographicNo,
CONCAT( "<a target=new
href=../../demographic/demographiccontrol.jsp?demographic_no=",
d.demographic_no, "&displaymode=edit&dboperation=search_detail>" ,
d.demographic_no, "<a/>" ) As "Dem",
l.dateObserved,
TIMESTAMPDIFF (YEAR, concat(year_of_birth,'-',month_of_birth,'-',date_of_birth), CURDATE()) as age,
 d.last_name, d.first_name, 
l.type, l.dataField , l.comments from measurements l, demographic d   where d.patient_status = "AC" and l.demographicNo = d.demographic_no and ( l.type like '{lab}')  order by  demographic_no, dateObserved desc  ) as t1  group by demographicNo order by dateObserved  desc
) as t2 where (dataField {ac})



</query>

<param id="lab" type="text" description="Lab Test type"> </param>
<param id="ac" type="text" description="LAB test value >=<"> </param>


</report>