Skip to main content
These properties allow you to customize the behavior and appearance of the SofIA SDK component to fit the specific needs of your implementation.

Active Properties

Interface Control

Callbacks

Callback Signatures

handleReport
Called when the user triggers report generation. The report object matches the structure defined in your template JSON Schema. Example payload:
setIsOpen
Called when the SDK requests a visibility change (e.g., user clicks the close button). setGetLastReport
Called once during initialization. Provides a function you can store and call later to retrieve the last generated report for the current patient/user session. handleExtras
Called when the user clicks an extras category button (petitions, appointments, tests, referrals…). Receives the array of items for that category, delivered exactly as the model extracted it against your templateExtras schema — the SDK does not rename or transform fields. The shape of each item is defined by your schema. Pairs with the templateExtras prop. See Clinical Actions (Extras).

Contextual Data

Report curation and EMR pre-fill

These props power two report features. See their dedicated guides for the full flow. The consent status indicator in the header is not a component property. It is enabled through your Omniloy account/profile settings (contact support@omniloy.com to turn it on). When enabled, the indicator reflects the signedConsent field you provide inside patientdata (see Patient Data).

Localization

The default language is "es" (Spanish). If your application targets English-speaking users, set language="en" explicitly.

Analytics context

Breaking change (v1.0.9). usermedicalspecialty replaces the camelCase userMedicalSpecialty that shipped in v1.0.8. The old name is no longer read: a host still passing it gets no error, but the value is silently dropped and events lose the specialty. Rename to the all-lowercase usermedicalspecialty, matching the other string props (userid, patientid, templateid).

Debugging

CSS Customization

SofIA SDK renders as a Web Component with Shadow DOM. This prevents style conflicts with the host application, but it also means the application’s global CSS does not directly affect internal SDK elements. If you need to adjust specific internal styles, inject a <style> tag into the component shadowRoot after the Web Component has been defined and mounted:
Use the selector that matches your component, for example #sofia or #sofia-component. In Angular, run this logic in ngAfterViewInit. In AngularJS, call it after configuring the component attributes and callbacks. If the component is mounted conditionally, run the function again after mounting it.
Internal class selectors can change between SDK versions. The selector above matches @omniloy/sofia-sdk 1.0.4. Keep these styles centralized, test the interface when updating @omniloy/sofia-sdk, and prefer documented component properties when they are available.

Manual Report Retrieval

In addition to receiving the report automatically, you can request it on-demand from your application. The set-get-last-report property executes a callback that provides you with an asynchronous function. You should store this reference to use it whenever you need to retrieve the last generated report.

Usage Examples

Basic setup with patient data

Data properties go on the element as attributes; callbacks are assigned as JS properties:

Chat-only mode (no report generation)

To use SofIA in chat-only mode, simply omit the template and templateid properties. The generate button will not appear.

Advanced configuration with callbacks

Callbacks are JS properties, not HTML attributes. Assign every callback directly on the element with camelCase (e.g. element.handleReport = fn, element.setIsOpen = fn, element.setGetLastReport = fn, element.onReportApply = fn, element.updateTemplate = fn). There is no handle-report HTML attribute or DOM event — an attribute like handle-report="myFn" will not fire. Simple data properties (isopen, patientdata, debug) use the same lowercase name as both an HTML attribute and a JS property.

Deprecated Properties

The following properties are deprecated and will be removed in v2.0. They have no effect in the current Chat-based UI architecture.

Important Notes

  • patientdata: Should only contain information necessary for the clinical context, following data minimization principles.
  • States: Changes in boolean properties are immediately reflected in the interface.
  • Localization: Changing the language affects the entire component interface, including error messages and labels.
  • Callbacks: Assign callbacks programmatically as JS properties on the element (e.g., element.handleReport = fn). They cannot be wired through HTML attributes or global function names.