///
import { Clinic, PatientProfile, IntakeData, Location, MeasurementData, Sensor, SensorMeasurementData, SignUpInfo, LoginInfo, User, ScreenName, HealthHistoryData, DocumentData, GenericMeasurement, BloodPressureMeasurement, PulseOxMeasurement, ThermometerMeasurement, GlucometerMeasurement, WeightScaleMeaurement, SpirometerMeasurement, MultifunctionMeasurement, PdfFileData, PdfDataSummary, PrescriptionText, MeasurementFileDataSummary } from '../types';
export * from '../types';
export interface GaleEventTypes {
/** Called when the user changes the system language. */
languagechange: null;
/** Called when the user fills out an intake form. */
intake: null;
/** Called when a new sesnor measurement is available. */
sensormeasurementdata: SensorMeasurementData;
/** Called when an external authentication login JSON is received */
externallogin: JSON;
/** Called when a sensor measurement is complete. */
sensordata: null;
/** Called when the user logs in or out. */
loginchange: null;
/** Called when a login request succeeeds. */
loginsuccess: null;
/** Called when a login request fails. */
loginerror: null;
/** Called when a new account is created. */
signupsuccess: null;
/** Called when creating a new account has failed, with the reason for failure. */
signuperror: string;
/** Called when a patient session has started or ended */
sessionchange: null;
/** Called when a zoom call has ended */
callend: null;
/** Called when a zoom call has started */
callstart: null;
/** Called when an error is thrown from the API, with the error message */
apierror: null;
}
export declare type EventType = keyof GaleEventTypes;
export declare class GaleEvent extends Event {
readonly data: GaleEventTypes[Type];
constructor(type: EventType, data?: GaleEventTypes[Type]);
}
export declare class GaleAPIBridge extends EventTarget {
private port;
private key;
/**
* @param options
* @param options.apiKey The 19Labs API key.
* @param options.simulatorPort A TCP port for running the 19Gale Simulator.
*/
constructor(options: {
apiKey: string;
simulatorPort?: number;
});
/**
Listen to a system event from Gale.
*/
listen(type: T, listener: (event: GaleEvent) => any): void;
unlisten(type: T, listener: (event: GaleEvent) => any): void;
/** @hidden */
addEventListener(event: string, handler: EventListener): void;
/** @hidden */
removeEventListener(event: string, handler: EventListener): void;
/** @hidden */
dispatchEvent(e: GaleEvent): boolean;
private adjustMeasurementData;
private sendCommand;
private sendCommandWithResponse;
private waitForAnyEvent;
/**
@return the current user, or null if not logged in.
*/
getCurrentUser(): Promise;
/**
@return the current language code, e.g. "en" or "es".
*/
getCurrentLanguage(): Promise;
/**
@return the current intake data, as filled in with the intake form.
*/
getIntake(): Promise;
/**
@return the device serial id
*/
getName(): Promise;
/**
@return the device serial id
*/
getSerial(): Promise;
/**
@return the device location
*/
getLocation(): Promise;
/**
@return all known sensor measurements for the current session.
*/
getSensorData(startSessionTime?: number): Promise;
/**
Attempts a login given a user and a password.
@param username
@param password
@return the current user if successful, throws an error otherwise.
*/
login(info: LoginInfo): Promise;
/**
Log outs from gale.
*/
logout(): Promise;
/**
Signs up a new user.
*/
signUp(info: SignUpInfo): Promise;
/** Saves the intake data. The format of the intake data is not defined. */
updateIntake(intake: object): Promise;
/**
Returns a list of clinics, as defined in the Gale configuration.
*/
getClinics(): Promise;
/**
Returns a list of patient profiles registered to the current user.
*/
getPatientProfiles(): Promise;
/**
Returns a list of available sensors, as defined in the Gale DMS.
*/
getSensors(): Promise;
/**
Shows a sensor page of a given type.
@see {@link BuiltinSensorTypes}.
*/
showSensor(type: string): Promise;
/**
Instructs Gale to navigate to a particular native page.
@param name the name of the screen to navigate to.
@param arg An optional argument for the screen. Can be the sensor type when showing a sensor,
or the clinic name when showing a clinic.
*/
navigate(name: ScreenName, arg?: string): void;
/**
Switch to a previously created patient profile.
@param patientName the full name of the patient
@param dateOfBirth the date of birth of the patient as recorded
*/
switchPatientProfile(profile: PatientProfile): void;
/**
Saves the current session data to the patient profile.
*/
saveCurrentPatientProfile(): void;
/**
* Produces email popup to send patient profile pdf summary
*/
submitHealthData(): void;
/**
* Print the current page
*/
print(): void;
/**
* Send an email with an attached pdf of a summary of the patient profile
* @param recipients A list of email addresses that the email will be sent to
* @param customBody The content of the email
*/
sendSummaryEmail(recipients: string, customBody: string): void;
/**
*
* @param {HealthHistoryData} healthHistory
* e.g. '{"allergies":"peanuts","medications":"tylenol","conditions":"asthma","medicalHistory":"The patient's medical history"}'
*/
setIntakeHealthHistory(healthHistory: HealthHistoryData): void;
addExternalDocument(document: DocumentData): void;
/**
*
* Creates a generic measurement treated as if it was made by an external application
*/
setMeasurement(data: GenericMeasurement): void;
/**
*
* @returns An object containing metedata for all pdf files stored on the device.
Each file object within the pdf files JSON has a uri attribute which can be used to reference the file using getPdfFileByUri
*/
getPdfData(): Promise;
/**
*
* @returns A JSON object containing the text from all PDFs, as well as whether it is left or right aligned.
*/
getPrescriptionText(): Promise;
/**
* @returns An object contatining metedata for all measurement files stored on the device.
* Each file object within the measurement files JSON has a uri attribute which can be used to reference the file using getMeasurementFileByUri
*/
getMeasurementFileData(): Promise;
/**
* Takes a file uri as a reference, exposes the relevant file to the captive webpage and returns a reference to the newly exposed file.
* The reference will take the form of https://{captivewebpageurl}/public/{filename} and the reference can be used as if the file were a part of the webpages directory
* @param uri The uri that references a measurement file. The uri can be obtained from getMeasurementFileData
* @returns Returns a string that can be used to reference the relevant file.
*/
getMeasurementFileByUri(uri: string): Promise;
/**
* Takes a file uri as a reference, exposes the relevant file to the captive webpage and returns a reference to the newly exposed file.
* The reference will take the form of https://{captivewebpageurl}/public/{filename} and the reference can be used as if the file were a part of the webpages directory
* @param uri The uri that references a Pdf file. The uri can be obtained from getPdfFileData
* @returns Returns a string that can be used to reference the relevant file.
*/
getPdfByUri(uri: string): Promise;
/**
*
* @returns An object containing metadata of all prescriptions if it exists
*/
getPrescriptionData(): Promise;
/**
*
* @returns An object containing metadata of all prescriptions if it exists
*/
getPatientVisitSummaryData(): Promise;
/**
*
* @param {string} note The note to be added to the patient profile
*/
setNote(note: string): void;
/**
*
* @param {string} user
* @param {string} profile
*/
authenticate(user: string, profile: string): void;
/**
* End a current session
*/
endSession(): Promise;
/**
* All of the below methods have a similar function, they create a manual measurement of
* the type specified by the method using measurement data provided
* @param data The relevant measurement data
*/
addBloodPressureData(data: BloodPressureMeasurement): void;
addPulseOxData(data: PulseOxMeasurement): void;
addThermometerData(data: ThermometerMeasurement): void;
addGlucometerData(data: GlucometerMeasurement): void;
addWeightScaleData(data: WeightScaleMeaurement): void;
addSpirometerData(data: SpirometerMeasurement): void;
addMultifunctionData(data: MultifunctionMeasurement): void;
}
//# sourceMappingURL=bridge.d.ts.map