Files
AIclinicalresearch/backend/src/modules/asl/fulltext-screening/__tests__/fulltext-screening-api.http
HaHafeng 74cf346453 feat(dc/tool-c): Add missing value imputation feature with 6 methods and MICE
Major features:
1. Missing value imputation (6 simple methods + MICE):
   - Mean/Median/Mode/Constant imputation
   - Forward fill (ffill) and Backward fill (bfill) for time series
   - MICE multivariate imputation (in progress, shape issue to fix)

2. Auto precision detection:
   - Automatically match decimal places of original data
   - Prevent false precision (e.g. 13.57 instead of 13.566716417910449)

3. Categorical variable detection:
   - Auto-detect and skip categorical columns in MICE
   - Show warnings for unsuitable columns
   - Suggest mode imputation for categorical data

4. UI improvements:
   - Rename button: "Delete Missing" to "Missing Value Handling"
   - Remove standalone "Dedup" and "MICE" buttons
   - 3-tab dialog: Delete / Fill / Advanced Fill
   - Display column statistics and recommended methods
   - Extended warning messages (8 seconds for skipped columns)

5. Bug fixes:
   - Fix sessionService.updateSessionData -> saveProcessedData
   - Fix OperationResult interface (add message and stats)
   - Fix Toolbar button labels and removal

Modified files:
Python: operations/fillna.py (new, 556 lines), main.py (3 new endpoints)
Backend: QuickActionService.ts, QuickActionController.ts, routes/index.ts
Frontend: MissingValueDialog.tsx (new, 437 lines), Toolbar.tsx, index.tsx
Tests: test_fillna_operations.py (774 lines), test scripts and docs
Docs: 5 documentation files updated

Known issues:
- MICE imputation has DataFrame shape mismatch issue (under debugging)
- Workaround: Use 6 simple imputation methods first

Status: Development complete, MICE debugging in progress
Lines added: ~2000 lines across 3 tiers
2025-12-10 13:06:00 +08:00

293 lines
7.6 KiB
HTTP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
###
# API
# 使REST ClientVS Code
###
@baseUrl = http://localhost:3001
@apiPrefix = /api/v1/asl/fulltext-screening
### ========================================
###
### ========================================
### 1.
GET {{baseUrl}}/api/v1/asl/projects
Content-Type: application/json
### 2. projectId
@projectId = 55941145-bba0-4b15-bda4-f0a398d78208
GET {{baseUrl}}/api/v1/asl/projects/{{projectId}}/literatures?page=1&limit=10
Content-Type: application/json
### ========================================
### API 1:
### ========================================
### 1.1:
# @name createTask
POST {{baseUrl}}{{apiPrefix}}/tasks
Content-Type: application/json
{
"projectId": "{{projectId}}",
"literatureIds": [
"e9c18ba3-9ad7-4cc9-ac78-b74a7ec91b12",
"e44ea8d9-6ba8-4b88-8d24-4fb46b3584e0"
],
"modelA": "deepseek-v3",
"modelB": "qwen-max",
"promptVersion": "v1.0.0"
}
### taskId
@taskId = {{createTask.response.body.data.taskId}}
### 1.2:
POST {{baseUrl}}{{apiPrefix}}/tasks
Content-Type: application/json
{
"projectId": "{{projectId}}"
}
### 1.3: projectId
POST {{baseUrl}}{{apiPrefix}}/tasks
Content-Type: application/json
{
"projectId": "00000000-0000-0000-0000-000000000000",
"literatureIds": ["lit-001"]
}
### 1.4: literatureIds
POST {{baseUrl}}{{apiPrefix}}/tasks
Content-Type: application/json
{
"projectId": "{{projectId}}",
"literatureIds": []
}
### ========================================
### API 2:
### ========================================
### 2.1:
GET {{baseUrl}}{{apiPrefix}}/tasks/{{taskId}}
Content-Type: application/json
### 2.2: taskId
GET {{baseUrl}}{{apiPrefix}}/tasks/00000000-0000-0000-0000-000000000000
Content-Type: application/json
### 2.3: 5
GET {{baseUrl}}{{apiPrefix}}/tasks/{{taskId}}
Content-Type: application/json
### ========================================
### API 3:
### ========================================
### 3.1:
GET {{baseUrl}}{{apiPrefix}}/tasks/{{taskId}}/results
Content-Type: application/json
### 3.2: 10
GET {{baseUrl}}{{apiPrefix}}/tasks/{{taskId}}/results?page=1&pageSize=10
Content-Type: application/json
### 3.3:
GET {{baseUrl}}{{apiPrefix}}/tasks/{{taskId}}/results?filter=conflict
Content-Type: application/json
### 3.4:
GET {{baseUrl}}{{apiPrefix}}/tasks/{{taskId}}/results?filter=pending
Content-Type: application/json
### 3.5:
GET {{baseUrl}}{{apiPrefix}}/tasks/{{taskId}}/results?filter=reviewed
Content-Type: application/json
### 3.6:
GET {{baseUrl}}{{apiPrefix}}/tasks/{{taskId}}/results?sortBy=priority&sortOrder=desc
Content-Type: application/json
### 3.7:
GET {{baseUrl}}{{apiPrefix}}/tasks/{{taskId}}/results?sortBy=createdAt&sortOrder=asc
Content-Type: application/json
### 3.8: 2
GET {{baseUrl}}{{apiPrefix}}/tasks/{{taskId}}/results?page=2&pageSize=5
Content-Type: application/json
### 3.9: filter
GET {{baseUrl}}{{apiPrefix}}/tasks/{{taskId}}/results?filter=invalid
Content-Type: application/json
### 3.10: pageSize
GET {{baseUrl}}{{apiPrefix}}/tasks/{{taskId}}/results?pageSize=999
Content-Type: application/json
### ========================================
### API 4:
### ========================================
### ID
# @name getFirstResult
GET {{baseUrl}}{{apiPrefix}}/tasks/{{taskId}}/results?pageSize=1
Content-Type: application/json
### resultId
@resultId = {{getFirstResult.response.body.data.results[0].resultId}}
### 4.1:
PUT {{baseUrl}}{{apiPrefix}}/results/{{resultId}}/decision
Content-Type: application/json
{
"finalDecision": "include",
"reviewNotes": ""
}
### 4.2:
PUT {{baseUrl}}{{apiPrefix}}/results/{{resultId}}/decision
Content-Type: application/json
{
"finalDecision": "exclude",
"exclusionReason": "field9",
"reviewNotes": "P±SD"
}
### 4.3:
PUT {{baseUrl}}{{apiPrefix}}/results/{{resultId}}/decision
Content-Type: application/json
{
"finalDecision": "exclude"
}
### 4.4: finalDecision
PUT {{baseUrl}}{{apiPrefix}}/results/{{resultId}}/decision
Content-Type: application/json
{
"finalDecision": "maybe"
}
### 4.5: resultId
PUT {{baseUrl}}{{apiPrefix}}/results/00000000-0000-0000-0000-000000000000/decision
Content-Type: application/json
{
"finalDecision": "include"
}
### ========================================
### API 5: Excel
### ========================================
### 5.1: Excel
GET {{baseUrl}}{{apiPrefix}}/tasks/{{taskId}}/export
Accept: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
### 5.2: ExceltaskId
GET {{baseUrl}}{{apiPrefix}}/tasks/00000000-0000-0000-0000-000000000000/export
Accept: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
### ========================================
###
### ========================================
### 1:
# @name fullFlowTask
POST {{baseUrl}}{{apiPrefix}}/tasks
Content-Type: application/json
{
"projectId": "{{projectId}}",
"literatureIds": [
"e9c18ba3-9ad7-4cc9-ac78-b74a7ec91b12"
],
"modelA": "deepseek-v3",
"modelB": "qwen-max"
}
@fullFlowTaskId = {{fullFlowTask.response.body.data.taskId}}
### 2: 2
GET {{baseUrl}}{{apiPrefix}}/tasks/{{fullFlowTaskId}}
Content-Type: application/json
### 3:
# @name fullFlowResults
GET {{baseUrl}}{{apiPrefix}}/tasks/{{fullFlowTaskId}}/results
Content-Type: application/json
@fullFlowResultId = {{fullFlowResults.response.body.data.results[0].resultId}}
### 4:
PUT {{baseUrl}}{{apiPrefix}}/results/{{fullFlowResultId}}/decision
Content-Type: application/json
{
"finalDecision": "include",
"reviewNotes": " - "
}
### 5: Excel
GET {{baseUrl}}{{apiPrefix}}/tasks/{{fullFlowTaskId}}/export
Accept: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
### ========================================
###
### ========================================
### :
POST {{baseUrl}}{{apiPrefix}}/tasks
Content-Type: application/json
{
"projectId": "{{projectId}}",
"literatureIds": [
"e9c18ba3-9ad7-4cc9-ac78-b74a7ec91b12",
"e44ea8d9-6ba8-4b88-8d24-4fb46b3584e0",
"c8f9e2d1-3a4b-5c6d-7e8f-9a0b1c2d3e4f"
],
"modelA": "deepseek-v3",
"modelB": "qwen-max"
}
### ========================================
###
### ========================================
### 使
###
GET {{baseUrl}}/api/v1/asl/projects/{{projectId}}/literatures
Content-Type: application/json
###