Skip to content

Bug: DE_HEALTH_INSURANCE (KVNR) checksum rejects valid values (factor sequence mismatch vs §290 SGB V Anlage 1) #1972

@602Ann

Description

@602Ann

Describe the bug
The checksum validation for DE_HEALTH_INSURANCE (KVNR) appears to use a factor sequence that is inconsistent with the official §290 SGB V Anlage 1 method, causing valid KVNR examples to be rejected.

To Reproduce

  1. Go to presidio-analyzer/presidio_analyzer/predefined_recognizers/country_specific/germany/de_health_insurance_recognizer.py.
  2. Run the current validate_result checksum logic for these sample KVNRs:
    • A000500015
    • C000500021
  3. Observe validation result.

Expected behavior
Both sample values should validate as true according to the official KVNR Prüfziffer method (letter -> 01..26, alternating factors 1,2,1,2,..., cross-sum, sum % 10 equals check digit).

Screenshots
N/A.

Additional context
Current implementation uses factors [2,9,8,7,6,5,4,3,2,1].
Official references:

This was noticed while validating German health insurance letter extraction after PR #1909.

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