/** * Input model and clinical knowledge types for the pgx-cpic codec * (Pharmacogenomics Diplotype Panels -> FHIR R4 Genomics Reporting Bundle + CPIC Alerts). */ export const PGX_GENES = [ "CYP2C19", "CYP2D6", "CYP2C9", "VKORC1", "SLCO1B1", "DPYD", "TPMT", "NUDT15", "UGT1A1", "CYP3A5", "HLA-B*57:01", "HLA-B*58:01", "HLA-B*15:02", "G6PD", ] as const; export type PgxGene = (typeof PGX_GENES)[number]; export type PgxSeverity = "high" | "moderate" | "low"; export interface PgxPatient { family?: string; given?: string[]; /** ISO calendar date YYYY-MM-DD (1900-01-01 to 2079-06-06). */ birthDate?: string; } export interface PgxLab { name: string; } export interface PgxGeneResult { gene: PgxGene; /** * Diplotype / genotype string from the gene's built-in CPIC allele table * (e.g. "*1/*2", "*2/*2", "positive", "G/A") or a custom UTF-8 escape string. */ diplotype: string; } export interface PgxPanel { patient: PgxPatient; lab?: PgxLab; /** ISO calendar date YYYY-MM-DD (1900-01-01 to 2079-06-06). */ testDate: string; results: PgxGeneResult[]; } export interface CpicDrugAlert { severity: PgxSeverity; rxnorm: string; drug: string; implication: string; recommendation: string; } export interface GeneSpec { index: number; gene: PgxGene; slug: string; hgncId: string; hgncSymbol: string; bits: number; escapeCode: number; diplotypes: readonly { diplotype: string; phenotype: string; }[]; }