feat: add supplementary insurance select to patient record info form
The «اطلاعات پرونده» form only exposed basic insurance («نوع بیمه»). Add a
«بیمه تکمیلی» select next to it, wired to the supplementary insurances from
insurance-pricing. Backend PATCH /api/v1/patient/{uuid} already accepts
supplementary_insurance_id (UserProfile entity + controller) — frontend-only:
schema field, form select, profileToFormValues/formValuesToPayload mapping,
PatientProfileUpdate type, and the supplementary option passed from both the
case-file info tab (PatientDetailPage) and MyPatientsPage.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -11,6 +11,7 @@ const options: PatientFormOptions = {
|
||||
marital: [{ value: 'single', label: 'مجرد' }],
|
||||
education: [{ value: 'bachelor', label: 'کارشناسی' }],
|
||||
insurance: [{ value: 3, label: 'تأمین اجتماعی' }],
|
||||
supplementary: [{ value: 5, label: 'بیمه دانا' }],
|
||||
province: [{ value: 8, label: 'یزد' }],
|
||||
city: [{ value: 42, label: 'یزد' }],
|
||||
referral: [{ value: 'instagram', label: 'اینستاگرام' }],
|
||||
@@ -25,6 +26,7 @@ const baseValues: PatientFormValues = {
|
||||
fathers_name: '',
|
||||
marital_status: null,
|
||||
basic_insurance_id: null,
|
||||
supplementary_insurance_id: null,
|
||||
field_of_study: '',
|
||||
education: null,
|
||||
job: '',
|
||||
@@ -54,6 +56,8 @@ describe('PatientRecordInfoForm', () => {
|
||||
it('برچسبهای اصلی و شماره پروندهٔ read-only را رندر میکند', () => {
|
||||
setup();
|
||||
expect(screen.getByText('نام و نام خانوادگی مراجعه کننده')).toBeInTheDocument();
|
||||
expect(screen.getByText('بیمه پایه')).toBeInTheDocument();
|
||||
expect(screen.getByText('بیمه تکمیلی')).toBeInTheDocument();
|
||||
expect(screen.getByText('نحوه آشنایی')).toBeInTheDocument();
|
||||
expect((screen.getByDisplayValue('123456789') as HTMLInputElement).readOnly).toBe(true);
|
||||
});
|
||||
|
||||
@@ -23,6 +23,7 @@ export const patientFormSchema = z.object({
|
||||
fathers_name: z.string(),
|
||||
marital_status: z.string().nullable(),
|
||||
basic_insurance_id: z.union([z.number(), z.string(), z.null()]),
|
||||
supplementary_insurance_id: z.union([z.number(), z.string(), z.null()]),
|
||||
field_of_study: z.string(),
|
||||
education: z.string().nullable(),
|
||||
job: z.string(),
|
||||
@@ -42,6 +43,7 @@ export interface PatientFormOptions {
|
||||
marital: SelectOption[];
|
||||
education: SelectOption[];
|
||||
insurance: SelectOption[];
|
||||
supplementary: SelectOption[];
|
||||
province: SelectOption[];
|
||||
city: SelectOption[];
|
||||
referral: SelectOption[];
|
||||
@@ -140,7 +142,8 @@ export default function PatientRecordInfoForm({
|
||||
</Field>
|
||||
|
||||
{sel('marital_status', 'وضعیت تاهل', options.marital)}
|
||||
{sel('basic_insurance_id', 'نوع بیمه', options.insurance)}
|
||||
{sel('basic_insurance_id', 'بیمه پایه', options.insurance)}
|
||||
{sel('supplementary_insurance_id', 'بیمه تکمیلی', options.supplementary)}
|
||||
|
||||
<Field label="رشته تحصیلی">
|
||||
<Input {...register('field_of_study')} placeholder="رشته تحصیلی را وارد نمایید" />
|
||||
|
||||
Reference in New Issue
Block a user