- Documents page shows a "Local Folder" card for each selected patient
with an "Open in Cloud Storage" button that deep-links to their folder
- Cloud Storage page reads ?folderId URL param on mount and auto-opens
the folder panel for seamless navigation from Documents
- Backend: GET /api/cloud-storage/patient-folder/:patientId endpoint
that idempotently gets or creates a top-level CloudFolder per patient
- CloudFolder schema gains optional patientId field linked to Patient
- Disk directories for cloud storage folders now use the folder's name
(e.g. "Xiaohui Wang/") instead of the opaque "folder-{id}/" path
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
39 lines
1.4 KiB
TypeScript
39 lines
1.4 KiB
TypeScript
import * as z from 'zod';
|
|
import { PatientStatusSchema } from '../../enums/PatientStatus.schema';
|
|
// prettier-ignore
|
|
export const PatientInputSchema = z.object({
|
|
id: z.number().int(),
|
|
firstName: z.string(),
|
|
lastName: z.string(),
|
|
dateOfBirth: z.date().optional().nullable(),
|
|
gender: z.string(),
|
|
phone: z.string(),
|
|
email: z.string().optional().nullable(),
|
|
address: z.string().optional().nullable(),
|
|
city: z.string().optional().nullable(),
|
|
zipCode: z.string().optional().nullable(),
|
|
insuranceProvider: z.string().optional().nullable(),
|
|
insuranceId: z.string().optional().nullable(),
|
|
groupNumber: z.string().optional().nullable(),
|
|
policyHolder: z.string().optional().nullable(),
|
|
allergies: z.string().optional().nullable(),
|
|
medicalConditions: z.string().optional().nullable(),
|
|
preferredLanguage: z.string().optional().nullable(),
|
|
status: PatientStatusSchema,
|
|
userId: z.number().int(),
|
|
createdAt: z.date(),
|
|
updatedAt: z.date(),
|
|
user: z.unknown(),
|
|
appointments: z.array(z.unknown()),
|
|
procedures: z.array(z.unknown()),
|
|
claims: z.array(z.unknown()),
|
|
groups: z.array(z.unknown()),
|
|
payment: z.array(z.unknown()),
|
|
communications: z.array(z.unknown()),
|
|
documents: z.array(z.unknown()),
|
|
conversation: z.unknown().optional().nullable(),
|
|
cloudFolders: z.array(z.unknown())
|
|
}).strict();
|
|
|
|
export type PatientInputType = z.infer<typeof PatientInputSchema>;
|