@omniloy/sofia-sdk 1.0.8 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,8 +15,8 @@ declare type ButtonProps = React_2.ComponentProps<'button'> & VariantProps<typeo
15
15
  };
16
16
 
17
17
  declare const buttonVariants: (props?: ({
18
- variant?: "report" | "default" | "icon" | "destructive" | "outline" | "secondary" | "ghost" | "empty" | "primary" | null | undefined;
19
- size?: "default" | "icon" | "padding" | "empty" | "sm" | "lg" | null | undefined;
18
+ variant?: "report" | "default" | "destructive" | "outline" | "secondary" | "ghost" | "empty" | "primary" | "icon" | null | undefined;
19
+ size?: "default" | "empty" | "icon" | "sm" | "lg" | "padding" | null | undefined;
20
20
  } & ClassProp) | undefined) => string;
21
21
 
22
22
  declare interface CuratedReport {
@@ -40,6 +40,14 @@ declare interface CuratedReport {
40
40
  */
41
41
  declare type ExistingTemplateValues = Record<string, unknown>;
42
42
 
43
+ /**
44
+ * A single extracted action item. Its shape is defined entirely by the host's
45
+ * `templateExtras` schema and passed through untouched — the SDK does NOT
46
+ * remap or normalise fields. For SINA, for example, each item is
47
+ * `{ type: string; description: string }`.
48
+ */
49
+ declare type Extra = Record<string, unknown>;
50
+
43
51
  export declare const getReportStorage: (patientId: string | undefined, doctorId: string | undefined) => Promise<object | undefined>;
44
52
 
45
53
  declare interface InsertionPreviewClassNames {
@@ -176,8 +184,18 @@ export declare interface OmniscribeProps {
176
184
  disablegenerate?: boolean;
177
185
  /** Enable debug logging */
178
186
  debug?: boolean;
179
- /** Doctor's medical specialty at the time of the event. Optional. When provided, it is attached to every tracked event for analytics segmentation. */
180
- userMedicalSpecialty?: string;
187
+ /**
188
+ * Doctor's medical specialty at the time of the event. Optional. When
189
+ * provided, it is attached to every tracked event for analytics segmentation.
190
+ *
191
+ * All-lowercase, matching the other string props (`userid`, `patientid`,
192
+ * `templateid`) and the attribute the Web Component exposes.
193
+ *
194
+ * BREAKING (since v1.0.9): this replaces the camelCase `userMedicalSpecialty`
195
+ * that shipped in v1.0.8. React hosts passing the old name must rename it —
196
+ * the old spelling is no longer read and the value is silently dropped.
197
+ */
198
+ usermedicalspecialty?: string;
181
199
  /** Expose function to get last generated report */
182
200
  setGetLastReport?: (fn: () => Promise<object | undefined>) => void;
183
201
  /**
@@ -204,6 +222,36 @@ export declare interface OmniscribeProps {
204
222
  * for fields with no readable content (generation degrades gracefully).
205
223
  */
206
224
  updateTemplate?: UpdateTemplateCallback;
225
+ /**
226
+ * Template fields configuration for extras (petitions, tests, appointments, etc.).
227
+ * Enables the extras action button when provided (together with a transcript
228
+ * and a wired `handleExtras`). Each HIS defines its own field names and enum
229
+ * values in this template — the SDK passes them through without transformation.
230
+ *
231
+ * Follows the canonical "camelCase JS property, kebab HTML attribute" contract
232
+ * used by the other camelCase props (`handleReport`, `updateTemplate`,
233
+ * `insertionPreviewClassNames`): assign it as `el.templateExtras` (or the
234
+ * `template-extras` attribute on the web component).
235
+ */
236
+ templateExtras?: object;
237
+ /**
238
+ * Generic callback for the actions detected from the transcription.
239
+ * Fired when the user clicks an extras category button. Receives the array
240
+ * of items for that category, passed through EXACTLY as the LLM produced it
241
+ * against the `templateExtras` schema — the SDK does no field remapping or
242
+ * normalisation. The item shape is therefore defined by the host's schema.
243
+ *
244
+ * Example (SINA petitions — `templateExtras` items are `{ type, description }`):
245
+ * ```
246
+ * handleExtras([
247
+ * { type: '3', description: 'Solicitar TAC con contraste.' },
248
+ * { type: '1', description: 'Solicitar analítica completa.' },
249
+ * ])
250
+ * ```
251
+ * The host reads whatever fields its schema defined (e.g. `type`) to trigger
252
+ * the appropriate action. To change the delivered shape, change templateExtras.
253
+ */
254
+ handleExtras?: (extras: Extra[]) => void;
207
255
  }
208
256
 
209
257
  /**