Self-supervised EHR models commonly reconstruct masked medical codes or predict future events, without explicitly modeling clinical relations across patients and visits. Contrastive methods can introduce relational supervision but usually reduce these relations to binary positive and negative pairs. We introduce EHR-CSS, a multi-granularity self-supervised contrastive framework for patient, visit, and medical-code representations. The patient and visit objectives assign target weights according to clinical similarity, while the medical-code objectives assign target weights according to the medical codes to be reconstructed or predicted. At each granularity, the proposed Cauchy-Schwarz Sequence (CSS) loss aligns a model distribution over candidate representations with its target distribution and includes a uniformity term over the candidate representations. Across evaluations on EHRSHOT with few-shot labels and on MIMIC-IV with fully supervised fine-tuning, EHR-CSS achieves the best overall performance among the evaluated methods. The code is available at https://github.com/keynekassapa13/EHR-CSS.
翻译:暂无翻译