cognovis De-Identification IG for German Practice Data
0.17.2 - release Germany

cognovis De-Identification IG for German Practice Data - Downloaded Version 0.17.2 See the Directory of published versions

Quasi-ID Generalizers

Quasi-ID Generalizers

Overview

Quasi-identifiers (quasi-IDs) are data fields that do not uniquely identify a person in isolation but become identifying when combined with other fields. In German ambulatory practice data, the most common quasi-IDs are:

  • birthDate — precise age is a strong demographic signal
  • address.postalCode — geographic precision can narrow populations
  • diagnosis codes (ICD-10-GM) — rare codes combined with age/location can be uniquely identifying
  • clinical dates — absolute dates can correlate with external records

Generalization replaces high-precision values with coarser equivalents that preserve analytical utility while reducing re-identification risk. This is preferable to full redaction (method: redact) in analytics and LLM modes because it keeps the data usable for statistical analysis, model training, and clinical decision support.

This IG defines four generalize:* methods used in de-identification manifests (FR-015). Each method is parameterized and has documented defaults for the llm-anonymized and analytics de-identification modes.

The canonical machine-readable parameter schemas are embedded in the Library/generalize-methods resource (see Artifacts). The consumer SDK's quasi-id-generalizers.ts is generated from that Library resource — implementations should consume the Library rather than hard-coding parameter shapes.


Re-identification Risk Background

These methods are informed by the re-ID risk thresholds in NFR-003 and AW-5:

  • k-anonymity floor: k=5 (each generalized record must be indistinguishable from at least 4 others along all quasi-ID dimensions)
  • Conservative patient baseline: datasets of up to 2,000 patients are treated as high-risk; the 5-year analytics buckets for age and 2-digit PLZ prefix are calibrated to reach k≥5 for typical German GP practice populations of this size

Implementers applying these methods to larger cohorts may relax bucket granularity; those working with very small cohorts (under 200 patients) should increase generalization strength.


Methods

generalize:ageGroup

Method code: generalize:ageGroup

For a profile-preserving R4 birthDate, generalization retains the FHIR date primitive and reduces it to the first day of the first year of its five-year band (for example, 1983-03-15 becomes 1980-01-01). Every birth year at least 90 years before the request year falls into the band of the request year minus 90, so ages 90 and over form one group (HIPAA Safe Harbor). A consumer that needs a coarse age-group label computes it as a derived analytical value; it never substitutes that label into Patient.birthDate.

Parameter Schema

Parameter Type Required Default (llm-anonymized) Default (analytics) Constraints
buckets string[] no ["0-17","18-30","31-50","51-65","66-80","81+"] ["0-4","5-9","10-14","15-19","20-24","25-29","30-34","35-39","40-44","45-49","50-54","55-59","60-64","65-69","70-74","75-79","80-84","85-89","90-94","95-99","100+"] Each entry matches ^[0-9]+-[0-9]+$ (closed range) or ^[0-9]+\+$ (open upper bound). Ranges must be non-overlapping and together cover 0–∞.

Input / Output Examples

Input birthDate Request Date buckets Output
1983-03-15 2026-05-01 any configured buckets 1980-01-01
1942-11-28 2026-05-01 any configured buckets 1940-01-01
1920-06-01 2026-05-01 any configured buckets 1935-01-01 (ages 90 and over)

Error Semantics

Condition Behavior
birthDate is null or absent Output is null; no error raised
birthDate cannot be parsed as a FHIR date Consumer raises ProcessingError with code=invalid-date
Computed age falls in no configured bucket Consumer raises ProcessingError with code=age-out-of-range (indicates misconfigured bucket list — must include an open upper bound)

Manifest Entry Example

{
  "resourceType": "Patient",
  "path": "birthDate",
  "method": "generalize:ageGroup",
  "params": { "buckets": ["0-17", "18-30", "31-50", "51-65", "66-80", "81+"] },
  "appliesIn": ["llm-anonymized"]
}

For analytics mode with 5-year buckets:

{
  "resourceType": "Patient",
  "path": "birthDate",
  "method": "generalize:ageGroup",
  "params": {
    "buckets": ["0-4","5-9","10-14","15-19","20-24","25-29","30-34","35-39",
                "40-44","45-49","50-54","55-59","60-64","65-69","70-74","75-79",
                "80-84","85-89","90-94","95-99","100+"]
  },
  "appliesIn": ["analytics"]
}

generalize:relativeDate

Method code: generalize:relativeDate

Replaces an absolute date with a signed integer representing the number of days between that date and a reference point within the same FHIR resource context. Positive values mean the target date is after the reference; negative values mean before.

The reference point is a closed enumeration (AW-4). Free-form FHIRPath expressions are not permitted — they were excluded for security (path injection) and performance (arbitrary evaluation cost) reasons.

Parameter Schema

Parameter Type Required Default Allowed Values
referencePoint string no encounter.start encounter.start, encounter.end, today, request-time, condition.recordedDate

Reference point semantics:

Value Resolves to
encounter.start Encounter.period.start of the linked encounter
encounter.end Encounter.period.end of the linked encounter
today Calendar date of the de-identification request (time-zone: UTC)
request-time Exact timestamp of the de-identification request (sub-day precision; output is still integer days)
condition.recordedDate Condition.recordedDate of the linked condition resource

Input / Output Examples

Target Date Reference Point Reference Date Output (days offset)
2026-03-10 encounter.start 2026-03-01 +9
2025-11-15 today (request: 2026-05-01) 2026-05-01 -167
2026-05-05 encounter.end 2026-05-10 -5
2026-01-20 condition.recordedDate 2026-01-20 0

Error Semantics

Condition Behavior
Target date field is null or absent Output is null; no error raised
referencePoint value is not in the closed enumeration Consumer raises ConfigurationError with code=unknown-reference-point
referencePoint is valid but unresolvable in resource context (e.g. encounter.start when no Encounter is linked) Consumer raises ProcessingError with code=unresolvable-reference-point
Reference date itself is null (e.g. Encounter.period.start is absent) Consumer raises ProcessingError with code=unresolvable-reference-point

Manifest Entry Example

{
  "resourceType": "Observation",
  "path": "effectiveDateTime",
  "method": "generalize:relativeDate",
  "params": { "referencePoint": "encounter.start" },
  "appliesIn": ["analytics", "llm-anonymized"]
}

generalize:icdCategory

Method code: generalize:icdCategory

Truncates an ICD-10-GM diagnosis code to a coarser category level. This reduces diagnostic precision while retaining broad clinical context needed for population analytics.

  • 3char mode: retains the 3-character category (letter + 2 digits), e.g. J45.10 → J45
  • 1char mode: retains only the chapter letter, e.g. J45.10 → J

Parameter Schema

Parameter Type Required Default Allowed Values
level string no 3char 3char, 1char

Input / Output Examples

Input Code level Output
J45.10 3char J45
J45.10 1char J
F32.1 3char F32
F32.1 1char F
Z00.0 3char Z00
Z00.0 1char Z

Error Semantics

Condition Behavior
Code field is null or absent Output is null; no error raised
Code does not match ICD-10-GM pattern (letter followed by digits, optional decimal suffix) Consumer raises ProcessingError with code=invalid-icd-code
level is not 3char or 1char Consumer raises ConfigurationError with code=unknown-level

Manifest Entry Example

{
  "resourceType": "Condition",
  "path": "code.coding[system='http://fhir.de/CodeSystem/bfarm/icd-10-gm'].code",
  "method": "generalize:icdCategory",
  "params": { "level": "3char" },
  "appliesIn": ["analytics", "llm-anonymized"]
}

generalize:plzPrefix

Method code: generalize:plzPrefix

Truncates a German postal code (PLZ) to its leading N digits. German PLZs are always 5 digits. Retaining 2 digits reduces geographic precision to the Leitregion level (approximately district), which is sufficient for most population analytics while being too coarse to enable re-identification by location in typical practice datasets.

Parameter Schema

Parameter Type Required Default Constraints
length integer no 2 1–4 inclusive. length=5 would be a no-op and is disallowed to prevent accidental full-precision retention.

Input / Output Examples

Input PLZ length Output
80331 2 80
10115 2 10
01067 2 01
80331 1 8
48149 3 481

Error Semantics

Condition Behavior
postalCode field is null or absent Output is null; no error raised
postalCode is shorter than length digits (e.g. a 4-digit non-German code with length=5) Consumer raises ProcessingError with code=plz-too-short
length is outside 1–4 Consumer raises ConfigurationError with code=invalid-length
postalCode contains non-digit characters Consumer raises ProcessingError with code=invalid-plz-format

Manifest Entry Example

{
  "resourceType": "Patient",
  "path": "address.postalCode",
  "method": "generalize:plzPrefix",
  "params": { "length": 2 },
  "appliesIn": ["analytics"]
}

Consumer SDK Integration

The quasi-id-generalizers.ts module in the consumer SDK is generated from the Library/generalize-methods resource defined in this IG. The Library embeds a JSON schema (content type application/json, base64-encoded) that specifies:

  • The method code string for each generalizer
  • The parameter name, type, constraints, and per-mode defaults
  • The error codes raised for each failure condition

Implementations should fetch and decode Library.content[0].data to obtain the authoritative parameter schema rather than hard-coding method signatures. This ensures the SDK stays in sync with IG version updates.

The Library resource is available at: https://fhir.cognovis.de/de-identification/Library/generalize-methods