Sign in

Peter E. DeWitt, Ph.D.

@peteredewitt.bsky.social
20 followers 32 following 13 posts

#biostatistics, #rstats, #EHR, #sepsis, #pediatrics, #PublicHealth, #HealthInformatics, #DataScience, #ClinicalResearch, #GoAvsGo, #woodworking

PostsRepliesMedia
Peter E. DeWitt, Ph.D. @peteredewitt.bsky.social · 05/10/2026
medicalcoder 0.10.0 is now on CRAN! This release adds FY 2027 ICD-10-CM diagnosis and ICD-10-PCS procedure code sets. ICD lookup, validation, and longitudinal comorbidity assessment in R—all reference data included. cran.r-project.org/package=medi... #RStats #PublicHealth #ICD #Comorbidities
021
Peter E. DeWitt, Ph.D. @peteredewitt.bsky.social · 16/07/2026
medicalcoder 0.9.0 is now on CRAN What’s new: Charlson methods, ICD-10-AM, ICD-10-SE Why use it: self-contained, longitudinally aware, auditable mappings #rstats #HealthInformatics #EHR #ClinicalResearch #RiskAdjustment #PublicHealth #comorbidity #Charlson #Elixhuaser #PCCC #pediatrics
040
Peter E. DeWitt, Ph.D. @peteredewitt.bsky.social · 05/05/2026
I had the opportunity to present the medicalcoder R package as a short talk and a poster at the @cubiomedinfo.bsky.social Spring 2026 Symposium. #BiomedicalInformatics #RStats #HealthDataScience #ClinicalResearch
070
Peter E. DeWitt, Ph.D. @peteredewitt.bsky.social · 25/03/2026
Just practicing hand cut dovetails #woodworking #handtools
1110
Peter E. DeWitt, Ph.D. @peteredewitt.bsky.social · 23/03/2026
I made this dice tower for some friends. Four baffles inside the tower. #woodworking
040
Peter E. DeWitt, Ph.D. @peteredewitt.bsky.social · 20/03/2026
My abstract has been accepted for presentation at R/Medicine 2026. I’ll be my R package, medicalcoder. www.peteredewitt.com/medicalcoder/ Thank you @rconsortium.bsky.social for putting on the conference! #rstats #RMedicine #HealthInformatics #EHR #ClinicalResearch
071
Peter E. DeWitt, Ph.D. @peteredewitt.bsky.social · 09/03/2026
Same ICD codes. Same patient. Different risk profiles. Encounter-level comorbidity logic assumes ICD codes are re-reported every visit. They usually aren’t. medicalcoder handles this 📦install.packages("medicalcoder") #rstats #HealthInformatics #EHR #ClinicalResearch #RiskAdjustment #PublicHealth
Diagram comparing longitudinal vs encounter-level comorbidity detection using ICD-10 codes across five patient encounters.

Top panel (Longitudinal): The patient initially has uncomplicated diabetes (E11.9). Later an encounter includes E11.22 and K72.10, indicating complex diabetes and severe liver disease. Using longitudinal logic, these conditions persist in later encounters even when only E11.9 appears, preserving severity and correctly flagging severe liver disease.

Bottom panel (Encounter-level): Each encounter is evaluated independently. Diabetes changes from uncomplicated → complex → back to uncomplicated when E11.9 reappears, and severe liver disease is never flagged because its code does not repeat.

Message: Ignoring patient history can downgrade severity or fail to identify comorbidities.Graphic showing how the medicalcoder R package controls comorbidity detection using the flag.method argument.

Left side: A sample dataset of patient encounters with variables patid, encid, icd10code, and poa, containing ICD-10 codes such as E11.9, K72.10, and E11.22.

Below the dataset are two example R code blocks calling medicalcoder::comorbidities():

flag.method = "current" (default), producing encounter-level comorbidity flags.

flag.method = "cumulative", producing patient-level flags that preserve comorbidities across encounters.

Right side: the medicalcoder hex logo and labels explaining that
current = encounter-level and cumulative = longitudinal history preserving.

The graphic illustrates that longitudinal comorbidity tracking in medicalcoder is controlled by a single argument.
022
Peter E. DeWitt, Ph.D. @peteredewitt.bsky.social · 23/02/2026
📦 medicalcoder v0.8.0 is now on CRAN. medicalcoder is a unified and longitudinally aware framework for ICD-based comorbidity assessment in #rstats CRAN: cran.r-project.org/package=medi... GitHub: github.com/dewittpe/med... Website: peteredewitt.com/medicalcoder/
1113