operationsGenetics / PGx personalization

Genetics / PGx personalization

Genetic personalization (B-3) lets a member’s genotype shape their clinical recommendations, grounded in a cited 6-gene catalog. It’s dark by default — with no genotype on file or the flag off, recommendations are unchanged.

The catalog (@platform/genetics)

A faithful, dependency-free library: the citation-backed catalog for DIO1, DIO2, MTHFR, TPO, CTLA4, VDR plus normalizeGenotypeCall / analyzeGenetics / applyGeneticModifiers. Each gene carries a variant name (rsID), evidence level, summary, rationale, and references. The modifiers are contextual (e.g. “prefer methylated B-vitamin forms for MTHFR variants”), never diagnostic.

Genotype ingestion (the path that never existed)

Genotype lives in patient-graph (patient_graph.genetic_profiles, one row per patient). Two ways in, via POST /v1/patients/{id}/genetic-profiles:

  • Raw DTC export — pass raw_genotypes as a flat rsid → genotype map (23andMe / AncestryDNA raw data). @platform/genetics.parseRawGenotypes maps the catalog’s rsIDs into normalized calls using strand-aware variant-allele counting (validated against a real 23andMe export: rs1801133 AG → C677T het, rs1801131 GT → A1298C het, rs2228570 AG → VDR FokI het, rs225014 TT → DIO2 Ala/Ala).
  • Structured profile — pass an already-normalized profile.

Ingestion is an upsert (genotype doesn’t change). GET returns the stored profile to authorized callers.

How it changes a recommendation

POST /v1/recommendations/generate (clinical) generates the ranked list, then — only when feature.clinical.genetics is on for the member AND a genotype exists — fetches the genotype from patient-graph and applies applyGeneticModifiers: matching recommendations get a genetics note appended to their description/rationale (e.g. the MTHFR methylation note on a B-complex rec). The audit records genetic_modifiers_applied (a count, never an allele).

PHI

The genotype calls are the most identifying PHI we hold. The genetic_profiles_safe view omits profile entirely (exposes only that a genotype exists + provenance — never an allele). Reads are ownership-checked (self or admin); erasure deletes the genotype with the rest of the patient’s record. The clinical fetch is M2M (admin:patient_graph), fail-open (any error → recommendations generated without genetic modifiers).

Flag

feature.clinical.genetics (dark feature flag, default off). Off → genotype data may be stored but never changes a recommendation. One flip to enable per (brand,user); one flip back to roll back.