Skip to content

Commit 0f46bbe

Browse files
committed
move hooks
1 parent abf3df2 commit 0f46bbe

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

vim--ai-scribe--react/src/components/organisms/ai-scribe-demo/AiScribeDemo.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
import { MEDICAL_KEYWORDS } from "./keywords.mock";
1515
import type { Note } from "./Note.interface";
1616
import { ProcessingTab } from "./ProcessingTab";
17-
import { usePatientName } from "./usePatientName";
17+
import { usePatientName } from "../../../vimOs/usePatientName";
1818
import { useRecorder } from "./useRecorder";
1919
import { UserTab } from "./UserTab";
2020

@@ -70,6 +70,7 @@ export const AiScribeDemo = () => {
7070
const [activeTab, setActiveTab] = useState<TabType>("record");
7171
const [notes, setNotes] = useState<Note[]>([]);
7272
const patientName = usePatientName();
73+
const [visitedPatient, setVisitedPatient] = useState<string | null>(null);
7374
const [isProcessing, setIsProcessing] = useState(false);
7475
const [selectedKeyword, setSelectedKeyword] = useState<string | null>(null);
7576
const { watch, reset } = useNoteFormContext();
@@ -106,6 +107,7 @@ export const AiScribeDemo = () => {
106107

107108
const handleEndVisit = () => {
108109
stopRecording();
110+
setVisitedPatient(patientName);
109111
setIsProcessing(true);
110112

111113
setTimeout(() => {
@@ -206,7 +208,7 @@ export const AiScribeDemo = () => {
206208

207209
{activeTab === "notes" && (
208210
<NotesTab
209-
patientName={patientName}
211+
patientName={visitedPatient}
210212
handleFullEhrUpdate={handleFullEhrUpdate}
211213
renderHighlightedText={renderHighlightedText}
212214
/>

vim--ai-scribe--react/src/components/organisms/notes-tab/NotesTab.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const NotesTab = ({
1111
handleFullEhrUpdate,
1212
renderHighlightedText,
1313
}: {
14-
patientName: string;
14+
patientName: string | null;
1515
handleFullEhrUpdate: () => Promise<void>;
1616
renderHighlightedText: (text: string) => JSX.Element;
1717
}) => {
@@ -29,8 +29,9 @@ export const NotesTab = ({
2929
return (
3030
<>
3131
<div className="flex flex-col justify-between items-center gap-2">
32-
<h2 className="text-3xl font-bold text-gray-800">
33-
{patientName || "Patient Name"}
32+
<h2 className="text-2xl text-gray-800">
33+
Notes for{" "}
34+
<span className="font-bold">{patientName || "Patient Name"}</span>
3435
</h2>
3536
<div className="flex items-center space-x-4">
3637
<Button
@@ -40,7 +41,7 @@ export const NotesTab = ({
4041
>
4142
Transcription
4243
</Button>
43-
<Button onClick={() => handleFullEhrUpdate()}>Push all to EHR</Button>
44+
<Button onClick={handleFullEhrUpdate}>Push all to EHR</Button>
4445
</div>
4546
<div className="text-sm text-gray-500">Note saved automatically</div>
4647
</div>

0 commit comments

Comments
 (0)