Skip to content

Canada - Add a recognizer for Quebec health insurance numbers (RAMQ / NAM) #2482

Open

Description

@mdeloupy

Is your feature request related to a problem? Please describe.
Presidio has Canadian recognizers for SIN (CA_SIN) and postal codes (CA_POSTAL_CODE), but nothing for the Quebec health insurance number (RAMQ, also called "NAM"). It is a direct identifier in Quebec health and administrative text, so it currently goes undetected and unanonymized.

Describe the solution you'd like
A pattern-based CaRamqRecognizer (entity CA_RAMQ) under country_specific/canada/:

  • Format: 4 letters followed by 8 digits, with optional space or dash separators (ABCD 1234 5678, ABCD-12-34-56-78, ABCD12345678).
  • Two exclusive patterns rank a match by its embedded birth date: a higher score (0.65) when the month is 01-12 (men) or 51-62 (women) and the day is 01-31, and 0.5 otherwise. The date never drops a match.
  • No checksum, since no check digit is published, so nothing is promoted to 1.0.
  • Context words such as ramq, assurance maladie, carte soleil and health card.
  • en and fr, disabled by default like the other country-specific recognizers, with the usual registration, docs row and tests (including the YAML configuration path).

I already have an implementation ready and will open a PR that references this issue.

Describe alternatives you've considered

  • A custom PatternRecognizer in user code. This works, but every Quebec user has to rewrite and maintain it, and it isn't discoverable.
  • A generic "4 letters + 8 digits" pattern. It would give many more false positives and no French context.
  • Validating the birth date strictly and rejecting non-matching numbers. I avoided this because I couldn't find an official specification for the structure.

Additional context

  • The format comes from secondary sources. I haven't found an official RAMQ specification, so I'd welcome a maintainer pointing to one.
  • The expected false positives are tokens of the same shape, such as order references. The recognizer is disabled by default, and a score threshold filters them.
  • All test values are synthetic.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions