handleReport hands you the clinical note, extras hand you the actions that come out of the visit —petitions, appointments, tests, referrals— ready for your HIS to execute.
Your schema defines the system. You declare the categories in the templateExtras prop and the SDK shows one button per category. On click, SofIA extracts only that category from the transcript and hands you the items exactly as they came out of your schema, with no field renaming or transformation. You decide the shape of each item in the schema.
Extras and reports are independent channels. Use
template + handleReport, templateExtras + handleExtras, or both at once.The two props
Both follow the same convention as
handleReport: camelCase JS property, kebab-case HTML attribute. In React the prop is templateExtras; on the web component you assign el.templateExtras or the template-extras attribute (which is scrubbed from the DOM after it is read, being sensitive data). handleExtras is a callback: JS property only, no HTML attribute.
From schema to buttons
The top-level properties oftemplateExtras are the categories. Each one renders a button:
…). Each button’s label is translated when the key exists in the active language; otherwise the capitalized property name is shown, so any category you define renders. Built-in translations ship for peticiones (Petitions), citas (Appointments), pruebas (Tests), and derivaciones (Referrals).
The flow
1
The buttons appear
When
templateExtras is set, a transcript exists, and handleExtras is wired. They do not depend on the report contents.2
The doctor clicks a category
The SDK extracts that category on demand: it builds a sub-schema with that single property and sends it to the extraction API. Only one category runs at a time; the button shows “Generating…” meanwhile.
3
Review or direct delivery
With the insertion preview modal active, the items open in the modal for the doctor to review and curate. Otherwise, they pass straight to
handleExtras.showInsertionPreview flag (per API key) is true and templateExtras is present. With the gate on, handleExtras receives the items on Apply; with the gate off, it receives them directly. Extraction never touches the clinical note.
PII is anonymized before it leaves and restored in the response, like everywhere else in the SDK (patient data). Items are extracted in the session language.
Your schema defines the fields
The SDK delivers the items exactly as they came out of yourtemplateExtras, mapping and renaming nothing. With a schema whose items are { type, description }, you receive:
type) to route each action to its endpoint. If you need a different shape, change the schema —don’t add a conversion layer in your integration.
Using it
Props reference
The buttons appear only when all three line up:
templateExtras with at least one category, a transcript in progress, and handleExtras wired.
Next steps
- Insertion preview modal — let the doctor curate the items before they reach your app
- Clinical data schemas — how to design the JSON Schema
- Optional properties — full callbacks reference