A method to advance adolescent sexual health research: Automated algorithm finds sexual history documentation - Robertson, Caryn; Mukherjee, Gargi; Gooding, Holly; Kandaswamy, Swaminathan; Orenstein, Evan (Frontiers in Digital Health, 2022)
Background: We aimed to develop and validate a rule-based natural language processing (NLP) algorithm to detect sexual history documentation and its five key components (partners, practices, past history of sexually transmitted infections (STIs), protection from STIs, and prevention of pregnancy) among adolescent encounters in the pediatric emergency and inpatient settings. Methods: We iteratively designed a NLP algorithm using pediatric emergency department (ED) provider notes from adolescent ED visits with specific abdominal or genitourinary (GU) chief complaints. The algorithm is composed of regular expressions identifying commonly used phrases in sexual history documentation. We validated this algorithm with inpatient admission notes for adolescents. We calculated the sensitivity, specificity, negative predictive value, positive predictive value, and F1 score of the tool in each environment using manual chart review as the gold standard. Results: In the ED test cohort with abdominal or GU complaints, 97/179 (54%) provider notes had a sexual history documented, and the NLP algorithm correctly classified each note. In the inpatient validation cohort, 97/321 (30%) admission notes included a sexual history, and the NLP algorithm had 100% sensitivity and 98.2% specificity. The algorithm demonstrated >97% sensitivity and specificity in both settings for detection of elements of a high quality sexual history including protection used and contraception. Type of sexual practice and STI testing offered were also detected with >97% sensitivity and specificity in the ED test cohort with slightly lower performance in the inpatient validation cohort. Conclusion: This NLP algorithm automatically detects the presence of sexual history documentation and its key components in ED and inpatient settings.