We are currently updating the OP Help Center content for the release of OP 14.19 or OP 19. OP 19 is a member of the certified OP 14 family of products (official version is 14.19.1), which you may see in your software (such as in Help > About) and in the Help Center tabs labeled 14.19. You may also notice that the version number in content and videos may not match the version of your software, and some procedural content may not match the workflow in your software. We appreciate your patience and understanding as we make these enhancements.

SQL: Fluoride Varnish Applied


This SQL shows all kids that are 1 - 3 years old who had a checkup on the date they were seen in a selected date range.  If they had a fluoride done (LOINC code "XFLUOR") sometime in that period (not necessarily the same day as the checkup), then it puts the date in "FLUORIDE DATE" column.

A sample image of this SQL report run in the Database Viewer is shown below:


This requires that you are documenting fluoride application as a Diagnostic test using the LOINC code XFLUOR.


To highlight and copy the code below to your clipboard, simply click the Copy button.

select physical.patno, date1, fluoride_date from physical
inner join register on register.patno = physical.patno
left outer join 
(select patno, loinc_code, date1 as fluoride_date from diag_test_order where loinc_code = 'XFLUOR' and date1  between :start_date and :end_date) d on d.patno = physical.patno
where date1 between :start_date and :end_date
and (date1-birthdat) >=365 and (date1-birthdat)<1460
order by patno