/// declare module "helpers" { export const logger: ProxyHandler; export function getFormValue(formName: string, key: string, def?: string): FormDataEntryValue | null | undefined; export const assert: (value: T | null | undefined, error?: string | undefined) => T; } declare module "internal" { export interface IntakeDataInternal { personalInfo: { firstName: string; lastName: string; dateOfBirth: string; gender: string; genderIndex: number; cardId: string; }; insurance: { hasInsurance: boolean; noInsurance: boolean; insurancePlanNotListed: boolean; insuranceName: string; insuranceID: string; guestVisitNotes: string; }; patientPhysiqueInfo: { height: { cm: string; feet: string; inch: string; heightUnit: string; }; weight: { weight: string; weightUnit: string; }; }; sessionId: string; } export interface ClinicInternal { clinicType: string; contactnumber: string; cpkey: string; datecreated: string; displaycontactnumber: boolean; displayname: string; h323number: string; lastmodified: string; logoembed: string; logoimage: string; name: string; requiresintake: boolean; shortdescription: string; sipnumber: string; transferclinic: string; type: string; uuid: string; zoomcheckbox?: string; zoomnumber?: string; allowRpm?: boolean; termsAndConditions?: string; } export interface SensorInternal { type: string; name: string; logoembed?: string; file?: string; } export interface NativeAPI { initMessagePort(nonce: string, hash: string): void; getCurrentUser(nonce: string, hash: string): string; getIntakeData(nonce: string, hash: string): string; getProxyResult(nonce: string, hash: string): string; getCurrentLanguage(): string; getClinics(nonce: string, hash: string): ClinicInternal[]; getSensors(nonce: string, hash: string): SensorInternal[]; getCurrentData(nonce: string, hash: string): any; bitmapToPNG(bitmapBase64: string): string; showClinic(name: string): void; showSensor(nonce: string, hash: string, name: string): void; showLogin(): void; showSignup(): void; showCallCenter(): void; showWellness(): void; showSensors(): void; showSummary(): void; showIntake(nonce: string, hash: string): void; showRestoreSession(nonce: string, hash: string): void; showSaveSession(nonce: string, hash: string): void; showNewSession(nonce: string, hash: string): void; showPatientProfile(nonce: string, hash: string): void; submitHealthData(nonce: string, hash: string): void; getMessagePort(nonce: string, hash: string): void; setIntake(intake: string): void; sendSummaryEmail(recipients: string, customBody: string): void; submitProxyUrl(nonce: string, hash: string, url: string, body: string): void; switchPatientProfile(nonce: string, hash: string, username: string, profileName: string, dobISO: string): void; } } declare module "types" { /** A call-center entry */ export interface Clinic { /** Display name of the clinic. Also used for navigating */ name: string; contactNumber: string; lastModified: Date; /** base64 encoded JPEG data */ logo: string; requiresIntake: boolean; zoomNumber?: string; sipNumber?: string; description: string; type: 'Amwell' | 'Zoom Call'; } export interface Sensor { type: BuiltinSensorTypes | string; name: string; /** base64-encoded JPEG */ logo: string | null; } export interface User { firstName: string; lastName: string; email: string; phone: string; } export interface LoginInfo { password: string; email: string; } export interface PatientProfile { patientName: string; dateOfBirth: Date; } export interface SignUpInfo extends User { password: string; confirmPassword: string; } export interface UpdateUserInfo { password: string; newFirstName?: string; newLastName?: string; newDob?: string; newEmail?: string; newGender?: string; newPhone?: string; } export interface IntakeData { info: { firstName: string; lastName: string; dateOfBirth: Date; gender: string; cardId: string; }; insurance: { status: 'yes' | 'no' | 'unspecified'; id: string; guestVisitNotes: string; }; physique: { height: string; heightUnit: 'cm' | 'feet' | 'inch'; weight: string; weightUnit: 'kg' | 'lb'; }; } export interface HealthHistoryData { allergies: string; medications: string; conditions: string; medicalHistory: string; } export interface PdfDataSummary { patientVisitSummaries?: PdfFileData[]; patientPrescriptions?: PdfFileData[]; } export interface PdfFileData { filename: string; providerName: string; clinicName: string; timestamp: string; uri: string; } export interface MeasurementFileDataSummary { stethoscope?: StethoscopeFileData[]; camera?: ImageFileData[]; otoscope?: ImageFileData[]; digitalCamera?: ImageFileData[]; } export interface ImageFileData { image: string; timestamp: string; uri: string; } export interface StethoscopeFileData { name: string; timestamp: string; uri: string; } export type SensorState = 'Disconnected' | 'Scanning' | 'Connected' | 'Active' | 'Connecting' | 'Setup'; export interface MeasurementData { state: SensorState; status: number; type: string; } export interface WeightScaleData extends MeasurementDataWithTimestamp { weight: number; unit: 'kg' | 'lb'; } export interface MeasurementDataWithTimestamp extends MeasurementData { time: string; timecomparitor: number; timestamp: string; } export interface BloodPressureMeasurementData extends MeasurementDataWithTimestamp { heartrate: number; highpressure: number; lowpressure: number; severity: string; } export interface ThermometerMeasurementData extends MeasurementDataWithTimestamp { temperature: string; } export interface CameraMeasurementData extends MeasurementData { } export interface OtoscopeImageData extends MeasurementData { imagecount: number; } export interface SingleMeasurementData extends MeasurementData { data: string; label: string; severity: string; status: number; unit: string; } export interface PulseOximeterData extends MeasurementDataWithTimestamp { PI: string; oxygen: string; plethysmograph?: number[]; respirationRate?: string; pulse: string; rssi: number; severity: string; } export interface GlucometerData extends MeasurementDataWithTimestamp { unit: number; glucometerData: string; } export interface StethoscopeMeasurementData extends MeasurementDataWithTimestamp { recordingtype: string; recordingname: string; duration: number; } /** Built-in sensors and their measurement data schemas */ export interface SensorTypes { 'Weight Scale': WeightScaleData; 'Thermometer': ThermometerMeasurementData; 'Glucometer': GlucometerData; 'Blood Pressure Monitor': BloodPressureMeasurementData; 'Camera': CameraMeasurementData; 'Otoscope': OtoscopeImageData; 'Pulse Oximeter': PulseOximeterData; 'Stethoscope': StethoscopeMeasurementData; } export interface MeasurementWithOptionalTimestamp { timestamp?: string; } export interface GenericMeasurement extends MeasurementWithOptionalTimestamp { name: string; value: string; units: string; device: string; } export interface BloodPressureMeasurement extends MeasurementWithOptionalTimestamp { pulse: string; highPressure: string; lowPressure: string; } export interface PulseOxMeasurement extends MeasurementWithOptionalTimestamp { perfusion: string; oxygen: string; respirationRate?: string; pulse: string; } export interface ThermometerMeasurement extends MeasurementWithOptionalTimestamp { temperature: string; unit: 'celsius' | 'fahrenheit'; } export interface GlucometerMeasurement extends MeasurementWithOptionalTimestamp { bloodSugar: string; unit: 'mg/dL' | 'mmol/L'; } export interface WeightScaleMeaurement extends MeasurementWithOptionalTimestamp { weight: string; unit: 'lbs' | 'kg'; bmi?: string; } export interface SpirometerMeasurement extends MeasurementWithOptionalTimestamp { label: 'PEF' | 'FVC' | 'FEF2575' | 'FEV6' | 'FEV1' | 'FEV1_FVC'; unit: 'L/m' | 'L' | '%'; value: string; } export interface MultifunctionMeasurement extends MeasurementWithOptionalTimestamp { label: 'BLOOD_SUGAR' | 'KETONE' | 'LACTATE' | 'CHOLESTEROL' | 'URIC_ACID'; unit: 'mg/dL' | 'mmol/L'; value: string; } /** Screens that the page can navigate to using the navigate() command. */ export type ScreenName = 'login' | 'signup' | 'callcenter' | 'clinic' | 'wellness' | 'sensors' | 'summary' | 'newSession' | 'switchProfile' | 'sensor' | 'logout'; export type BuiltinSensorTypes = keyof SensorTypes; export type SensorMeasurementData = SensorTypes[keyof SensorTypes]; } declare module "client/bridge" { import { Clinic, PatientProfile, IntakeData, MeasurementData, Sensor, SensorMeasurementData, SignUpInfo, LoginInfo, User, ScreenName, HealthHistoryData, GenericMeasurement, BloodPressureMeasurement, PulseOxMeasurement, ThermometerMeasurement, GlucometerMeasurement, WeightScaleMeaurement, SpirometerMeasurement, MultifunctionMeasurement, PdfFileData, PdfDataSummary, MeasurementFileDataSummary } from "types"; export { Clinic, Sensor, PatientProfile, IntakeData, User, SensorMeasurementData, LoginInfo, SignUpInfo, UpdateUserInfo, MeasurementData, BuiltinSensorTypes, SensorTypes, ScreenName } 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 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 an error is thrown from the API, with the error message */ apierror: null; } export type EventType = keyof GaleEventTypes; export class GaleEvent extends Event { readonly data: GaleEventTypes[Type]; constructor(type: EventType, data?: GaleEventTypes[Type]); } export 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 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 all known sensor measurements for the current session. */ getSensorData(): 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; /** * * 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 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(): void; /** * 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; } } declare module "client/dom" { import { GaleAPIBridge } from "client/bridge"; export function init(bridge: GaleAPIBridge): Promise; } declare module "simulator/lib/ConfigSchema" { import { ClinicInternal, SensorInternal } from "internal"; interface ScreenConfig { hipaaCheck: boolean; icon: string; url?: string; } interface Language { code: string; default: boolean; name: string; visible: boolean; } export interface FullConfigSchema { device: { alerts: { data: { condition: string; message: string; severity: string; title: string; type: string; }; timestamp: string; }[]; amwell: { apikey: string; https: string; password: string; username: string; }; assignedPosition: any; careprovider: string; config: { allowScreenTimeout: boolean; amwell: { apikey: string; https: string; password: string; username: string; }; availableLanguages: Language[]; availableguides: { name: string; visible: boolean; }[]; backgroundimage: string; backgroundimageembed: string | null; backgroundimagename: string | null; callCenter: { clinicsDefault: boolean; clinicsEnable: boolean; clinicsEnglishName: string; clinicsFooter: boolean; clinicsName: string; clinicsShow: boolean; clinicsSpanishName: string; } & ScreenConfig; clinics: ClinicInternal[]; contacts: { contactsDefault: boolean; contactsEnable: boolean; contactsEnglishName: string; contactsSpanishName: string; contactsFooter: boolean; contactsName: string; contactsShow?: string; } & ScreenConfig; cpkey: string; createAccount: { createAccountDefault: boolean; createAccountEnable: boolean; createAccountFooter: boolean; createAccountName: string; } & ScreenConfig; datecreated: string; daydreamurl: string; feedback: { "feedbackDefault": boolean; "feedbackEnable": boolean; "feedbackEnglishName": string; "feedbackFooter": boolean; "feedbackName": string; "feedbackSpanishName": string; } & ScreenConfig; firstavailabledoctor: object; guides: { guidesDefault: boolean; guidesEnable: boolean; guidesEnglishName: string; guidesFooter: boolean; guidesName: string; guidesShow: boolean; guidesSpanishName: string; } & ScreenConfig; hideContacts: boolean; hideCreateUser: boolean; home: { homeDefault: boolean; homeEnable: boolean; homeEnglishName: string; homeFooter: boolean; homeName: string; homeShow: boolean; homeSpanishName: string; homeUrl: string; } & ScreenConfig; homeurl: string | null; intake: { intakeDefault: boolean; intakeFooter: boolean; intakeEnable: boolean; intakeName: string; } & ScreenConfig; lastmodified: string; measurements: { measurementsDefault: boolean; measurementsEnable: boolean; measurementsEnglishName: string; measurementsFooter: boolean; measurementsName: string; measurementsShow: boolean; measurementsSpanishName: string; } & ScreenConfig; modulesenabled: any[]; name: string; nameofcustom: string; newSession: { newSessionDefault: boolean; newSessionEnable: boolean; newSessionFooter: boolean; newSessionName: string; } & ScreenConfig; notes: string; openfirstcustom: boolean; owner: string; prxydeviceport: string; prxyserverport: string; prxyurl: string; restoreSession: { restoreSessionDefault: boolean; restoreSessionEnable: boolean; restoreSessionFooter: boolean; restoreSessionName: string; } & ScreenConfig; saveSession: { saveSessionDefault: boolean; saveSessionEnable: boolean; saveSessionFooter: boolean; saveSessionName: string; } & ScreenConfig; settings: { settingsDefault: boolean; settingsEnable: boolean; settingsEnglishName: string; settingsFooter: boolean; settingsName: string; settingsShow: boolean; settingsSpanishName: string; } & ScreenConfig; smartcall: any[]; twilio: { accountSid: string; authToken: string; }; type: string; userAccount: boolean; uuid: string; wellness: { wellnessDefault: boolean; wellnessEnable: boolean; wellnessEnglishName: string; wellnessFooter: boolean; wellnessName: string; wellnessShow: boolean; wellnessSpanishName: string; wellnessUrl: string; } & ScreenConfig; wellnessUrl: string; }; contacts: any[]; cpkey: string; datecreated: string; devicepwd: string; diagnosticdevices: SensorInternal[]; email: { password: string; user: string; }; guidesUrl: string; lastmodified: string; lastmodifiedby: string; location: { address: string; city: string; country: string; state: string; zip: string; }; name: string; notes: string; provision: boolean; pubkey: string; sensorInstructionsUrl: string; serial19Labs: string; serialnumber: string; subAccount: string; termsAndConditions: string; type: string; uuid: string; }; } interface ScreenSetup { url: string; name: string; default: boolean; footer: boolean; } export interface ConfigSchema { sensors: SensorInternal[]; clinics: ClinicInternal[]; deviceName: string; languages: Language[]; home: ScreenSetup | null; wellness: ScreenSetup | null; callcenter: ScreenSetup | null; measurements: ScreenSetup | null; } export function parseConfigSchema(internal: FullConfigSchema): ConfigSchema; } declare module "simulator/lib/bootstrap" { export function createConfig(serialnumber: string): Promise<{ p12cert: Blob; password: string; }>; export function registerDevice(): Promise; export function updateConfig(): Promise; } declare module "simulator/lib/simulator" { } //# sourceMappingURL=index.d.ts.map