augnitoambientsdk
Version:
Use this typescript SDK to integrate Augnito’s Ambient Tech within your EMR. To get access credentials or know more about how Augnito Ambient can benefit you, please visit our website and connect with our sales team: https://augnito.ai/
193 lines (192 loc) • 9.46 kB
TypeScript
import AmbientConfig from "./config/AmbientConfig";
import { SettingsConfigType, UserConfigMap } from "./config/SettingsConfig";
import { NoteTypeConfig } from "./config/NoteTypeConfig";
import { PreferenceConfig } from "./config";
import ErrorInfo from "./config/ErrorInfo";
/**
* Augnito Ambient Manager
* @description Handles the connection with the Ambient API Server.
*/
export declare class AugnitoAmbient {
private _logTag;
private _ambientRestAPI;
private _ambientPaceAPI;
private config;
private enableLog;
private shouldReadAudioIntensity;
private recorderIns;
private forceStopAudio;
private _isRecording;
private echoCancellation;
private noiseSuppression;
private autoGainControl;
constructor(config: AmbientConfig);
/**
* @description Callback to receive the JOb Id
*/
onJobCreated?: (text: string) => void;
/**
* @description Callback for status changed
*/
onStateChanged?: (isRecording: boolean) => void;
/**
* Callback triggered when an error occurs within the SDK
*/
onError?: (error: ErrorInfo) => void;
onOtherResult?: (text: string) => void;
onIntensityValue?: (intensity: number) => void;
onIdleMic?: () => void;
onSoapNoteGenerated?: (soapNote: string) => void;
onTranscriptGenerated?: (transcript: string) => void;
onCodesGenerated?: (codes: string) => void;
onJobStatus?: (statusResponse: string) => void;
private initRecorder;
/**
* Returns the Note parameters which need be use while doing toggle listeing
* @returns JSON object of Note parameters
*/
getNoteParams(): Promise<any>;
/**
* @param PageSize number of notes to fetch
* @param PageID is optional parameter, send start page id to fetch
* @returns list of notes for the user
*/
getAllNotes(PageSize: number, PageID?: string): Promise<any>;
/**
* @param JobId to retrieve output for a specific audio file
* @returns JSON object contains both Transcript and Note on sucess else fail resonse
*/
getSummarizedNote(JobId: string): Promise<any>;
/**
* @param JobId needs to pass to store the final Note for that audio
* @param NoteDate This key will store the final edited Note that user wants to send.
* @returns suceess response on successful submit of note else fail response
*/
sendSummarizedNote(JobId: string, NoteDate: string): Promise<any>;
/**
* @param filetype Type of file being uploaded, wav, mp3, etc. Ex: “filetype=wav“
* @param noteparams Qualifiers to determine the type of clinical note to be generated for that audio file.
* @returns Callback triggers to reurn the Job id on meta message
*/
toggleListening(_filetype: string, _noteparams: string, jobName?: string, jobId?: string, recordedDuration?: number): void;
/**
* Method called to pause or resume audio recording accordingly
* @param filetype Type of file being uploaded, wav, mp3, etc. Ex: “filetype=wav“
* @param noteparams Qualifiers to determine the type of clinical note to be generated for that audio file.
* @returns Callback triggers to reurn the Job id on meta message
*/
togglePauseResumeListening(_filetype: string, _noteparams: string, jobName?: string, jobId?: string, recordedDuration?: number): void;
/**
* Method called to start audio recording
*/
startListening(): void;
/**
* Method called to stop audio recording and clean up resources
*/
stopListening(): void;
/**
* @param JobIds to delete one or more notes
* @returns success response on successful delete of notes else fail response
*/
deleteNotes(JobIds: string[]): Promise<any>;
/**
* @param JobId to rename note title
* @param NewJobName new title for the note
* @returns success response on successful rename of note else fail response
*/
renameNoteTitle(JobId: string, NewJobName: string): Promise<any>;
/**
* @param JobId to retrieve pdf for a specific note
* @param NoteType takes a NoteTypeConfig value
* @param SpecialityId a numberic value which identifies the department to populate in the PDF
* @param Language, optional parameter, to specify the language in which to generate PDF, default value being English
* @param PersonnelInfo, optional parameter, to give details to fill into header of PDF. Default json string is '{"PatientName":"","PatientID":"","Age":"","Gender":"","ReceivingDoctor":"","DoctorName":"","DoctorDesignation":"","DoctorEmail":""}'
* @param RegenerateNote, optional parameter, to indicate if PDF has to be re-generated especially after an update is made to the note
* @returns json response with base64 string of the pdf output to be read from Data.PDF of the response
*/
getNotePDF(JobId: string, NoteType: NoteTypeConfig, SpecialityId: number, Language?: string, PersonnelInfo?: string, RegenerateNote?: boolean): Promise<any>;
/**
* @param JobId to end note forcefully for paused job
* @returns success response on end of job else fail response
*/
endPausedJob(JobId: string): Promise<any>;
/**
* @param JobId needs to be passed to generate output
* @param Regenerate a bool to be set to true if CDI suggestions should be re-generated after an update is made to the note else set to false
* @param SoapNote is the structered soap note used to generate suggestions
* @param Codes structured medical codes used to generate suggestions
* @param PatientDetails json string which contains details such as age, gender and history of patient
* @returns JSON object contains suggestion Items on success else fail response
*/
generateCDISuggestions(JobId: string, Regenerate: boolean, SoapNote?: string, Codes?: string, PatientDetails?: string): Promise<any>;
/**
* @param JobId for which patient context needs to be updated
* @param Context a text string which gives context/history of patient useful to generate note
* @param Replace to be set to true if an update of context needs to be saved
* @returns success response on update of context else fail response
*/
updatePatientContext(JobId: string, Context: string, Replace: boolean): Promise<any>;
/**
* @param JobId for which note such as patient/referral/CDI suggestions needs to be updated
* @param NoteType takes a NoteTypeConfig value
* @param NewNote to update note json with specific values modified such as to submit feedback for CDI suggestions
* @returns success response on update of new note else fail response
*/
modifyGeneratedNote(JobId: string, NoteType: NoteTypeConfig, NewNote?: string): Promise<any>;
/**
* @param JobId to retrieve transcript for a specific audio file
* @returns JSON object contains Time in seconds, Text spoken at that time and also array of MedicalData to highlight on success else fail response.
*/
fetchTranscriptionForNote(JobId: string): Promise<any>;
/**
* @param JobId the job identifier for which feedback is being submitted
* @param Ratings a numeric rating from 1 to 5, value representing user satisfaction with the generated note
* @param Comment optional text comment providing additional feedback details
* @param Type optional string to specify the feedback category, defaults to 'SOAPFeedBack'
* @returns success response on successful submission of feedback else fail response
*/
sendFeedback(JobId: string, Ratings: number, Comment?: string, Type?: string): Promise<any>;
/**
* @param ConfigId to retrieve user config list for speciality type, visit type etc
* @returns a list of user config for a particular type
*/
getUserConfiguration(ConfigId: SettingsConfigType): Promise<any>;
/**
* @param ConfigMap a list of userconfig settings to update selected/unselected speciality type, visit type etc
* @returns success response on successful update else fail response
*/
updateUserConfiguration(ConfigMap: UserConfigMap[]): Promise<any>;
/**
* @returns a list of user preference
*/
getUserPreferenceSettings(): Promise<any>;
/**
* @param NewUserPreference a list of preference of type PreferenceConfig to be updated
* @returns success response on successful update else fail response
*/
updateUserPreferenceSettings(NewUserPreference: PreferenceConfig): Promise<any>;
/**
* @param options an object which is optional and takes custom url as string and timeout in milliseconds
* @returns true if connected else false and onError callback triggered with SDK12
*/
isInternetAvailable(options?: {
url: null;
timeoutMs?: null;
} | undefined): Promise<boolean>;
private onEventCallback;
private onStateChangeCallback;
private handleException;
private onErrorCallback;
private onOtherResultsCallback;
private onIntensityCallback;
private onIdleMicCallback;
private onSpeechResponseCallback;
private onJobStatusEventCallback;
private onSessionEventCallback;
/**
* Validates the Ambient config has all the mandatory fields
* @param config The config sent by the client application
*/
validateConfig(config: AmbientConfig): AmbientConfig;
private createSocketConfig;
}