Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

augnitoambientsdk

Package Overview
Dependencies
Maintainers
0
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

augnitoambientsdk

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/

  • 2.0.0
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Augnito Ambient SDK

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/

Installation

Install the library in your project

  npm install augnitoambientsdk

Basic Usage

Import the library

import { AugnitoAmbient, AmbientConfig } from "augnitoambientsdk";

Create the configuration file and instantiate Augnito Ambient Manager

private ambientConfig: AmbientConfig = {
    server: '<your server>',
    subscriptionCode: '<your subscriptionCode>',
    accessKey: '<your accessKey>',
    userTag: '<your usertag>',
    enableLogs: false, // set to true to check sdk logs in the browser console
};

const augnitoAmbient = new AugnitoAmbient(ambientConfig);

1- Get Note Parameters

  • Get Region, Note Type and Gender

    Get all possible note-parameters (applicable categories and possible values) that are expected to be passed when creating a job (when doctor-patient consultation is started). These details are used to provide consultation SOAP notes with higher accuracy.

    //Returns JSON of Region, Note Type and Gender
    const noteParamsJson = augnitoAmbient.getNoteParams();
    
  • Get Speciality and Visit Types

    Augnito allows the speciality-type and visit-types for the doctor-patient consultation mapped at the hospital organization level. This method returns the list of speciality-type or visit-type (based on the value of ConfigTypeId parameter) mapped for the user in the hospital-organization.

    All supported specialty-types and visit-types for the hospital-organization can be specified to Augnito team at the start of integration or as and when needed.

    At the start of recording it is necessary to pass the ConfigID of applicable (user can select one or default value to be sent) Speciality and VisitType in the noteparams string.

    /** Response JSON for each item of speciality and visit type
     * ID: number,
     * ConfigID: number,
     * Value: string,
     * Description: string,
     * IsSelected: boolean,
     * IsDefault: boolean
     */
    
    //Get list of specialities enabled for organisation
    const specialities = await augnitoAmbient.getUserConfiguration(
      SettingsConfigType.SPECIALITY
    );
    
    //Get list of visit types enabled for organisation
    const visitTypes = await augnitoAmbient.getUserConfiguration(
      SettingsConfigType.VISIT_TYPE
    );
    

2- Toggle the client

Now all you have to do is toggle the status when you want to start/stop or pause/resume recording!

/**
 * @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. Region, NoteType and Gender values to be passed from response for getNoteParams(). Speciality and Visit Type can be set to the ConfigID returned by getUserConfiguration()
 * @param jobName, optional, a title for the note generated
 * @param jobId, optional, to be set if reconnecting to paused job id to continue recording the note
 * @param recordedDuration, optional, set recorded duration of previous paused job id if reconnecting to it
 */

// Toggles the start/stop recording
augnitoAmbient.toggleListening(
    filetype:string,
    noteparams:string,
    jobName?: string,
    jobId?: string,
    recordedDuration?: number
);
example: augnitoAmbient.toggleListening("wav","{'Region': 1, 'Speciality': 11, 'NoteType': 1, 'VisitType':29, 'Gender': 0}")

//Toggles the Pause/Resume recording
augnitoAmbient.togglePauseResumeListening(
    filetype: string,
    noteparams: string,
    jobName?: string,
    jobId?: string,
    recordedDuration?: number
);
example: augnitoAmbient.togglePauseResumeListening("wav","{'Region': 1, 'Speciality': 11, 'NoteType': 1, 'VisitType':29, 'Gender': 0}")
//#region Callbacks

//Callback to change recording button style
public onStateChanged?: (isRecording: boolean)
example: augnitoAmbient.onStateChanged = (isRecording: boolean) => {console.log(isRecording)}

//Callback to receive the Job Id
public onJobCreated?: (text: string)
example: augnitoAmbient.onJobCreated = (text: string) => {console.log(text)}

//Callback to receive when an error occurs within the SDK
public onError?: (errorMessage: string)
example: augnitoAmbient.onError = (errorMessage: string) => {console.log(errorMessage)}

//#endregion

3- Explicitly stop the recording

/**
 * Stops the recording and cleans up resources
 * This function needs to be explicitly called whenever togglePauseResumeListening() function is used
 */
augnitoAmbient.stopListening();

4- List Jobs

Get all Jobs (SOAP notes and other clinical notes) created within the doctor (user’s) account with respect to the given usertag along with meta data. These notes are sorted by timestamp of creation and support pagination.

/**
 * @param PageSize a number, to fetch specified number of notes as a page for each request
 * @param PageID is optional parameter, a string value, When PageID is not given, first set of notes is retrieved according to the specified PageSize. To fetch next set of notes send the PageIDNext received as part of response from the previous getAllNotes call
 * @returns list of notes for the user on success else fail response
 */

const JobList = await augnitoAmbient.getAllNotes(PageSize: number, PageID?: string);

5- Fetch Job Output

Retrieve a particular SOAP note or any other clinical note for the given JobId and with respect to the given UserTag (doctor).

/**
 * @param JobId string, to retrieve output for a specific audio file
 * @returns JSON object contains Transcript, Note, FormattedSoap, Codes, NoteParams and SystemEOS on success else fail response
 */

const JobOutput = augnitoAmbient.getSummarizedNote(JobId:string);

6- Send Final Note

Doctor might make edits to the generated SOAP note and then save it to the EMR. You can use this API to send the final edited SOAP note to help increase accuracy of output in future.

/**
 * @param JobId string, needs to pass to store the final Note for that audio file
 * @param NoteData string, This key will store the final edited Note that user wants to send.
 * @returns success response on successful submit of note else fail response
 */

augnitoAmbient.sendSummarizedNote(JobId:string, NoteData:string);

7- Delete Notes

Allows you to build a capability for the user (doctor) to delete one or more notes generated under his/her UserTag.

/**
 * @param JobIds array of jobid string values, to delete one or more notes
 * @returns success response on successful delete of notes else fail response
 */

const result = await augnitoAmbient.deleteNotes(JobIds: string[])

8- Rename Note Title

Allows you to build a capability for the user (doctor) to rename generated note under his/her UserTag.

/**
 * @param JobId string, to rename note title
 * @param NewJobName string, new title for the note
 * @returns success response on successful rename of note else fail response
 */

const result = await augnitoAmbient.renameNoteTitle(JobId: string, NewJobName: string)

9- Download Note as PDF

Allows you to build a capability for the user (doctor) to download generated note as PDF.

/**
 * @param JobId to retrieve pdf for a specific note
 * @returns base64 string of the pdf output
 */

const result = await augnitoAmbient.getNotePDF(JobId: string)

10- Update Speciality and Visit type config

To select/deselect or to set as default any specialty and visit type for the individual user (doctor) differentiated through UserTag.

All specialties and visit types specified by the organization to Augnito will be available (through function defined in Get Speciality and Visit Types section above) for the mapping to organization users. Out of the mapping, only the applicable specialty and visit types for the user can be configured using this API

/**
 * @param ConfigMap Config mapping json. ID to set each config can be obtained by calling the function defined in Get Speciality and Visit Types section above
 * @returns success response on successful update else fail response
 */

const result = await augnitoAmbient.updateUserConfiguration(ConfigMap: UserConfigMap[])

11- Send EOS for abruptly ended Job

Allows the client-application to send explicit EOS for a recording which did not finish due to reasons such as mistakenly closing browser before stopping the recording.

getAllNotes method will return status of such a job as JOBPAUSED. endPausedJob method can be called to end the job successfully.

If recording was not completed before abrupt closure then reconnection to JobID can be done using using toggleListening or togglePauseResumeListening to continue recording.

The reconnection needs to be done within 5-10 of the initial recording, else Augnito system will generate the note output with audio data sent to it.

/**
 * @param JobId to send EOS for a paused job
 * @returns success response on EOS sent for job else fail response
 */

const result = await augnitoAmbient.endPausedJob(JobId: string)

Keywords

FAQs

Package last updated on 23 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc