Browse Source

代码更新

837390164@qq.com 1 month ago
parent
commit
94376b0288
3 changed files with 412 additions and 326 deletions
  1. 9 0
      src/api/basicData.ts
  2. 41 2
      src/pages/BasicData/DRGCoreAlgorithmConfig.tsx
  3. 362 324
      src/pages/DRG/Results.tsx

+ 9 - 0
src/api/basicData.ts

@@ -273,6 +273,9 @@ export interface CoreAlgorithmItem {
   dgdov: string;
   payStandard: string;
   PayStandard?: string;
+  highMultiplier?: string;
+  lowMultiplier?: string;
+  weight?: string;
   year?: string;
   pay_standard?: string;
   insuType: string;
@@ -302,6 +305,9 @@ export interface SaveCoreAlgorithmParams {
   pipValue: string;
   dgdov: string;
   payStandard: string;
+  highMultiplier?: string;
+  lowMultiplier?: string;
+  weight?: string;
   insuType: string;
   mdtrtArea: string;
   medinsLv: string;
@@ -1023,6 +1029,9 @@ export interface DrgCoreAlgorithmImportPreviewItem {
   pipValue: string;
   dgdov: string;
   payStandard: string;
+  highMultiplier?: string;
+  lowMultiplier?: string;
+  weight?: string;
   status: 'valid' | 'duplicate' | 'invalid';
   statusDesc: string;
   errorMsg?: string;

+ 41 - 2
src/pages/BasicData/DRGCoreAlgorithmConfig.tsx

@@ -642,6 +642,9 @@ const CoreAlgorithmConfig: React.FC = () => {
         identification: record.identification,
         remark: record.remark,
         year: record.year || '',
+        highMultiplier: record.highMultiplier || '',
+        lowMultiplier: record.lowMultiplier || '',
+        weight: record.weight || '',
       } as any);
     }, 100);
   };
@@ -763,7 +766,25 @@ const CoreAlgorithmConfig: React.FC = () => {
       dataIndex: 'payStandard',
       width: 75,
       align: 'right',
-    },    
+    },
+    {
+      title: '高倍率',
+      dataIndex: 'highMultiplier',
+      width: 55,
+      align: 'right',
+    },
+    {
+      title: '低倍率',
+      dataIndex: 'lowMultiplier',
+      width: 55,
+      align: 'right',
+    },
+    {
+      title: '权重',
+      dataIndex: 'weight',
+      width: 55,
+      align: 'right',
+    },
     {
       title: '险种',
       dataIndex: 'insuType',
@@ -835,6 +856,9 @@ const CoreAlgorithmConfig: React.FC = () => {
     { title: '预估点值', dataIndex: 'pipValue', width: 90, align: 'right' },
     { title: '差异系数', dataIndex: 'dgdov', width: 80, align: 'right' },
     { title: '支付标准', dataIndex: 'payStandard', width: 90, align: 'right' },
+    { title: '高倍率', dataIndex: 'highMultiplier', width: 75, align: 'right' },
+    { title: '低倍率', dataIndex: 'lowMultiplier', width: 75, align: 'right' },
+    { title: '权重', dataIndex: 'weight', width: 70, align: 'right' },
     {
       title: '状态',
       dataIndex: 'status',
@@ -1058,6 +1082,21 @@ const CoreAlgorithmConfig: React.FC = () => {
                   <Input placeholder="如 26880" />
                 </Form.Item>
               </Col>
+              <Col span={8}>
+                <Form.Item name="highMultiplier" label="高倍率(HighMultiplier)">
+                  <Input placeholder="如 2.5" />
+                </Form.Item>
+              </Col>
+              <Col span={8}>
+                <Form.Item name="lowMultiplier" label="低倍率(LowMultiplier)">
+                  <Input placeholder="如 0.5" />
+                </Form.Item>
+              </Col>
+              <Col span={8}>
+                <Form.Item name="weight" label="权重(Weight)">
+                  <Input placeholder="如 1.2" />
+                </Form.Item>
+              </Col>
             </Row>
           </Card>
 
@@ -1359,7 +1398,7 @@ const CoreAlgorithmConfig: React.FC = () => {
                 description={
                   <ul style={{ margin: 0, paddingLeft: 16 }}>
                     <li>必填列:DRG代码(DRGCode)、DRG描述(DRGDesc)、基准点数(Points)、预估点值(PipValue)、病组差异系数(DGDOV)、支付标准(PayStandard)</li>
-                    <li>字段说明:DRGCode=DRG代码、DRGDesc=DRG描述、Points=基准点数、PipValue=预估点值、DGDOV=病组差异系数、PayStandard=支付标准</li>
+                    <li>字段说明:DRGCode=DRG代码、DRGDesc=DRG描述、Points=基准点数、PipValue=预估点值、DGDOV=病组差异系数、PayStandard=支付标准、HighMultiplier=高倍率、LowMultiplier=低倍率、Weight=权重</li>
                     <li>重复处理:DRG代码+行政区划+机构代码相同则更新,否则新增</li>
                     <li>模板规范:模板列名不可变更</li>
                   </ul>

+ 362 - 324
src/pages/DRG/Results.tsx

@@ -1,8 +1,11 @@
 import React, { useState, useEffect } from 'react';
-import { Card, Form, Input, Button, Table, Tag, Row, Col, Typography, Collapse, Space, DatePicker, Select, message, Statistic, Modal, Descriptions } from 'antd';
+import {
+  Card, Form, Input, Button, Table, Tag, Typography,
+  Space, DatePicker, Select, message, Modal, Descriptions
+} from 'antd';
 import { SearchOutlined, ReloadOutlined, EyeOutlined } from '@ant-design/icons';
 import type { ColumnsType } from 'antd/es/table';
-import request from '@/api/request';
+import { invoke } from '@/api/request';
 
 const { Title, Text } = Typography;
 const { RangePicker } = DatePicker;
@@ -10,293 +13,359 @@ const { Option } = Select;
 
 /**
  * 分组结果查询页面
+ * 对应后端接口: 02010036 - 查询DRG分组记录表
+ * 对应数据表: BS_DRGGroupRecord (User.BSDRGGroupRecord)
  */
-interface ResultRecord {
+
+/** 后端返回的 BS_DRGGroupRecord 单条记录 */
+interface GroupRecord {
   id: number;
-  patientId: string;
+  /** HIS唯一就诊ID(病案ID) */
+  admID: string;
+  /** 病案号 */
+  medcasNo: string;
+  /** 患者姓名 */
   patientName: string;
-  inpatientId: string;
-  admitDate: string;
-  dischargeDate: string;
-  mainDiagnosis: string;
+  /** 医保个人编号 */
+  psnNo: string;
+  /** 参保地 */
+  insuranceAreaCode: string;
+  /** 医保险种 */
+  insuType: string;
+  /** 性别 (1=男, 2=女) */
+  sex: string;
+  /** 年龄 */
+  age: number;
+  /** 主诊断代码 */
+  mainDiagnosisCode: string;
+  /** 主诊断名称 */
   mainDiagnosisName: string;
-  drgCode: string;
-  drgName: string;
-  mdcCode: string;
-  mdcName: string;
-  totalCost: number;
+  /** 诊断类型编码 */
+  diaTypeCode: string;
+  /** 病种编码 */
+  diagnosisCode: string;
+  /** 病种名称 */
+  diagnosisName: string;
+  /** 主手术代码 */
+  mainOperationCode: string;
+  /** 主手术名称 */
+  mainOperationName: string;
+  /** DRG编码 */
+  drg: string;
+  /** DRG描述 */
+  drgDesc: string;
+  /** 权重 */
+  weight: number;
+  /** 基准费用 */
   benchmarkCost: number;
-  riskLevel: string;
-  hospAlgorithmInfo?: Array<{
-    hisHospCode: string;
-    hospCode: string;
-    hospName: string;
-    drg: string;
-    drgDesc: string;
-    points: string | number;
-    pipValue: string | number;
-    dgdov: string | number;
-    payStandard: string | number;
-    totalAmt?: string | number;
-    preProfit?: string | number;
-    preLoss?: string | number;
-    discrepancyRate?: string | number;
-  }>;
+  /** CC标志 (1=有合并症) */
+  ccFlag: string;
+  /** MCC标志 (1=有严重合并症) */
+  mccFlag: string;
+  /** 分组时间 */
+  groupTime: string;
+  /** 分组阶段 (1=事前, 2=事中, 3=事后) */
+  groupStage: string;
+  /** 备注 */
+  remark: string;
+  /** HIS科室编码 */
+  department: string;
+  /** HIS科室名称 */
+  departmentDesc: string;
+  /** 医疗机构代码 */
+  fixmedinsCode: string;
+  /** 医疗机构名称 */
+  fixmedinsName: string;
+  /** 创建日期 */
+  createDate: string;
+  /** 创建时间 */
+  createTime: string;
+  /** 更新日期 */
+  updateDate: string;
+  /** 更新时间 */
+  updateTime: string;
+  /** 入院时间 */
+  admDateTime: string;
+  /** 出院时间 */
+  discgDateTime: string;
+  /** 结算时间 */
+  settleDateTime: string;
+}
+
+/** 查询表单参数 */
+interface SearchParams {
+  patientName?: string;
+  drg?: string;
+  mainDiagnosisCode?: string;
+  admID?: string;
+  medcasNo?: string;
+  department?: string;
+  groupStage?: string;
+  discgDateRange?: [any, any];
+  admDateRange?: [any, any];
+  settleDateRange?: [any, any];
+  createDateRange?: [any, any];
 }
 
 const Results: React.FC = () => {
   const [loading, setLoading] = useState(false);
-  const [data, setData] = useState<ResultRecord[]>([]);
-  const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 });
-  const [selectedRecord, setSelectedRecord] = useState<ResultRecord | null>(null);
+  const [data, setData] = useState<GroupRecord[]>([]);
+  const [pagination, setPagination] = useState({
+    current: 1,
+    pageSize: 20,
+    total: 0,
+  });
+  const [selectedRecord, setSelectedRecord] = useState<GroupRecord | null>(null);
   const [detailModalOpen, setDetailModalOpen] = useState(false);
   const [form] = Form.useForm();
 
-  // 模拟数据
-  const mockData: ResultRecord[] = [
-    {
-      id: 1,
-      patientId: 'P2024010001',
-      patientName: '张三',
-      inpatientId: 'ZY2024010001',
-      admitDate: '2024-01-15',
-      dischargeDate: '2024-01-22',
-      mainDiagnosis: 'J18.900',
-      mainDiagnosisName: '肺炎',
-      drgCode: 'ES23',
-      drgName: '呼吸系统肿瘤',
-      mdcCode: 'MDCE',
-      mdcName: '呼吸系统疾病及功能障碍',
-      totalCost: 12500,
-      benchmarkCost: 10800,
-      riskLevel: '中',
-      hospAlgorithmInfo: [
-        {
-          hisHospCode: 'H001',
-          hospCode: 'H001',
-          hospName: '测试医院',
-          drg: 'ES23',
-          drgDesc: '呼吸系统肿瘤',
-          points: 45,
-          pipValue: 240,
-          dgdov: 1.0,
-          payStandard: 10800,
-          totalAmt: 12500,
-          preProfit: 0,
-          preLoss: 1700,
-          discrepancyRate: -15.7
-        }
-      ]
-    },
-    {
-      id: 2,
-      patientId: 'P2024010002',
-      patientName: '李四',
-      inpatientId: 'ZY2024010002',
-      admitDate: '2024-01-18',
-      dischargeDate: '2024-01-25',
-      mainDiagnosis: 'I21.000',
-      mainDiagnosisName: '急性前壁心肌梗死',
-      drgCode: 'FM23',
-      drgName: '心脏介入治疗',
-      mdcCode: 'MDCF',
-      mdcName: '循环系统疾病及功能障碍',
-      totalCost: 28500,
-      benchmarkCost: 32000,
-      riskLevel: '高',
-      hospAlgorithmInfo: [
-        {
-          hisHospCode: 'H001',
-          hospCode: 'H001',
-          hospName: '测试医院',
-          drg: 'FM23',
-          drgDesc: '心脏介入治疗',
-          points: 68,
-          pipValue: 471,
-          dgdov: 1.1,
-          payStandard: 32028,
-          totalAmt: 28500,
-          preProfit: 3528,
-          preLoss: 0,
-          discrepancyRate: 12.3
-        }
-      ]
-    },
-    {
-      id: 3,
-      patientId: 'P2024010003',
-      patientName: '王五',
-      inpatientId: 'ZY2024010003',
-      admitDate: '2024-01-20',
-      dischargeDate: '2024-01-28',
-      mainDiagnosis: 'S72.000',
-      mainDiagnosisName: '股骨颈骨折',
-      drgCode: 'IC13',
-      drgName: '髋关节置换',
-      mdcCode: 'MDCI',
-      mdcName: '肌肉骨骼系统及功能障碍',
-      totalCost: 45000,
-      benchmarkCost: 48000,
-      riskLevel: '低',
-      hospAlgorithmInfo: [
-        {
-          hisHospCode: 'H001',
-          hospCode: 'H001',
-          hospName: '测试医院',
-          drg: 'IC13',
-          drgDesc: '髋关节置换',
-          points: 120,
-          pipValue: 400,
-          dgdov: 1.0,
-          payStandard: 48000,
-          totalAmt: 45000,
-          preProfit: 3000,
-          preLoss: 0,
-          discrepancyRate: 6.7
-        }
-      ]
-    }
-  ];
-
-  // 加载数据
-  const loadData = async (params: any = {}) => {
+  /** 加载数据 - 调用 02010036 接口 */
+  const loadData = async (searchParams: SearchParams = {}, page = 1, pageSize = 20) => {
     setLoading(true);
     try {
-      // 实际项目中从API获取数据
-      // const res = await request.get('/api/drg/results', { params });
-      // setData(res.data.list);
-      // setPagination({ ...pagination, total: res.data.total });
-      
-      // 模拟数据
-      setTimeout(() => {
-        setData(mockData);
-        setPagination({ ...pagination, total: mockData.length });
-        setLoading(false);
-      }, 500);
+      // 构建请求参数(匹配后端 GroupDevice.QueryDRGGroupRecord 入参)
+      const params: Record<string, string> = {};
+
+      if (searchParams.admID) params.admID = searchParams.admID;
+      if (searchParams.medcasNo) params.medcasNo = searchParams.medcasNo;
+      if (searchParams.patientName) params.patientName = searchParams.patientName;
+      if (searchParams.drg) params.drg = searchParams.drg;
+      if (searchParams.mainDiagnosisCode) params.mainDiagnosisCode = searchParams.mainDiagnosisCode;
+      if (searchParams.department) params.department = searchParams.department;
+      if (searchParams.groupStage) params.groupStage = searchParams.groupStage;
+
+      // 出院日期范围 → discgStartDate / discgEndDate
+      if (searchParams.discgDateRange) {
+        const [start, end] = searchParams.discgDateRange;
+        if (start) params.discgStartDate = start.format('YYYY-MM-DD');
+        if (end) params.discgEndDate = end.format('YYYY-MM-DD');
+      }
+      // 入院日期范围 → admStartDate / admEndDate
+      if (searchParams.admDateRange) {
+        const [start, end] = searchParams.admDateRange;
+        if (start) params.admStartDate = start.format('YYYY-MM-DD');
+        if (end) params.admEndDate = end.format('YYYY-MM-DD');
+      }
+      // 结算日期范围 → settleStartDate / settleEndDate
+      if (searchParams.settleDateRange) {
+        const [start, end] = searchParams.settleDateRange;
+        if (start) params.settleStartDate = start.format('YYYY-MM-DD');
+        if (end) params.settleEndDate = end.format('YYYY-MM-DD');
+      }
+      // 创建日期范围 → startDate / endDate
+      if (searchParams.createDateRange) {
+        const [start, end] = searchParams.createDateRange;
+        if (start) params.startDate = start.format('YYYY-MM-DD');
+        if (end) params.endDate = end.format('YYYY-MM-DD');
+      }
+
+      const result = await invoke(
+        '02010036',
+        [params],
+        undefined,
+        { pageSize, currentPage: page }
+      );
+
+      if (result.errorCode === '0') {
+        setData(result.result?.rows || []);
+        setPagination({
+          current: page,
+          pageSize,
+          total: result.result?.total || 0,
+        });
+      } else {
+        message.error(result.errorMessage || '查询失败');
+        setData([]);
+      }
     } catch (error: any) {
       message.error(error.message || '加载数据失败');
+      setData([]);
+    } finally {
       setLoading(false);
     }
   };
 
   useEffect(() => {
     loadData();
+    // eslint-disable-next-line react-hooks/exhaustive-deps
   }, []);
 
-  // 查询
-  const handleSearch = (values: any) => {
-    loadData({ ...values, current: 1 });
+  /** 查询 */
+  const handleSearch = (values: SearchParams) => {
+    loadData(values, 1, pagination.pageSize);
   };
 
-  // 重置
+  /** 重置 */
   const handleReset = () => {
     form.resetFields();
     loadData();
   };
 
-  // 查看详情
-  const handleViewDetail = (record: ResultRecord) => {
+  /** 查看详情 */
+  const handleViewDetail = (record: GroupRecord) => {
     setSelectedRecord(record);
     setDetailModalOpen(true);
   };
 
-  // 分页变化
+  /** 分页变化 */
   const handleTableChange = (paginationConfig: any) => {
-    setPagination(paginationConfig);
-    loadData({ current: paginationConfig.current, pageSize: paginationConfig.pageSize });
+    const searchValues = form.getFieldsValue();
+    loadData(searchValues, paginationConfig.current, paginationConfig.pageSize);
+  };
+
+  /** 性别显示 */
+  const renderSex = (sex: string) => (sex === '1' ? '男' : sex === '2' ? '女' : sex || '-');
+
+  /** 分组阶段显示 */
+  const renderGroupStage = (stage: string) => {
+    const map: Record<string, { label: string; color: string }> = {
+      '1': { label: '事前', color: 'blue' },
+      '2': { label: '事中', color: 'orange' },
+      '3': { label: '事后', color: 'green' },
+    };
+    const item = map[stage];
+    return item ? <Tag color={item.color}>{item.label}</Tag> : stage || '-';
+  };
+
+  /** CC/MCC标志合并显示 */
+  const renderComplicationFlag = (ccFlag: string, mccFlag: string) => {
+    if (mccFlag === '1') return <Tag color="red">MCC(严重合并症)</Tag>;
+    if (ccFlag === '1') return <Tag color="orange">CC(合并症)</Tag>;
+    return <Tag>无</Tag>;
   };
 
-  const columns: ColumnsType<ResultRecord> = [
-    { title: '患者ID', dataIndex: 'patientId', key: 'patientId', width: 120 },
+  const columns: ColumnsType<GroupRecord> = [
+    { title: '就诊ID', dataIndex: 'admID', key: 'admID', width: 130, ellipsis: true },
     { title: '姓名', dataIndex: 'patientName', key: 'patientName', width: 80 },
-    { title: '住院号', dataIndex: 'inpatientId', key: 'inpatientId', width: 130 },
-    { title: '入院日期', dataIndex: 'admitDate', key: 'admitDate', width: 100 },
-    { title: '出院日期', dataIndex: 'dischargeDate', key: 'dischargeDate', width: 100 },
-    { title: '主诊断', dataIndex: 'mainDiagnosis', key: 'mainDiagnosis', width: 100 },
-    { title: '诊断名称', dataIndex: 'mainDiagnosisName', key: 'mainDiagnosisName', ellipsis: true },
-    { 
-      title: 'DRG编码', 
-      key: 'drg', 
+    { title: '病案号', dataIndex: 'medcasNo', key: 'medcasNo', width: 110 },
+    {
+      title: 'DRG编码',
+      key: 'drg',
       width: 150,
       render: (_, record) => (
         <Space direction="vertical" size={0}>
-          <Tag color="blue">{record.drgCode}</Tag>
-          <Text style={{ fontSize: 12 }} ellipsis={{ tooltip: record.drgName }}>
-            {record.drgName}
+          <Tag color="blue">{record.drg}</Tag>
+          <Text style={{ fontSize: 12 }} ellipsis={{ tooltip: record.drgDesc }}>
+            {record.drgDesc}
           </Text>
         </Space>
-      )
+      ),
     },
-    { 
-      title: '风险等级', 
-      dataIndex: 'riskLevel', 
-      key: 'riskLevel', 
-      width: 80,
-      render: (level: string) => (
-        <Tag color={level === '高' ? 'red' : level === '中' ? 'orange' : 'green'}>
-          {level}
-        </Tag>
-      )
+    {
+      title: '主诊断',
+      key: 'diagnosis',
+      width: 180,
+      render: (_, record) => (
+        <Space direction="vertical" size={0}>
+          <Text style={{ fontSize: 12 }} type="secondary">{record.mainDiagnosisCode}</Text>
+          <Text style={{ fontSize: 12 }} ellipsis={{ tooltip: record.mainDiagnosisName }}>
+            {record.mainDiagnosisName || '-'}
+          </Text>
+        </Space>
+      ),
     },
     {
-      title: '总费用',
-      dataIndex: 'totalCost',
-      key: 'totalCost',
-      width: 100,
-      render: (cost: number) => `¥${cost?.toLocaleString() || 0}`
+      title: '权重',
+      dataIndex: 'weight',
+      key: 'weight',
+      width: 70,
+      render: (val: number) => val != null ? val.toFixed(2) : '-',
     },
     {
       title: '基准费用',
       dataIndex: 'benchmarkCost',
       key: 'benchmarkCost',
       width: 100,
-      render: (cost: number) => `¥${cost?.toLocaleString() || 0}`
+      render: (cost: number) =>
+        cost != null ? `¥${cost.toLocaleString()}` : '-',
+    },
+    {
+      title: '合并症',
+      key: 'complication',
+      width: 120,
+      render: (_, record) => renderComplicationFlag(record.ccFlag, record.mccFlag),
+    },
+    {
+      title: '科室',
+      dataIndex: 'departmentDesc',
+      key: 'departmentDesc',
+      width: 100,
+      ellipsis: true,
+    },
+    {
+      title: '分组阶段',
+      dataIndex: 'groupStage',
+      key: 'groupStage',
+      width: 80,
+      render: (val: string) => renderGroupStage(val),
+    },
+    {
+      title: '分组时间',
+      dataIndex: 'groupTime',
+      key: 'groupTime',
+      width: 160,
     },
     {
       title: '操作',
       key: 'action',
-      width: 80,
+      width: 70,
       fixed: 'right',
       render: (_, record) => (
-        <Button 
-          type="link" 
-          icon={<EyeOutlined />} 
+        <Button
+          type="link"
+          size="small"
+          icon={<EyeOutlined />}
           onClick={() => handleViewDetail(record)}
         >
           详情
         </Button>
-      )
-    }
+      ),
+    },
   ];
 
   return (
     <div style={{ padding: 16 }}>
       <Card>
         <Title level={4}>分组结果查询</Title>
-        
+
         {/* 搜索表单 */}
-        <Form 
-          form={form} 
-          layout="inline" 
+        <Form
+          form={form}
+          layout="inline"
           onFinish={handleSearch}
-          style={{ marginBottom: 16 }}
+          style={{ marginBottom: 16, flexWrap: 'wrap', rowGap: 8 }}
         >
-          <Form.Item name="keyword" label="关键词">
-            <Input placeholder="姓名/住院号/诊断" style={{ width: 150 }} />
+          <Form.Item name="patientName" label="患者姓名">
+            <Input placeholder="姓名" style={{ width: 120 }} allowClear />
           </Form.Item>
-          <Form.Item name="drgCode" label="DRG编码">
-            <Input placeholder="DRG编码" style={{ width: 120 }} />
+          <Form.Item name="admID" label="就诊ID">
+            <Input placeholder="就诊ID" style={{ width: 130 }} allowClear />
           </Form.Item>
-          <Form.Item name="dateRange" label="出院日期">
-            <RangePicker />
+          <Form.Item name="medcasNo" label="病案号">
+            <Input placeholder="病案号" style={{ width: 120 }} allowClear />
           </Form.Item>
-          <Form.Item name="riskLevel" label="风险等级">
-            <Select placeholder="请选择" style={{ width: 100 }} allowClear>
-              <Option value="高">高</Option>
-              <Option value="中">中</Option>
-              <Option value="低">低</Option>
+          <Form.Item name="drg" label="DRG编码">
+            <Input placeholder="DRG编码" style={{ width: 100 }} allowClear />
+          </Form.Item>
+          <Form.Item name="mainDiagnosisCode" label="主诊断">
+            <Input placeholder="主诊断编码" style={{ width: 120 }} allowClear />
+          </Form.Item>
+          <Form.Item name="department" label="科室">
+            <Input placeholder="科室编码" style={{ width: 100 }} allowClear />
+          </Form.Item>
+          <Form.Item name="groupStage" label="分组阶段">
+            <Select placeholder="全部" style={{ width: 90 }} allowClear>
+              <Option value="1">事前</Option>
+              <Option value="2">事中</Option>
+              <Option value="3">事后</Option>
             </Select>
           </Form.Item>
+          <Form.Item name="discgDateRange" label="出院日期">
+            <RangePicker style={{ width: 240 }} />
+          </Form.Item>
+          <Form.Item name="admDateRange" label="入院日期">
+            <RangePicker style={{ width: 240 }} />
+          </Form.Item>
           <Form.Item>
             <Space>
               <Button type="primary" icon={<SearchOutlined />} htmlType="submit">
@@ -317,138 +386,107 @@ const Results: React.FC = () => {
           loading={loading}
           pagination={pagination}
           onChange={handleTableChange}
-          scroll={{ x: 1200 }}
+          scroll={{ x: 1500 }}
           size="small"
         />
       </Card>
 
       {/* 详情弹窗 */}
       <Modal
-        title="分组结果详情"
+        title="分组记录详情"
         open={detailModalOpen}
         onCancel={() => setDetailModalOpen(false)}
         footer={null}
         width={900}
+        destroyOnClose
       >
         {selectedRecord && (
           <>
+            {/* 基础信息 */}
+            <Title level={5} style={{ marginTop: 0 }}>基础信息</Title>
+            <Descriptions bordered column={3} size="small" style={{ marginBottom: 16 }}>
+              <Descriptions.Item label="就诊ID">{selectedRecord.admID || '-'}</Descriptions.Item>
+              <Descriptions.Item label="患者姓名">{selectedRecord.patientName || '-'}</Descriptions.Item>
+              <Descriptions.Item label="病案号">{selectedRecord.medcasNo || '-'}</Descriptions.Item>
+              <Descriptions.Item label="医保编号">{selectedRecord.psnNo || '-'}</Descriptions.Item>
+              <Descriptions.Item label="性别">{renderSex(selectedRecord.sex)}</Descriptions.Item>
+              <Descriptions.Item label="年龄">{selectedRecord.age != null ? selectedRecord.age : '-'}</Descriptions.Item>
+              <Descriptions.Item label="参保地">{selectedRecord.insuranceAreaCode || '-'}</Descriptions.Item>
+              <Descriptions.Item label="险种">{selectedRecord.insuType || '-'}</Descriptions.Item>
+              <Descriptions.Item label="诊断类型">{selectedRecord.diaTypeCode || '-'}</Descriptions.Item>
+            </Descriptions>
+
+            {/* 诊断/手术信息 */}
+            <Title level={5}>诊断与手术信息</Title>
             <Descriptions bordered column={2} size="small" style={{ marginBottom: 16 }}>
-              <Descriptions.Item label="患者ID">{selectedRecord.patientId}</Descriptions.Item>
-              <Descriptions.Item label="姓名">{selectedRecord.patientName}</Descriptions.Item>
-              <Descriptions.Item label="住院号">{selectedRecord.inpatientId}</Descriptions.Item>
-              <Descriptions.Item label="风险等级">
-                <Tag color={selectedRecord.riskLevel === '高' ? 'red' : selectedRecord.riskLevel === '中' ? 'orange' : 'green'}>
-                  {selectedRecord.riskLevel}
-                </Tag>
+              <Descriptions.Item label="主诊断编码">
+                <Tag color="blue">{selectedRecord.mainDiagnosisCode || '-'}</Tag>
               </Descriptions.Item>
-              <Descriptions.Item label="入院日期">{selectedRecord.admitDate}</Descriptions.Item>
-              <Descriptions.Item label="出院日期">{selectedRecord.dischargeDate}</Descriptions.Item>
-              <Descriptions.Item label="主诊断" span={2}>
-                <Space>
-                  <Tag color="blue">{selectedRecord.mainDiagnosis}</Tag>
-                  <Text>{selectedRecord.mainDiagnosisName}</Text>
-                </Space>
+              <Descriptions.Item label="主诊断名称">
+                <Text>{selectedRecord.mainDiagnosisName || '-'}</Text>
               </Descriptions.Item>
-              <Descriptions.Item label="DRG编码">{selectedRecord.drgCode}</Descriptions.Item>
-              <Descriptions.Item label="DRG名称">{selectedRecord.drgName}</Descriptions.Item>
-              <Descriptions.Item label="MDC编码">{selectedRecord.mdcCode}</Descriptions.Item>
-              <Descriptions.Item label="MDC名称">{selectedRecord.mdcName}</Descriptions.Item>
+              <Descriptions.Item label="病种编码">{selectedRecord.diagnosisCode || '-'}</Descriptions.Item>
+              <Descriptions.Item label="病种名称">{selectedRecord.diagnosisName || '-'}</Descriptions.Item>
+              <Descriptions.Item label="主手术编码">{selectedRecord.mainOperationCode || '-'}</Descriptions.Item>
+              <Descriptions.Item label="主手术名称">{selectedRecord.mainOperationName || '-'}</Descriptions.Item>
             </Descriptions>
 
-            <Row gutter={16} style={{ marginBottom: 16 }}>
-              <Col span={8}>
-                <Card size="small">
-                  <Statistic 
-                    title="总费用" 
-                    value={selectedRecord.totalCost} 
-                    prefix="¥"
-                    valueStyle={{ color: '#1890ff' }}
-                  />
-                </Card>
-              </Col>
-              <Col span={8}>
-                <Card size="small">
-                  <Statistic 
-                    title="基准费用" 
-                    value={selectedRecord.benchmarkCost} 
-                    prefix="¥"
-                    valueStyle={{ color: '#52c41a' }}
-                  />
-                </Card>
-              </Col>
-              <Col span={8}>
-                <Card size="small">
-                  <Statistic 
-                    title="费用差异" 
-                    value={selectedRecord.totalCost - selectedRecord.benchmarkCost} 
-                    prefix="¥"
-                    valueStyle={{ color: selectedRecord.totalCost > selectedRecord.benchmarkCost ? '#ff4d4f' : '#52c41a' }}
-                  />
-                </Card>
-              </Col>
-            </Row>
+            {/* DRG分组结果 */}
+            <Title level={5}>DRG分组结果</Title>
+            <Descriptions bordered column={3} size="small" style={{ marginBottom: 16 }}>
+              <Descriptions.Item label="DRG编码">
+                <Tag color="blue">{selectedRecord.drg || '-'}</Tag>
+              </Descriptions.Item>
+              <Descriptions.Item label="DRG名称" span={2}>
+                <Text>{selectedRecord.drgDesc || '-'}</Text>
+              </Descriptions.Item>
+              <Descriptions.Item label="权重">
+                {selectedRecord.weight != null ? selectedRecord.weight.toFixed(4) : '-'}
+              </Descriptions.Item>
+              <Descriptions.Item label="基准费用">
+                {selectedRecord.benchmarkCost != null ? `¥${selectedRecord.benchmarkCost.toLocaleString()}` : '-'}
+              </Descriptions.Item>
+              <Descriptions.Item label="分组阶段">
+                {renderGroupStage(selectedRecord.groupStage)}
+              </Descriptions.Item>
+              <Descriptions.Item label="CC标志">
+                {selectedRecord.ccFlag === '1' ? <Tag color="orange">有合并症</Tag> : <Tag>无</Tag>}
+              </Descriptions.Item>
+              <Descriptions.Item label="MCC标志">
+                {selectedRecord.mccFlag === '1' ? <Tag color="red">有严重合并症</Tag> : <Tag>无</Tag>}
+              </Descriptions.Item>
+              <Descriptions.Item label="分组时间">{selectedRecord.groupTime || '-'}</Descriptions.Item>
+            </Descriptions>
+
+            {/* 科室与机构信息 */}
+            <Title level={5}>科室与机构信息</Title>
+            <Descriptions bordered column={2} size="small" style={{ marginBottom: 16 }}>
+              <Descriptions.Item label="科室编码">{selectedRecord.department || '-'}</Descriptions.Item>
+              <Descriptions.Item label="科室名称">{selectedRecord.departmentDesc || '-'}</Descriptions.Item>
+              <Descriptions.Item label="机构代码">{selectedRecord.fixmedinsCode || '-'}</Descriptions.Item>
+              <Descriptions.Item label="机构名称">{selectedRecord.fixmedinsName || '-'}</Descriptions.Item>
+            </Descriptions>
 
-            {/* 医疗机构算法信息 */}
-            {selectedRecord.hospAlgorithmInfo && selectedRecord.hospAlgorithmInfo.length > 0 && (
+            {/* 时间信息 */}
+            <Title level={5}>时间信息</Title>
+            <Descriptions bordered column={3} size="small" style={{ marginBottom: 16 }}>
+              <Descriptions.Item label="入院时间">{selectedRecord.admDateTime || '-'}</Descriptions.Item>
+              <Descriptions.Item label="出院时间">{selectedRecord.discgDateTime || '-'}</Descriptions.Item>
+              <Descriptions.Item label="结算时间">{selectedRecord.settleDateTime || '-'}</Descriptions.Item>
+              <Descriptions.Item label="创建日期">{selectedRecord.createDate || '-'}</Descriptions.Item>
+              <Descriptions.Item label="创建时间">{selectedRecord.createTime || '-'}</Descriptions.Item>
+              <Descriptions.Item label="更新时间">
+                {selectedRecord.updateDate ? `${selectedRecord.updateDate} ${selectedRecord.updateTime || ''}` : '-'}
+              </Descriptions.Item>
+            </Descriptions>
+
+            {/* 备注 */}
+            {selectedRecord.remark && (
               <>
-                <Title level={5}>医疗机构算法信息</Title>
-                <Row gutter={[16, 16]}>
-                  {selectedRecord.hospAlgorithmInfo.map((item, index) => (
-                    <Col span={12} key={index}>
-                      <Card 
-                        size="small" 
-                        title={
-                          <Space>
-                            <Tag color="green">{item.drg}</Tag>
-                            <Text type="secondary">{item.hospName}</Text>
-                          </Space>
-                        }
-                        style={{ backgroundColor: '#f6ffed', border: '1px solid #b7eb8f' }}
-                      >
-                        <Row gutter={[8, 8]}>
-                          <Col span={12}>
-                            <Text type="secondary" style={{ fontSize: 12 }}>基准点数: </Text>
-                            <Text style={{ fontSize: 13 }}>{item.points || '-'}</Text>
-                          </Col>
-                          <Col span={12}>
-                            <Text type="secondary" style={{ fontSize: 12 }}>预估标准: </Text>
-                            <Text style={{ fontSize: 13 }}>{item.payStandard || '-'}</Text>
-                          </Col>
-                          <Col span={12}>
-                            <Text type="secondary" style={{ fontSize: 12 }}>点值: </Text>
-                            <Text style={{ fontSize: 13 }}>{item.pipValue || '-'}</Text>
-                          </Col>
-                          <Col span={12}>
-                            <Text type="secondary" style={{ fontSize: 12 }}>差异系数: </Text>
-                            <Text style={{ fontSize: 13 }}>{item.dgdov || '-'}</Text>
-                          </Col>
-                          <Col span={12}>
-                            <Text type="secondary" style={{ fontSize: 12 }}>当前费用总额: </Text>
-                            <Text style={{ fontSize: 13 }}>{item.totalAmt !== undefined ? `¥${item.totalAmt}` : '-'}</Text>
-                          </Col>
-                          <Col span={12}>
-                            <Text type="secondary" style={{ fontSize: 12 }}>预估盈利: </Text>
-                            <Text style={{ fontSize: 13, color: '#52c41a' }}>
-                              {item.preProfit !== undefined ? `¥${item.preProfit}` : '-'}
-                            </Text>
-                          </Col>
-                          <Col span={12}>
-                            <Text type="secondary" style={{ fontSize: 12 }}>预估亏损: </Text>
-                            <Text style={{ fontSize: 13, color: '#ff4d4f' }}>
-                              {item.preLoss !== undefined ? `¥${item.preLoss}` : '-'}
-                            </Text>
-                          </Col>
-                          <Col span={12}>
-                            <Text type="secondary" style={{ fontSize: 12 }}>差异率: </Text>
-                            <Text style={{ fontSize: 13 }}>
-                              {item.discrepancyRate !== undefined ? `${item.discrepancyRate}%` : '-'}
-                            </Text>
-                          </Col>
-                        </Row>
-                      </Card>
-                    </Col>
-                  ))}
-                </Row>
+                <Title level={5}>备注</Title>
+                <Card size="small" style={{ backgroundColor: '#fafafa' }}>
+                  <Text style={{ whiteSpace: 'pre-wrap' }}>{selectedRecord.remark}</Text>
+                </Card>
               </>
             )}
           </>