React Advanced Odontogram - v2.2.1
    Preparing search index...

    Function applyRecurrentCariesScore

    • SP6 Task 2: the recurrent (secondary) caries transition on a FILLED surface. The CARS group of the contextual popup drives the caries state-machine on a surface that carries a filling:

      • score 0 (Sound) → remove the caries from the surface (revert to a plain filling) and clear its severity;
      • score > 0 → add the caries to the surface (becomes recurrent / subcaries-{surface}) and store the CARS value as its severity. Guarded on the filling actually being present, so a CARS score never lands on a surface without a filling (that would be primary caries, authored via the depth group instead). Mutates state.caries (Set of caries-{surface}) and state.cariesSeverity (Map surface→0..6). Extracted so the two transitions are unit-testable without the DOM.

      Parameters

      • state: {
            caries: Set<string>;
            cariesSeverity: Map<string, number>;
            fillingSurfaceMaterials: Map<string, string>;
        }
      • surface: string
      • score: number

      Returns void