@adminide-stack/yantra-mobile 12.0.141 → 12.0.142-alpha.0

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.
@@ -1,4 +1,4 @@
1
- import {jsx,jsxs}from'react/jsx-runtime';import {useState,useEffect}from'react';import {View,StyleSheet,Text,ScrollView,ActivityIndicator}from'react-native';import {MaterialCommunityIcons}from'@expo/vector-icons';import {Tap,DIM}from'../../inbox/components/Tap.js';import {formatDuration,NOTE_DISCLAIMER}from'../noteText.js';const STAGE_TEXT = {
1
+ import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {useState,useEffect}from'react';import {View,StyleSheet,Text,ScrollView,ActivityIndicator}from'react-native';import {MaterialCommunityIcons}from'@expo/vector-icons';import {Tap,DIM}from'../../inbox/components/Tap.js';import {formatDuration,NOTE_DISCLAIMER,SUGGESTION_HEADINGS,SUGGESTION_DISCLAIMER}from'../noteText.js';import {splitPlaceholders,placeholderLabel}from'../privacy.js';import {shownNote}from'../shownNote.js';const STAGE_TEXT = {
2
2
  uploading: "Uploading the recording\u2026",
3
3
  writing: "Transcribing and writing the note\u2026"
4
4
  };
@@ -11,6 +11,17 @@ function dictationDate(iso) {
11
11
  minute: "2-digit"
12
12
  });
13
13
  }
14
+ function Redacted({
15
+ text,
16
+ theme
17
+ }) {
18
+ const runs = splitPlaceholders(text);
19
+ if (runs.length === 1 && !runs[0].placeholder) return /* @__PURE__ */ jsx(Fragment, { children: text });
20
+ return /* @__PURE__ */ jsx(Fragment, { children: runs.map((run, i) => run.placeholder ? /* @__PURE__ */ jsx(Text, { style: [styles.placeholder, {
21
+ backgroundColor: theme.chip,
22
+ color: theme.muted
23
+ }], accessibilityLabel: `${placeholderLabel(run.text)}, hidden`, children: `\xA0${placeholderLabel(run.text).replace(/ /g, "\xA0")}\xA0` }, i) : run.text) });
24
+ }
14
25
  function Section({
15
26
  title,
16
27
  items,
@@ -30,10 +41,115 @@ function Section({
30
41
  }] }),
31
42
  /* @__PURE__ */ jsx(Text, { style: [styles.itemText, {
32
43
  color: theme.ink
33
- }], children: item })
44
+ }], children: /* @__PURE__ */ jsx(Redacted, { text: item, theme }) })
34
45
  ] }, i))
35
46
  ] });
36
47
  }
48
+ function PrivacyRow({
49
+ record,
50
+ showIdentifiers,
51
+ onToggle,
52
+ theme
53
+ }) {
54
+ const {
55
+ redaction
56
+ } = record;
57
+ if (!redaction) return null;
58
+ const count = redaction.identifiers.length;
59
+ const what = count === 1 ? "1 name or number" : `${count} names and numbers`;
60
+ const line = count ? `${what} ${showIdentifiers ? "shown here" : "hidden"}. The AI never saw them.` : "No names or numbers were heard. The AI saw the dictation as spoken.";
61
+ return /* @__PURE__ */ jsxs(View, { style: [styles.privacy, {
62
+ backgroundColor: theme.goodSoft
63
+ }], children: [
64
+ /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "shield-lock-outline", size: 18, color: theme.good }),
65
+ /* @__PURE__ */ jsxs(View, { style: styles.privacyText, children: [
66
+ /* @__PURE__ */ jsx(Text, { style: [styles.privacyLine, {
67
+ color: theme.ink
68
+ }], children: line }),
69
+ redaction.method === "patterns" && count ? /* @__PURE__ */ jsx(Text, { style: [styles.privacyNote, {
70
+ color: theme.warnInk
71
+ }], children: "Found without the medical transcriber; check that no name was missed." }) : null
72
+ ] }),
73
+ count ? /* @__PURE__ */ jsx(Tap, { onPress: onToggle, accessibilityRole: "button", accessibilityLabel: showIdentifiers ? "Hide names and numbers" : "Show names and numbers", style: [styles.privacyToggle, {
74
+ borderColor: theme.border,
75
+ backgroundColor: theme.card
76
+ }], pressedStyle: DIM, children: /* @__PURE__ */ jsx(Text, { style: [styles.privacyToggleText, {
77
+ color: theme.ink
78
+ }], children: showIdentifiers ? "Hide" : "Show" }) }) : null
79
+ ] });
80
+ }
81
+ const SUGGESTION_ICON = {
82
+ missing: "text-box-plus-outline",
83
+ safety: "alert-octagon-outline",
84
+ coding: "tag-outline",
85
+ follow_up: "calendar-check-outline"
86
+ };
87
+ function Suggestions({
88
+ items,
89
+ state,
90
+ onSuggest,
91
+ theme
92
+ }) {
93
+ const loading = state.status === "loading";
94
+ let content;
95
+ if (!items) {
96
+ content = /* @__PURE__ */ jsx(Text, { style: [styles.suggestWhy, {
97
+ color: theme.muted
98
+ }], children: "Ask the AI to read the note and point out what to add or check before you sign. It reads the note with names and numbers hidden." });
99
+ } else if (!items.length) {
100
+ content = /* @__PURE__ */ jsx(Text, { style: [styles.suggestWhy, {
101
+ color: theme.muted
102
+ }], children: "Nothing to add: the note covers what the AI would check." });
103
+ } else {
104
+ content = Object.keys(SUGGESTION_HEADINGS).map((kind) => {
105
+ const group = items.filter((s) => s.kind === kind);
106
+ if (!group.length) return null;
107
+ return /* @__PURE__ */ jsxs(View, { style: styles.suggestGroup, children: [
108
+ /* @__PURE__ */ jsxs(View, { style: styles.suggestHead, children: [
109
+ /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: SUGGESTION_ICON[kind], size: 16, color: kind === "safety" ? theme.crit : theme.accent }),
110
+ /* @__PURE__ */ jsx(Text, { style: [styles.suggestKind, {
111
+ color: theme.ink
112
+ }], children: SUGGESTION_HEADINGS[kind] })
113
+ ] }),
114
+ group.map((s, i) => /* @__PURE__ */ jsxs(View, { style: styles.suggestItem, children: [
115
+ /* @__PURE__ */ jsx(Text, { style: [styles.suggestText, {
116
+ color: theme.ink
117
+ }], children: /* @__PURE__ */ jsx(Redacted, { text: s.text, theme }) }),
118
+ s.why ? /* @__PURE__ */ jsx(Text, { style: [styles.suggestWhy, {
119
+ color: theme.muted
120
+ }], children: /* @__PURE__ */ jsx(Redacted, { text: s.why, theme }) }) : null
121
+ ] }, i))
122
+ ] }, kind);
123
+ });
124
+ }
125
+ let buttonLabel = "Get suggestions";
126
+ if (loading) buttonLabel = "Reading the note\u2026";
127
+ else if (items) buttonLabel = "Ask again";
128
+ return /* @__PURE__ */ jsxs(View, { style: [styles.card, {
129
+ backgroundColor: theme.card,
130
+ borderColor: theme.border
131
+ }], children: [
132
+ /* @__PURE__ */ jsx(Text, { style: [styles.heading, {
133
+ color: theme.muted
134
+ }], children: "SUGGESTIONS" }),
135
+ content,
136
+ state.status === "error" ? /* @__PURE__ */ jsx(Text, { style: [styles.suggestError, {
137
+ color: theme.crit
138
+ }], children: state.message }) : null,
139
+ /* @__PURE__ */ jsxs(Tap, { onPress: onSuggest, disabled: loading, accessibilityRole: "button", accessibilityLabel: items ? "Ask for suggestions again" : "Get suggestions", style: [styles.suggestButton, {
140
+ borderColor: theme.accent,
141
+ opacity: loading ? 0.6 : 1
142
+ }], pressedStyle: DIM, children: [
143
+ loading ? /* @__PURE__ */ jsx(ActivityIndicator, { color: theme.accent, size: "small" }) : /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "lightbulb-on-outline", size: 18, color: theme.accent }),
144
+ /* @__PURE__ */ jsx(Text, { style: [styles.suggestButtonText, {
145
+ color: theme.accent
146
+ }], children: buttonLabel })
147
+ ] }),
148
+ (items == null ? void 0 : items.length) ? /* @__PURE__ */ jsx(Text, { style: [styles.suggestFoot, {
149
+ color: theme.faint
150
+ }], children: SUGGESTION_DISCLAIMER }) : null
151
+ ] });
152
+ }
37
153
  function actionTone(action, theme) {
38
154
  if (action === "start") return {
39
155
  bg: theme.goodSoft,
@@ -74,10 +190,10 @@ function Medications({
74
190
  /* @__PURE__ */ jsxs(View, { style: styles.medText, children: [
75
191
  /* @__PURE__ */ jsx(Text, { style: [styles.medName, {
76
192
  color: theme.ink
77
- }], children: med.name }),
193
+ }], children: /* @__PURE__ */ jsx(Redacted, { text: med.name, theme }) }),
78
194
  /* @__PURE__ */ jsx(Text, { style: [styles.medDetail, {
79
195
  color: detail ? theme.muted : theme.warnInk
80
- }], children: detail || "No dose or frequency dictated" })
196
+ }], children: detail ? /* @__PURE__ */ jsx(Redacted, { text: detail, theme }) : "No dose or frequency dictated" })
81
197
  ] }),
82
198
  /* @__PURE__ */ jsx(View, { style: [styles.pill, {
83
199
  backgroundColor: tone.bg
@@ -115,7 +231,11 @@ function NoteView({
115
231
  stage,
116
232
  theme,
117
233
  bottomInset,
118
- onRetry
234
+ onRetry,
235
+ showIdentifiers,
236
+ onToggleIdentifiers,
237
+ suggestState,
238
+ onSuggest
119
239
  }) {
120
240
  var _a;
121
241
  const [showTranscript, setShowTranscript] = useState(false);
@@ -140,17 +260,20 @@ function NoteView({
140
260
  ] });
141
261
  }
142
262
  const {
143
- note
144
- } = record;
263
+ note,
264
+ transcript,
265
+ suggestions
266
+ } = shownNote(record, record.note, showIdentifiers);
145
267
  return /* @__PURE__ */ jsxs(ScrollView, { contentContainerStyle: [styles.scroll, {
146
268
  paddingBottom: 24 + bottomInset
147
269
  }], children: [
148
270
  /* @__PURE__ */ jsx(Text, { style: [styles.title, {
149
271
  color: theme.ink
150
- }], children: note.title }),
272
+ }], children: /* @__PURE__ */ jsx(Redacted, { text: note.title, theme }) }),
151
273
  /* @__PURE__ */ jsx(Text, { style: [styles.meta, {
152
274
  color: theme.faint
153
275
  }], children: meta }),
276
+ /* @__PURE__ */ jsx(PrivacyRow, { record, showIdentifiers, onToggle: onToggleIdentifiers, theme }),
154
277
  note.to_verify.length ? /* @__PURE__ */ jsxs(View, { style: [styles.verify, {
155
278
  backgroundColor: theme.warnSoft,
156
279
  borderColor: theme.warnBorder
@@ -161,9 +284,12 @@ function NoteView({
161
284
  color: theme.warnInk
162
285
  }], children: "Check before you use" })
163
286
  ] }),
164
- note.to_verify.map((item, i) => /* @__PURE__ */ jsx(Text, { style: [styles.verifyItem, {
287
+ note.to_verify.map((item, i) => /* @__PURE__ */ jsxs(Text, { style: [styles.verifyItem, {
165
288
  color: theme.warnInk
166
- }], children: `\u2022 ${item}` }, i))
289
+ }], children: [
290
+ "\u2022 ",
291
+ /* @__PURE__ */ jsx(Redacted, { text: item, theme })
292
+ ] }, i))
167
293
  ] }) : null,
168
294
  /* @__PURE__ */ jsx(Section, { title: "SUBJECTIVE", items: note.subjective, theme }),
169
295
  /* @__PURE__ */ jsx(Section, { title: "OBJECTIVE", items: note.objective, theme }),
@@ -171,7 +297,8 @@ function NoteView({
171
297
  /* @__PURE__ */ jsx(Section, { title: "PLAN", items: note.plan, theme }),
172
298
  /* @__PURE__ */ jsx(Medications, { meds: note.medications, theme }),
173
299
  note.follow_up ? /* @__PURE__ */ jsx(Section, { title: "FOLLOW-UP", items: [note.follow_up], theme }) : null,
174
- record.transcript ? /* @__PURE__ */ jsxs(View, { style: [styles.card, {
300
+ record.redaction ? /* @__PURE__ */ jsx(Suggestions, { items: suggestions, state: suggestState, onSuggest, theme }) : null,
301
+ transcript ? /* @__PURE__ */ jsxs(View, { style: [styles.card, {
175
302
  backgroundColor: theme.card,
176
303
  borderColor: theme.border
177
304
  }], children: [
@@ -183,7 +310,7 @@ function NoteView({
183
310
  ] }),
184
311
  showTranscript ? /* @__PURE__ */ jsx(Text, { style: [styles.transcript, {
185
312
  color: theme.ink
186
- }], children: record.transcript }) : null
313
+ }], children: /* @__PURE__ */ jsx(Redacted, { text: transcript, theme }) }) : null
187
314
  ] }) : null,
188
315
  /* @__PURE__ */ jsx(Text, { style: [styles.disclaimer, {
189
316
  color: theme.faint
@@ -301,6 +428,94 @@ const styles = StyleSheet.create({
301
428
  fontSize: 12,
302
429
  textAlign: "center"
303
430
  },
431
+ placeholder: {
432
+ fontSize: 13,
433
+ fontWeight: "600",
434
+ borderRadius: 4,
435
+ overflow: "hidden"
436
+ },
437
+ privacy: {
438
+ marginTop: 12,
439
+ borderRadius: 12,
440
+ paddingHorizontal: 12,
441
+ paddingVertical: 10,
442
+ flexDirection: "row",
443
+ alignItems: "center",
444
+ gap: 10
445
+ },
446
+ privacyText: {
447
+ flex: 1
448
+ },
449
+ privacyLine: {
450
+ fontSize: 13,
451
+ lineHeight: 18
452
+ },
453
+ privacyNote: {
454
+ marginTop: 2,
455
+ fontSize: 12,
456
+ lineHeight: 17
457
+ },
458
+ privacyToggle: {
459
+ paddingHorizontal: 14,
460
+ paddingVertical: 6,
461
+ borderRadius: 999,
462
+ borderWidth: StyleSheet.hairlineWidth
463
+ },
464
+ privacyToggleText: {
465
+ fontSize: 13,
466
+ fontWeight: "600"
467
+ },
468
+ suggestGroup: {
469
+ marginTop: 8
470
+ },
471
+ suggestHead: {
472
+ flexDirection: "row",
473
+ alignItems: "center",
474
+ gap: 6,
475
+ marginBottom: 2
476
+ },
477
+ suggestKind: {
478
+ fontSize: 14,
479
+ fontWeight: "700"
480
+ },
481
+ suggestItem: {
482
+ marginTop: 6,
483
+ paddingLeft: 22
484
+ },
485
+ suggestText: {
486
+ fontSize: 15,
487
+ lineHeight: 21
488
+ },
489
+ suggestWhy: {
490
+ marginTop: 2,
491
+ fontSize: 13,
492
+ lineHeight: 18
493
+ },
494
+ suggestError: {
495
+ marginTop: 10,
496
+ fontSize: 13,
497
+ lineHeight: 18
498
+ },
499
+ suggestButton: {
500
+ marginTop: 12,
501
+ flexDirection: "row",
502
+ alignItems: "center",
503
+ justifyContent: "center",
504
+ gap: 8,
505
+ paddingVertical: 10,
506
+ borderRadius: 999,
507
+ borderWidth: 1
508
+ },
509
+ suggestButtonText: {
510
+ fontSize: 15,
511
+ fontWeight: "600"
512
+ },
513
+ suggestFoot: {
514
+ marginTop: 10,
515
+ fontSize: 12,
516
+ lineHeight: 17,
517
+ textAlign: "center"
518
+ },
304
519
  center: {
305
520
  flex: 1,
306
521
  alignItems: "center",
@@ -1 +1 @@
1
- {"version":3,"file":"NoteView.js","sources":["../../../../src/features/dictate/components/NoteView.tsx"],"sourcesContent":["/**\n * A dictation's note: what to check first (amber, above everything), the four\n * SOAP sections, the medications with what was dictated for each, follow-up,\n * and the transcript behind a toggle. While the note is being written this\n * shows the stage; when writing failed, why and a Retry that reuses the saved\n * recording.\n */\nimport React, { useEffect, useState } from 'react';\nimport { ActivityIndicator, ScrollView, StyleSheet, Text, View } from 'react-native';\nimport { MaterialCommunityIcons } from '@expo/vector-icons';\nimport { DIM, Tap } from '../../inbox/components/Tap';\nimport { formatDuration, NOTE_DISCLAIMER } from '../noteText';\nimport type { DictateStage } from '../dictateClient';\nimport type { DictateTheme } from '../dictateTheme';\nimport type { DictationRecord, NoteMedication } from '../types';\n\nconst STAGE_TEXT: Record<DictateStage, string> = {\n uploading: 'Uploading the recording…',\n writing: 'Transcribing and writing the note…',\n};\n\nexport function dictationDate(iso: string): string {\n const d = new Date(iso);\n return Number.isNaN(d.getTime())\n ? ''\n : d.toLocaleString(undefined, { month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' });\n}\n\nfunction Section({ title, items, theme }: { title: string; items: string[]; theme: DictateTheme }) {\n if (!items.length) return null;\n return (\n <View style={[styles.card, { backgroundColor: theme.card, borderColor: theme.border }]}>\n <Text style={[styles.heading, { color: theme.muted }]}>{title}</Text>\n {items.map((item, i) => (\n <View key={i} style={styles.item}>\n <View style={[styles.bullet, { backgroundColor: theme.faint }]} />\n <Text style={[styles.itemText, { color: theme.ink }]}>{item}</Text>\n </View>\n ))}\n </View>\n );\n}\n\nfunction actionTone(action: NoteMedication['action'], theme: DictateTheme): { bg: string; ink: string } {\n if (action === 'start') return { bg: theme.goodSoft, ink: theme.good };\n if (action === 'change') return { bg: theme.accentSoft, ink: theme.accent };\n if (action === 'stop') return { bg: theme.recSoft, ink: theme.crit };\n return { bg: theme.chip, ink: theme.muted };\n}\n\nfunction Medications({ meds, theme }: { meds: NoteMedication[]; theme: DictateTheme }) {\n if (!meds.length) return null;\n return (\n <View style={[styles.card, { backgroundColor: theme.card, borderColor: theme.border }]}>\n <Text style={[styles.heading, { color: theme.muted }]}>MEDICATIONS</Text>\n {meds.map((med, i) => {\n const tone = actionTone(med.action, theme);\n const detail = [med.dose, med.route, med.frequency].filter(Boolean).join(' · ');\n return (\n <View\n key={`${med.name}-${i}`}\n style={[\n styles.med,\n i > 0 && { borderTopColor: theme.border, borderTopWidth: StyleSheet.hairlineWidth },\n ]}\n >\n <View style={styles.medText}>\n <Text style={[styles.medName, { color: theme.ink }]}>{med.name}</Text>\n <Text style={[styles.medDetail, { color: detail ? theme.muted : theme.warnInk }]}>\n {detail || 'No dose or frequency dictated'}\n </Text>\n </View>\n <View style={[styles.pill, { backgroundColor: tone.bg }]}>\n <Text style={[styles.pillText, { color: tone.ink }]}>{med.action}</Text>\n </View>\n </View>\n );\n })}\n </View>\n );\n}\n\nfunction Writing({ stage, theme }: { stage: DictateStage; theme: DictateTheme }) {\n const [seconds, setSeconds] = useState(0);\n useEffect(() => {\n const id = setInterval(() => setSeconds((s) => s + 1), 1000);\n return () => clearInterval(id);\n }, []);\n return (\n <View style={styles.center}>\n <ActivityIndicator color={theme.accent} />\n <Text style={[styles.centerTitle, { color: theme.ink }]}>{STAGE_TEXT[stage]}</Text>\n <Text style={[styles.centerDetail, { color: theme.faint }]}>{seconds}s · usually under a minute</Text>\n </View>\n );\n}\n\nexport function NoteView({\n record,\n stage,\n theme,\n bottomInset,\n onRetry,\n}: {\n record: DictationRecord;\n stage: DictateStage | null;\n theme: DictateTheme;\n bottomInset: number;\n onRetry: () => void;\n}) {\n const [showTranscript, setShowTranscript] = useState(false);\n const meta = [dictationDate(record.createdAt), formatDuration(record.durationMs)].filter(Boolean).join(' · ');\n\n if (record.status === 'writing' || (record.status === 'saved' && stage)) {\n return <Writing stage={stage ?? 'writing'} theme={theme} />;\n }\n if (!record.note) {\n return (\n <View style={styles.center}>\n <MaterialCommunityIcons name=\"alert-circle-outline\" size={28} color={theme.crit} />\n <Text style={[styles.centerTitle, { color: theme.ink }]}>No note yet</Text>\n <Text style={[styles.centerDetail, { color: theme.muted }]}>\n {record.error ?? 'The recording is saved on this phone.'}\n </Text>\n {record.audioUri ? (\n <Tap\n onPress={onRetry}\n accessibilityRole=\"button\"\n style={[styles.retry, { backgroundColor: theme.accent }]}\n pressedStyle={DIM}\n >\n <Text style={[styles.retryText, { color: theme.accentInk }]}>Write the note</Text>\n </Tap>\n ) : null}\n </View>\n );\n }\n\n const { note } = record;\n return (\n <ScrollView contentContainerStyle={[styles.scroll, { paddingBottom: 24 + bottomInset }]}>\n <Text style={[styles.title, { color: theme.ink }]}>{note.title}</Text>\n <Text style={[styles.meta, { color: theme.faint }]}>{meta}</Text>\n\n {note.to_verify.length ? (\n <View style={[styles.verify, { backgroundColor: theme.warnSoft, borderColor: theme.warnBorder }]}>\n <View style={styles.verifyHead}>\n <MaterialCommunityIcons name=\"alert-outline\" size={18} color={theme.warnInk} />\n <Text style={[styles.verifyTitle, { color: theme.warnInk }]}>Check before you use</Text>\n </View>\n {note.to_verify.map((item, i) => (\n <Text key={i} style={[styles.verifyItem, { color: theme.warnInk }]}>\n {`• ${item}`}\n </Text>\n ))}\n </View>\n ) : null}\n\n <Section title=\"SUBJECTIVE\" items={note.subjective} theme={theme} />\n <Section title=\"OBJECTIVE\" items={note.objective} theme={theme} />\n <Section title=\"ASSESSMENT\" items={note.assessment} theme={theme} />\n <Section title=\"PLAN\" items={note.plan} theme={theme} />\n <Medications meds={note.medications} theme={theme} />\n {note.follow_up ? <Section title=\"FOLLOW-UP\" items={[note.follow_up]} theme={theme} /> : null}\n\n {record.transcript ? (\n <View style={[styles.card, { backgroundColor: theme.card, borderColor: theme.border }]}>\n <Tap\n onPress={() => setShowTranscript((v) => !v)}\n accessibilityRole=\"button\"\n style={styles.transcriptToggle}\n pressedStyle={DIM}\n >\n <Text style={[styles.heading, styles.headingFlat, { color: theme.muted }]}>TRANSCRIPT</Text>\n <MaterialCommunityIcons\n name={showTranscript ? 'chevron-up' : 'chevron-down'}\n size={20}\n color={theme.muted}\n />\n </Tap>\n {showTranscript ? (\n <Text style={[styles.transcript, { color: theme.ink }]}>{record.transcript}</Text>\n ) : null}\n </View>\n ) : null}\n\n <Text style={[styles.disclaimer, { color: theme.faint }]}>{NOTE_DISCLAIMER}</Text>\n </ScrollView>\n );\n}\n\nconst styles = StyleSheet.create({\n scroll: { paddingHorizontal: 16, paddingTop: 8 },\n title: { fontSize: 21, fontWeight: '700', lineHeight: 27 },\n meta: { marginTop: 4, fontSize: 13 },\n verify: { marginTop: 16, borderRadius: 14, borderWidth: StyleSheet.hairlineWidth, padding: 14 },\n verifyHead: { flexDirection: 'row', alignItems: 'center', gap: 8, marginBottom: 6 },\n verifyTitle: { fontSize: 14, fontWeight: '700' },\n verifyItem: { fontSize: 14, lineHeight: 20, marginTop: 4 },\n card: {\n marginTop: 12,\n borderRadius: 14,\n borderWidth: StyleSheet.hairlineWidth,\n paddingHorizontal: 14,\n paddingVertical: 12,\n },\n heading: { fontSize: 12, fontWeight: '700', letterSpacing: 0.8, marginBottom: 6 },\n headingFlat: { marginBottom: 0 },\n item: { flexDirection: 'row', alignItems: 'flex-start', marginTop: 6 },\n bullet: { width: 5, height: 5, borderRadius: 2.5, marginTop: 8, marginRight: 10 },\n itemText: { flex: 1, fontSize: 15, lineHeight: 21 },\n med: { flexDirection: 'row', alignItems: 'center', paddingVertical: 10 },\n medText: { flex: 1, paddingRight: 10 },\n medName: { fontSize: 15, fontWeight: '600', textTransform: 'capitalize' },\n medDetail: { marginTop: 2, fontSize: 13 },\n pill: { paddingHorizontal: 10, paddingVertical: 4, borderRadius: 999 },\n pillText: { fontSize: 12, fontWeight: '600', textTransform: 'capitalize' },\n transcriptToggle: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between' },\n transcript: { marginTop: 10, fontSize: 14, lineHeight: 21 },\n disclaimer: { marginTop: 18, fontSize: 12, textAlign: 'center' },\n center: { flex: 1, alignItems: 'center', justifyContent: 'center', paddingHorizontal: 32 },\n centerTitle: { marginTop: 14, fontSize: 16, fontWeight: '600', textAlign: 'center' },\n centerDetail: { marginTop: 6, fontSize: 13, lineHeight: 19, textAlign: 'center' },\n retry: { marginTop: 18, paddingHorizontal: 20, paddingVertical: 12, borderRadius: 999 },\n retryText: { fontSize: 15, fontWeight: '600' },\n});\n"],"names":[],"mappings":"qUAeA,MAAM,UAA2C,GAAA;AAAA,EAC/C,SAAW,EAAA,+BAAA;AAAA,EACX,OAAS,EAAA;AACX,CAAA;AACO,SAAS,cAAc,GAAqB,EAAA;AACjD,EA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QAAA;AAAA,IAChB,iBAAmB,EAAA;AAAA,GACrB;AAAA,EACA,WAAa,EAAA;AAAA,IACX,SAAW,EAAA,EAAA;AAAA,IACX,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA,KAAA;AAAA,IACZ,SAAW,EAAA;AAAA,GACb;AAAA,EACA,YAAc,EAAA;AAAA,IACZ,SAAW,EAAA,CAAA;AAAA,IACX,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA,EAAA;AAAA,IACZ,SAAW,EAAA;AAAA,GACb;AAAA,EACA,KAAO,EAAA;AAAA,IACL,SAAW,EAAA,EAAA;AAAA,IACX,iBAAmB,EAAA,EAAA;AAAA,IACnB,eAAiB,EAAA,EAAA;AAAA,IACjB,YAAc,EAAA;AAAA,GAChB;AAAA,EACA,SAAW,EAAA;AAAA,IACT,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA;AAAA;AAEhB,CAAC,CAAA"}
1
+ {"version":3,"file":"NoteView.js","sources":["../../../../src/features/dictate/components/NoteView.tsx"],"sourcesContent":["/**\n * A dictation's note: what to check first (amber, above everything), the four\n * SOAP sections, the medications with what was dictated for each, follow-up,\n * the AI's suggestions on demand, and the transcript behind a toggle. While\n * the note is being written this shows the stage; when writing failed, why and\n * a Retry that reuses the saved recording.\n *\n * A note written with its identifiers hidden from the AI shows them hidden\n * (\"Name 1\") or put back, as the clinician chooses; the suggestions are asked\n * for with the hidden version only.\n */\nimport React, { useEffect, useState } from 'react';\nimport { ActivityIndicator, ScrollView, StyleSheet, Text, View } from 'react-native';\nimport { MaterialCommunityIcons } from '@expo/vector-icons';\nimport { DIM, Tap } from '../../inbox/components/Tap';\nimport { formatDuration, NOTE_DISCLAIMER, SUGGESTION_DISCLAIMER, SUGGESTION_HEADINGS } from '../noteText';\nimport { placeholderLabel, splitPlaceholders } from '../privacy';\nimport type { DictateStage } from '../dictateClient';\nimport type { DictateTheme } from '../dictateTheme';\nimport type { DictationRecord, NoteMedication, NoteSuggestion, SuggestionKind } from '../types';\nimport { shownNote, type SuggestState } from '../shownNote';\n\nconst STAGE_TEXT: Record<DictateStage, string> = {\n uploading: 'Uploading the recording…',\n writing: 'Transcribing and writing the note…',\n};\n\nexport function dictationDate(iso: string): string {\n const d = new Date(iso);\n return Number.isNaN(d.getTime())\n ? ''\n : d.toLocaleString(undefined, { month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' });\n}\n\n/** Text with each hidden identifier drawn as a small label (\"Name 1\"), so it reads as a gap, not a code. */\nfunction Redacted({ text, theme }: { text: string; theme: DictateTheme }) {\n const runs = splitPlaceholders(text);\n if (runs.length === 1 && !runs[0].placeholder) return <>{text}</>;\n return (\n <>\n {runs.map((run, i) =>\n run.placeholder ? (\n <Text\n key={i}\n style={[styles.placeholder, { backgroundColor: theme.chip, color: theme.muted }]}\n accessibilityLabel={`${placeholderLabel(run.text)}, hidden`}\n >\n {/* Non-breaking: a label wraps whole, never leaving a shaded gap at a line end. */}\n {`\\u00A0${placeholderLabel(run.text).replace(/ /g, '\\u00A0')}\\u00A0`}\n </Text>\n ) : (\n run.text\n ),\n )}\n </>\n );\n}\n\nfunction Section({ title, items, theme }: { title: string; items: string[]; theme: DictateTheme }) {\n if (!items.length) return null;\n return (\n <View style={[styles.card, { backgroundColor: theme.card, borderColor: theme.border }]}>\n <Text style={[styles.heading, { color: theme.muted }]}>{title}</Text>\n {items.map((item, i) => (\n <View key={i} style={styles.item}>\n <View style={[styles.bullet, { backgroundColor: theme.faint }]} />\n <Text style={[styles.itemText, { color: theme.ink }]}>\n <Redacted text={item} theme={theme} />\n </Text>\n </View>\n ))}\n </View>\n );\n}\n\n/** What the AI saw, and the switch between hidden and put back. */\nfunction PrivacyRow({\n record,\n showIdentifiers,\n onToggle,\n theme,\n}: {\n record: DictationRecord;\n showIdentifiers: boolean;\n onToggle: () => void;\n theme: DictateTheme;\n}) {\n const { redaction } = record;\n if (!redaction) return null;\n const count = redaction.identifiers.length;\n const what = count === 1 ? '1 name or number' : `${count} names and numbers`;\n const line = count\n ? `${what} ${showIdentifiers ? 'shown here' : 'hidden'}. The AI never saw them.`\n : 'No names or numbers were heard. The AI saw the dictation as spoken.';\n return (\n <View style={[styles.privacy, { backgroundColor: theme.goodSoft }]}>\n <MaterialCommunityIcons name=\"shield-lock-outline\" size={18} color={theme.good} />\n <View style={styles.privacyText}>\n <Text style={[styles.privacyLine, { color: theme.ink }]}>{line}</Text>\n {redaction.method === 'patterns' && count ? (\n <Text style={[styles.privacyNote, { color: theme.warnInk }]}>\n Found without the medical transcriber; check that no name was missed.\n </Text>\n ) : null}\n </View>\n {count ? (\n <Tap\n onPress={onToggle}\n accessibilityRole=\"button\"\n accessibilityLabel={showIdentifiers ? 'Hide names and numbers' : 'Show names and numbers'}\n style={[styles.privacyToggle, { borderColor: theme.border, backgroundColor: theme.card }]}\n pressedStyle={DIM}\n >\n <Text style={[styles.privacyToggleText, { color: theme.ink }]}>\n {showIdentifiers ? 'Hide' : 'Show'}\n </Text>\n </Tap>\n ) : null}\n </View>\n );\n}\n\nconst SUGGESTION_ICON: Record<SuggestionKind, React.ComponentProps<typeof MaterialCommunityIcons>['name']> = {\n missing: 'text-box-plus-outline',\n safety: 'alert-octagon-outline',\n coding: 'tag-outline',\n follow_up: 'calendar-check-outline',\n};\n\n/** The AI's read of the note, on demand: grouped by kind, each with why. */\nfunction Suggestions({\n items,\n state,\n onSuggest,\n theme,\n}: {\n items: NoteSuggestion[] | null;\n state: SuggestState;\n onSuggest: () => void;\n theme: DictateTheme;\n}) {\n const loading = state.status === 'loading';\n let content: React.ReactNode;\n if (!items) {\n content = (\n <Text style={[styles.suggestWhy, { color: theme.muted }]}>\n Ask the AI to read the note and point out what to add or check before you sign. It reads the note with\n names and numbers hidden.\n </Text>\n );\n } else if (!items.length) {\n content = (\n <Text style={[styles.suggestWhy, { color: theme.muted }]}>\n Nothing to add: the note covers what the AI would check.\n </Text>\n );\n } else {\n content = (Object.keys(SUGGESTION_HEADINGS) as SuggestionKind[]).map((kind) => {\n const group = items.filter((s) => s.kind === kind);\n if (!group.length) return null;\n return (\n <View key={kind} style={styles.suggestGroup}>\n <View style={styles.suggestHead}>\n <MaterialCommunityIcons\n name={SUGGESTION_ICON[kind]}\n size={16}\n color={kind === 'safety' ? theme.crit : theme.accent}\n />\n <Text style={[styles.suggestKind, { color: theme.ink }]}>{SUGGESTION_HEADINGS[kind]}</Text>\n </View>\n {group.map((s, i) => (\n <View key={i} style={styles.suggestItem}>\n <Text style={[styles.suggestText, { color: theme.ink }]}>\n <Redacted text={s.text} theme={theme} />\n </Text>\n {s.why ? (\n <Text style={[styles.suggestWhy, { color: theme.muted }]}>\n <Redacted text={s.why} theme={theme} />\n </Text>\n ) : null}\n </View>\n ))}\n </View>\n );\n });\n }\n let buttonLabel = 'Get suggestions';\n if (loading) buttonLabel = 'Reading the note…';\n else if (items) buttonLabel = 'Ask again';\n return (\n <View style={[styles.card, { backgroundColor: theme.card, borderColor: theme.border }]}>\n <Text style={[styles.heading, { color: theme.muted }]}>SUGGESTIONS</Text>\n {content}\n {state.status === 'error' ? (\n <Text style={[styles.suggestError, { color: theme.crit }]}>{state.message}</Text>\n ) : null}\n <Tap\n onPress={onSuggest}\n disabled={loading}\n accessibilityRole=\"button\"\n accessibilityLabel={items ? 'Ask for suggestions again' : 'Get suggestions'}\n style={[styles.suggestButton, { borderColor: theme.accent, opacity: loading ? 0.6 : 1 }]}\n pressedStyle={DIM}\n >\n {loading ? (\n <ActivityIndicator color={theme.accent} size=\"small\" />\n ) : (\n <MaterialCommunityIcons name=\"lightbulb-on-outline\" size={18} color={theme.accent} />\n )}\n <Text style={[styles.suggestButtonText, { color: theme.accent }]}>{buttonLabel}</Text>\n </Tap>\n {items?.length ? (\n <Text style={[styles.suggestFoot, { color: theme.faint }]}>{SUGGESTION_DISCLAIMER}</Text>\n ) : null}\n </View>\n );\n}\n\nfunction actionTone(action: NoteMedication['action'], theme: DictateTheme): { bg: string; ink: string } {\n if (action === 'start') return { bg: theme.goodSoft, ink: theme.good };\n if (action === 'change') return { bg: theme.accentSoft, ink: theme.accent };\n if (action === 'stop') return { bg: theme.recSoft, ink: theme.crit };\n return { bg: theme.chip, ink: theme.muted };\n}\n\nfunction Medications({ meds, theme }: { meds: NoteMedication[]; theme: DictateTheme }) {\n if (!meds.length) return null;\n return (\n <View style={[styles.card, { backgroundColor: theme.card, borderColor: theme.border }]}>\n <Text style={[styles.heading, { color: theme.muted }]}>MEDICATIONS</Text>\n {meds.map((med, i) => {\n const tone = actionTone(med.action, theme);\n const detail = [med.dose, med.route, med.frequency].filter(Boolean).join(' · ');\n return (\n <View\n key={`${med.name}-${i}`}\n style={[\n styles.med,\n i > 0 && { borderTopColor: theme.border, borderTopWidth: StyleSheet.hairlineWidth },\n ]}\n >\n <View style={styles.medText}>\n <Text style={[styles.medName, { color: theme.ink }]}>\n <Redacted text={med.name} theme={theme} />\n </Text>\n <Text style={[styles.medDetail, { color: detail ? theme.muted : theme.warnInk }]}>\n {detail ? <Redacted text={detail} theme={theme} /> : 'No dose or frequency dictated'}\n </Text>\n </View>\n <View style={[styles.pill, { backgroundColor: tone.bg }]}>\n <Text style={[styles.pillText, { color: tone.ink }]}>{med.action}</Text>\n </View>\n </View>\n );\n })}\n </View>\n );\n}\n\nfunction Writing({ stage, theme }: { stage: DictateStage; theme: DictateTheme }) {\n const [seconds, setSeconds] = useState(0);\n useEffect(() => {\n const id = setInterval(() => setSeconds((s) => s + 1), 1000);\n return () => clearInterval(id);\n }, []);\n return (\n <View style={styles.center}>\n <ActivityIndicator color={theme.accent} />\n <Text style={[styles.centerTitle, { color: theme.ink }]}>{STAGE_TEXT[stage]}</Text>\n <Text style={[styles.centerDetail, { color: theme.faint }]}>{seconds}s · usually under a minute</Text>\n </View>\n );\n}\n\nexport function NoteView({\n record,\n stage,\n theme,\n bottomInset,\n onRetry,\n showIdentifiers,\n onToggleIdentifiers,\n suggestState,\n onSuggest,\n}: {\n record: DictationRecord;\n stage: DictateStage | null;\n theme: DictateTheme;\n bottomInset: number;\n onRetry: () => void;\n showIdentifiers: boolean;\n onToggleIdentifiers: () => void;\n suggestState: SuggestState;\n onSuggest: () => void;\n}) {\n const [showTranscript, setShowTranscript] = useState(false);\n const meta = [dictationDate(record.createdAt), formatDuration(record.durationMs)].filter(Boolean).join(' · ');\n\n if (record.status === 'writing' || (record.status === 'saved' && stage)) {\n return <Writing stage={stage ?? 'writing'} theme={theme} />;\n }\n if (!record.note) {\n return (\n <View style={styles.center}>\n <MaterialCommunityIcons name=\"alert-circle-outline\" size={28} color={theme.crit} />\n <Text style={[styles.centerTitle, { color: theme.ink }]}>No note yet</Text>\n <Text style={[styles.centerDetail, { color: theme.muted }]}>\n {record.error ?? 'The recording is saved on this phone.'}\n </Text>\n {record.audioUri ? (\n <Tap\n onPress={onRetry}\n accessibilityRole=\"button\"\n style={[styles.retry, { backgroundColor: theme.accent }]}\n pressedStyle={DIM}\n >\n <Text style={[styles.retryText, { color: theme.accentInk }]}>Write the note</Text>\n </Tap>\n ) : null}\n </View>\n );\n }\n\n const { note, transcript, suggestions } = shownNote(record, record.note, showIdentifiers);\n return (\n <ScrollView contentContainerStyle={[styles.scroll, { paddingBottom: 24 + bottomInset }]}>\n <Text style={[styles.title, { color: theme.ink }]}>\n <Redacted text={note.title} theme={theme} />\n </Text>\n <Text style={[styles.meta, { color: theme.faint }]}>{meta}</Text>\n <PrivacyRow\n record={record}\n showIdentifiers={showIdentifiers}\n onToggle={onToggleIdentifiers}\n theme={theme}\n />\n\n {note.to_verify.length ? (\n <View style={[styles.verify, { backgroundColor: theme.warnSoft, borderColor: theme.warnBorder }]}>\n <View style={styles.verifyHead}>\n <MaterialCommunityIcons name=\"alert-outline\" size={18} color={theme.warnInk} />\n <Text style={[styles.verifyTitle, { color: theme.warnInk }]}>Check before you use</Text>\n </View>\n {note.to_verify.map((item, i) => (\n <Text key={i} style={[styles.verifyItem, { color: theme.warnInk }]}>\n {'• '}\n <Redacted text={item} theme={theme} />\n </Text>\n ))}\n </View>\n ) : null}\n\n <Section title=\"SUBJECTIVE\" items={note.subjective} theme={theme} />\n <Section title=\"OBJECTIVE\" items={note.objective} theme={theme} />\n <Section title=\"ASSESSMENT\" items={note.assessment} theme={theme} />\n <Section title=\"PLAN\" items={note.plan} theme={theme} />\n <Medications meds={note.medications} theme={theme} />\n {note.follow_up ? <Section title=\"FOLLOW-UP\" items={[note.follow_up]} theme={theme} /> : null}\n\n {/* Only a note whose identifiers were hidden from the AI goes back to it. */}\n {record.redaction ? (\n <Suggestions items={suggestions} state={suggestState} onSuggest={onSuggest} theme={theme} />\n ) : null}\n\n {transcript ? (\n <View style={[styles.card, { backgroundColor: theme.card, borderColor: theme.border }]}>\n <Tap\n onPress={() => setShowTranscript((v) => !v)}\n accessibilityRole=\"button\"\n style={styles.transcriptToggle}\n pressedStyle={DIM}\n >\n <Text style={[styles.heading, styles.headingFlat, { color: theme.muted }]}>TRANSCRIPT</Text>\n <MaterialCommunityIcons\n name={showTranscript ? 'chevron-up' : 'chevron-down'}\n size={20}\n color={theme.muted}\n />\n </Tap>\n {showTranscript ? (\n <Text style={[styles.transcript, { color: theme.ink }]}>\n <Redacted text={transcript} theme={theme} />\n </Text>\n ) : null}\n </View>\n ) : null}\n\n <Text style={[styles.disclaimer, { color: theme.faint }]}>{NOTE_DISCLAIMER}</Text>\n </ScrollView>\n );\n}\n\nconst styles = StyleSheet.create({\n scroll: { paddingHorizontal: 16, paddingTop: 8 },\n title: { fontSize: 21, fontWeight: '700', lineHeight: 27 },\n meta: { marginTop: 4, fontSize: 13 },\n verify: { marginTop: 16, borderRadius: 14, borderWidth: StyleSheet.hairlineWidth, padding: 14 },\n verifyHead: { flexDirection: 'row', alignItems: 'center', gap: 8, marginBottom: 6 },\n verifyTitle: { fontSize: 14, fontWeight: '700' },\n verifyItem: { fontSize: 14, lineHeight: 20, marginTop: 4 },\n card: {\n marginTop: 12,\n borderRadius: 14,\n borderWidth: StyleSheet.hairlineWidth,\n paddingHorizontal: 14,\n paddingVertical: 12,\n },\n heading: { fontSize: 12, fontWeight: '700', letterSpacing: 0.8, marginBottom: 6 },\n headingFlat: { marginBottom: 0 },\n item: { flexDirection: 'row', alignItems: 'flex-start', marginTop: 6 },\n bullet: { width: 5, height: 5, borderRadius: 2.5, marginTop: 8, marginRight: 10 },\n itemText: { flex: 1, fontSize: 15, lineHeight: 21 },\n med: { flexDirection: 'row', alignItems: 'center', paddingVertical: 10 },\n medText: { flex: 1, paddingRight: 10 },\n medName: { fontSize: 15, fontWeight: '600', textTransform: 'capitalize' },\n medDetail: { marginTop: 2, fontSize: 13 },\n pill: { paddingHorizontal: 10, paddingVertical: 4, borderRadius: 999 },\n pillText: { fontSize: 12, fontWeight: '600', textTransform: 'capitalize' },\n transcriptToggle: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between' },\n transcript: { marginTop: 10, fontSize: 14, lineHeight: 21 },\n disclaimer: { marginTop: 18, fontSize: 12, textAlign: 'center' },\n placeholder: { fontSize: 13, fontWeight: '600', borderRadius: 4, overflow: 'hidden' },\n privacy: {\n marginTop: 12,\n borderRadius: 12,\n paddingHorizontal: 12,\n paddingVertical: 10,\n flexDirection: 'row',\n alignItems: 'center',\n gap: 10,\n },\n privacyText: { flex: 1 },\n privacyLine: { fontSize: 13, lineHeight: 18 },\n privacyNote: { marginTop: 2, fontSize: 12, lineHeight: 17 },\n privacyToggle: {\n paddingHorizontal: 14,\n paddingVertical: 6,\n borderRadius: 999,\n borderWidth: StyleSheet.hairlineWidth,\n },\n privacyToggleText: { fontSize: 13, fontWeight: '600' },\n suggestGroup: { marginTop: 8 },\n suggestHead: { flexDirection: 'row', alignItems: 'center', gap: 6, marginBottom: 2 },\n suggestKind: { fontSize: 14, fontWeight: '700' },\n suggestItem: { marginTop: 6, paddingLeft: 22 },\n suggestText: { fontSize: 15, lineHeight: 21 },\n suggestWhy: { marginTop: 2, fontSize: 13, lineHeight: 18 },\n suggestError: { marginTop: 10, fontSize: 13, lineHeight: 18 },\n suggestButton: {\n marginTop: 12,\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n gap: 8,\n paddingVertical: 10,\n borderRadius: 999,\n borderWidth: 1,\n },\n suggestButtonText: { fontSize: 15, fontWeight: '600' },\n suggestFoot: { marginTop: 10, fontSize: 12, lineHeight: 17, textAlign: 'center' },\n center: { flex: 1, alignItems: 'center', justifyContent: 'center', paddingHorizontal: 32 },\n centerTitle: { marginTop: 14, fontSize: 16, fontWeight: '600', textAlign: 'center' },\n centerDetail: { marginTop: 6, fontSize: 13, lineHeight: 19, textAlign: 'center' },\n retry: { marginTop: 18, paddingHorizontal: 20, paddingVertical: 12, borderRadius: 999 },\n retryText: { fontSize: 15, fontWeight: '600' },\n});\n"],"names":[],"mappings":"+dAqBA,MAAM,UAA2C,GAAA;AAAA,EAC/C,SAAW,EAAA,+BAAA;AAAA,EACX,OAAS,EAAA;AACX,CAAA;AACO,SAAS,cAAc,GAAqB,EAAA;AACjD,EAAM,MAAA,CAAA,GAAI,IAAI,IAAA,CAAK,GAAG,CAAA;AACtB,EAAO,OAAA,MAAA,CAAO,MAAM,CAAE,CAAA,OAAA,EAAS,CAAI,GAAA,EAAA,GAAK,CAAE,CAAA,cAAA,CAAe,MAAW,EAAA;AAAA,IAClE,KAAO,EAAA,OAAA;AAAA,IACP,GAAK,EAAA,SAAA;AAAA,IACL,IAAM,EAAA,SAAA;AAAA,IACN,MAAQ,EAAA;AAAA,GACT,CAAA;AACH;AAGA,SAAS,QAAS,CAAA;AAAA,EAChB,IAAA;AAAA,EACA;AACF,CAGG,EAAA;AACD,EAAM,MAAA,IAAA,GAAO,kBAAkB,IAAI,CAAA;AACnC,EAAI,IAAA,IAAA,CAAK,MAAW,KAAA,CAAA,IAAK,CAAC,IAAA,CAAK,CAAC,CAAE,CAAA,WAAA,EAAoB,uBAAA,GAAA,CAAA,QAAA,EAAA,EAAG,QAAK,EAAA,IAAA,EAAA,CAAA;AAC9D,EAAA,uBACW,GAAA,CAAA,QAAA,EA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AAW,EAAA;AAAA,GACb;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,CAAA;AAAA,IACN,UAAY,EAAA,QAAA;AAAA,IACZ,cAAgB,EAAA,QAAA;AAAA,IAChB,iBAAmB,EAAA;AAAA,GACrB;AAAA,EACA,WAAa,EAAA;AAAA,IACX,SAAW,EAAA,EAAA;AAAA,IACX,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA,KAAA;AAAA,IACZ,SAAW,EAAA;AAAA,GACb;AAAA,EACA,YAAc,EAAA;AAAA,IACZ,SAAW,EAAA,CAAA;AAAA,IACX,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA,EAAA;AAAA,IACZ,SAAW,EAAA;AAAA,GACb;AAAA,EACA,KAAO,EAAA;AAAA,IACL,SAAW,EAAA,EAAA;AAAA,IACX,iBAAmB,EAAA,EAAA;AAAA,IACnB,eAAiB,EAAA,EAAA;AAAA,IACjB,YAAc,EAAA;AAAA,GAChB;AAAA,EACA,SAAW,EAAA;AAAA,IACT,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA;AAAA;AAEhB,CAAC,CAAA"}
@@ -16,6 +16,8 @@ var __spreadValues = (a, b) => {
16
16
  };
17
17
  const DICTATE_CONNECTOR = "yantra-meetings";
18
18
  const CLINICAL_NOTE_ACTION = "YANTRA_MEETINGS_CLINICAL_NOTE";
19
+ const SUGGEST_ACTION = "YANTRA_MEETINGS_CLINICAL_SUGGEST";
20
+ const SUGGEST_TIMEOUT_MS = 4 * 6e4;
19
21
  const NOTE_TIMEOUT_MS = 10 * 6e4;
20
22
  class DictateError extends Error {
21
23
  constructor(kind, message) {
@@ -31,6 +33,47 @@ const strings = (v) => {
31
33
  return str(v) ? [str(v)] : [];
32
34
  };
33
35
  const ACTIONS = ["start", "continue", "change", "stop", "mentioned"];
36
+ const KINDS = ["missing", "safety", "coding", "follow_up"];
37
+ function shapeNote(note) {
38
+ const meds = Array.isArray(note.medications) ? note.medications : [];
39
+ return {
40
+ title: str(note.title) || "Clinical note",
41
+ subjective: strings(note.subjective),
42
+ objective: strings(note.objective),
43
+ assessment: strings(note.assessment),
44
+ plan: strings(note.plan),
45
+ medications: meds.map(asRecord).filter((m) => !!m && !!str(m.name)).map((m) => {
46
+ const action = str(m.action).toLowerCase();
47
+ return {
48
+ name: str(m.name),
49
+ dose: str(m.dose),
50
+ route: str(m.route),
51
+ frequency: str(m.frequency),
52
+ action: ACTIONS.includes(action) ? action : "mentioned"
53
+ };
54
+ }),
55
+ follow_up: str(note.follow_up),
56
+ to_verify: strings(note.to_verify)
57
+ };
58
+ }
59
+ function identifiersOf(v) {
60
+ return (Array.isArray(v) ? v : []).map(asRecord).filter((i) => !!i && /^\[[A-Z]+_\d+\]$/.test(str(i.token)) && !!str(i.value)).map((i) => ({
61
+ token: str(i.token),
62
+ value: str(i.value),
63
+ kind: str(i.kind)
64
+ }));
65
+ }
66
+ function redactionOf(v) {
67
+ const r = asRecord(v);
68
+ const note = asRecord(r == null ? void 0 : r.note);
69
+ if (!r || !note) return void 0;
70
+ return {
71
+ method: r.method === "patterns" ? "patterns" : "entities",
72
+ note: shapeNote(note),
73
+ transcript: str(r.transcript),
74
+ identifiers: identifiersOf(r.identifiers)
75
+ };
76
+ }
34
77
  function unwrapNote(raw) {
35
78
  var _a;
36
79
  let layer = asRecord(raw);
@@ -40,30 +83,14 @@ function unwrapNote(raw) {
40
83
  const note = asRecord(layer.note);
41
84
  if (note) {
42
85
  const transcript = asRecord(layer.transcript);
43
- const meds = Array.isArray(note.medications) ? note.medications : [];
44
- return {
45
- note: {
46
- title: str(note.title) || "Clinical note",
47
- subjective: strings(note.subjective),
48
- objective: strings(note.objective),
49
- assessment: strings(note.assessment),
50
- plan: strings(note.plan),
51
- medications: meds.map(asRecord).filter((m) => !!m && !!str(m.name)).map((m) => {
52
- const action = str(m.action).toLowerCase();
53
- return {
54
- name: str(m.name),
55
- dose: str(m.dose),
56
- route: str(m.route),
57
- frequency: str(m.frequency),
58
- action: ACTIONS.includes(action) ? action : "mentioned"
59
- };
60
- }),
61
- follow_up: str(note.follow_up),
62
- to_verify: strings(note.to_verify)
63
- },
86
+ const redaction = redactionOf(layer.redaction);
87
+ return __spreadValues({
88
+ note: shapeNote(note),
64
89
  transcript: str(transcript == null ? void 0 : transcript.text),
65
90
  model: str(layer.model) || void 0
66
- };
91
+ }, redaction ? {
92
+ redaction
93
+ } : {});
67
94
  }
68
95
  layer = (_a = asRecord(layer.data)) != null ? _a : asRecord(layer.result);
69
96
  }
@@ -100,4 +127,47 @@ async function writeNoteFromRecording(audioUri, deps, opts = {}, onStage = () =>
100
127
  const empty = !written.transcript && ![n.subjective, n.objective, n.assessment, n.plan].some((s) => s.length);
101
128
  if (empty) throw new DictateError("empty", "The dictation has no speech.");
102
129
  return written;
103
- }export{CLINICAL_NOTE_ACTION,DICTATE_CONNECTOR,DictateError,NOTE_TIMEOUT_MS,dictateErrorText,unwrapNote,writeNoteFromRecording};//# sourceMappingURL=dictateClient.js.map
130
+ }
131
+ async function suggestFromNote(redaction, deps) {
132
+ var _a;
133
+ const raw = await deps.exec(DICTATE_CONNECTOR, SUGGEST_ACTION, {
134
+ note: redaction.note,
135
+ transcript: redaction.transcript,
136
+ // Which placeholders exist, so a new one numbers on; never what they stand for.
137
+ identifiers: redaction.identifiers.map(({
138
+ token,
139
+ kind
140
+ }) => ({
141
+ token,
142
+ kind
143
+ }))
144
+ }, {
145
+ timeoutMs: SUGGEST_TIMEOUT_MS
146
+ });
147
+ let layer = asRecord(raw);
148
+ for (let depth = 0; layer && depth < 6; depth += 1) {
149
+ if (Array.isArray(layer.suggestions)) {
150
+ const items = layer.suggestions.map(asRecord).filter((s) => !!s && KINDS.includes(str(s.kind)) && !!str(s.text)).map((s) => ({
151
+ kind: str(s.kind),
152
+ text: str(s.text),
153
+ why: str(s.why)
154
+ }));
155
+ return {
156
+ items,
157
+ identifiers: identifiersOf(layer.identifiers)
158
+ };
159
+ }
160
+ const reason = [layer.error, layer.message].find((v) => typeof v === "string" && !!v.trim());
161
+ if (layer.successful === false && reason) throw new DictateError("failed", reason);
162
+ layer = (_a = asRecord(layer.data)) != null ? _a : asRecord(layer.result);
163
+ }
164
+ throw new DictateError("failed", "The suggestions came back empty.");
165
+ }
166
+ function suggestErrorText(err) {
167
+ const message = err instanceof Error ? err.message : String(err);
168
+ if (/network request failed|offline|not signed in/i.test(message)) return "You are offline or signed out. Try again when you are back online.";
169
+ if (/action '[^']*' not found in connector|not found in registry|is not installed/i.test(message)) return "Suggestions are not available on this workspace yet.";
170
+ if (/temporarily unavailable|problem on our side|all LLM providers failed|HTTP 5\d\d/i.test(message)) return "Yantra could not read the note right now. This is a problem on our side; try again in a few minutes.";
171
+ if (/timed? ?out|abort/i.test(message)) return "Reading the note took too long. Try again.";
172
+ return "The suggestions could not be written. Try again.";
173
+ }export{CLINICAL_NOTE_ACTION,DICTATE_CONNECTOR,DictateError,NOTE_TIMEOUT_MS,SUGGEST_ACTION,SUGGEST_TIMEOUT_MS,dictateErrorText,identifiersOf,suggestErrorText,suggestFromNote,unwrapNote,writeNoteFromRecording};//# sourceMappingURL=dictateClient.js.map