|
|
@@ -15,9 +15,9 @@ const registerInfoSchema: Record<
|
|
|
keyof Omit<RegisterInfo, IgnoredKeys>,
|
|
|
z.ZodTypeAny
|
|
|
> = {
|
|
|
- accession_number: z.string().nonempty(),
|
|
|
+ accession_number: z.string().nonempty().regex(/^[a-zA-Z0-9_-]+$/, '只能输入数字、英文字符、下划线和连字符'),
|
|
|
patient_name: z.string().nonempty(),
|
|
|
- patient_id: z.string().nonempty(),
|
|
|
+ patient_id: z.string().nonempty().regex(/^[a-zA-Z0-9_-]+$/, '只能输入数字、英文字符、下划线和连字符'),
|
|
|
patient_size: z.string().nonempty(),
|
|
|
patient_age: z.object({
|
|
|
number: z.number(), // 必须是数字
|
|
|
@@ -27,7 +27,7 @@ const registerInfoSchema: Record<
|
|
|
patient_sex: z.string().optional(),
|
|
|
|
|
|
ref_physician: z.string().optional(),
|
|
|
- operator_id: z.string().optional(),
|
|
|
+ operator_id: z.string().regex(/^[a-zA-Z0-9_-]*$/, '只能输入数字、英文字符、下划线和连字符'),
|
|
|
weight: z.number().optional(),
|
|
|
thickness: z.number().optional(),
|
|
|
length: z.number().optional(),
|