diff --git a/package-lock.json b/package-lock.json index 5b7701d..7255022 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.1.0", "license": "MIT", "dependencies": { - "@stanfordbdhg/engagehf-models": "^0.5.0", + "@stanfordbdhg/engagehf-models": "^0.6.0", "@stanfordspezi/spezi-web-design-system": "^0.3.0", "@t3-oss/env-core": "^0.11.1", "@tanstack/react-query": "^5.62.0", @@ -3717,9 +3717,9 @@ } }, "node_modules/@stanfordbdhg/engagehf-models": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@stanfordbdhg/engagehf-models/-/engagehf-models-0.5.0.tgz", - "integrity": "sha512-iCkxfo4Al+GaRk6NUTM7/JNkVikliYKBwvAjiH+GPb3udAo/rSTWV0RD5UTiouQSazhdf6Qd6KZTrUzN8v0AuQ==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@stanfordbdhg/engagehf-models/-/engagehf-models-0.6.0.tgz", + "integrity": "sha512-f4CFerWr/YrXdXB+K66Rq8SbKF9byKWx+/NA+kIHXxUjIELh5ZQvO83voVT7dlnEfepN3i0nWz5V1Wwd2UPHLQ==", "dependencies": { "zod": "^3.23.8" }, diff --git a/package.json b/package.json index 2a1138d..04f9eeb 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "prepush": "npm run lint:fix && tsc --noEmit" }, "dependencies": { - "@stanfordbdhg/engagehf-models": "^0.5.0", + "@stanfordbdhg/engagehf-models": "^0.6.0", "@stanfordspezi/spezi-web-design-system": "^0.3.0", "@t3-oss/env-core": "^0.11.1", "@tanstack/react-query": "^5.62.0", diff --git a/routes/~_dashboard/~patients/PatientForm.tsx b/routes/~_dashboard/~patients/PatientForm.tsx index 915a0ae..90adc94 100644 --- a/routes/~_dashboard/~patients/PatientForm.tsx +++ b/routes/~_dashboard/~patients/PatientForm.tsx @@ -32,6 +32,10 @@ export const patientFormSchema = z.object({ displayName: z.string(), clinician: z.string().min(1, 'Clinician is required'), dateOfBirth: z.date().optional(), + providerName: z.preprocess( + (value) => (value === '' ? null : value), + z.string().nullable(), + ), }) export type PatientFormSchema = z.infer @@ -43,7 +47,10 @@ interface PatientFormProps { email: string | null }> userInfo?: Pick - user?: Pick + user?: Pick< + User, + 'organization' | 'clinician' | 'dateOfBirth' | 'providerName' + > onSubmit: (data: PatientFormSchema) => Promise clinicianPreselectId?: string } @@ -62,6 +69,7 @@ export const PatientForm = ({ displayName: userInfo?.displayName ?? '', clinician: user?.clinician ?? clinicianPreselectId ?? '', dateOfBirth: user?.dateOfBirth ? new Date(user.dateOfBirth) : undefined, + providerName: user?.providerName ?? '', }, }) @@ -114,6 +122,18 @@ export const PatientForm = ({ )} /> + + Displayed as "Provider" of the Health Report.
+ If "Provider name" is not set, assigned clinician will be shown. + + } + render={({ field }) => } + /> diff --git a/routes/~_dashboard/~patients/~$id/~index.tsx b/routes/~_dashboard/~patients/~$id/~index.tsx index c58265b..d816e5e 100644 --- a/routes/~_dashboard/~patients/~$id/~index.tsx +++ b/routes/~_dashboard/~patients/~$id/~index.tsx @@ -112,6 +112,7 @@ const PatientPage = () => { clinician: form.clinician, organization: clinician.organization, dateOfBirth: form.dateOfBirth?.toISOString() ?? null, + providerName: form.providerName, } if (resourceType === 'user') { await callables.updateUserInformation({ diff --git a/routes/~_dashboard/~patients/~invite.tsx b/routes/~_dashboard/~patients/~invite.tsx index 9c5bc75..a089442 100644 --- a/routes/~_dashboard/~patients/~invite.tsx +++ b/routes/~_dashboard/~patients/~invite.tsx @@ -39,6 +39,7 @@ const InvitePatientPage = () => { clinician: form.clinician, organization: clinician.organization, dateOfBirth: form.dateOfBirth?.toISOString(), + providerName: form.providerName, }, }) toast.success('Patient has been successfully invited!')