feat: save claim attachments to cloud storage and documents page
- Claim file uploads (chatbot or manual) now save to both the Cloud Storage patient folder and the Documents page via new POST /api/claims/upload-to-cloud endpoint - MH submit flow now calls uploadAttachmentsToLocalFolder (same as DDMA/United/Tufts) so chatbot-attached X-rays are persisted - Removed old /upload-attachments disk route and attachmentDiskStorage multer config; deleted uploads/patients/ folder - uploadAttachmentsToLocalFolder now points to /upload-to-cloud and sends patientId so the backend can create the patient folder Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -899,11 +899,10 @@ export function ClaimForm({
|
||||
...formToCreateClaim
|
||||
} = f;
|
||||
|
||||
// build claimFiles metadata from uploadedFiles (only filename + mimeType)
|
||||
const claimFilesMeta: ClaimFileMeta[] = (uploadedFiles || []).map((f) => ({
|
||||
filename: f.name,
|
||||
mimeType: f.type,
|
||||
}));
|
||||
// Save uploaded files to disk (uploads/patients/<name>/) and record their paths
|
||||
const claimFilesMeta: ClaimFileMeta[] = uploadedFiles?.length
|
||||
? await uploadAttachmentsToLocalFolder(uploadedFiles)
|
||||
: [];
|
||||
|
||||
const selectedNpiProviderId = npiProvider?.npiNumber
|
||||
? npiProviders.find((p) => p.npiNumber === npiProvider.npiNumber)?.id ?? null
|
||||
@@ -1423,10 +1422,11 @@ export function ClaimForm({
|
||||
: patient?.firstName ?? `patient-${patientId}`;
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append("patientId", String(patientId));
|
||||
formData.append("patientName", patientName);
|
||||
files.forEach((f) => formData.append("files", f));
|
||||
|
||||
const res = await apiRequest("POST", "/api/claims/upload-attachments", formData);
|
||||
const res = await apiRequest("POST", "/api/claims/upload-to-cloud", formData);
|
||||
const data = await res.json();
|
||||
return (data.data ?? []) as ClaimFileMeta[];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user