232 Background: Electronic health records (EHRs) are a widely adopted but underutilized source of data for systematic assessment of healthcare quality. Barriers for use of this data source include its vast complexity, lack of structure, and the lack of use of standardized vocabulary and terminology by clinicians. This project aims to develop generalizable algorithms to extract useful knowledge regarding prostate cancer quality metrics from EHRs. Methods: We used EHR ICD-9/10 codes to identify prostate cancer patients receiving care at our academic medical center. Patients were confirmed in the California Cancer Registry (CCR), which provided data on tumor characteristics, treatment data, treatment outcomes and survival. We focused on three potential pretreatment process quality measures, which included documentation within 6 months prior to initial treatment of prostate-specific antigen (PSA), digital rectal exam (DRE) performance, and Gleason score. Each quality metric was defined using target terms and concepts to extract from the EHRs. Terms were mapped to a standardized medical vocabulary or ontology, enabling us to represent the metric elements by a concept domain and its permissible values. The structured representation of the quality metric included rules that accounted for the temporal order of the metric components. Our algorithms used natural language processing for free text annotation and negation, to ensure terms such as ‘DRE deferred’ are appropriately categorized. Results: We identified 2,123 patients receiving prostate cancer treatment between 2008-2016, of whom 1413 (67%) were matched in the CCR. We compared accuracy of our data mining algorithm, a random sample of manual chart review, and the CCR. (See Table.) Conclusions: EHR systems can be used to assess and report quality metrics systematically, efficiently, and with high accuracy. The development of such systems can improve and reduce the burden of quality reporting and potentially reduce costs of measuring quality metrics through automation. [Table: see text]