feat(dc): Add multi-metric transformation feature (direction 1+2)

Summary:
- Implement intelligent multi-metric grouping detection algorithm
- Add direction 1: timepoint-as-row, metric-as-column (analysis format)
- Add direction 2: timepoint-as-column, metric-as-row (display format)
- Fix column name pattern detection (FMA___ issue)
- Maintain original Record ID order in output
- Add full-select/clear buttons in UI
- Integrate into TransformDialog with Radio selection
- Update 3 documentation files

Technical Details:
- Python: detect_metric_groups(), apply_multi_metric_to_long(), apply_multi_metric_to_matrix()
- Backend: 3 new methods in QuickActionService
- Frontend: MultiMetricPanel.tsx (531 lines)
- Total: ~1460 lines of new code

Status: Fully tested and verified, ready for production
This commit is contained in:
2025-12-21 15:06:15 +08:00
parent 8be8cdcf53
commit 9b81aef9a7
123 changed files with 4781 additions and 150 deletions

View File

@@ -540,19 +540,19 @@ docker rm extraction-test
```bash
# 1. 登录阿里云容器镜像服务
# 获取登录命令:阿里云控制台 → 容器镜像服务 → 访问凭证 → 设置Registry登录密码
docker login --username=<your-username> registry.cn-hangzhou.aliyuncs.com
docker login --username=<your-username> registry.cn-beijing.aliyuncs.com
# 2. 给镜像打标签
docker tag extraction-service:latest \
registry.cn-hangzhou.aliyuncs.com/clinical-research/extraction-service:v1.0
registry.cn-beijing.aliyuncs.com/clinical-research/extraction-service:v1.0
# 3. 推送到阿里云
docker push registry.cn-hangzhou.aliyuncs.com/clinical-research/extraction-service:v1.0
docker push registry.cn-beijing.aliyuncs.com/clinical-research/extraction-service:v1.0
# 4. 推送 latest 标签(便于后续更新)
docker tag extraction-service:latest \
registry.cn-hangzhou.aliyuncs.com/clinical-research/extraction-service:latest
docker push registry.cn-hangzhou.aliyuncs.com/clinical-research/extraction-service:latest
registry.cn-beijing.aliyuncs.com/clinical-research/extraction-service:latest
docker push registry.cn-beijing.aliyuncs.com/clinical-research/extraction-service:latest
```
---
@@ -572,7 +572,7 @@ docker push registry.cn-hangzhou.aliyuncs.com/clinical-research/extraction-servi
3. **镜像配置**:
```
镜像地址: registry.cn-hangzhou.aliyuncs.com/clinical-research/extraction-service:latest
镜像地址: registry.cn-beijing.aliyuncs.com/clinical-research/extraction-service:latest
镜像版本: latest
镜像拉取策略: Always每次部署都拉取最新镜像
```
@@ -690,7 +690,7 @@ TZ=Asia/Shanghai
3. **查看并复制"内网访问地址"**,通常是以下格式之一:
```
# 格式 1: 内网 IP + 端口(⭐⭐⭐⭐⭐ 强烈推荐,最稳定)
172.16.0.10:8000
172.17.x.x:8000
# 格式 2: SAE 内网 Service 域名(需要额外配置服务发现,不推荐)
extraction-service-xxxxx.cn-hangzhou.sae.aliyuncs.com:8000
@@ -716,7 +716,7 @@ TZ=Asia/Shanghai
5. **✅ 推荐做法(按优先级排序)**
```bash
# ⭐⭐⭐⭐⭐ 方案A直接使用内网IP强烈推荐
EXTRACTION_SERVICE_URL=http://172.16.0.10:8000
EXTRACTION_SERVICE_URL=http://172.17.x.x:8000
# 获取方式SAE控制台 > Python应用 > 实例列表 > 查看内网IP
# ⭐⭐⭐ 方案B使用SAE服务发现需要额外配置不推荐初期使用
@@ -730,7 +730,7 @@ TZ=Asia/Shanghai
```bash
# ⚠️ 使用 SAE 控制台显示的真实内网地址
EXTRACTION_SERVICE_URL=http://172.16.0.10:8000
EXTRACTION_SERVICE_URL=http://172.17.x.x:8000
# 注意:
# 1. 不要使用猜测的域名
@@ -817,7 +817,7 @@ export async function testExtractionService() {
2. **查看 Node.js 后端日志**SAE 控制台 → 后端应用 → 日志):
```
[INFO] Calling extraction service: http://172.16.0.10:8000/extract/pdf
[INFO] Calling extraction service: http://172.17.x.x:8000/extract/pdf
[INFO] Extraction completed in 2.3s
[INFO] Extracted text preview: "This is a test document..."
```
@@ -1050,7 +1050,7 @@ pip list --outdated
# 2. 重建镜像(包含安全更新)
docker build -t extraction-service:v1.1 .
docker push registry.cn-hangzhou.aliyuncs.com/clinical-research/extraction-service:v1.1
docker push registry.cn-beijing.aliyuncs.com/clinical-research/extraction-service:v1.1
# 3. 在 SAE 中更新镜像版本
```
@@ -1131,7 +1131,7 @@ with open(pdf_path, 'rb') as f:
```
后端日志Connection refused
ECONNREFUSED: connect ECONNREFUSED 172.16.0.10:8000
ECONNREFUSED: connect ECONNREFUSED 172.17.x.x:8000
Error: getaddrinfo ENOTFOUND extraction-service.internal
```
@@ -1144,7 +1144,7 @@ Error: getaddrinfo ENOTFOUND extraction-service.internal
EXTRACTION_SERVICE_URL=http://extraction-service.internal:8000
# ✅ 正确配置SAE 控制台显示的真实地址)
EXTRACTION_SERVICE_URL=http://172.16.0.10:8000
EXTRACTION_SERVICE_URL=http://172.17.x.x:8000
```
**解决方法**
@@ -1300,7 +1300,7 @@ EXTRACTION_SERVICE_URL=http://extraction-service:8000
# ✅ 正确做法:从 SAE 控制台获取真实地址
# SAE 控制台 → extraction-service 应用 → 应用访问配置
# 复制显示的"VPC 内网访问地址"
EXTRACTION_SERVICE_URL=http://172.16.0.10:8000
EXTRACTION_SERVICE_URL=http://172.17.x.x:8000
```
**原因**
@@ -1498,7 +1498,7 @@ echo "Done!"
docker build -t extraction-service:v1.0 .
# 推送镜像
docker push registry.cn-hangzhou.aliyuncs.com/clinical-research/extraction-service:v1.0
docker push registry.cn-beijing.aliyuncs.com/clinical-research/extraction-service:v1.0
# 查看 SAE 日志
# SAE 控制台 → 应用详情 → 日志