import type { Encounter, FhirResource, Patient, Practitioner } from 'fhir/r4'; import type Client from 'fhirclient/lib/Client'; import type { FhirContext } from '@aehrc/sdc-populate'; /** * SmartConfigStore properties and methods * Properties can be accessed for fine-grain details. * Methods are usually used internally, using them from an external source is not recommended. * * @property client - The FHIRClient object (https://github.com/smart-on-fhir/client-js) * @property patient - The patient resource in context * @property user - The user resource in context * @property encounter - The encounter resource in context * @property fhirContext - fhirContext array from SMART App Launch * @property resolvedFhirContextReferences - resolved references from fhirContext, keyed by resource type e.g. `{ "PractitionerRole": }` * @property setClient - Set the FHIRClient object when launching via SMART App Launch * @property setPatient - Set the patient resource in context * @property setUser - Set the user resource in context * @property setEncounter - Set the encounter resource in context * @property setFhirContext - Set the fhirContext array from SMART App Launch * @property setResolvedFhirContextReferences - Set the resolvedFhirContextReferences object * * @author Sean Fong */ export interface SmartConfigStoreType { client: Client | null; patient: Patient | null; user: Practitioner | null; encounter: Encounter | null; fhirContext: FhirContext[] | null; resolvedFhirContextReferences: Record | null; setClient: (client: Client) => void; setPatient: (patient: Patient) => void; setUser: (user: Practitioner) => void; setEncounter: (encounter: Encounter) => void; setFhirContext: (fhirContext: FhirContext[]) => void; setResolvedFhirContextReferences: (resolvedFhirContextReferences: Record) => void; } /** * Smart Config state management store. This is only used for answerExpressions. * It is recommended to manage the state of the FHIRClient, patient, user, and encounter in the parent application, since the renderer doesn't provide pre-population capabilities. * Will be deprecated in version 1.0.0. * * This is the vanilla version of the store which can be used in non-React environments. * @see {@link SmartConfigStoreType} for available properties and methods. * * @author Sean Fong */ export declare const smartConfigStore: import("zustand/vanilla").StoreApi; /** * Smart Config state management store. This is only used for answerExpressions. * It is recommended to manage the state of the FHIRClient, patient, user, and encounter in the parent application, since the renderer doesn't provide pre-population capabilities. * Will be deprecated in version 1.0.0. * * This is the React version of the store which can be used as React hooks in React functional components. * @see {@link SmartConfigStoreType} for available properties and methods. * @see {@link smartConfigStore} for the vanilla store. * * @author Sean Fong */ export declare const useSmartConfigStore: import("zustand/vanilla").StoreApi & { use: { client: () => Client | null; patient: () => Patient | null; user: () => Practitioner | null; encounter: () => Encounter | null; fhirContext: () => FhirContext[] | null; resolvedFhirContextReferences: () => Record | null; setClient: () => (client: Client) => void; setPatient: () => (patient: Patient) => void; setUser: () => (user: Practitioner) => void; setEncounter: () => (encounter: Encounter) => void; setFhirContext: () => (fhirContext: FhirContext[]) => void; setResolvedFhirContextReferences: () => (resolvedFhirContextReferences: Record) => void; }; };