mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
refactor(insights): drop the unused baseline-capable-type allowlist
The additive HealthKit baselines dispatch via an explicit per-metric type map, so the allowlist helper and its constant had no consumer.
This commit is contained in:
1 parent
46be440ee8
commit
7ff91fcf55
2 files changed
-26
No files matched your search
@@ -39,11 +39,9 @@ export type { DeriveCoverageArgs } from "./coverage";
|
||||
export {
|
||||
DERIVED_METRIC_IDS,
|
||||
VITALS_BASELINE_TYPES,
|
||||
BASELINE_CAPABLE_TYPES,
|
||||
isDerivedMetricId,
|
||||
getDerivedMetricMeta,
|
||||
isVitalsBaselineType,
|
||||
isBaselineCapableType,
|
||||
} from "./registry";
|
||||
export type {
|
||||
DerivedMetricId,
|
||||
|
||||
@@ -124,25 +124,6 @@ export const VITALS_BASELINE_TYPES: MeasurementType[] = [
|
||||
"WEIGHT",
|
||||
];
|
||||
|
||||
/**
|
||||
* The full set of measurement types the type-generic baseline engine
|
||||
* (`computeVitalsBaseline`, median ± k·MAD) can produce a personal band
|
||||
* for. A superset of `VITALS_BASELINE_TYPES`: it adds the v1.10.3
|
||||
* additive HealthKit signals that get an `any-user-baseline` derived
|
||||
* metric of their own (wrist temperature as a personal-deviation band;
|
||||
* stair ascent/descent speed as a personal trend band — NO population
|
||||
* cutoff, since stair pace is geometry-confounded). The engine is
|
||||
* type-generic; this allowlist is the gate, kept distinct from
|
||||
* `VITALS_BASELINE_TYPES` so a stair-speed baseline is never mislabelled a
|
||||
* "vital".
|
||||
*/
|
||||
export const BASELINE_CAPABLE_TYPES: MeasurementType[] = [
|
||||
...VITALS_BASELINE_TYPES,
|
||||
"WRIST_TEMPERATURE",
|
||||
"STAIR_ASCENT_SPEED",
|
||||
"STAIR_DESCENT_SPEED",
|
||||
];
|
||||
|
||||
const REGISTRY: Record<DerivedMetricId, DerivedMetricMeta> = {
|
||||
VITALS_BASELINE: {
|
||||
id: "VITALS_BASELINE",
|
||||
@@ -306,8 +287,3 @@ export function getDerivedMetricMeta(
|
||||
export function isVitalsBaselineType(type: string): boolean {
|
||||
return (VITALS_BASELINE_TYPES as string[]).includes(type);
|
||||
}
|
||||
|
||||
/** `true` when the type-generic baseline engine can band this type. */
|
||||
export function isBaselineCapableType(type: string): boolean {
|
||||
return (BASELINE_CAPABLE_TYPES as string[]).includes(type);
|
||||
}
|
||||
Reference in new issue
Block a user