JWT Claims Configuration

Configure the JWT token claims. The assistant will reload automatically when any claim is changed.

Debug Mode

Enable debug mode

Status: Enabled (shows all processing info)

When enabled, shows transcription results, FHIR processing, and other debug information in the chat.

Audio Mock for Testing

Enable audio mock

Status:

When enabled, microphone input will use static/test.wav instead of real microphone.

API Methods Demo

Test the public API methods that can be called from parent applications:

Start Transcription

Usage: AutoscriberAssistant.startTranscription('custom-id-123')

Set FHIR Context

Usage: AutoscriberAssistant.fhirContext(fhirResource)

Fill Questionnaire

Usage: AutoscriberAssistant.fillQuestionnaire()

Fill Questionnaire with Context

Usage: AutoscriberAssistant.fillQuestionnaire(contextObject)

Received FHIR Documents (0)

This section shows FHIR documents received through the callback function whenever the chat receives a mediaType:application/fhir+json result.

How to embed

Import the script (in header)

<script src="https://assistant.autoscriber.com/js"></script>

Add a container (in body)

<div id="my-chat-container"></div>

Initialize the assistant (in body)

<script>
// Basic initialization with JWT token
const jwtToken = 'your-jwt-token-here'; // JWT token containing practitionerId, language, sessionId
const assistant = AutoscriberAssistant.init('my-chat-container', jwtToken);

// With FHIR callback (optional)
function onFhirDocumentReceived(fhirDocument) {
    console.log('Received FHIR document:', fhirDocument);
    // Handle the FHIR document in your application
}
const assistant = AutoscriberAssistant.init('my-chat-container', jwtToken, onFhirDocumentReceived);

// With refresh token callback (optional)
async function refreshToken(sessionId) {
    // Make API call to refresh the JWT token
    const response = await fetch(...)
    const data = await response.json();
    return data.token;
}
const assistant = AutoscriberAssistant.init('my-chat-container', jwtToken, onFhirDocumentReceived, refreshToken);

// With language override (optional, defaults to 'en')
const assistant = AutoscriberAssistant.init('my-chat-container', jwtToken, onFhirDocumentReceived, refreshToken, 'nl');

// With debug mode (optional, defaults to false)
const assistant = AutoscriberAssistant.init('my-chat-container', jwtToken, onFhirDocumentReceived, refreshToken, 'en', true);

// Language parameter:
// - 'en': English (default)
// - 'nl': Dutch
// - 'de': German
// If an invalid language is provided, 'en' will be used and an error will be logged

// Debug mode controls what information is shown:
// - true: Shows all processing info, transcripts, FHIR data, and status messages
// - false: Shows only essential user actions (transcription/summarizing pills) and final results

// JWT Token Requirements:
// The JWT token must contain these claims:
// - practitionerId: Unique identifier for the practitioner
// - language: Language code (e.g., "en", "nl", "de") - used as fallback if no language parameter provided
// - sessionId: Unique session identifier
// - iat: Issued at timestamp
// - exp: Expiration timestamp</script>

API Methods

// Fill questionnaire from session context
AutoscriberAssistant.fillQuestionnaire();

// Fill questionnaire with explicit context
const context = {
    questionnaire: { /* FHIR Questionnaire */ },
    transcript: { /* FHIR Transcript */ }
};
AutoscriberAssistant.fillQuestionnaire(context);

// Set FHIR context for session
AutoscriberAssistant.fhirContext(fhirResource);

// Start transcription
AutoscriberAssistant.startTranscription('custom-id');