Browse Source

DRG和DIP分组查询相关前后端增加年份筛选规则

837390164@qq.com 5 months ago
parent
commit
330076cd09

+ 4 - 0
src/api/basicData.ts

@@ -273,6 +273,7 @@ export interface CoreAlgorithmItem {
   dgdov: string;
   payStandard: string;
   PayStandard?: string;
+  year?: string;
   pay_standard?: string;
   insuType: string;
   mdtrtArea: string;
@@ -974,6 +975,7 @@ export interface DrgCoreAlgorithmImportParams {
   medinsLv: string;        // 机构等级(来自医疗机构的HospGrade_Dr)
   fileData: string;
   fileName: string;
+  year?: string;
 }
 
 /** 下载DRG核心算法配置导入模板 (02010052) */
@@ -1019,6 +1021,7 @@ export interface DipCoreAlgorithmItem {
   thirdAdjustCoefficient: string;
   createDate: string;
   createTime: string;
+  year?: string;
 }
 
 /** 查询DIP核心算法配置参数 */
@@ -1127,6 +1130,7 @@ export interface DipCoreAlgorithmImportParams {
   medinsLv: string;
   fileData: string;
   fileName: string;
+  year?: string;
 }
 
 /** 下载DIP核心算法配置导入模板 (02010056) */

+ 4 - 0
src/api/drgGrouping.ts

@@ -641,6 +641,8 @@ export interface DRGGroupParamsLowerCamel {
   admissionNo?: string;
   /** 医疗机构信息数组 */
   hospInfo?: HospInfoLowerCamel[];
+  /** 分组方案年份(4位数字,如 2026),医疗机构信息不为空时必填 */
+  groupYear?: number;
 }
 
 /**
@@ -737,6 +739,8 @@ export interface DRGGroupResultLowerCamel {
     pipValue: string | number;
     dgdov: string | number;
     payStandard: string | number;
+    /** 实际使用的分组方案年份 */
+    groupPlanYear?: string | number;
     /** 当前费用总额 */
     totalAmt?: string | number;
     /** 预估盈利 */

+ 59 - 6
src/pages/BasicData/DIPCoreAlgorithmConfig.tsx

@@ -14,6 +14,7 @@ import {
 } from '@ant-design/icons';
 import type { UploadFile } from 'antd/es/upload/interface';
 import type { ColumnsType } from 'antd/es/table';
+import dayjs from 'dayjs';
 import CustomPagination from '../../components/CustomPagination';
 import {
   queryDipCoreAlgorithm, deleteDipCoreAlgorithm,
@@ -46,6 +47,7 @@ const DIPCoreAlgorithmConfig: React.FC = () => {
   const [provinceId, setProvinceId] = useState('');
   const [cityId, setCityId] = useState('');
   const [medinsLv, setMedinsLv] = useState('');
+  const [year, setYear] = useState('');
 
   // 弹窗
   const [modalVisible, setModalVisible] = useState(false);
@@ -133,6 +135,7 @@ const DIPCoreAlgorithmConfig: React.FC = () => {
         provinceID: provinceId,
         cityID: cityId,
         medinsLv,
+        year: year || undefined,
       };
       const res = await queryDipCoreAlgorithm(filters, {
         pageSize,
@@ -149,7 +152,7 @@ const DIPCoreAlgorithmConfig: React.FC = () => {
     } finally {
       setLoading(false);
     }
-  }, [principalDiagnosis, principalDiagnosisName, majorProcedure, majorProcedureName, provinceId, cityId, medinsLv, currentPage, pageSize]);
+  }, [principalDiagnosis, principalDiagnosisName, majorProcedure, majorProcedureName, provinceId, cityId, medinsLv, year, currentPage, pageSize]);
 
   useEffect(() => {
     fetchData();
@@ -170,6 +173,7 @@ const DIPCoreAlgorithmConfig: React.FC = () => {
     setProvinceId('');
     setCityId('');
     setMedinsLv('');
+    setYear('');
     setCityList([]);
     setCurrentPage(1);
   };
@@ -233,6 +237,9 @@ const DIPCoreAlgorithmConfig: React.FC = () => {
     setModalCityList([]);
     setModalVisible(true);
     loadModalProvinces();
+    setTimeout(() => {
+      form.setFieldsValue({ year: dayjs().year() });
+    }, 0);
   };
 
   // 编辑
@@ -259,6 +266,7 @@ const DIPCoreAlgorithmConfig: React.FC = () => {
             primaryAdjustCoefficient: record.primaryAdjustCoefficient ? parseFloat(record.primaryAdjustCoefficient) : undefined,
             secondaryAdjustCoefficient: record.secondaryAdjustCoefficient ? parseFloat(record.secondaryAdjustCoefficient) : undefined,
             thirdAdjustCoefficient: record.thirdAdjustCoefficient ? parseFloat(record.thirdAdjustCoefficient) : undefined,
+            year: record.year || '',
           });
         });
       } else {
@@ -279,6 +287,7 @@ const DIPCoreAlgorithmConfig: React.FC = () => {
           primaryAdjustCoefficient: record.primaryAdjustCoefficient ? parseFloat(record.primaryAdjustCoefficient) : undefined,
           secondaryAdjustCoefficient: record.secondaryAdjustCoefficient ? parseFloat(record.secondaryAdjustCoefficient) : undefined,
           thirdAdjustCoefficient: record.thirdAdjustCoefficient ? parseFloat(record.thirdAdjustCoefficient) : undefined,
+          year: record.year || '',
         });
       }
     });
@@ -480,7 +489,8 @@ const DIPCoreAlgorithmConfig: React.FC = () => {
       mdtrtArea: selectedCity?.code || '',
       medinsLv: medinsLv,
       fileData: fileContentRef.current,
-      fileName: fileNameRef.current
+      fileName: fileNameRef.current,
+      year: importForm.getFieldValue('importYear') || '',
     };
 
     try {
@@ -533,7 +543,8 @@ const DIPCoreAlgorithmConfig: React.FC = () => {
       mdtrtArea: selectedCity?.code || '',
       medinsLv: medinsLv,
       fileData: fileContentRef.current,
-      fileName: fileNameRef.current
+      fileName: fileNameRef.current,
+      year: importForm.getFieldValue('importYear') || '',
     };
 
     try {
@@ -593,6 +604,12 @@ const DIPCoreAlgorithmConfig: React.FC = () => {
       key: 'principalDiagnosisName',
       width: 180,
     },
+    {
+      title: '年份',
+      dataIndex: 'year',
+      key: 'year',
+      width: 80,
+    },
     {
       title: '主要手术代码',
       dataIndex: 'majorProcedure',
@@ -737,7 +754,7 @@ const DIPCoreAlgorithmConfig: React.FC = () => {
                 />
               </Form.Item>
             </Col>
-            <Col span={3}>
+            <Col span={2}>
               <Form.Item label="省">
                 <Select
                   placeholder="请选择省"
@@ -753,7 +770,7 @@ const DIPCoreAlgorithmConfig: React.FC = () => {
                 </Select>
               </Form.Item>
             </Col>
-            <Col span={3}>
+            <Col span={2}>
               <Form.Item label="市">
                 <Select
                   placeholder="请选择市"
@@ -785,7 +802,20 @@ const DIPCoreAlgorithmConfig: React.FC = () => {
                 </Select>
               </Form.Item>
             </Col>
-             <Col span={4}>
+            <Col span={2}>
+              <Form.Item label="年份">
+                <InputNumber
+                  placeholder="全部"
+                  value={year ? Number(year) : undefined}
+                  onChange={v => setYear(v ? String(v) : '')}
+                  style={{ width: '100%' }}
+                  min={2020}
+                  max={2099}
+                  precision={0}
+                />
+              </Form.Item>
+            </Col>
+             <Col span={3}>
               <Form.Item label=" " style={{ marginBottom: 0 }}>
                 <Space>
                   <Button type="primary" icon={<SearchOutlined />} onClick={handleSearch}>
@@ -992,6 +1022,16 @@ const DIPCoreAlgorithmConfig: React.FC = () => {
               />
             </Form.Item>
           </div>
+
+          <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '0 16px' }}>
+            <Form.Item
+              label="分组方案年份"
+              name="year"
+              rules={[{ required: true, message: '请输入年份' }]}
+            >
+              <InputNumber placeholder="请输入年份" style={{ width: '100%' }} min={2020} max={2099} precision={0} />
+            </Form.Item>
+          </div>
         </Form>
       </Modal>
 
@@ -1080,6 +1120,19 @@ const DIPCoreAlgorithmConfig: React.FC = () => {
                 </Col>
               </Row>
 
+              <Row gutter={16}>
+                <Col span={8}>
+                  <Form.Item
+                    name="importYear"
+                    label="分组方案年份"
+                    rules={[{ required: true, message: '请输入年份' }]}
+                    initialValue={dayjs().year()}
+                  >
+                    <InputNumber placeholder="请输入年份" style={{ width: '100%' }} min={2020} max={2099} precision={0} />
+                  </Form.Item>
+                </Col>
+              </Row>
+
               <Divider />
 
               <Form.Item label="导入文件" required>

+ 49 - 7
src/pages/BasicData/DRGCoreAlgorithmConfig.tsx

@@ -1,6 +1,6 @@
 import React, { useState, useEffect, useCallback, useRef } from 'react';
 import {
-  Card, Table, Button, Input, Select, Space, Modal, Form,
+  Card, Table, Button, Input, InputNumber, Select, Space, Modal, Form,
   Row, Col, Tag, message, Popconfirm, DatePicker, Upload,
   Steps, Alert, Statistic, Divider, Typography, List, Result, Modal as ImportModal
 } from 'antd';
@@ -43,6 +43,7 @@ const CoreAlgorithmConfig: React.FC = () => {
   const [cityId, setCityId] = useState('');
   const [queryInsuType, setQueryInsuType] = useState('');
   const [status, setStatus] = useState('');
+  const [year, setYear] = useState('');
 
   // 弹窗
   const [modalOpen, setModalOpen] = useState(false);
@@ -110,6 +111,7 @@ const CoreAlgorithmConfig: React.FC = () => {
           cityID: cityId || undefined,
           insuType: queryInsuType || undefined,
           status: status || undefined,
+          year: year || undefined,
         },
         { pageSize: size, currentPage: page }
       );
@@ -124,12 +126,12 @@ const CoreAlgorithmConfig: React.FC = () => {
     } finally {
       setLoading(false);
     }
-  }, [drg, fixmedinsName, provinceId, cityId, queryInsuType, status, currentPage, pageSize]);
+  }, [drg, fixmedinsName, provinceId, cityId, queryInsuType, status, year, currentPage, pageSize]);
 
   useEffect(() => {
     fetchData(1, pageSize);
     setCurrentPage(1);
-  }, [drg, fixmedinsName, provinceId, cityId, queryInsuType, status]);
+  }, [drg, fixmedinsName, provinceId, cityId, queryInsuType, status, year]);
 
   // 页面加载时获取查询条件下拉数据
   useEffect(() => {
@@ -195,6 +197,7 @@ const CoreAlgorithmConfig: React.FC = () => {
     setCityId('');
     setQueryInsuType('');
     setStatus('');
+    setYear('');
   };
 
   // ==================== 导入功能方法 ====================
@@ -400,7 +403,8 @@ const CoreAlgorithmConfig: React.FC = () => {
       fixmedinsName: selectedHospital?.descripts || '',
       medinsLv: selectedHospital?.medinsLv || selectedHospital?.MedinsLv || '',
       fileData: fileContentRef.current,
-      fileName: fileNameRef.current
+      fileName: fileNameRef.current,
+      year: importForm.getFieldValue('importYear') || '',
     };
 
     try {
@@ -460,7 +464,8 @@ const CoreAlgorithmConfig: React.FC = () => {
       fixmedinsName: selectedHospital?.descripts || '',
       medinsLv: selectedHospital?.medinsLv || selectedHospital?.MedinsLv || '',
       fileData: fileContentRef.current,
-      fileName: fileNameRef.current
+      fileName: fileNameRef.current,
+      year: importForm.getFieldValue('importYear') || '',
     };
 
     try {
@@ -556,7 +561,8 @@ const CoreAlgorithmConfig: React.FC = () => {
     fetchHospitalData(); // 弹窗打开时获取医疗机构数据
     // 设置生效日期默认值为当年1月1日
     form.setFieldsValue({
-      startDate: dayjs().startOf('year')
+      startDate: dayjs().startOf('year'),
+      year: dayjs().year(),
     });
   };
 
@@ -609,6 +615,7 @@ const CoreAlgorithmConfig: React.FC = () => {
         stopDate: record.stopDate ? dayjs(record.stopDate) : undefined,
         identification: record.identification,
         remark: record.remark,
+        year: record.year || '',
       } as any);
     }, 100);
   };
@@ -676,6 +683,7 @@ const CoreAlgorithmConfig: React.FC = () => {
         id: editRecord?.id || '',
         startDate: values.startDate ? (values.startDate as any).format('YYYY-MM-DD') : '',
         stopDate: values.stopDate ? (values.stopDate as any).format('YYYY-MM-DD') : '',
+        year: values.year || '',
       };
       const res = await saveCoreAlgorithm(params);
       if (res.errorCode === '0') {
@@ -705,6 +713,11 @@ const CoreAlgorithmConfig: React.FC = () => {
       width: 160,
       ellipsis: true,
     },
+    {
+      title: '年份',
+      dataIndex: 'year',
+      width: 50,
+    },
     {
       title: '基准点数',
       dataIndex: 'points',
@@ -912,6 +925,17 @@ const CoreAlgorithmConfig: React.FC = () => {
               <Option value="0">无效</Option>
             </Select>
           </Col>
+          <Col>
+            <InputNumber
+              placeholder="年份"
+              value={year ? Number(year) : undefined}
+              onChange={v => setYear(v ? String(v) : '')}
+              style={{ width: 100 }}
+              min={2020}
+              max={2099}
+              precision={0}
+            />
+          </Col>
           <Col>
             <Space>
               <Button type="primary" icon={<SearchOutlined />} onClick={handleSearch}>查询</Button>
@@ -935,7 +959,7 @@ const CoreAlgorithmConfig: React.FC = () => {
           dataSource={data}
           rowKey="id"
           loading={loading}
-          scroll={{ x: 1490 }}
+          scroll={{ x: 1570 }}
           size="small"
           pagination={false}
         />
@@ -1144,6 +1168,11 @@ const CoreAlgorithmConfig: React.FC = () => {
                   <Input placeholder="标识码" />
                 </Form.Item>
               </Col>
+              <Col span={8}>
+                <Form.Item name="year" label="分组方案年份" rules={[{ required: true, message: '请输入年份' }]}>
+                  <InputNumber placeholder="请输入年份" style={{ width: '100%' }} min={2020} max={2099} precision={0} />
+                </Form.Item>
+              </Col>
               <Col span={24}>
                 <Form.Item name="remark" label="备注">
                   <Input.TextArea rows={2} placeholder="备注信息" />
@@ -1251,6 +1280,19 @@ const CoreAlgorithmConfig: React.FC = () => {
                 </Col>
               </Row>
 
+              <Row gutter={16}>
+                <Col span={8}>
+                  <Form.Item
+                    name="importYear"
+                    label="分组方案年份"
+                    rules={[{ required: true, message: '请输入年份' }]}
+                    initialValue={dayjs().year()}
+                  >
+                    <InputNumber placeholder="请输入年份" style={{ width: '100%' }} min={2020} max={2099} precision={0} />
+                  </Form.Item>
+                </Col>
+              </Row>
+
               <Divider />
 
               <Form.Item label="导入文件" required>

+ 30 - 2
src/pages/DRG/CustomQuery.tsx

@@ -6,7 +6,8 @@ import {
 } from 'antd';
 import { 
   PlayCircleOutlined, ReloadOutlined, PlusOutlined, DeleteOutlined,
-  MedicineBoxOutlined, UserOutlined, ScissorOutlined, BankOutlined
+  MedicineBoxOutlined, UserOutlined, ScissorOutlined, BankOutlined,
+  CalendarOutlined
 } from '@ant-design/icons';
 import { drgGroup, convertResultToLowerCamel, type DiagnosisInfoLowerCamel, type OperationInfoLowerCamel, type DRGGroupResultLowerCamel } from '@/api/drgGrouping';
 import { queryMedInsuIcdInfo, getProvinceData, getCityData, type MedInsuIcdItem, type ProvinceItem, type CityItem } from '@/api/basicData';
@@ -194,12 +195,17 @@ const DRGCustomQuery: React.FC = () => {
           name: h.descripts,
         }));
 
-      // 校验:如果医疗机构信息不为空,则省市必选
+      // 校验:如果医疗机构信息不为空,则省市和分组方案年份必选
       if (hospInfo.length > 0 && (!values.Province || !values.City)) {
         message.error('选择医疗机构时,参保省份、参保城市为必选项');
         setLoading(false);
         return;
       }
+      if (hospInfo.length > 0 && !values.GroupYear) {
+        message.error('选择医疗机构时,分组方案年份为必填项');
+        setLoading(false);
+        return;
+      }
 
       // 构建小驼峰入参
       // 注意:diseInfo 和 oprnInfo 必须传递,即使是空数组
@@ -229,6 +235,8 @@ const DRGCustomQuery: React.FC = () => {
         oprnInfo: operations,
         // 医疗机构信息数组,即使为空也要传递
         hospInfo: hospInfo,
+        // 分组方案年份
+        groupYear: values.GroupYear,
       };
 
       // 直接调用接口(内部会自动转换大小驼峰)
@@ -1143,6 +1151,7 @@ const DRGCustomQuery: React.FC = () => {
                 TraumaLevel: 0,
                 HospitalDays: 1,
                 DischargeType: '1', // 默认值:1-医嘱离院
+                GroupYear: new Date().getFullYear(), // 默认当前年份
               }}
             >
           {/* 患者基本信息 */}
@@ -1316,6 +1325,25 @@ const DRGCustomQuery: React.FC = () => {
                   </Select>
                 </Form.Item>
               </Col>
+              <Col span={6}>
+                <Form.Item 
+                  name="GroupYear" 
+                  label={
+                    <Space size={4}>
+                      <CalendarOutlined />
+                      <span>分组方案年份</span>
+                    </Space>
+                  }
+                >
+                  <InputNumber 
+                    min={2020} 
+                    max={2099} 
+                    placeholder="请输入年份"
+                    style={{ width: '100%' }} 
+                    precision={0}
+                  />
+                </Form.Item>
+              </Col>
             </Row>
 
           </Card>