Registered Nurse Step down

VTech Solution

Not Interested
Bookmark
Report This Job

profile Job Location:

Potsdam, NY - USA

profile Monthly Salary: Not Disclosed
Posted on: 30+ days ago
Vacancies: 1 Vacancy

Job Summary

Job Summary:
use client;
import React useRef useState from react;
import Card CardContent CardHeader CardTitle CardDescription from ./ui/card;
import Button from ./ui/button;
import Paperclip Plus Trash2 FileText File FileCode Loader2 from lucide-react;
import nanoid from nanoid;
import useToast from @/hooks/use-toast;
import type AttachedDocument from @/types;
import useRouter from next/navigation;
// Loading dialog while AI re-analyzes
import Dialog DialogContent DialogHeader DialogTitle from @/components/ui/dialog;
interface AnalysisLoadingDialogProps
readonly open: boolean;
function AnalysisLoadingDialog( open : AnalysisLoadingDialogProps)
return (




Analyzing documents


Our AI is updating the proposal analysis. This may take a moment.





);
interface AttachedDocumentsProps
readonly docs: AttachedDocument;
readonly setDocs: ;
readonly proposalId: string;
readonly onRefresh: () > Promise;
readonly readOnly: boolean;
export function AttachedDocuments(
docs
setDocs
proposalId
onRefresh
readOnly
: AttachedDocumentsProps)
const fileInputRef useRef(null);
const toast useToast();
const router useRouter();
const isAnalyzing setIsAnalyzing useState(false);
const getFileIcon (filename: string) >
const ext (.).pop().toLowerCase();
if (!ext) return ;
if (doc docx pdf txt (ext))
return ;

if (js ts tsx json py java c cpp (ext))
return ;

return ;
;
const handleFileAdd async (event: ) >
const files ;
if (!files 0) return;
const apiUrl ;
const formData new FormData();
(files).forEach(file > (files file));
try
setIsAnalyzing(true);
const res await fetch($apiUrl/api/proposals/$proposalId/files
method: POST
body: formData
);
const data await ();
if (!) throw new Error( Failed to upload files);
// Handle duplicate
if ( duplicate )
const skippedList ( ) Some files;
toast(
title: Duplicate file(s) skipped
description: $skippedList already exist based on first 100 words.
variant: destructive
);
return;
// Normal upload success
const newFiles analysis data;
if (newFiles && > 0)
setDocs(prev > ...prev ...newFiles);
(new CustomEvent(analysisUpdated detail: analysis ));
toast( title: $ document(s) added and analysis updated. );
// Refresh proposal data dynamically instead of full reload
if (onRefresh) await onRefresh();
else
toast(
title: No new documents added
description: File Already Exists.
variant: destructive
);

catch (err: any)
toast(
variant: destructive
title: Upload Failed
description: Could not upload files
);
finally
setIsAnalyzing(false);
if () ;

;
const handleFileDelete async (docId: string) >
try
setIsAnalyzing(true);
const res await fetch(
$ method: DELETE
);
const data await ();
if (!) throw new Error( Failed to delete file);
// Update local state
const newDocs (d > ! docId);
setDocs(newDocs);
// If last file deleted delete proposal redirect dashboard
if ( 0)
toast( title: All files removed description: Deleting proposal... );
const delRes await fetch($
method: DELETE
);
if (!)
const errData await ();
throw new Error( Failed to delete proposal);
toast(
title: Proposal deleted
description: Redirecting to dashboard...
);
// Wait a bit then redirect and reload
setTimeout(() >
(/);
();
1200);
return;
// Notify analysis update
(new CustomEvent(analysisUpdated detail: ));
toast( title: File deleted description: Analysis will update shortly. );
//
Job Summary: use client; import React useRef useState from react; import Card CardContent CardHeader CardTitle CardDescription from ./ui/card; import Button from ./ui/button; import Paperclip Plus Trash2 FileText File FileCode Loader2 from lucide-react; import nanoid from nanoid; import u...
View more view more

Key Skills

  • EMR Systems
  • Hospital Experience
  • Acute Care
  • ICU Experience
  • Hospice Care
  • Workers' Compensation Law
  • Home Care
  • Nursing
  • Catheterization
  • Critical Care Experience
  • Medication Administration
  • Tube Feeding