UNPKG

@medplum/dosespot-react

Version:

Medplum DoseSpot React SDK

88 lines (65 loc) 3.46 kB
import type { CodeableConcept } from '@medplum/fhirtypes'; import type { Coding } from '@medplum/fhirtypes'; import type { Identifier } from '@medplum/fhirtypes'; import type { MedicationKnowledge } from '@medplum/fhirtypes'; export declare const DOSESPOT_ADD_FAVORITE_MEDICATION_BOT: Identifier; export declare const DOSESPOT_CLINIC_FAVORITE_ID_SYSTEM = "https://dosespot.com/clinic-favorite-medication-id"; export declare const DOSESPOT_DISPENSABLE_DRUG_ID_SYSTEM = "https://dosespot.com/dispensable-drug-id"; export declare const DOSESPOT_GET_FAVORITE_MEDICATIONS_BOT: Identifier; export declare const DOSESPOT_IFRAME_BOT: Identifier; export declare const DOSESPOT_MEDICATION_HISTORY_BOT: Identifier; export declare const DOSESPOT_NOTIFICATION_COUNTS_BOT: Identifier; export declare const DOSESPOT_PATIENT_ID_SYSTEM = "https://dosespot.com/patient-id"; export declare const DOSESPOT_PATIENT_SYNC_BOT: Identifier; export declare const DOSESPOT_PRESCRIPTIONS_SYNC_BOT: Identifier; export declare const DOSESPOT_SEARCH_MEDICATIONS_BOT: Identifier; export declare interface DoseSpotClinicFormularyReturn { state: DoseSpotClinicFormularyState; /** * Search for DoseSpot Medications and returns array of temporary MedicationKnowledge objects that are not yet saved to the FHIR server */ readonly searchMedications: (searchTerm: string) => Promise<CodeableConcept[]>; /** * Set the currently selected medication. Can be set as a CodeableConcept or a Coding, but state is always stored as a CodeableConcept */ readonly setSelectedMedication: (medication: CodeableConcept | Coding | undefined) => void; /** * Set the directions for the currently selected medication */ readonly setSelectedMedicationDirections: (directions: string | undefined) => void; /** * Save a DoseSpot Medication to the Clinic's favorites and returns the MedicationKnowledge object that was saved */ readonly saveFavoriteMedication: () => Promise<MedicationKnowledge>; /** * Clear the state */ readonly clear: () => void; } export declare interface DoseSpotClinicFormularyState { selectedMedication: CodeableConcept | undefined; directions: string | undefined; } export declare interface DoseSpotIFrameOptions { readonly patientId?: string; readonly onPatientSyncSuccess?: () => void; readonly onIframeSuccess?: (url: string) => void; readonly onError?: (err: unknown) => void; } export declare interface DoseSpotNotificationCountsResponse { PendingPrescriptionsCount: number; PendingRxChangeCount: number; RefillRequestsCount: number; TransactionErrorsCount: number; } export declare interface DoseSpotNotificationsOptions { readonly refreshIntervalMilliseconds?: number; readonly onChange?: (count: number) => void; readonly onError?: (err: unknown) => void; } export declare const getMedicationName: (medication: MedicationKnowledge | undefined) => string; export declare const MEDPLUM_BOT_SYSTEM = "https://www.medplum.com/bots"; export declare function useDoseSpotClinicFormulary(): DoseSpotClinicFormularyReturn; export declare function useDoseSpotIFrame(options: DoseSpotIFrameOptions): string | undefined; export declare function useDoseSpotNotifications(options?: DoseSpotNotificationsOptions): number | undefined; export { }