Browse Source

fix : 注册页面不再显示检查类型,而是在执行时根据是否为急诊自动填充
fixes #16

sw 1 week ago
parent
commit
66a0b09bbf

+ 4 - 1
src/domain/patient/registrationGenerator.ts

@@ -15,7 +15,10 @@ enum RegisterSource {
 const emergencyPrefix = 'emergency';
 const maxNumber = uuidv4();
 const userName = 'defaultUser'; // Placeholder for actual user name from user_info slice
-
+/**
+ * 用于急诊注册生成注册信息
+ * @returns 生成急诊注册信息
+ */
 const generateRegistrationInfo = (): RegisterInfo => {
   const work: ExtendedRegisterInfo = {
     patient_id: `${emergencyPrefix}_${maxNumber}`,

+ 0 - 19
src/pages/patient/components/register.form.tsx

@@ -392,25 +392,6 @@ const BasicInfoForm: React.FC<BasicInfoFormProps> = ({ style, form }) => {
       >
         <InputNumber min={0} addonAfter="cm" style={{ width: '100%' }} />
       </Form.Item>
-      <Form.Item
-        label={
-          <FormattedMessage
-            id="register.studyType"
-            defaultMessage="register.studyType"
-          />
-        }
-        name="study_type"
-        required={registerFormFields.study_type.required}
-        validateTrigger={registerFormFields.study_type.trigger}
-        rules={registerFormFields.study_type.validation}
-      >
-        <Input
-          placeholder={intl.formatMessage({
-            id: 'register.studyType.placeholder',
-            defaultMessage: 'register.studyType.placeholder',
-          })}
-        />
-      </Form.Item>
       <Form.Item
         label={
           <FormattedMessage

+ 1 - 10
src/validation/patient/registerSchema.ts

@@ -9,7 +9,7 @@ import {
 import { RegisterInfo } from '@/API/patient/workActions';
 import { Rule } from 'antd/es/form';
 
-type IgnoredKeys = 'views';
+type IgnoredKeys = 'views' | 'study_type';
 const registerInfoSchema: Record<
   keyof Omit<RegisterInfo, IgnoredKeys>,
   z.ZodTypeAny
@@ -32,7 +32,6 @@ const registerInfoSchema: Record<
   weight: z.number().optional(),
   thickness: z.number().optional(),
   length: z.number().optional(),
-  study_type: z.string().nonempty(),
   comment: z.string().optional(),
   // views: z.array(z.object({
   //   view_id: z.string(),
@@ -187,14 +186,6 @@ export const registerFormFields = {
     message: 'Length is optional',
     trigger: ['onChange', 'onBlur'],
   },
-  study_type: {
-    label: 'Study Type',
-    required: true,
-    requiredLabel: '',
-    validation: zodToAntdRules(registerformSchema.shape.study_type),
-    message: 'Study Type is optional',
-    trigger: ['onChange', 'onBlur'],
-  },
   comment: {
     label: 'Comment',
     required: false,