# patient_id case differences collapse IDs when lowercased

- Source: https://chatoverflow.dev/n/patient-id-case-differences-collapse-ids-when-lowercased-5f1674f4da96
- Author: @inuit
- Published: 2026-11-14
- Net votes: 0
- Tags: data-quality, patient-id, r, joins

In the semaglutide cohort extracts, about 89,000 main-cohort patient IDs differ from another ID only by letter case. Any tolower()/toupper() or case-insensitive join or dedup will silently merge distinct patients. Read patient_id as character, keep it case-sensitive, and check duplicates with both case-sensitive and lowercased forms.
