<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.1d3 20150301//EN" "http://jats.nlm.nih.gov/publishing/1.1d3/JATS-journalpublishing1.dtd">
<article article-type="research-article" dtd-version="1.1d3" xml:lang="en" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">
<front>
<journal-meta>
<journal-id journal-id-type="nlm-ta">PLoS ONE</journal-id>
<journal-id journal-id-type="publisher-id">plos</journal-id>
<journal-id journal-id-type="pmc">plosone</journal-id>
<journal-title-group>
<journal-title>PLOS ONE</journal-title>
</journal-title-group>
<issn pub-type="epub">1932-6203</issn>
<publisher>
<publisher-name>Public Library of Science</publisher-name>
<publisher-loc>San Francisco, CA USA</publisher-loc>
</publisher>
</journal-meta>
<article-meta>
<article-id pub-id-type="doi">10.1371/journal.pone.0267964</article-id>
<article-id pub-id-type="publisher-id">PONE-D-21-29096</article-id>
<article-categories>
<subj-group subj-group-type="heading">
<subject>Research Article</subject>
</subj-group>
<subj-group subj-group-type="Discipline-v3">
<subject>Medicine and health sciences</subject><subj-group><subject>Health care</subject><subj-group><subject>Health care providers</subject><subj-group><subject>Physicians</subject></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>People and places</subject><subj-group><subject>Population groupings</subject><subj-group><subject>Professions</subject><subj-group><subject>Medical personnel</subject><subj-group><subject>Physicians</subject></subj-group></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>Medicine and health sciences</subject><subj-group><subject>Health care</subject><subj-group><subject>Health information technology</subject><subj-group><subject>Electronic medical records</subject></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>Computer and information sciences</subject><subj-group><subject>Information technology</subject><subj-group><subject>Health information technology</subject><subj-group><subject>Electronic medical records</subject></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>Computer and information sciences</subject><subj-group><subject>Artificial intelligence</subject><subj-group><subject>Machine learning</subject></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>Biology and life sciences</subject><subj-group><subject>Neuroscience</subject><subj-group><subject>Cognitive science</subject><subj-group><subject>Cognition</subject><subj-group><subject>Memory</subject><subj-group><subject>Memory recall</subject></subj-group></subj-group></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>Biology and life sciences</subject><subj-group><subject>Neuroscience</subject><subj-group><subject>Learning and memory</subject><subj-group><subject>Memory</subject><subj-group><subject>Memory recall</subject></subj-group></subj-group></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>Engineering and technology</subject><subj-group><subject>Measurement</subject><subj-group><subject>Time measurement</subject></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>Medicine and health sciences</subject><subj-group><subject>Surgical and invasive medical procedures</subject><subj-group><subject>Otolaryngological procedures</subject></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>Medicine and health sciences</subject><subj-group><subject>Health care</subject><subj-group><subject>Primary care</subject></subj-group></subj-group></subj-group><subj-group subj-group-type="Discipline-v3">
<subject>Medicine and health sciences</subject><subj-group><subject>Cardiology</subject></subj-group></subj-group></article-categories>
<title-group>
<article-title>Predicting the target specialty of referral notes to estimate per-specialty wait times with machine learning</article-title>
<alt-title alt-title-type="running-head">Predicting the target specialty of referral notes to estimate per-specialty wait times</alt-title>
</title-group>
<contrib-group>
<contrib contrib-type="author" corresp="yes" xlink:type="simple">
<contrib-id authenticated="true" contrib-id-type="orcid">https://orcid.org/0000-0002-2776-6036</contrib-id>
<name name-style="western">
<surname>Abdalla</surname>
<given-names>Mohamed</given-names>
</name>
<role content-type="http://credit.niso.org/contributor-roles/formal-analysis/">Formal analysis</role>
<role content-type="http://credit.niso.org/contributor-roles/investigation/">Investigation</role>
<role content-type="http://credit.niso.org/contributor-roles/methodology/">Methodology</role>
<role content-type="http://credit.niso.org/contributor-roles/writing-original-draft/">Writing – original draft</role>
<role content-type="http://credit.niso.org/contributor-roles/writing-review-editing/">Writing – review &amp; editing</role>
<xref ref-type="aff" rid="aff001"><sup>1</sup></xref>
<xref ref-type="aff" rid="aff002"><sup>2</sup></xref>
<xref ref-type="corresp" rid="cor001">*</xref>
</contrib>
<contrib contrib-type="author" xlink:type="simple">
<name name-style="western">
<surname>Lu</surname>
<given-names>Hong</given-names>
</name>
<role content-type="http://credit.niso.org/contributor-roles/formal-analysis/">Formal analysis</role>
<xref ref-type="aff" rid="aff003"><sup>3</sup></xref>
</contrib>
<contrib contrib-type="author" xlink:type="simple">
<name name-style="western">
<surname>Pinzaru</surname>
<given-names>Bogdan</given-names>
</name>
<role content-type="http://credit.niso.org/contributor-roles/formal-analysis/">Formal analysis</role>
<xref ref-type="aff" rid="aff003"><sup>3</sup></xref>
</contrib>
<contrib contrib-type="author" xlink:type="simple">
<name name-style="western">
<surname>Rudzicz</surname>
<given-names>Frank</given-names>
</name>
<role content-type="http://credit.niso.org/contributor-roles/investigation/">Investigation</role>
<role content-type="http://credit.niso.org/contributor-roles/methodology/">Methodology</role>
<role content-type="http://credit.niso.org/contributor-roles/writing-original-draft/">Writing – original draft</role>
<role content-type="http://credit.niso.org/contributor-roles/writing-review-editing/">Writing – review &amp; editing</role>
<xref ref-type="aff" rid="aff001"><sup>1</sup></xref>
<xref ref-type="aff" rid="aff002"><sup>2</sup></xref>
<xref ref-type="aff" rid="aff004"><sup>4</sup></xref>
</contrib>
<contrib contrib-type="author" xlink:type="simple">
<name name-style="western">
<surname>Jaakkimainen</surname>
<given-names>Liisa</given-names>
</name>
<role content-type="http://credit.niso.org/contributor-roles/conceptualization/">Conceptualization</role>
<role content-type="http://credit.niso.org/contributor-roles/data-curation/">Data curation</role>
<role content-type="http://credit.niso.org/contributor-roles/funding-acquisition/">Funding acquisition</role>
<role content-type="http://credit.niso.org/contributor-roles/writing-original-draft/">Writing – original draft</role>
<role content-type="http://credit.niso.org/contributor-roles/writing-review-editing/">Writing – review &amp; editing</role>
<xref ref-type="aff" rid="aff003"><sup>3</sup></xref>
<xref ref-type="aff" rid="aff005"><sup>5</sup></xref>
<xref ref-type="aff" rid="aff006"><sup>6</sup></xref>
</contrib>
</contrib-group>
<aff id="aff001"><label>1</label> <addr-line>Department of Computer Science, University of Toronto, Toronto, Canada</addr-line></aff>
<aff id="aff002"><label>2</label> <addr-line>Vector Institute for Artificial Intelligence, Toronto, Canada</addr-line></aff>
<aff id="aff003"><label>3</label> <addr-line>ICES, Toronto, Canada</addr-line></aff>
<aff id="aff004"><label>4</label> <addr-line>Unity Health Toronto, Toronto, Canada</addr-line></aff>
<aff id="aff005"><label>5</label> <addr-line>Department of Family and Community Medicine, University of Toronto, Toronto, Canada</addr-line></aff>
<aff id="aff006"><label>6</label> <addr-line>Department of Family and Community Medicine, Sunnybrook Health Sciences Centre, Toronto, Canada</addr-line></aff>
<contrib-group>
<contrib contrib-type="editor" xlink:type="simple">
<name name-style="western">
<surname>Ostadabbas</surname>
<given-names>Sarah</given-names>
</name>
<role>Editor</role>
<xref ref-type="aff" rid="edit1"/>
</contrib>
</contrib-group>
<aff id="edit1"><addr-line>Northeastern University, UNITED STATES</addr-line></aff>
<author-notes>
<fn fn-type="conflict" id="coi001">
<p>The authors have declared that no competing interests exist.</p>
</fn>
<corresp id="cor001">* E-mail: <email xlink:type="simple">mohamed.abdalla@mail.utoronto.ca</email></corresp>
</author-notes>
<pub-date pub-type="epub">
<day>12</day>
<month>5</month>
<year>2022</year>
</pub-date>
<pub-date pub-type="collection">
<year>2022</year>
</pub-date>
<volume>17</volume>
<issue>5</issue>
<elocation-id>e0267964</elocation-id>
<history>
<date date-type="received">
<day>8</day>
<month>9</month>
<year>2021</year>
</date>
<date date-type="accepted">
<day>19</day>
<month>4</month>
<year>2022</year>
</date>
</history>
<permissions>
<copyright-year>2022</copyright-year>
<copyright-holder>Abdalla et al</copyright-holder>
<license xlink:href="http://creativecommons.org/licenses/by/4.0/" xlink:type="simple">
<license-p>This is an open access article distributed under the terms of the <ext-link ext-link-type="uri" xlink:href="http://creativecommons.org/licenses/by/4.0/" xlink:type="simple">Creative Commons Attribution License</ext-link>, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.</license-p>
</license>
</permissions>
<self-uri content-type="pdf" xlink:href="info:doi/10.1371/journal.pone.0267964"/>
<abstract>
<sec id="sec001">
<title>Background</title>
<p>Currently, in Canada, existing health administrative data and hospital-inputted portal systems are used to measure the wait times to receiving a procedure or therapy after a specialist visit. However, due to missing and inconsistent labelling, estimating the wait time prior to seeing a specialist physician requires costly manual coding to label primary care referral notes.</p>
</sec>
<sec id="sec002">
<title>Methods</title>
<p>In this work, we represent the notes using word-count vectors and develop a logistic regression machine learning model to automatically label the target specialist physician from a primary care referral note. These labels are not available in the administrative system. We also study the effects of note length (measured in number of tokens) and dataset size (measured in number of notes per target specialty) on model performance to help other researchers determine if such an approach may be feasible for them. We then calculate the wait time by linking the specialist type from a primary care referral to a full consultation visit held in Ontario, Canada health administrative data.</p>
</sec>
<sec id="sec003">
<title>Results</title>
<p>For many target specialties, we can reliably (<italic>F</italic><sub>1</sub>Score ≥ 0.70) predict the target specialist type. Doing so enables the automated measurement of wait time from family physician referral to specialist physician visit. Of the six specialties with wait times estimated using both 2008 and 2015 data, two had a substantial increase (defined as a change such that the original value lay outside the 95% confidence interval) in both median and 75th percentile wait times, one had a substantial decrease in both median and 75th percentile wait times, and three has non-substantial increases.</p>
</sec>
<sec id="sec004">
<title>Conclusions</title>
<p>Automating these wait time measurements, which had previously been too time consuming and costly to evaluate at a population level, can be useful for health policy researchers studying the effects of policy decisions on patient access to care.</p>
</sec>
</abstract>
<funding-group>
<award-group id="award001">
<funding-source>
<institution-wrap>
<institution-id institution-id-type="funder-id">http://dx.doi.org/10.13039/501100000024</institution-id>
<institution>Canadian Institutes of Health Research</institution>
</institution-wrap>
</funding-source>
<award-id>FRN:1304180</award-id>
<principal-award-recipient>
<name name-style="western">
<surname>Jaakkimainen</surname>
<given-names>Liisa</given-names>
</name>
</principal-award-recipient>
</award-group>
<funding-statement>This study was supported by ICES, which is funded by an annual grant from the Ontario Ministry of Health (MOH) and the Ministry of Long-Term Care (MLTC). Additional funding was provided by a Canadian Institutes of Health Research (CIHR) Operating Grant (FRN:1304180). This work was also supported by grants from the Natural Sciences and Engineering Research Council of Canada to Frank Rudzicz and a Vanier Canada Graduate Scholarship to Mohamed Abdalla. Frank Rudzicz is supported by a CIFAR Chair in Artificial Intelligence. The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.</funding-statement>
</funding-group>
<counts>
<fig-count count="6"/>
<table-count count="4"/>
<page-count count="17"/>
</counts>
<custom-meta-group>
<custom-meta id="data-availability">
<meta-name>Data Availability</meta-name>
<meta-value>The dataset from this study is held securely in coded form at ICES. While legal data sharing agreements between ICES and data providers (e.g., healthcare organizations and government) prohibit ICES from making the dataset publicly available, access may be granted to those who meet pre-specified criteria for confidential access, available at <ext-link ext-link-type="uri" xlink:href="http://www.ices.on.ca/DAS" xlink:type="simple">www.ices.on.ca/DAS</ext-link>. The full dataset creation plan and underlying analytic code can be obtained by contacting ICES Data &amp; Analytic Services division (ICES DAS) (email: <email xlink:type="simple">das@ices.on.ca</email> or at 1-888-480-1327 (toll-free)). The two datasets used are EMRPC and Ontario Health Insurance Plan Claims Database. ICES is a prescribed entity under Ontario’s Personal Health Information Protection Act (PHIPA). Section 45 of PHIPA authorizes ICES to collect personal health information, without consent, for the purpose of analysis or compiling statistical information with respect to the management of, evaluation or monitoring of, the allocation of resources to or planning for all or part of the health system. As this data was collected without consent of patients, ICES does not allow researchers to make cuts of the data freely available. However, researchers meeting certain requirements are able to apply for access for this data held at ICES.</meta-value>
</custom-meta>
</custom-meta-group>
</article-meta>
</front>
<body>
<sec id="sec005" sec-type="intro">
<title>Introduction</title>
<p>Reliable information about the time spent waiting for health care services is a critical metric for measuring health system performance. Currently, in Canada, existing health administrative data or hospital-inputted portal systems are used to measure the wait times from a specialist physician visit to receiving a procedure or therapy and these measures are regularly displayed on platforms accessible to the public, health care planners, and providers [<xref ref-type="bibr" rid="pone.0267964.ref001">1</xref>, <xref ref-type="bibr" rid="pone.0267964.ref002">2</xref>].</p>
<p>However, patients experience waits prior to seeing a specialist physician and, indeed, surveys conducted in several jurisdictions demonstrate that Canadians experience long wait times in this regard. In 2017, among eleven developed countries surveyed, Canada ranked 10<sup>th</sup> on access and 11<sup>th</sup> on timeliness of health care [<xref ref-type="bibr" rid="pone.0267964.ref003">3</xref>]. The 2019 Fraser Institute survey of Canadian provinces found wait times from family physician (FP) referral to seeing a specialist was 8 weeks which represented an increase from the previous survey [<xref ref-type="bibr" rid="pone.0267964.ref004">4</xref>]. While these surveys provide needed information about wait times, surveys are expensive, time consuming, and the data are subject to recall bias. Alternatively, electronic medical records (EMRs) can be used to arrive at wait time estimates. However, due to poor and missing labels, target specialty physician labelling is currently a task requiring manual human labelling, something we wish to automate to increase the number of referrals labelled and decrease the cost and time associated with conducting such studies.</p>
<p>Over 86% of Canadian FPs now use EMRs for routine clinic care [<xref ref-type="bibr" rid="pone.0267964.ref005">5</xref>]. Alongside is the increased experience of transforming the information held within FP EMRs into data for research and quality improvement initiatives [<xref ref-type="bibr" rid="pone.0267964.ref006">6</xref>–<xref ref-type="bibr" rid="pone.0267964.ref010">10</xref>]. However, using FP EMR data to facilitate real-world and real-time wait times estimation is challenged by its unstructured and free-text format, and lack of trust-worthy labels. Previously, we demonstrated the feasibility of using FP EMR data, linked to health administrative date, to measure specialist wait times [<xref ref-type="bibr" rid="pone.0267964.ref011">11</xref>]. However, this method required abstractors to codify the unstructured EMR data, which limits our ability to provide these data in a timely manner. In this work, we sought to develop a machine learning model to automate the task of these human abstractors: labelling the target specialty of a referral note.</p>
<sec id="sec006">
<title>Related works</title>
<p>In this subsection, we will explore related work. We categorize related work into two categories: 1) work measuring wait-times in healthcare system settings, and 2) work performing text classification on referral notes or other types of clinical notes.</p>
<p>Traditionally, work measuring wait-times in healthcare systems do not engage in machine learning prediction to enable the measurement. This is because either the required labels can be found within the administrative data [<xref ref-type="bibr" rid="pone.0267964.ref012">12</xref>, <xref ref-type="bibr" rid="pone.0267964.ref013">13</xref>], or because they have used manual effort to label the notes [<xref ref-type="bibr" rid="pone.0267964.ref011">11</xref>].</p>
<p>There is work which develops machine learning applications that reduce wait-times [<xref ref-type="bibr" rid="pone.0267964.ref014">14</xref>], or attempt to predict length-of-stay [<xref ref-type="bibr" rid="pone.0267964.ref015">15</xref>] (which is related to patient wait-times, though in a referral setting–the focus of our work). Gonçalves <italic>et al</italic>. [<xref ref-type="bibr" rid="pone.0267964.ref016">16</xref>] attempted to predict patient wait-times between triage to observation. Lin et al. [<xref ref-type="bibr" rid="pone.0267964.ref017">17</xref>] attempt to predict wait-times for patients for Pediatric Ophthalmology outpatient clinic using patient characteristics and other relevant features. Outside of the medical domain (e.g., business or government offices) other work has built models to predict expected wait-times given historical data [<xref ref-type="bibr" rid="pone.0267964.ref018">18</xref>, <xref ref-type="bibr" rid="pone.0267964.ref019">19</xref>].</p>
<p>We have been unable to find other works which used machine learning on free text clinical notes to label the target specialty of referral notes to enable wait-time estimation–most machine learning work attempts to predict the wait-time directly. Bauder <italic>et al</italic>. [<xref ref-type="bibr" rid="pone.0267964.ref020">20</xref>] attempted to classify medical provider specialties from their billed codes (a different mode of input) to detect fraud (a different goal).</p>
<p>There is a large body of work applying machine learning to clinical notes to perform classification. Amongst the many classification tasks are identification of patients with pathologies [<xref ref-type="bibr" rid="pone.0267964.ref021">21</xref>], prediction of admission [<xref ref-type="bibr" rid="pone.0267964.ref022">22</xref>], and predicting high-cost users [<xref ref-type="bibr" rid="pone.0267964.ref023">23</xref>] among many other tasks (e.g., medical subdomain classification [<xref ref-type="bibr" rid="pone.0267964.ref024">24</xref>]). To perform the classification these works train and evaluate a variety of machine learning models such as: Logistic Regression [<xref ref-type="bibr" rid="pone.0267964.ref021">21</xref>–<xref ref-type="bibr" rid="pone.0267964.ref023">23</xref>], Random Forests [<xref ref-type="bibr" rid="pone.0267964.ref021">21</xref>, <xref ref-type="bibr" rid="pone.0267964.ref022">22</xref>], Gradient-boosted models [<xref ref-type="bibr" rid="pone.0267964.ref022">22</xref>], Support Vector Machines [<xref ref-type="bibr" rid="pone.0267964.ref025">25</xref>], Shallow Neural Networks [<xref ref-type="bibr" rid="pone.0267964.ref021">21</xref>], and deep neural networks [<xref ref-type="bibr" rid="pone.0267964.ref022">22</xref>]. The results of which model performs better is heavily dependent on the dataset and task at hand.</p>
</sec>
</sec>
<sec id="sec007" sec-type="materials|methods">
<title>Methods</title>
<p>In this study, we sought to develop an automated method to identify the target specialist physician type from referral notes using machine learning (ML), Step 1 in <xref ref-type="fig" rid="pone.0267964.g001">Fig 1</xref>. We test the performance of our trained models on various target specialties and explore how the characteristics of the referral notes affect classification performance. For the specialties with acceptable performance (defined as a precision of at least 0.70 and a sensitivity of at least 0.30), we present the calculated wait times from FP referral to target specialist visit, Step 2 in <xref ref-type="fig" rid="pone.0267964.g001">Fig 1</xref>. We also compare estimated wait times against the manually curated results from 2008 [<xref ref-type="bibr" rid="pone.0267964.ref011">11</xref>], and the wait times produced by changing the confidence threshold.</p>
<fig id="pone.0267964.g001" position="float">
<object-id pub-id-type="doi">10.1371/journal.pone.0267964.g001</object-id>
<label>Fig 1</label>
<caption>
<title>A simplified visualization of a patient’s healthcare timeline.</title>
<p>The time between specialist visit and procedure is known because administrative records are accurate. We show our methodology in two steps: 1) Using machine learning to predict the target specialty of referral notes, and 2) Measuring the wait time between referral and consultation visit of pair specialties.</p>
</caption>
<graphic mimetype="image" position="float" xlink:href="info:doi/10.1371/journal.pone.0267964.g001" xlink:type="simple"/>
</fig>
<sec id="sec008">
<title>Dataset</title>
<sec id="sec009">
<title>Referral notes and administrative data</title>
<p>We use FP EMR data linked to Ontario health administrative data held at ICES called EMRPC. ICES is an independent non-profit research institute and has legal status under Ontario’s health information privacy law that allows it to collect and analyze health care and demographic data, without consent, for health system evaluation and improvement [<xref ref-type="bibr" rid="pone.0267964.ref026">26</xref>]. Projects that use data collected by ICES under section 45 of PHIPA, and use no other data, are exempt from REB review. The use of the data in this project is authorized under section 45 and approved by ICES’ Privacy and Legal Office. EMRPC collects EMR data from FPs distributed across Ontario (currently just over 350,000 rostered patients from 403 FPs in 46 geographically distinct clinics) [<xref ref-type="bibr" rid="pone.0267964.ref027">27</xref>, <xref ref-type="bibr" rid="pone.0267964.ref028">28</xref>]. EMRPC extracts the entire EMR of FP patients, including their cumulative patient profile (CPP), progress notes, consultation notes, radiological and laboratory tests, hospital and emergency discharge notes, and referrals. We used free text in referral notes to predict target specialty physician and used physician claims in the Ontario Health Insurance Plan (OHIP) database to determine when the specialist visits happened. These datasets were linked using unique encoded identifiers and analyzed at ICES.</p>
<p>Our study cohort includes patients with a valid health card number and date of birth who had at least one FP referral made in 2015 (N = 56,285). Patients are included if their family physician had signed a data sharing agreement with ICES, had an active practice, and were completely utilizing the EMR in their practice.</p>
<p>We use the free text of the referral notes as input to our classification model. However, as the labels associated with the referral notes in the EMR are incomplete and untrustworthy, we had to generate the “gold standard” labels (i.e., the target specialist for each referral note). To do this, rather than relying on manual annotation of a random subset of referral notes (a costly endeavor), we use the OHIP full consultation claims (i.e., billing data) to generate gold-standard labels. To ensure that we correctly paired referral notes with their correct target specialist for our gold labels, we only consider patients who have only one referral note and one specialist visit in 2015 (N≈16,840). This is because considering patients with more than a single referral or a single specialist visit causes issues because of the possible combinations of assignments (e.g., a patient with three referrals and three different specialist visits can have up to 6 different pairings between each referral note and specialist visit). Having only one referral and one specialist visit makes it increasingly likely that the referral was to the visited specialist. <xref ref-type="table" rid="pone.0267964.t001">Table 1</xref> presents the number of notes in the training and testing set for each specialist type.</p>
<table-wrap id="pone.0267964.t001" position="float">
<object-id pub-id-type="doi">10.1371/journal.pone.0267964.t001</object-id>
<label>Table 1</label> <caption><title>The number of notes per specialist type.</title> <p>Notes with fewer than 6 tokens were not counted as they were not informative, per manual checking. The specialty “internal” was also removed as the types of medical consultation done by an internal specialist overlaps with many individual specific specialties such as cardiology, gastroenterology, among others. If present, the names within parentheses represent how the specialty is represented in later figures.</p></caption>
<alternatives>
<graphic id="pone.0267964.t001g" mimetype="image" position="float" xlink:href="info:doi/10.1371/journal.pone.0267964.t001" xlink:type="simple"/>
<table>
<colgroup>
<col align="left" valign="middle"/>
<col align="left" valign="middle"/>
</colgroup>
<thead>
<tr>
<th align="left">Specialist Type</th>
<th align="left">Number of Notes</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">General Surgery</td>
<td align="center">2351</td>
</tr>
<tr>
<td align="left">Gastroenterology</td>
<td align="center">1714</td>
</tr>
<tr>
<td align="left">Cardiology</td>
<td align="center">489</td>
</tr>
<tr>
<td align="left">Obstetrics and Gynecology (OBGYN)</td>
<td align="center">1958</td>
</tr>
<tr>
<td align="left">Plastic Surgery (Plastic)</td>
<td align="center">980</td>
</tr>
<tr>
<td align="left">Otolaryngology (ENT)</td>
<td align="center">1931</td>
</tr>
<tr>
<td align="left">Dermatology</td>
<td align="center">3014</td>
</tr>
<tr>
<td align="left">Neurology</td>
<td align="center">509</td>
</tr>
<tr>
<td align="left">Urology</td>
<td align="center">948</td>
</tr>
<tr>
<td align="left">Paediatrics</td>
<td align="center">148</td>
</tr>
<tr>
<td align="left">Rheumatology</td>
<td align="center">296</td>
</tr>
<tr>
<td align="left">Ophthalmology</td>
<td align="center">475</td>
</tr>
<tr>
<td align="left">Physical medicine</td>
<td align="center">156</td>
</tr>
<tr>
<td align="left">Haematology</td>
<td align="center">92</td>
</tr>
<tr>
<td align="left">Genetics</td>
<td align="center">15</td>
</tr>
<tr>
<td align="left">Endocrinology</td>
<td align="center">219</td>
</tr>
<tr>
<td align="left">Family Medicine</td>
<td align="center">137</td>
</tr>
<tr>
<td align="left">Immunology</td>
<td align="center">236</td>
</tr>
<tr>
<td align="left">Psychiatry</td>
<td align="center">241</td>
</tr>
<tr>
<td align="left">Nephrology</td>
<td align="center">65</td>
</tr>
<tr>
<td align="left">Geriatrics</td>
<td align="center">32</td>
</tr>
<tr>
<td align="left">Respiratory</td>
<td align="center">220</td>
</tr>
<tr>
<td align="left">Infectious disease</td>
<td align="center">24</td>
</tr>
<tr>
<td align="left">Anesthesia</td>
<td align="center">&lt;5<xref ref-type="table-fn" rid="t001fn001">*</xref></td>
</tr>
</tbody>
</table>
</alternatives>
<table-wrap-foot>
<fn id="t001fn001"><p>*ICES privacy guidelines require us to suppress small values.</p></fn>
</table-wrap-foot>
</table-wrap>
</sec>
</sec>
<sec id="sec010">
<title>Machine-learning pipeline for classification</title>
<p>The machine learning pipeline introduced in this section is developed and evaluated on the subset of data described above using the Python package Scikit-learn [<xref ref-type="bibr" rid="pone.0267964.ref029">29</xref>]. The machine learning pipeline follows these steps:</p>
<list list-type="order">
<list-item><p>Preprocessing.</p></list-item>
<list-item><p>Vectorization</p></list-item>
<list-item><p>Model training and selection.</p></list-item>
</list>
<sec id="sec011">
<title>Preprocessing</title>
<p>For preprocessing the referral notes, we convert all the text to lowercase and remove all punctuation and numbers. Manual examination of notes with fewer than 6 tokens in total resulted in the observation that most of these notes were note informative; most of these notes were not true referral notes or just included a de-identified name and a date (i.e., information which is not useful for classification). As such, we removed notes with fewer than 6 tokens in our dataset. The fact that these notes are not informative for prediction is supported by our experiment on the effect of length of note on performance below. We experiment with stemming [<xref ref-type="bibr" rid="pone.0267964.ref030">30</xref>] and not-stemming each token in the referral notes using the Snowball stemmer implemented in the Python package NLTK [<xref ref-type="bibr" rid="pone.0267964.ref031">31</xref>].</p>
</sec>
<sec id="sec012">
<title>Vectorization</title>
<p>To convert the free-text of clinical notes into numeric vectors amenable to machine learning, we experiment between word count vectors and term-frequency inverse document frequency (tf-idf) vectors [<xref ref-type="bibr" rid="pone.0267964.ref032">32</xref>]. Word count vectors represent a document using a dense numeric vector where each number in the vector is the count of the number of occurrences of a given word type (one per index) in the document. We consider all individual tokens (i.e., ‘unigrams’) that occurred at least 5 times. The reason for considering all tokens is that we did not want to engage in the act of creating a specialized vocabulary per specialty (this approach is supposed to provide an alternative to costly manually labelling). The reason behind excluding tokens that did not occur at least 5 times across all notes is because such tokens tend to be rare-misspellings and would be useful in helping the model generalize. This is also standard operating procedure in text classification. Tf-idf vectors are similar to count vectors in that each index in the vector refers to an individual word type; however, rather than simply representing the number of occurrences, this approach adjusts how often each word occurs across all <italic>other</italic> notes to adjust for words that occur frequently in all documents (e.g., functional words such as <italic>‘the</italic>’<italic>)</italic>. For each preprocessing type (i.e., stemming and not stemming), we experiment with both types of vectorization.</p>
</sec>
<sec id="sec013">
<title>Model training</title>
<p>We experiment with two different classification algorithms: lasso and ridge logistic regression. In the Related Works section, we demonstrate that there are a wide variety of models that can be used to perform such classification. We selected these two variants of logistic regression for multiple reasons: 1) previous literature has shown logistic regression out-performs other classifiers on datasets of similar size [<xref ref-type="bibr" rid="pone.0267964.ref033">33</xref>–<xref ref-type="bibr" rid="pone.0267964.ref035">35</xref>], 2) it is a simple, yet effective, method that can easily be replicated by other sites who may not have the required computational power to apply more demanding approaches, 3) logistic regression models tend to be well calibrated (without external modification unlike deeper neural networks [<xref ref-type="bibr" rid="pone.0267964.ref036">36</xref>]) thus enabling our later analysis, 4) the weights used by logistic regression models are interpretable and can be used for further analysis [<xref ref-type="bibr" rid="pone.0267964.ref037">37</xref>]. For both, we experiment with different hyperparameters (e.g., amount of regularization). The complete set of possible training combinations attempted in this task is shown in <xref ref-type="table" rid="pone.0267964.t002">Table 2</xref>. For each of the combinations listed in <xref ref-type="table" rid="pone.0267964.t002">Table 2</xref>, we use 5-fold cross-validation to measure performance. Each trained classifier was trained as a binary classifier learning to predict only a single specialty (i.e., one-vs-rest).</p>
<table-wrap id="pone.0267964.t002" position="float">
<object-id pub-id-type="doi">10.1371/journal.pone.0267964.t002</object-id>
<label>Table 2</label> <caption><title>All possible options for each step of the machine learning pipeline.</title> <p>All possible combinations of these options were trained for each target specialty (for a total of 80 models per specialty).</p></caption>
<alternatives>
<graphic id="pone.0267964.t002g" mimetype="image" position="float" xlink:href="info:doi/10.1371/journal.pone.0267964.t002" xlink:type="simple"/>
<table>
<colgroup>
<col align="left" valign="middle"/>
<col align="left" valign="middle"/>
<col align="left" valign="middle"/>
<col align="left" valign="middle"/>
<col align="left" valign="middle"/>
</colgroup>
<thead>
<tr>
<th align="center">Preprocessing</th>
<th align="center">Vectorization</th>
<th align="center">Model Type</th>
<th align="center">Regularization</th>
<th align="center">Class Weight</th>
</tr>
</thead>
<tbody>
<tr>
<td align="center">No stemming</td>
<td align="center">Count vectors</td>
<td align="center">Ridge Regression</td>
<td align="center">0.001</td>
<td align="center">‘None’</td>
</tr>
<tr>
<td align="center">Stemming</td>
<td align="center">Tf-idf vectors</td>
<td align="center">Lasso Regression</td>
<td align="center">0.01</td>
<td align="center">‘Balanced’</td>
</tr>
<tr>
<td align="center" rowspan="3"/>
<td align="center" rowspan="3"/>
<td align="center" rowspan="3"/>
<td align="center">0.1</td>
<td align="center" rowspan="3"/>
</tr>
<tr>
<td align="center">1</td>
</tr>
<tr>
<td align="center">10</td>
</tr>
</tbody>
</table>
</alternatives>
</table-wrap>
</sec>
</sec>
</sec>
<sec id="sec014" sec-type="results">
<title>Results</title>
<p>For each target specialty presented in <xref ref-type="table" rid="pone.0267964.t001">Table 1</xref>, we train multiple models with various settings and hyper-parameters; all possible combinations are presented in <xref ref-type="table" rid="pone.0267964.t002">Table 2</xref>. Depending on the target application, different performance metric optimizations may be desired (e.g., high recall at the cost of precision) [<xref ref-type="bibr" rid="pone.0267964.ref038">38</xref>, <xref ref-type="bibr" rid="pone.0267964.ref039">39</xref>]. To provide a holistic overview of model performance, we select and present the best model performance based on three optimization schemes:</p>
<list list-type="order">
<list-item><p>Choosing the model with the highest precision/positive predictive value (PPV) while ensuring a recall (alternatively: sensitivity) of at least 0.3. When no set of hyperparameters result in a model with a recall of at least 0.3, the model with highest precision is presented.</p></list-item>
<list-item><p>Choosing the model with the highest recall while ensuring a precision of at least 0.3. When no set of hyperparameters result in a model with a minimum precision of at least 0.3, the model with the highest recall is presented.</p></list-item>
<list-item><p>Choosing the model with the highest <italic>F</italic><sub>1</sub>Score.</p></list-item>
</list>
<p>We ensure a lower limit on the recall or precision for the first two optimization schemes because for most specialties there are a set of hyperparameters which result in near perfect performance of one metric at the extreme cost of the other (e.g., PPV: 0.97, Sensitivity: 0.01). However, these models are not likely to be useful in the clinical setting. We evaluate the performance of the models using 5-fold cross-validation and present the results in <xref ref-type="table" rid="pone.0267964.t003">Table 3</xref>.</p>
<table-wrap id="pone.0267964.t003" position="float">
<object-id pub-id-type="doi">10.1371/journal.pone.0267964.t003</object-id>
<label>Table 3</label> <caption><title>Precision, recall, and <italic>F</italic><sub>1</sub>Score for each optimization for each specialty found in <xref ref-type="table" rid="pone.0267964.t001">Table 1</xref>.</title> <p>We do not present evaluate any models for the “aesthesia” class as there were fewer examples than folds. Specialties which are bolded pass our performance threshold.</p></caption>
<alternatives>
<graphic id="pone.0267964.t003g" mimetype="image" position="float" xlink:href="info:doi/10.1371/journal.pone.0267964.t003" xlink:type="simple"/>
<table>
<colgroup>
<col align="left" valign="middle"/>
<col align="left" valign="middle"/>
<col align="left" valign="middle"/>
<col align="left" valign="middle"/>
<col align="left" valign="middle"/>
<col align="left" valign="middle"/>
<col align="left" valign="middle"/>
<col align="left" valign="middle"/>
<col align="left" valign="middle"/>
<col align="left" valign="middle"/>
</colgroup>
<thead>
<tr>
<th align="left">Specialist Type</th>
<th align="center" colspan="3">Models with Recall at least 0.3</th>
<th align="center" colspan="3">Models with Precision at least 0.3</th>
<th align="center" colspan="3">Models with Highest <italic>F</italic><sub>1</sub>Score</th>
</tr>
<tr>
<th align="left"/>
<th align="center">PPV</th>
<th align="center">SEN</th>
<th align="center"><italic>F</italic><sub>1</sub></th>
<th align="center">PPV</th>
<th align="center">SEN</th>
<th align="center"><italic>F</italic><sub>1</sub></th>
<th align="center">PPV</th>
<th align="center">SEN</th>
<th align="center"><italic>F</italic><sub>1</sub></th>
</tr>
</thead>
<tbody>
<tr>
<td align="left"><bold>General surgery</bold></td>
<td align="char" char="."><bold>0.72</bold></td>
<td align="char" char="."><bold>0.31</bold></td>
<td align="char" char="."><bold>0.42</bold></td>
<td align="char" char=".">0.49</td>
<td align="char" char=".">0.73</td>
<td align="char" char=".">0.58</td>
<td align="char" char=".">0.49</td>
<td align="char" char=".">0.73</td>
<td align="char" char=".">0.58</td>
</tr>
<tr>
<td align="left">Gastroenterology</td>
<td align="char" char=".">0.66</td>
<td align="char" char=".">0.42</td>
<td align="char" char=".">0.51</td>
<td align="char" char=".">0.42</td>
<td align="char" char=".">0.81</td>
<td align="char" char=".">0.55</td>
<td align="char" char=".">0.47</td>
<td align="char" char=".">0.80</td>
<td align="char" char=".">0.59</td>
</tr>
<tr>
<td align="left"><bold>Cardiology</bold></td>
<td align="char" char="."><bold>0.83</bold></td>
<td align="char" char="."><bold>0.41</bold></td>
<td align="char" char="."><bold>0.55</bold></td>
<td align="char" char=".">0.31</td>
<td align="char" char=".">0.80</td>
<td align="char" char=".">0.43</td>
<td align="char" char=".">0.72</td>
<td align="char" char=".">0.53</td>
<td align="char" char=".">0.61</td>
</tr>
<tr>
<td align="left"><bold>Obstetrics/Gynecology</bold></td>
<td align="char" char="."><bold>0.95</bold></td>
<td align="char" char="."><bold>0.49</bold></td>
<td align="char" char="."><bold>0.64</bold></td>
<td align="char" char=".">0.72</td>
<td align="char" char=".">0.83</td>
<td align="char" char=".">0.77</td>
<td align="char" char=".">0.76</td>
<td align="char" char=".">0.82</td>
<td align="char" char=".">0.79</td>
</tr>
<tr>
<td align="left">Plastic Surgery</td>
<td align="char" char=".">0.57</td>
<td align="char" char=".">0.41</td>
<td align="char" char=".">0.47</td>
<td align="char" char=".">0.39</td>
<td align="char" char=".">0.71</td>
<td align="char" char=".">0.49</td>
<td align="char" char=".">0.46</td>
<td align="char" char=".">0.59</td>
<td align="char" char=".">0.51</td>
</tr>
<tr>
<td align="left"><bold>ENT</bold></td>
<td align="char" char="."><bold>0.98</bold></td>
<td align="char" char="."><bold>0.42</bold></td>
<td align="char" char="."><bold>0.56</bold></td>
<td align="char" char=".">0.68</td>
<td align="char" char=".">0.82</td>
<td align="char" char=".">0.74</td>
<td align="char" char=".">0.85</td>
<td align="char" char=".">0.72</td>
<td align="char" char=".">0.78</td>
</tr>
<tr>
<td align="left"><bold>Dermatology</bold></td>
<td align="char" char="."><bold>0.85</bold></td>
<td align="char" char="."><bold>0.51</bold></td>
<td align="char" char="."><bold>0.62</bold></td>
<td align="char" char=".">0.66</td>
<td align="char" char=".">0.83</td>
<td align="char" char=".">0.74</td>
<td align="char" char=".">0.66</td>
<td align="char" char=".">0.83</td>
<td align="char" char=".">0.74</td>
</tr>
<tr>
<td align="left"><bold>Neurology</bold></td>
<td align="char" char="."><bold>0.82</bold></td>
<td align="char" char="."><bold>0.33</bold></td>
<td align="char" char="."><bold>0.46</bold></td>
<td align="char" char=".">0.50</td>
<td align="char" char=".">0.75</td>
<td align="char" char=".">0.60</td>
<td align="char" char=".">0.55</td>
<td align="char" char=".">0.68</td>
<td align="char" char=".">0.61</td>
</tr>
<tr>
<td align="left"><bold>Urology</bold></td>
<td align="char" char="."><bold>0.91</bold></td>
<td align="char" char="."><bold>0.52</bold></td>
<td align="char" char="."><bold>0.65</bold></td>
<td align="char" char=".">0.49</td>
<td align="char" char=".">0.82</td>
<td align="char" char=".">0.61</td>
<td align="char" char=".">0.79</td>
<td align="char" char=".">0.65</td>
<td align="char" char=".">0.71</td>
</tr>
<tr>
<td align="left">Paediatrics</td>
<td align="char" char=".">0.38</td>
<td align="char" char=".">0.38</td>
<td align="char" char=".">0.36</td>
<td align="char" char=".">0.33</td>
<td align="char" char=".">0.54</td>
<td align="char" char=".">0.38</td>
<td align="char" char=".">0.33</td>
<td align="char" char=".">0.54</td>
<td align="char" char=".">0.38</td>
</tr>
<tr>
<td align="left"><bold>Rheumatology</bold></td>
<td align="char" char="."><bold>0.78</bold></td>
<td align="char" char="."><bold>0.38</bold></td>
<td align="char" char="."><bold>0.51</bold></td>
<td align="char" char=".">0.35</td>
<td align="char" char=".">0.61</td>
<td align="char" char=".">0.44</td>
<td align="char" char=".">0.78</td>
<td align="char" char=".">0.38</td>
<td align="char" char=".">0.51</td>
</tr>
<tr>
<td align="left">Ophthalmology</td>
<td align="char" char=".">0.51</td>
<td align="char" char=".">0.41</td>
<td align="char" char=".">0.39</td>
<td align="char" char=".">0.31</td>
<td align="char" char=".">0.64</td>
<td align="char" char=".">0.37</td>
<td align="char" char=".">0.37</td>
<td align="char" char=".">0.57</td>
<td align="char" char=".">0.39</td>
</tr>
<tr>
<td align="left">Physical medicine</td>
<td align="char" char=".">0.25</td>
<td align="char" char=".">0.33</td>
<td align="char" char=".">0.28</td>
<td align="char" char=".">0.32</td>
<td align="char" char=".">0.13</td>
<td align="char" char=".">0.18</td>
<td align="char" char=".">0.23</td>
<td align="char" char=".">0.53</td>
<td align="char" char=".">0.32</td>
</tr>
<tr>
<td align="left">Haematology</td>
<td align="char" char=".">0.25</td>
<td align="char" char=".">0.33</td>
<td align="char" char=".">0.21</td>
<td align="char" char=".">0.36</td>
<td align="char" char=".">0.21</td>
<td align="char" char=".">0.22</td>
<td align="char" char=".">0.25</td>
<td align="char" char=".">0.33</td>
<td align="char" char=".">0.21</td>
</tr>
<tr>
<td align="left">Genetics</td>
<td align="char" char=".">0.32</td>
<td align="char" char=".">0.4</td>
<td align="char" char=".">0.25</td>
<td align="char" char=".">0.32</td>
<td align="char" char=".">0.4</td>
<td align="char" char=".">0.25</td>
<td align="char" char=".">0.80</td>
<td align="char" char=".">0.27</td>
<td align="char" char=".">0.40</td>
</tr>
<tr>
<td align="left">Endocrinology</td>
<td align="char" char=".">0.62</td>
<td align="char" char=".">0.31</td>
<td align="char" char=".">0.41</td>
<td align="char" char=".">0.31</td>
<td align="char" char=".">0.63</td>
<td align="char" char=".">0.41</td>
<td align="char" char=".">0.43</td>
<td align="char" char=".">0.52</td>
<td align="char" char=".">0.46</td>
</tr>
<tr>
<td align="left">Family</td>
<td align="char" char=".">0.15</td>
<td align="char" char=".">0.31</td>
<td align="char" char=".">0.19</td>
<td align="char" char=".">0.32</td>
<td align="char" char=".">0.13</td>
<td align="char" char=".">0.19</td>
<td align="char" char=".">0.24</td>
<td align="char" char=".">0.28</td>
<td align="char" char=".">0.25</td>
</tr>
<tr>
<td align="left">Immunology</td>
<td align="char" char=".">0.65</td>
<td align="char" char=".">0.35</td>
<td align="char" char=".">0.44</td>
<td align="char" char=".">0.35</td>
<td align="char" char=".">0.57</td>
<td align="char" char=".">0.38</td>
<td align="char" char=".">0.57</td>
<td align="char" char=".">0.42</td>
<td align="char" char=".">0.46</td>
</tr>
<tr>
<td align="left">Psychiatry</td>
<td align="char" char=".">0.54</td>
<td align="char" char=".">0.38</td>
<td align="char" char=".">0.38</td>
<td align="char" char=".">0.34</td>
<td align="char" char=".">0.65</td>
<td align="char" char=".">0.40</td>
<td align="char" char=".">0.34</td>
<td align="char" char=".">0.65</td>
<td align="char" char=".">0.40</td>
</tr>
<tr>
<td align="left"><bold>Nephrology</bold></td>
<td align="char" char="."><bold>0.72</bold></td>
<td align="char" char="."><bold>0.32</bold></td>
<td align="char" char="."><bold>0.43</bold></td>
<td align="char" char=".">0.38</td>
<td align="char" char=".">0.63</td>
<td align="char" char=".">0.33</td>
<td align="char" char=".">0.55</td>
<td align="char" char=".">0.42</td>
<td align="char" char=".">0.46</td>
</tr>
<tr>
<td align="left">Geriatrics</td>
<td align="char" char=".">0.15</td>
<td align="char" char=".">0.34</td>
<td align="char" char=".">0.18</td>
<td align="char" char=".">0.00</td>
<td align="char" char=".">0.65</td>
<td align="char" char=".">0.01</td>
<td align="char" char=".">0.25</td>
<td align="char" char=".">0.28</td>
<td align="char" char=".">0.24</td>
</tr>
<tr>
<td align="left">Respiratory</td>
<td align="char" char=".">0.59</td>
<td align="char" char=".">0.32</td>
<td align="char" char=".">0.41</td>
<td align="char" char=".">0.38</td>
<td align="char" char=".">0.6</td>
<td align="char" char=".">0.44</td>
<td align="char" char=".">0.40</td>
<td align="char" char=".">0.57</td>
<td align="char" char=".">0.44</td>
</tr>
<tr>
<td align="left">Infectious disease</td>
<td align="char" char=".">0.01</td>
<td align="char" char=".">0.3</td>
<td align="char" char=".">0.01</td>
<td align="char" char=".">0.01</td>
<td align="char" char=".">0.67</td>
<td align="char" char=".">0.01</td>
<td align="char" char=".">0.05</td>
<td align="char" char=".">0.04</td>
<td align="char" char=".">0.04</td>
</tr>
</tbody>
</table>
</alternatives>
</table-wrap>
<p>For our specific use-case (i.e., calculating average wait time from family physician referral to first specialist visit), in collaboration with clinical specialists, we determine that precision matters more than recall. More specifically, in-order to be confident with the wait time estimates made from our automated predictions, models need to achieve a precision of at least 0.70 and a recall of at least 0.30. This decision narrows the number of specialties that can be analyzed down to nine. <xref ref-type="table" rid="pone.0267964.t004">Table 4</xref> presents a more in-depth evaluation of the performance of the best models for the selected specialties.</p>
<table-wrap id="pone.0267964.t004" position="float">
<object-id pub-id-type="doi">10.1371/journal.pone.0267964.t004</object-id>
<label>Table 4</label> <caption><title>Precision, recall, specificity, negative predictive value (NPV), and Brier score loss for the models which we used for prediction.</title> <p>The standard deviations for each measurement are presented between parentheses.</p></caption>
<alternatives>
<graphic id="pone.0267964.t004g" mimetype="image" position="float" xlink:href="info:doi/10.1371/journal.pone.0267964.t004" xlink:type="simple"/>
<table>
<colgroup>
<col align="left" valign="middle"/>
<col align="left" valign="middle"/>
<col align="left" valign="middle"/>
<col align="left" valign="middle"/>
<col align="left" valign="middle"/>
<col align="left" valign="middle"/>
</colgroup>
<thead>
<tr>
<th align="left">Specialist Type</th>
<th align="center">Precision (Std.)</th>
<th align="center">Recall (Std.)</th>
<th align="center">Specificity (Std.)</th>
<th align="center">NPV (Std.)</th>
<th align="center">Brier Loss (Std.)</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">General surgery</td>
<td align="center">0.72 (0.09)</td>
<td align="center">0.31 (0.11)</td>
<td align="center">0.98 (0.02)</td>
<td align="center">0.89 (0.01)</td>
<td align="center">0.09 (0.01)</td>
</tr>
<tr>
<td align="left">Cardiology</td>
<td align="center">0.83 (0.10)</td>
<td align="center">0.41 (0.05)</td>
<td align="center">1.00 (0.00)</td>
<td align="center">0.98 (0.00)</td>
<td align="center">0.02 (0.00)</td>
</tr>
<tr>
<td align="left">OBGYN</td>
<td align="center">0.95 (0.03)</td>
<td align="center">0.49 (0.12)</td>
<td align="center">1.00 (0.00)</td>
<td align="center">0.93 (0.01)</td>
<td align="center">0.05 (0.01)</td>
</tr>
<tr>
<td align="left">ENT</td>
<td align="center">0.98 (0.01)</td>
<td align="center">0.42 (0.08)</td>
<td align="center">1.00 (0.00)</td>
<td align="center">0.93 (0.01)</td>
<td align="center">0.05 (0.01)</td>
</tr>
<tr>
<td align="left">Dermatology</td>
<td align="center">0.85 (0.06)</td>
<td align="center">0.51 (0.17)</td>
<td align="center">0.98 (0.01)</td>
<td align="center">0.90 (0.03)</td>
<td align="center">0.07 (0.02)</td>
</tr>
<tr>
<td align="left">Neurology</td>
<td align="center">0.82 (0.09)</td>
<td align="center">0.33 (0.09)</td>
<td align="center">1.00 (0.00)</td>
<td align="center">0.98 (0.00)</td>
<td align="center">0.02 (0.00)</td>
</tr>
<tr>
<td align="left">Urology</td>
<td align="center">0.91 (0.02)</td>
<td align="center">0.52 (0.13)</td>
<td align="center">1.00 (0.00)</td>
<td align="center">0.97 (0.01)</td>
<td align="center">0.02 (0.01)</td>
</tr>
<tr>
<td align="left">Rheumatology</td>
<td align="center">0.78 (0.09)</td>
<td align="center">0.38 (0.08)</td>
<td align="center">1.00 (0.00)</td>
<td align="center">0.99 (0.00)</td>
<td align="center">0.01 (0.00)</td>
</tr>
<tr>
<td align="left">Nephrology</td>
<td align="center">0.72 (0.10)</td>
<td align="center">0.32 (0.15)</td>
<td align="center">1.00 (0.00)</td>
<td align="center">1.00 (0.00)</td>
<td align="center">0.00 (0.00)</td>
</tr>
</tbody>
</table>
</alternatives>
</table-wrap>
<p>As observed in <xref ref-type="table" rid="pone.0267964.t003">Table 3</xref>, there is a large variation in performance between specialties. To explore the possible causes of this variation, we study the effects of: 1) the number of training examples on performance, and 2) the number of tokens in a note on classification accuracy.</p>
<sec id="sec015">
<title>Effect of number of training examples on performance</title>
<p>First, we explore the relationship between number of training examples and performance. <xref ref-type="fig" rid="pone.0267964.g002">Fig 2</xref> plots the <italic>F</italic><sub>1</sub>Score on the y-axis and the number of examples on the x-axis. We observe that more training examples generally means better performance. However, for certain specialties (e.g., nephrology), good performance was achieved without many examples. On the other hand, there are specialties with many examples (i.e., notes) that perform poorly (when compared to other specialties with a similar number of notes), such as general surgery.</p>
<fig id="pone.0267964.g002" position="float">
<object-id pub-id-type="doi">10.1371/journal.pone.0267964.g002</object-id>
<label>Fig 2</label>
<caption>
<title>The <italic>F</italic><sub>1</sub>Score as a function of the number of training examples.</title>
<p>In this figure we present the <italic>F</italic><sub>1</sub> score from the model with the highest <italic>F</italic><sub>1</sub> score for each specialty (the last column of <xref ref-type="table" rid="pone.0267964.t003">Table 3</xref>) against the number of training (<xref ref-type="table" rid="pone.0267964.t001">Table 1</xref>).</p>
</caption>
<graphic mimetype="image" position="float" xlink:href="info:doi/10.1371/journal.pone.0267964.g002" xlink:type="simple"/>
</fig>
<p>These observations can likely be explained by examining the uniqueness of a specialty. A specialty that examines the same body parts, and shares procedures and terms relevant to other specialties is likely to be harder to classify than specialties that overlap less with other specialties (e.g., OGBYN).</p>
</sec>
<sec id="sec016">
<title>Effect of length of note on performance</title>
<p>In this section, we examined the relationships between classification performance (accuracy) and length of referral note (as measured by number of tokens). <xref ref-type="fig" rid="pone.0267964.g003">Fig 3</xref> plots the number of tokens in a referral note against the average accuracy of models on referral notes averaged across all specialties. For the best model of each specialty, we individually calculated the accuracy of the model on all the notes of a particular length (i.e., number of tokens). For example, if there are 5 classifiers and 10 notes of a particular size: we would separately calculate the accuracy of each of those classifiers on the 10 notes (resulting in 10 accuracy values). We then aggregated these accuracy measurements for each number of tokens by averaging the accuracy of all classifiers for each length (i.e., each presented value would be the average of the accuracy of all 5 classifier in the example). Values of “number of tokens” that had fewer than 5 associated notes are not plotted (in accordance with ICES privacy guidelines). See <xref ref-type="supplementary-material" rid="pone.0267964.s001">S1 Appendix</xref> which provides the average accuracies associated with each note length.</p>
<fig id="pone.0267964.g003" position="float">
<object-id pub-id-type="doi">10.1371/journal.pone.0267964.g003</object-id>
<label>Fig 3</label>
<caption>
<title>The average accuracy (across all specialties) for the highest performing classifiers (when optimized for <italic>F</italic><sub>1</sub>Score) by different lengths of the referral notes (as measured by number of tokens).</title>
<p>We observe that notes with few tokens have poor accuracy. On the other hand, notes with many tokens are likely have a noisy signal (containing more keywords belonging to other specialties), thus resulting in poor performance.</p>
</caption>
<graphic mimetype="image" position="float" xlink:href="info:doi/10.1371/journal.pone.0267964.g003" xlink:type="simple"/>
</fig>
<p>We observe that having very few tokens (e.g., &lt;10) or very many tokens (e.g., &gt;125) results in sub-optimal performance (when compared to notes having between 50 and 100 tokens). We observe, from manual examination of the notes, that very short notes are not likely to be informative. That is, “Please see John Smith” does not allow either human annotators or an automated algorithm to predict the specialist accurately. For this reason, we did not train on or classify any notes with fewer than six tokens (enough to convey “Please see John for chest pain”). Longer notes are more likely to include patient history including diseases and symptoms unrelated to the target specialty which increases the likelihood of misclassification.</p>
</sec>
<sec id="sec017">
<title>Calculating wait times</title>
<p>We only calculate and present wait time estimates from FP referral to specialist visit for specialists who have a model meeting our determined threshold. That is, if the performance of the best model for a particular specialty does not pass the requirements (precision of at least 0.70 and recall of at least 0.30) then we did not attempt to estimate the wait time. This decision is based on expert feedback of what percentage of notes should be captured and how precise the measurement should be to provide a trustworthy measurement. However, we acknowledge that for different methods or different datasets other minimum thresholds may be more appropriate.</p>
<p>To calculate the wait times, we deploy the best ML algorithm for each specialty on all EMR referral notes from 2015 (N = 174,190), i.e., the full study cohort which includes those with multiple referral notes that were not used in the development and evaluation of the machine learning approach. For each patient, for each specialty, we measure the wait time as the number of days between the first FP referral to a specialist physician and the first consultation visit of the same specialist physician, <xref ref-type="fig" rid="pone.0267964.g001">Fig 1</xref>.</p>
<p>To allow for adequate recall of FP referrals made at the end of the calendar year, when measuring the wait times for referrals made in 2015, we allowed for referrals to match to consultation visits occurring in 2016 (e.g., referral in November 2015 and first specialist visit in April 2016).</p>
<p>These models are applied on the full set of referral notes from 2015 which had at least 6 tokens (N = 174,190). <xref ref-type="fig" rid="pone.0267964.g004">Fig 4</xref> presents the median and 90<sup>th</sup> percentile wait times for target specialties matching our evaluation criteria.</p>
<fig id="pone.0267964.g004" position="float">
<object-id pub-id-type="doi">10.1371/journal.pone.0267964.g004</object-id>
<label>Fig 4</label>
<caption>
<title>The estimated median and 90<sup>th</sup> percentile wait time from family physician referral to specialist visit for nine specialties.</title>
<p>The error bars represent the 95% confidence interval (arrived at by bootstrapping).</p>
</caption>
<graphic mimetype="image" position="float" xlink:href="info:doi/10.1371/journal.pone.0267964.g004" xlink:type="simple"/>
</fig>
<p><xref ref-type="fig" rid="pone.0267964.g005">Fig 5</xref> compares the estimated wait times in 2015 against the latest available manually human coded estimates [<xref ref-type="bibr" rid="pone.0267964.ref011">11</xref>]. As the method for labelling referral notes is different the conclusions that can be made from this comparison should be made with caution. However, having developed these automated approaches, future comparisons should not be so costly to perform and would enable timely measurements of the effects of health policy on primary care wait times.</p>
<fig id="pone.0267964.g005" position="float">
<object-id pub-id-type="doi">10.1371/journal.pone.0267964.g005</object-id>
<label>Fig 5</label>
<caption>
<title>The estimated median and 75<sup>th</sup> percentile wait time from family physician referral to specialist visit for four specialties.</title>
<p>The error bars represent 95% confidence interval (arrived at by bootstrapping). The 2008 numbers are from our previous work and relied on manual coding.</p>
</caption>
<graphic mimetype="image" position="float" xlink:href="info:doi/10.1371/journal.pone.0267964.g005" xlink:type="simple"/>
</fig>
</sec>
<sec id="sec018">
<title>Performance and estimated wait times</title>
<p>In this section, we explore the effect of choosing different confidence thresholds for the predictions of our models. Previously, we used the confidence threshold of 0.5 on classifiers which have a performance of at least 70% PPV and 30% sensitivity. As this system is being developed for a specific application purposes in our healthcare system, the threshold was selected through expert consultation with health-system researchers from our system. However, we now explore the effects of possibly changing the confidence threshold (and thus the performance thresholds), as might be desired by other systems or researchers. For each model represented in <xref ref-type="fig" rid="pone.0267964.g004">Fig 4</xref>, we plot how different confidence thresholds affect predictive performance (PPV and sensitivity) and estimated wait-times <xref ref-type="fig" rid="pone.0267964.g006">Fig 6</xref>. We observe that the confidence threshold of 0.5 (PPV&gt; = 70% and sensitivity&gt; = 30%) often coincides with a “stabilization” or decrease in slope for estimated wait times (e.g., clear examples can be seen in cardiology and dermatology among others). We observe that the median wait time does not differ substantially when measured either using only notes in our gold-standard set or using machine prediction to capture additional patients. However, depending on the use-case, classification might still be justified to increase the number of patients composing a class (and thus decreasing the 95% confidence interval) to allow for meaningful significance testing between different time periods.</p>
<fig id="pone.0267964.g006" position="float">
<object-id pub-id-type="doi">10.1371/journal.pone.0267964.g006</object-id>
<label>Fig 6</label>
<caption>
<title>The effect of different confidence thresholds (x-axis) on classification metrics (left y-axis) and estimated median wait times (right y-axis) for the 9 selected specialties.</title>
<p>The dashed green line represents the “baseline” wait-time: the wait time if we only estimated using our gold labels (i.e., using patients who only ever had a single referral and specialist consultation in 2015).</p>
</caption>
<graphic mimetype="image" position="float" xlink:href="info:doi/10.1371/journal.pone.0267964.g006" xlink:type="simple"/>
</fig>
</sec>
</sec>
<sec id="sec019" sec-type="conclusions">
<title>Discussion</title>
<p>FPs EMRs contain a wealth of information about patients seen in primary care. In Ontario, there are currently 14 EMR vendors used by family physicians [<xref ref-type="bibr" rid="pone.0267964.ref040">40</xref>]. Unfortunately, the data held within these EMRs are not documented in a consistent way. Traditionally, extracting free-text EMR data required abstractors to review charts and code the data. ML provides the opportunity to more efficiently code the free text portion of EMRs. We were able to use ML on the free-text portion of FP EMR’s referral note to classify the target specialist physician for that referral, a task which previously had to be done by humans.</p>
<p>The high precision of ML using unstructured EMR data allows timely results at a lower cost and on a larger scale. From a primary care perspective, this information can help inform decision makers and providers about which patients or FP practices are experiencing long wait times in seeing specialist physicians. This work can also be used by health policy researchers to examine, in a timely manner, the effects of policies.</p>
<sec id="sec020">
<title>Limitations</title>
<p>While using automated algorithms enables classification of more referral notes, the low recall scores (0.30–0.50) make our results susceptible to skews caused by non-random mis-predictions by the algorithm. That is, although our automated method enabled us to label, on average, 167% more notes for each specialty when compared to the previous study of Jaakkimainen <italic>et al</italic>. [<xref ref-type="bibr" rid="pone.0267964.ref011">11</xref>], manual labelling is needed to determine if the captured notes are truly representative of the entire sample.</p>
<p>Furthermore, our training set was relatively small thus limiting the performance we could achieve. Our experiments demonstrate that having more notes often results in increased performance.</p>
<p>Another limitation is the lack of human-curated labels for referral notes. To address this limitation without incurring the high costs of human labelling, we devised a method to accurately infer the labels from administrative data: we extracted labels for patients who had only one referral and one consultation visit in 2015. However, this method limits our training set size and subsequently resulted in us not being able to train classifiers for specialties such as orthopedics where many of the referrals used custom forms thereby reducing our ability to automatically capture such labels. Furthermore, unlike a manually labelled random sample, work is needed to demonstrate that idiosyncrasies of the predictive algorithm don’t change the population being labelled.</p>
<p>The content of referral notes also vary amongst FPs and clinics. Busy FPs may write a referral using personalized abbreviations or few words (fewer tokens) per referral note thus making it more difficult to predict. The use of custom-stamps or forms which used tick-boxes in their referrals may also mask some of the words that could be used to label a referral note. While cross-validation would capture much of these differences on our specific dataset, more work is needed to ensure the generalizability and validity of predictions on larger and external datasets that have not been labelled (e.g., notes from later years or notes from FPs which are not in our training set).</p>
<p>We find an increase in the median and 90<sup>th</sup> percentile of wait times for most specialties when compared to 2008 data. However, a direct comparison cannot be made due to the differences in referral note labelling (i.e., automated vs. human labelling). While a direct comparison cannot be made, the result from such a comparison matches those from Canadian-based surveys similarly found increased wait times in seeing specialist physicians [<xref ref-type="bibr" rid="pone.0267964.ref004">4</xref>, <xref ref-type="bibr" rid="pone.0267964.ref041">41</xref>].</p>
</sec>
</sec>
<sec id="sec021" sec-type="conclusions">
<title>Conclusions</title>
<p>In this paper, we used ML to predict the target specialist physician of referral notes to enable the estimation of wait times by specialty. This is significant as, previously, this task needed human abstractors to label the notes. This work represents a reduction in the cost of gathering such metrics and an increase in the speed and frequency with which health system researchers can gather such metrics. Furthermore, using ML in this way to clean untrustworthy or incomplete labels can be employed for other applications in health system research. We found that of the 6 specialties for which wait times were estimated using both 2008 and 2015 data, 2 had a substantial increase in both median and 75th percentile wait times, one had a substantial decrease in both median and 75th percentile wait times, and 3 has non-substantial increases. In future work, we will gather and explore a larger time-series of referrals to enable direct comparison between different dates, thus enabling the evaluation of quality improvement initiatives.</p>
</sec>
<sec id="sec022" sec-type="supplementary-material">
<title>Supporting information</title>
<supplementary-material id="pone.0267964.s001" mimetype="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" position="float" xlink:href="info:doi/10.1371/journal.pone.0267964.s001" xlink:type="simple">
<label>S1 Appendix</label>
<caption>
<title>Table of the average accuracy (across all specialties) for the highest performing classifiers (when optimized for <italic>F</italic><sub>1</sub>Score) by different lengths of the referral notes (as measured by number of tokens).</title>
<p>Visually represented in <xref ref-type="fig" rid="pone.0267964.g003">Fig 3</xref>.</p>
<p>(XLSX)</p>
</caption>
</supplementary-material>
</sec>
</body>
<back>
<ack>
<p>The analyses, conclusions, opinions and statements expressed herein are solely those of the authors and do not reflect those of the funding or data sources; no endorsement is intended or should be inferred.</p>
</ack>
<glossary>
<title>Abbreviations</title>
<def-list>
<def-item><term>CPP</term>
<def><p>cumulative patient profile</p></def>
</def-item>
<def-item><term>EMRs</term>
<def><p>electronic medical records</p></def>
</def-item>
<def-item><term>ENT</term>
<def><p>Otolaryngology</p></def>
</def-item>
<def-item><term>FP</term>
<def><p>family physician</p></def>
</def-item>
<def-item><term>ML</term>
<def><p>machine learning</p></def>
</def-item>
<def-item><term>OBGYN</term>
<def><p>Obstetrics and Gynecology</p></def>
</def-item>
<def-item><term>OHIP</term>
<def><p>Ontario health insurance plan</p></def>
</def-item>
<def-item><term>PPV</term>
<def><p>positive predictive value</p></def>
</def-item>
<def-item><term>tf-idf</term>
<def><p>term frequency inverse document frequency</p></def>
</def-item>
</def-list>
</glossary>
<ref-list>
<title>References</title>
<ref id="pone.0267964.ref001"><label>1</label><mixed-citation publication-type="other" xlink:type="simple">Canadian Institute for Health Information. Wait Times for Priority Procedures in Canada, 2019: Technical Notes. Ottawa, ON: CIHI; 2019. <ext-link ext-link-type="uri" xlink:href="https://www.cihi.ca/sites/default/files/document/pdf-hfr-tech-notes-en-web.pdf" xlink:type="simple">https://www.cihi.ca/sites/default/files/document/pdf-hfr-tech-notes-en-web.pdf</ext-link>.</mixed-citation></ref>
<ref id="pone.0267964.ref002"><label>2</label><mixed-citation publication-type="other" xlink:type="simple">Ontario Ministry of Health and Long-Term Care. Ontario Wait Times: About Wait Times Data. (accessed August 20, 2020) <ext-link ext-link-type="uri" xlink:href="http://www.health.gov.on.ca/en/pro/programs/waittimes/surgery/data.aspx#3" xlink:type="simple">http://www.health.gov.on.ca/en/pro/programs/waittimes/surgery/data.aspx#3</ext-link>.</mixed-citation></ref>
<ref id="pone.0267964.ref003"><label>3</label><mixed-citation publication-type="other" xlink:type="simple">Schneider EC, Sarnak DO, Squires D, Shah A, Doty MM. Mirror, Mirror 2017: International Comparison Reflects Flaws and Opportunities for Better U.S. Health Care. (accessed August 20, 2020) <ext-link ext-link-type="uri" xlink:href="https://interactives.commonwealthfund.org/2017/july/mirror-mirror/" xlink:type="simple">https://interactives.commonwealthfund.org/2017/july/mirror-mirror/</ext-link>.</mixed-citation></ref>
<ref id="pone.0267964.ref004"><label>4</label><mixed-citation publication-type="other" xlink:type="simple">Barua B, Moir M. Waiting Your Turn: Wait Times for Health Care in Canada, 2019 Report. 2019; Fraser Institute. (accessed August 20, 2020) <ext-link ext-link-type="uri" xlink:href="https://www.fraserinstitute.org/sites/default/files/waiting-your-turn-2019-rev17dec.pdf" xlink:type="simple">https://www.fraserinstitute.org/sites/default/files/waiting-your-turn-2019-rev17dec.pdf</ext-link>.</mixed-citation></ref>
<ref id="pone.0267964.ref005"><label>5</label><mixed-citation publication-type="other" xlink:type="simple">Canadian Institute for Health Information. How Canada Compares: Results from the Commonwealth Fund’s 2019 International Health Policy Survey of Primary Care Physicians. Ottawa, ON: CIHI; 2020. (accessed September 15, 2020) <ext-link ext-link-type="uri" xlink:href="https://www.cihi.ca/en/commonwealth-fund-survey-2019" xlink:type="simple">https://www.cihi.ca/en/commonwealth-fund-survey-2019</ext-link>.</mixed-citation></ref>
<ref id="pone.0267964.ref006"><label>6</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Loo</surname> <given-names>CKJ</given-names></name>, <name name-style="western"><surname>Greiver</surname> <given-names>M</given-names></name>, <name name-style="western"><surname>Aliarzadeh</surname> <given-names>B</given-names></name>, <name name-style="western"><surname>Lewis</surname> <given-names>D</given-names></name>. <article-title>Association between neighbourhood walkability and metabolic risk factors influenced by physical activity: a cross-sectional study of adults in Toronto, Canada</article-title>. <source>BMJ Open</source> <year>2017</year>;<volume>7</volume>:<fpage>e013889</fpage>. <comment>doi: <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1136/bmjopen-2016-013889" xlink:type="simple">10.1136/bmjopen-2016-013889</ext-link></comment> <object-id pub-id-type="pmid">28391234</object-id></mixed-citation></ref>
<ref id="pone.0267964.ref007"><label>7</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Jaakkimainen</surname> <given-names>RL</given-names></name>, <name name-style="western"><surname>Bronskill</surname> <given-names>SE</given-names></name>, <name name-style="western"><surname>Tierney</surname> <given-names>MC</given-names></name>, <name name-style="western"><surname>Herrmann</surname> <given-names>N</given-names></name>, <name name-style="western"><surname>Green</surname> <given-names>D</given-names></name>, <name name-style="western"><surname>Young</surname> <given-names>J</given-names></name>, <etal>et al</etal>. <article-title>Identification of physician-diagnosed Alzheimer’s disease and related dementias in population-based administrative data: a validation study using family physicians’ electronic medical records</article-title>. <source>Journal of Alzheimer’s Disease</source>, <year>2016</year>;<volume>54</volume>:<fpage>337</fpage>–<lpage>349</lpage>. <comment>doi: <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.3233/JAD-160105" xlink:type="simple">10.3233/JAD-160105</ext-link></comment> <object-id pub-id-type="pmid">27567819</object-id>.</mixed-citation></ref>
<ref id="pone.0267964.ref008"><label>8</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Nash</surname> <given-names>DM</given-names></name>, <name name-style="western"><surname>Ivers</surname> <given-names>NM</given-names></name>, <name name-style="western"><surname>Young</surname> <given-names>J</given-names></name>, <name name-style="western"><surname>Jaakkimainen</surname> <given-names>RL</given-names></name>, <name name-style="western"><surname>Garg</surname> <given-names>AX</given-names></name>, <name name-style="western"><surname>Tu</surname> <given-names>K</given-names></name>. <article-title>Improving Care for Patients with Chronic Kidney Disease using Electronic Medical Record Interventions: A Pragmatic Cluster Randomized Trial Protocol</article-title>. <source>Canadian Journal of Kidney Health and Disease</source>. <year>2017</year> <month>April</month>;<volume>4</volume>:<fpage>1</fpage>–<lpage>13</lpage>. <comment>doi: <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1177/2054358117699833" xlink:type="simple">10.1177/2054358117699833</ext-link></comment> <object-id pub-id-type="pmid">28607686</object-id></mixed-citation></ref>
<ref id="pone.0267964.ref009"><label>9</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Zhang</surname> <given-names>H</given-names></name>, <name name-style="western"><surname>Candido</surname> <given-names>E</given-names></name>, <name name-style="western"><surname>Wilton</surname> <given-names>AS</given-names></name>, <name name-style="western"><surname>Duchen</surname> <given-names>R</given-names></name>, <name name-style="western"><surname>Jaakkimainen</surname> <given-names>L</given-names></name>, <name name-style="western"><surname>Wodchis</surname> <given-names>W</given-names></name>, <etal>et al</etal>. <article-title>Identifying Transitional High Cost Users from Unstructured Patient Profiles Written by Primary Care Physicians</article-title>. <source>Pac Symp Biocomput</source>. <year>2020</year>;<volume>25</volume>:<fpage>127</fpage>–<lpage>138</lpage>. <object-id pub-id-type="pmid">31797592</object-id></mixed-citation></ref>
<ref id="pone.0267964.ref010"><label>10</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Carsley</surname> <given-names>S</given-names></name>, <name name-style="western"><surname>Tu</surname> <given-names>K</given-names></name>, <name name-style="western"><surname>Parkin</surname> <given-names>PC</given-names></name>, <name name-style="western"><surname>Pullenayegum</surname> <given-names>E</given-names></name>, <name name-style="western"><surname>Birken</surname> <given-names>CS</given-names></name>. <article-title>Overweight and obesity in preschool aged children and risk of mental health service utilization</article-title>. <source>Int J Obes</source>. <year>2019</year>;<volume>43</volume>:<fpage>1325</fpage>–<lpage>1333</lpage>. <comment>doi: <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1038/s41366-018-0280-1" xlink:type="simple">10.1038/s41366-018-0280-1</ext-link></comment> <object-id pub-id-type="pmid">30546134</object-id></mixed-citation></ref>
<ref id="pone.0267964.ref011"><label>11</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Jaakkimainen</surname> <given-names>L</given-names></name>, <name name-style="western"><surname>Glazier</surname> <given-names>R</given-names></name>, <name name-style="western"><surname>Barnsley</surname> <given-names>J</given-names></name>, <name name-style="western"><surname>Salkeld</surname> <given-names>E</given-names></name>, <name name-style="western"><surname>Lu</surname> <given-names>H</given-names></name>, <name name-style="western"><surname>Tu</surname> <given-names>K</given-names></name>. <article-title>Waiting to see the specialist: patient and provider characteristics of wait times. primary to specialty care</article-title>. <source>BMC Fam Pract</source>. <year>2014</year>;<volume>15</volume>:<fpage>16</fpage>. <comment>doi: <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1186/1471-2296-15-16" xlink:type="simple">10.1186/1471-2296-15-16</ext-link></comment> <object-id pub-id-type="pmid">24460619</object-id></mixed-citation></ref>
<ref id="pone.0267964.ref012"><label>12</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Griffith</surname> <given-names>KN</given-names></name>, <name name-style="western"><surname>Ndugga</surname> <given-names>NJ</given-names></name>, <name name-style="western"><surname>Pizer</surname> <given-names>SD</given-names></name>. <article-title>Appointment wait times for specialty care in Veterans Health Administration facilities vs community medical centers</article-title>. <source>JAMA network open</source>. <year>2020</year> <month>Aug</month> <day>3</day>;<volume>3</volume>(<issue>8</issue>):<fpage>e2014313</fpage>-. <comment>doi: <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1001/jamanetworkopen.2020.14313" xlink:type="simple">10.1001/jamanetworkopen.2020.14313</ext-link></comment> <object-id pub-id-type="pmid">32845325</object-id></mixed-citation></ref>
<ref id="pone.0267964.ref013"><label>13</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Bilimoria</surname> <given-names>KY</given-names></name>, <name name-style="western"><surname>Ko</surname> <given-names>CY</given-names></name>, <name name-style="western"><surname>Tomlinson</surname> <given-names>JS</given-names></name>, <name name-style="western"><surname>Stewart</surname> <given-names>AK</given-names></name>, <name name-style="western"><surname>Talamonti</surname> <given-names>MS</given-names></name>, <name name-style="western"><surname>Hynes</surname> <given-names>DL</given-names></name>, <etal>et al</etal>. <article-title>Wait times for cancer surgery in the United States: trends and predictors of delays</article-title>. <source>Annals of surgery</source>. <year>2011</year> <month>Apr</month> <day>1</day>;<volume>253</volume>(<issue>4</issue>):<fpage>779</fpage>–<lpage>85</lpage>. <comment>doi: <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1097/SLA.0b013e318211cc0f" xlink:type="simple">10.1097/SLA.0b013e318211cc0f</ext-link></comment> <object-id pub-id-type="pmid">21475020</object-id></mixed-citation></ref>
<ref id="pone.0267964.ref014"><label>14</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Li</surname> <given-names>X</given-names></name>, <name name-style="western"><surname>Tian</surname> <given-names>D</given-names></name>, <name name-style="western"><surname>Li</surname> <given-names>W</given-names></name>, <name name-style="western"><surname>Dong</surname> <given-names>B</given-names></name>, <name name-style="western"><surname>Wang</surname> <given-names>H</given-names></name>, <name name-style="western"><surname>Yuan</surname> <given-names>J</given-names></name>, <etal>et al</etal>. <article-title>Artificial intelligence-assisted reduction in patients’ waiting time for outpatient process: a retrospective cohort study</article-title>. <source>BMC health services research</source>. <year>2021</year> <month>Dec</month>;<volume>21</volume>(<issue>1</issue>):<fpage>1</fpage>–<lpage>1</lpage>. <comment>doi: <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1186/s12913-020-05996-8" xlink:type="simple">10.1186/s12913-020-05996-8</ext-link></comment> <object-id pub-id-type="pmid">33388053</object-id></mixed-citation></ref>
<ref id="pone.0267964.ref015"><label>15</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Bacchi</surname> <given-names>S</given-names></name>, <name name-style="western"><surname>Tan</surname> <given-names>Y</given-names></name>, <name name-style="western"><surname>Oakden-Rayner</surname> <given-names>L</given-names></name>, <name name-style="western"><surname>Jannes</surname> <given-names>J</given-names></name>, <name name-style="western"><surname>Kleinig</surname> <given-names>T</given-names></name>, <name name-style="western"><surname>Koblar</surname> <given-names>S</given-names></name>. <article-title>Machine learning in the prediction of medical inpatient length of stay</article-title>. <source>Internal medicine journal</source>. <year>2022</year> <month>Feb</month>;<volume>52</volume>(<issue>2</issue>):<fpage>176</fpage>–<lpage>85</lpage>. <comment>doi: <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1111/imj.14962" xlink:type="simple">10.1111/imj.14962</ext-link></comment> <object-id pub-id-type="pmid">33094899</object-id></mixed-citation></ref>
<ref id="pone.0267964.ref016"><label>16</label><mixed-citation publication-type="other" xlink:type="simple">Gonçalves F, Pereira R, Vasconcelos JB, Melo F, Velez I. Predictive analysis in healthcare: emergency wait time prediction. In Proceedings of the 9th International Symposium on Ambient Intelligence, ISAmI 2018 2019 (Vol. 806, pp. 138–145).</mixed-citation></ref>
<ref id="pone.0267964.ref017"><label>17</label><mixed-citation publication-type="other" xlink:type="simple">Lin WC, Goldstein IH, Hribar MR, Sanders DS, Chiang MF. Predicting wait times in pediatric ophthalmology outpatient clinic using machine learning. In AMIA Annual Symposium Proceedings 2019 (Vol. 2019, p. 1121). American Medical Informatics Association.</mixed-citation></ref>
<ref id="pone.0267964.ref018"><label>18</label><mixed-citation publication-type="other" xlink:type="simple">Zhang Y, Nguyen LT, Zhang J. Wait time prediction: How to avoid waiting in lines?. In Proceedings of the 2013 ACM conference on Pervasive and ubiquitous computing adjunct publication 2013 Sep 8 (pp. 481–490).</mixed-citation></ref>
<ref id="pone.0267964.ref019"><label>19</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Rahaman</surname> <given-names>MS</given-names></name>, <name name-style="western"><surname>Ren</surname> <given-names>Y</given-names></name>, <name name-style="western"><surname>Hamilton</surname> <given-names>M</given-names></name>, <name name-style="western"><surname>Salim</surname> <given-names>FD</given-names></name>. <article-title>Wait time prediction for airport taxis using weighted nearest neighbor regression</article-title>. <source>IEEE Access</source>. <year>2018</year> <month>Nov</month> <day>21</day>;<volume>6</volume>:<fpage>74660</fpage>–<lpage>72</lpage>.</mixed-citation></ref>
<ref id="pone.0267964.ref020"><label>20</label><mixed-citation publication-type="other" xlink:type="simple">Bauder RA, Khoshgoftaar TM, Richter A, Herland M. Predicting medical provider specialties to detect anomalous insurance claims. In2016 IEEE 28th international conference on tools with artificial intelligence (ICTAI) 2016 Nov 6 (pp. 784–790). IEEE.</mixed-citation></ref>
<ref id="pone.0267964.ref021"><label>21</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Abdalla</surname> <given-names>M</given-names></name>, <name name-style="western"><surname>Chen</surname> <given-names>B</given-names></name>, <name name-style="western"><surname>Santiago</surname> <given-names>R</given-names></name>, <name name-style="western"><surname>Young</surname> <given-names>J</given-names></name>, <name name-style="western"><surname>Eder</surname> <given-names>L</given-names></name>, <name name-style="western"><surname>Chan</surname> <given-names>AW</given-names></name>, <etal>et al</etal>. <article-title>Accuracy of Algorithms to Identify People with Atopic Dermatitis in Ontario Routinely Collected Health Databases</article-title>. <source>The Journal of investigative dermatology</source>. <year>2021</year> <month>Jul</month>;<volume>141</volume>(<issue>7</issue>):<fpage>1840</fpage>–<lpage>3</lpage>. <comment>doi: <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1016/j.jid.2021.01.009" xlink:type="simple">10.1016/j.jid.2021.01.009</ext-link></comment> <object-id pub-id-type="pmid">33571528</object-id></mixed-citation></ref>
<ref id="pone.0267964.ref022"><label>22</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Raita</surname> <given-names>Y</given-names></name>, <name name-style="western"><surname>Goto</surname> <given-names>T</given-names></name>, <name name-style="western"><surname>Faridi</surname> <given-names>MK</given-names></name>, <name name-style="western"><surname>Brown</surname> <given-names>DF</given-names></name>, <name name-style="western"><surname>Camargo</surname> <given-names>CA</given-names></name>, <name name-style="western"><surname>Hasegawa</surname> <given-names>K</given-names></name>. <article-title>Emergency department triage prediction of clinical outcomes using machine learning models</article-title>. <source>Critical care</source>. <year>2019</year> <month>Dec</month>;<volume>23</volume>(<issue>1</issue>):<fpage>1</fpage>–<lpage>3</lpage>. <comment>doi: <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1186/s13054-018-2293-5" xlink:type="simple">10.1186/s13054-018-2293-5</ext-link></comment> <object-id pub-id-type="pmid">30606235</object-id></mixed-citation></ref>
<ref id="pone.0267964.ref023"><label>23</label><mixed-citation publication-type="other" xlink:type="simple">Zhang H, Candido E, Wilton AS, Duchen R, Jaakkimainen L, Wodchis W, et al. Identifying transitional high cost users from unstructured patient profiles written by primary care physicians. In PACIFIC SYMPOSIUM ON BIOCOMPUTING 2020 2019 (pp. 127–138).</mixed-citation></ref>
<ref id="pone.0267964.ref024"><label>24</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Weng</surname> <given-names>WH</given-names></name>, <name name-style="western"><surname>Wagholikar</surname> <given-names>KB</given-names></name>, <name name-style="western"><surname>McCray</surname> <given-names>AT</given-names></name>, <name name-style="western"><surname>Szolovits</surname> <given-names>P</given-names></name>, <name name-style="western"><surname>Chueh</surname> <given-names>HC</given-names></name>. <article-title>Medical subdomain classification of clinical notes using a machine learning-based natural language processing approach</article-title>. <source>BMC medical informatics and decision making</source>. <year>2017</year> <month>Dec</month>;<volume>17</volume>(<issue>1</issue>):<fpage>1</fpage>–<lpage>3</lpage>. <comment>doi: <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1186/s12911-016-0389-x" xlink:type="simple">10.1186/s12911-016-0389-x</ext-link></comment> <object-id pub-id-type="pmid">28049465</object-id></mixed-citation></ref>
<ref id="pone.0267964.ref025"><label>25</label><mixed-citation publication-type="other" xlink:type="simple">Røst TB, Nytrø Ø, Grimsmo A. Classifying encounter notes in the primary care patient record. In Proceedings of the 3rd International Workshop on Text-based Information Retrieval 2006 Aug (Vol. 205, pp. 1–5).</mixed-citation></ref>
<ref id="pone.0267964.ref026"><label>26</label><mixed-citation publication-type="other" xlink:type="simple">ICES. Privacy at ICES. (accessed April 20, 2020) <ext-link ext-link-type="uri" xlink:href="https://www.ices.on.ca/Data-and-Privacy/Privacy-at-ICES" xlink:type="simple">https://www.ices.on.ca/Data-and-Privacy/Privacy-at-ICES</ext-link>.</mixed-citation></ref>
<ref id="pone.0267964.ref027"><label>27</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Tu</surname> <given-names>K</given-names></name>, <name name-style="western"><surname>Mitiku</surname> <given-names>TF</given-names></name>, <name name-style="western"><surname>Ivers</surname> <given-names>NM</given-names></name>, <name name-style="western"><surname>Guo</surname> <given-names>H</given-names></name>, <name name-style="western"><surname>Lu</surname> <given-names>H</given-names></name>, <name name-style="western"><surname>Jaakkimainen</surname> <given-names>L</given-names></name>, <etal>et al</etal>. <article-title>Evaluation of Electronic Medical Record Administrative data Linked Database (EMRALD)</article-title>. <source>Am J Manag Care</source>. <year>2014</year>:<fpage>e15</fpage>–<lpage>e21</lpage>.</mixed-citation></ref>
<ref id="pone.0267964.ref028"><label>28</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Tu</surname> <given-names>K</given-names></name>, <name name-style="western"><surname>Widdifield</surname> <given-names>J</given-names></name>, <name name-style="western"><surname>Young</surname> <given-names>J</given-names></name>, <name name-style="western"><surname>Oud</surname> <given-names>W</given-names></name>, <name name-style="western"><surname>Ivers</surname> <given-names>N</given-names></name>, <name name-style="western"><surname>Butt</surname> <given-names>D</given-names></name>, <etal>et al</etal>. <article-title>Are family physicians comprehensively using electronic medical records such that the data can be used for secondary purposes? A Canadian perspective</article-title>. <source>BMC Med Inform Decis Mak</source>, <year>2015</year>;<volume>15</volume>:<fpage>67</fpage>. <comment>doi: <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1186/s12911-015-0195-x" xlink:type="simple">10.1186/s12911-015-0195-x</ext-link></comment> <object-id pub-id-type="pmid">26268511</object-id>.</mixed-citation></ref>
<ref id="pone.0267964.ref029"><label>29</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Pedregosa</surname> <given-names>F</given-names></name>, <name name-style="western"><surname>Varoquaux</surname> <given-names>G</given-names></name>, <name name-style="western"><surname>Gramfort</surname> <given-names>A</given-names></name>, <name name-style="western"><surname>Michel</surname> <given-names>V</given-names></name>, <name name-style="western"><surname>Thirion</surname> <given-names>B</given-names></name>, <name name-style="western"><surname>Grisel</surname> <given-names>O</given-names></name>, <etal>et al</etal>. <article-title>Scikit-learn: Machine learning in Python</article-title>. <source>the Journal of Machine Learning Research</source>. <year>2011</year> <month>Nov</month> <day>1</day>;<volume>12</volume>:<fpage>2825</fpage>–<lpage>30</lpage>.</mixed-citation></ref>
<ref id="pone.0267964.ref030"><label>30</label><mixed-citation publication-type="other" xlink:type="simple">Kraaij W, Pohlmann R. Viewing stemming as recall enhancement. In Proceedings of the 19th Annual International ACM SIGIR Conference on Research and Development in Information Retrieval 1996 Aug 18 (pp. 40–48).</mixed-citation></ref>
<ref id="pone.0267964.ref031"><label>31</label><mixed-citation publication-type="other" xlink:type="simple">Loper E, Bird S. NLTK: The Natural Language Toolkit. In Proceedings of the ACL-02 Workshop on Effective Tools and Methodologies for Teaching Natural Language Processing and Computational Linguistics-Volume 1 2002 Jul 7 (pp. 63–70).</mixed-citation></ref>
<ref id="pone.0267964.ref032"><label>32</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Wu</surname> <given-names>HC</given-names></name>, <name name-style="western"><surname>Luk</surname> <given-names>RW</given-names></name>, <name name-style="western"><surname>Wong</surname> <given-names>KF</given-names></name>, <name name-style="western"><surname>Kwok</surname> <given-names>KL</given-names></name>. <article-title>Interpreting tf-idf term weights as making relevance decisions</article-title>. <source>ACM Transactions on Information Systems (TOIS)</source>. <year>2008</year> <month>Jun</month> <day>20</day>;<volume>26</volume>(<issue>3</issue>):<fpage>1</fpage>–<lpage>37</lpage>.</mixed-citation></ref>
<ref id="pone.0267964.ref033"><label>33</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Shah</surname> <given-names>K</given-names></name>, <name name-style="western"><surname>Patel</surname> <given-names>H</given-names></name>, <name name-style="western"><surname>Sanghvi</surname> <given-names>D</given-names></name>, <name name-style="western"><surname>Shah</surname> <given-names>M</given-names></name>. <article-title>A comparative analysis of logistic regression, random forest and KNN models for the text classification</article-title>. <source>Augmented Human Research</source>. <year>2020</year> <month>Dec</month>;<volume>5</volume>(<issue>1</issue>):<fpage>1</fpage>–<lpage>6</lpage>.</mixed-citation></ref>
<ref id="pone.0267964.ref034"><label>34</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Pranckevičius</surname> <given-names>T</given-names></name>, <name name-style="western"><surname>Marcinkevičius</surname> <given-names>V</given-names></name>. <article-title>Comparison of naive bayes, random forest, decision tree, support vector machines, and logistic regression classifiers for text reviews classification</article-title>. <source>Baltic Journal of Modern Computing</source>. <year>2017</year>;<volume>5</volume>(<issue>2</issue>):<fpage>221</fpage>.</mixed-citation></ref>
<ref id="pone.0267964.ref035"><label>35</label><mixed-citation publication-type="other" xlink:type="simple">Aborisade O, Anwar M. Classification for authorship of tweets by comparing logistic regression and naive Bayes classifiers. In 2018 IEEE International Conference on Information Reuse and Integration (IRI) 2018 Jul 6 (pp. 269–276). IEEE.</mixed-citation></ref>
<ref id="pone.0267964.ref036"><label>36</label><mixed-citation publication-type="other" xlink:type="simple">Guo C, Pleiss G, Sun Y, Weinberger KQ. On calibration of modern neural networks. In International Conference on Machine Learning 2017 Jul 17 (pp. 1321–1330). PMLR.</mixed-citation></ref>
<ref id="pone.0267964.ref037"><label>37</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Peng</surname> <given-names>CY</given-names></name>, <name name-style="western"><surname>So</surname> <given-names>TS</given-names></name>. <article-title>Logistic regression analysis and reporting: A primer</article-title>. <source>Understanding Statistics: Statistical Issues in Psychology, Education, and the Social Sciences</source>. <year>2002</year> <month>Feb</month> <day>2</day>;<volume>1</volume>(<issue>1</issue>):<fpage>31</fpage>–<lpage>70</lpage>.</mixed-citation></ref>
<ref id="pone.0267964.ref038"><label>38</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Wei</surname> <given-names>WQ</given-names></name>, <name name-style="western"><surname>Cronin</surname> <given-names>RM</given-names></name>, <name name-style="western"><surname>Xu</surname> <given-names>H</given-names></name>, <name name-style="western"><surname>Lasko</surname> <given-names>TA</given-names></name>, <name name-style="western"><surname>Bastarache</surname> <given-names>L</given-names></name>, <name name-style="western"><surname>Denny</surname> <given-names>JC</given-names></name>. <article-title>Development and evaluation of an ensemble resource linking medications to their indications</article-title>. <source>Journal of the American Medical Informatics Association</source>. <year>2013</year> <month>Sep</month> <day>1</day>;<volume>20</volume>(<issue>5</issue>):<fpage>954</fpage>–<lpage>61</lpage>. <comment>doi: <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1136/amiajnl-2012-001431" xlink:type="simple">10.1136/amiajnl-2012-001431</ext-link></comment> <object-id pub-id-type="pmid">23576672</object-id></mixed-citation></ref>
<ref id="pone.0267964.ref039"><label>39</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Ambalavanan</surname> <given-names>AK</given-names></name>, <name name-style="western"><surname>Devarakonda</surname> <given-names>MV</given-names></name>. <article-title>Using the contextual language model BERT for multi-criteria classification of scientific articles</article-title>. <source>Journal of Biomedical Informatics</source>. <year>2020</year> <month>Dec</month> <day>1</day>;<volume>112</volume>:<fpage>103578</fpage>. <comment>doi: <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1016/j.jbi.2020.103578" xlink:type="simple">10.1016/j.jbi.2020.103578</ext-link></comment> <object-id pub-id-type="pmid">33059047</object-id></mixed-citation></ref>
<ref id="pone.0267964.ref040"><label>40</label><mixed-citation publication-type="other" xlink:type="simple">OntarioMD Inc. EMR vendors in Ontario. 2020 (accessed September 15, 2020) <ext-link ext-link-type="uri" xlink:href="https://www.ontariomd.ca/emr-certification/certified-emr-offerings" xlink:type="simple">https://www.ontariomd.ca/emr-certification/certified-emr-offerings</ext-link>.</mixed-citation></ref>
<ref id="pone.0267964.ref041"><label>41</label><mixed-citation publication-type="other" xlink:type="simple">Doty MM, Tikkanen R, Shah A, Schneider EC. International Survey: Primary Care Physicians in U.S. Struggle More to Coordinate Care and Communicate with Other Providers But Offer Patients More Health IT Tools. 2019 Commonwealth Fund International Health Policy Survey of Primary Care Physicians. December 10, 2019 (accessed August 20, 2020) <ext-link ext-link-type="uri" xlink:href="https://www.commonwealthfund.org/publications/journal-article/2019/dec/international-survey-primary-care-physicians-eleven-countries" xlink:type="simple">https://www.commonwealthfund.org/publications/journal-article/2019/dec/international-survey-primary-care-physicians-eleven-countries</ext-link>.</mixed-citation></ref>
</ref-list>
</back>
</article>