|
@@ -0,0 +1,183 @@
|
|
|
+import React from 'react';
|
|
|
+import { Row, Col, Input, Select, DatePicker, Button, Form } from 'antd';
|
|
|
+import { RootState, useAppDispatch } from '@/states/store';
|
|
|
+import {
|
|
|
+ updateField,
|
|
|
+ updateDropdown,
|
|
|
+ BaseInfoState,
|
|
|
+} from '@/states/patient/DiagnosticReport/baseInfoSlice';
|
|
|
+import dayjs from 'dayjs';
|
|
|
+import { useSelector } from 'react-redux';
|
|
|
+
|
|
|
+const { Option } = Select;
|
|
|
+
|
|
|
+export const BaseInfo: React.FC = () => {
|
|
|
+ const data = useSelector((s: RootState) => s.baseInfo);
|
|
|
+ const dispatch = useAppDispatch();
|
|
|
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
|
+ const onChange = (key: keyof BaseInfoState, val: any) => {
|
|
|
+ dispatch(updateField({ key, value: val }));
|
|
|
+ };
|
|
|
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
|
+ const onDropdownChange = (key: keyof BaseInfoState, val: any) => {
|
|
|
+ dispatch(updateDropdown({ key, value: val }));
|
|
|
+ };
|
|
|
+
|
|
|
+ return (
|
|
|
+ <Form layout="vertical">
|
|
|
+ <Row gutter={12}>
|
|
|
+ <Col span={6}>
|
|
|
+ <Form.Item label="曾用名">
|
|
|
+ <Input
|
|
|
+ value={data.usedName}
|
|
|
+ onChange={(e) => onChange('usedName', e.target.value)}
|
|
|
+ />
|
|
|
+ </Form.Item>
|
|
|
+ </Col>
|
|
|
+ <Col span={6}>
|
|
|
+ <Form.Item label="英文名">
|
|
|
+ <Input
|
|
|
+ value={data.englishName}
|
|
|
+ onChange={(e) => onChange('englishName', e.target.value)}
|
|
|
+ />
|
|
|
+ </Form.Item>
|
|
|
+ </Col>
|
|
|
+ <Col span={6}>
|
|
|
+ <Form.Item label="患者编号">
|
|
|
+ <Input disabled value={data.patientNo} />
|
|
|
+ </Form.Item>
|
|
|
+ </Col>
|
|
|
+ <Col span={6}>
|
|
|
+ <Form.Item label="检查单号">
|
|
|
+ <Input disabled value={data.examNo} />
|
|
|
+ </Form.Item>
|
|
|
+ </Col>
|
|
|
+
|
|
|
+ <Col span={4}>
|
|
|
+ <Form.Item label="性别">
|
|
|
+ <Select
|
|
|
+ value={data.gender}
|
|
|
+ onChange={(v) => onDropdownChange('gender', v)}
|
|
|
+ >
|
|
|
+ <Option value="男">男</Option>
|
|
|
+ <Option value="女">女</Option>
|
|
|
+ </Select>
|
|
|
+ </Form.Item>
|
|
|
+ </Col>
|
|
|
+ <Col span={4}>
|
|
|
+ <Form.Item label="年龄">
|
|
|
+ <Input
|
|
|
+ addonAfter="Y"
|
|
|
+ value={data.age}
|
|
|
+ onChange={(e) => onChange('age', e.target.value)}
|
|
|
+ />
|
|
|
+ </Form.Item>
|
|
|
+ </Col>
|
|
|
+ <Col span={6}>
|
|
|
+ <Form.Item label="就诊类型">
|
|
|
+ <Row gutter={4}>
|
|
|
+ <Col flex="auto">
|
|
|
+ <Select
|
|
|
+ value={data.visitType}
|
|
|
+ onChange={(v) => onDropdownChange('visitType', v)}
|
|
|
+ >
|
|
|
+ <Option value="门诊">门诊</Option>
|
|
|
+ <Option value="住院">住院</Option>
|
|
|
+ <Option value="体检">体检</Option>
|
|
|
+ </Select>
|
|
|
+ </Col>
|
|
|
+ <Col>
|
|
|
+ <Button>...</Button>
|
|
|
+ </Col>
|
|
|
+ </Row>
|
|
|
+ </Form.Item>
|
|
|
+ </Col>
|
|
|
+ <Col span={6}>
|
|
|
+ <Form.Item label="门诊/住院号">
|
|
|
+ <Input
|
|
|
+ value={data.clinicNo}
|
|
|
+ onChange={(e) => onChange('clinicNo', e.target.value)}
|
|
|
+ />
|
|
|
+ </Form.Item>
|
|
|
+ </Col>
|
|
|
+ <Col span={6}>
|
|
|
+ <Form.Item label="科室">
|
|
|
+ <Row gutter={4}>
|
|
|
+ <Col flex="auto">
|
|
|
+ <Select
|
|
|
+ value={data.department}
|
|
|
+ onChange={(v) => onDropdownChange('department', v)}
|
|
|
+ >
|
|
|
+ <Option value="内科">内科</Option>
|
|
|
+ <Option value="外科">外科</Option>
|
|
|
+ </Select>
|
|
|
+ </Col>
|
|
|
+ <Col>
|
|
|
+ <Button>...</Button>
|
|
|
+ </Col>
|
|
|
+ </Row>
|
|
|
+ </Form.Item>
|
|
|
+ </Col>
|
|
|
+
|
|
|
+ <Col span={6}>
|
|
|
+ <Form.Item label="检查时间">
|
|
|
+ <DatePicker
|
|
|
+ className="w-full"
|
|
|
+ value={data.examTime ? dayjs(data.examTime) : null}
|
|
|
+ onChange={(d) =>
|
|
|
+ onChange('examTime', d?.format('YYYY-MM-DD') || '')
|
|
|
+ }
|
|
|
+ />
|
|
|
+ </Form.Item>
|
|
|
+ </Col>
|
|
|
+ <Col span={6}>
|
|
|
+ <Form.Item label="身体部位">
|
|
|
+ <Select
|
|
|
+ value={data.bodyPart}
|
|
|
+ onChange={(v) => onDropdownChange('bodyPart', v)}
|
|
|
+ >
|
|
|
+ <Option value="腹部">腹部</Option>
|
|
|
+ <Option value="胸部">胸部</Option>
|
|
|
+ <Option value="头部">头部</Option>
|
|
|
+ </Select>
|
|
|
+ </Form.Item>
|
|
|
+ </Col>
|
|
|
+ <Col span={6}>
|
|
|
+ <Form.Item label="检查描述">
|
|
|
+ <Input
|
|
|
+ value={data.examDesc}
|
|
|
+ onChange={(e) => onChange('examDesc', e.target.value)}
|
|
|
+ />
|
|
|
+ </Form.Item>
|
|
|
+ </Col>
|
|
|
+ <Col span={6}>
|
|
|
+ <Form.Item label="检查部位">
|
|
|
+ <Input
|
|
|
+ value={data.examPosition}
|
|
|
+ onChange={(e) => onChange('examPosition', e.target.value)}
|
|
|
+ />
|
|
|
+ </Form.Item>
|
|
|
+ </Col>
|
|
|
+
|
|
|
+ <Col span={6}>
|
|
|
+ <Form.Item label="临床诊断">
|
|
|
+ <Row gutter={4}>
|
|
|
+ <Col flex="auto">
|
|
|
+ <Select
|
|
|
+ value={data.clinicalDiag}
|
|
|
+ onChange={(v) => onDropdownChange('clinicalDiag', v)}
|
|
|
+ >
|
|
|
+ <Option value="肺炎">肺炎</Option>
|
|
|
+ <Option value="肝炎">肝炎</Option>
|
|
|
+ </Select>
|
|
|
+ </Col>
|
|
|
+ <Col>
|
|
|
+ <Button>...</Button>
|
|
|
+ </Col>
|
|
|
+ </Row>
|
|
|
+ </Form.Item>
|
|
|
+ </Col>
|
|
|
+ </Row>
|
|
|
+ </Form>
|
|
|
+ );
|
|
|
+};
|