public static class FhirUnitConverter
{
    public static (decimal Value, string Unit) Normalize(
        string internalCode, decimal value, string? fhirUnit, bool allowFahrenheit)
    {
        if (internalCode == "TEMP_C" && allowFahrenheit &&
            fhirUnit is not null &&
            (fhirUnit.Equals("[degF]", StringComparison.OrdinalIgnoreCase) ||
             fhirUnit.Equals("degF", StringComparison.OrdinalIgnoreCase)))
        {
            var celsius = (value - 32m) * 5m / 9m;
            return (Math.Round(celsius, 2), "Cel");
        }

        return (value, fhirUnit ?? "1");
    }
}