169 Background: In this era of electronic health records (EHR), quality monitoring can be a fast repetitive process. Having access to the relational database of the EHR permits rapid case identification and quality indicator determination. We hereby describe evaluation of hepatitis B testing prior to rituximab administration, a quality measure as per ASCO guidelines. Methods: We connected SQL Query Manager with EPIC Clarity database. Using the object model for medication orders, location and department, we used SQL language to build a temporary dataset of all patients who have a completed order for a Rituximab infusion at a specific department location within the past 6 months. Using the dataset obtained in step 2, we created a smaller dataset with one row for each patient. We updated each unique patient row by updating columns for the count of completed Rituximab infusions, the first infusion date and the last infusion date. We then updated each row from a query of the order procedure and results object model. The unique patient id and component id are the key fields for this query. The Hepatitis B surface antigen and core antibody results were queried from up to 6 months prior to the initial rituximab dose. We looped through the dataset and compared the first Rituximab start date with the Hepatitis B testing date. If the testing date is before the drug administration date, a Boolean column was updated to indicate a 1 for passing the quality measure and a 0 for not passing. Finally, we reviewed that chart of any patients who fail the electronic quality measure check as some Hepatitis B testing may be represented in scanned results and these scanned results cannot be queried. Results: When the final SQL query runs, it takes less than a minute to see the result set. The query can be run at any interval or date range. Once the SQL procedure is created, there is essentially no labor and very low costs to run procedure at specific time intervals. Conclusions: Quality control is integral for improvement in patient care. Doing quality monitoring can be labor intensive, expensive, repetitive and time consuming. By using the relational database created and maintained by the EHR we can accomplish the quality control in faster way that is time and cost effective.