///
export type UnitType = {
code: string;
default: boolean;
display: string;
system: string;
target: number;
unit: string;
increment?: number;
stepAmount?: number;
quickAddAmount?: number;
displayZero?: string;
displayOne?: string;
displayTwo?: string;
displayFew?: string;
displayMany?: string;
displayOther?: string;
targetMin?: number;
targetMax?: number;
targetStepAmount?: number;
};
export type MetricType = {
account: string;
color: string;
description: string;
image?: string;
icon: string;
id: string;
lifePoints: number;
name: string;
resourceType: 'Observation' | 'Procedure';
units: UnitType[];
code: string;
system: string;
};
export type InstalledMetricSettings = Pick & {
order: number;
installed?: boolean;
};
export type BulkInstalledMetricSettings = InstalledMetricSettings & {
metricId: string;
};
export type InstalledMetric = MetricType & InstalledMetricSettings & {
metricId: string;
};
export type Tracker = MetricType & Partial;
export type TrackerValue = {
code: TrackerResource['code'];
id: string;
createdDate: Date;
value: number;
};
/**
* @description A map of dates, in UTC format at the start of the user's day, to a map of metricIds to _TrackerValue_ objects
*/
export type TrackerValues = Record>;
/**
* @description TrackerValues keyed by a values context key like system|key
*/
export type ContextTrackerValues = Record;
export type EducationContent = {
description?: string;
thumbnail?: string;
url?: string;
};
export type Code = {
system: string;
code: string;
display: string;
id?: string;
educationContent?: EducationContent;
};
export type TrackerResource = {
id?: string;
code: {
coding: Code[];
};
meta: {
tag: Array<{
code: string;
system: string;
}>;
};
status: string;
} & ({
readonly resourceType: 'Observation';
effectiveDateTime: string;
valueQuantity: {
value: number;
unit: string;
system: string;
code: string;
};
} | {
readonly resourceType: 'Procedure';
performedPeriod: {
start: string;
end: string;
};
});
export type CodedRelationship = Code & {
specializedBy: CodedRelationship[];
};
/**
* @description A system and codeBelow, used for querying via codeBelow but
* also for caching purposes. It should represent the tile/context under
* which values should be fetched & cached.
*/
export type TrackerValuesContext = {
system: string;
codeBelow: string;
shouldUseOntology?: boolean;
};
export declare class TrackerDetailsError extends Error {
userErrorMessage?: string;
}
export declare const TRACK_TILE_CAPABILITIES_VERSION = 3;
export declare const TRACK_TILE_CAPABILITIES_VERSION_HEADER = "LifeOmic-TrackTile-Capabilities-Version";
export declare const TRACKER_CODE = "f0ff8f26-eb4d-4322-9683-390c90aab83d";
export declare const TRACKER_CODE_SYSTEM = "http://lifeomic.com/fhir/track-tile-value";
export declare const TRACKER_PILLAR_CODE = "b7d1b3f4-89cd-4c11-9f00-024a9a7bd235";
export declare const TRACKER_PILLAR_CODE_SYSTEM = "http://lifeomic.com/fhir/track-tile-pillar-value";
export type TrackTileService = {
/**
* @description providing a patientId will tag the resources with the subject's id and query for data with the same id.
*/
readonly patientId?: string;
/**
* @description account and project that is used for fetching tracker settings.
*/
readonly accountId: string;
readonly projectId: string;
fetchTrackers: (includePublic?: boolean) => Promise;
upsertTracker: (metricId: string, settings: InstalledMetricSettings) => Promise;
upsertTrackers: (settings: BulkInstalledMetricSettings[]) => Promise;
/**
* @description NOTE: For Procedure resources, the TrackerValue `value` prop
* MUST be returned as the duration (end-start) in seconds.
*/
fetchTrackerValues: (valuesContext: TrackerValuesContext, dates: {
start: Date;
end: Date;
}) => Promise;
upsertTrackerResource: (valuesContext: TrackerValuesContext, resource: TrackerResource) => Promise;
deleteTrackerResource: (valuesContext: TrackerValuesContext, resourceType: Tracker['resourceType'], id: string) => Promise;
fetchOntology: (code: string) => Promise;
};
export declare const TrackTileServiceContext: import("react").Context;
export declare const TrackTileServiceProvider: import("react").Provider;
export declare const useTrackTileService: () => TrackTileService;
export declare const extractBulkSettings: (install: InstalledMetric) => BulkInstalledMetricSettings;