28sungmin/m4-add-skills/fidelity
Claude Code and agent skill by 28sungmin/m4-add-skills
- community
Checking that the SKILL.md file is still in the repository.
Calculate structured fidelity for clinical variables in a QUIQ-format table. Measures how frequently each clinical concept (event, diagnosis, prescription, procedure) appears per patient. Use for data quality assessment of clinical record completeness and recording pattern consistency.
Install
npx vskill@latest install 28sungmin/m4-add-skills/fidelitySKILL.md
Fidelity
Calculates structured fidelity for clinical variables in a QUIQ-format table. Measures the average per-patient recording frequency for each clinical concept, grouped by category (Mapping_info_1).
When to Use This Skill
- After QUIQ conversion, to assess how faithfully clinical events are recorded per patient
- To identify variables with unusually high or low recording frequency
- As part of LYDUS quality management assessment
Categories and Filtering
| Category | Mapping_info_1 | Is_categorical | Grouped by Value | |
|---|---|---|---|---|
| Event | contains event | any | ❌ (전체 빈도만) | |
| Diagnosis | contains diagnosis | = 1 | ✅ | |
| Prescription | contains prescription | = 1 | ✅ | |
| Procedure | contains procedure | = 1 | ✅ |
- Event는 값 구분 없이 환자별 발생 횟수만 집계
- 나머지 3개 카테고리는
(Variable_name, Value)조합별로 집계
Metrics
(Original_table_name, Variable_name[, Value]) 그룹별:
| 컬럼 | 의미 | |
|---|---|---|
Patient_num | 해당 항목을 가진 환자 수 | |
Mean | 환자별 평균 기록 횟수 | |
Std | 환자별 기록 횟수의 표준편차 |
Weighted Fidelity = Σ(Patient_num × Mean) / Σ(Patient_num)
Output
| File | Description | |
|---|---|---|
fidelity_total.txt | Weighted Fidelity (전체 가중 평균 빈도) | |
fidelity_summary.csv | 카테고리별 전체 결과 |
How to Run
As a script with config
Critical Notes
- Event Value = NULL — Event 카테고리는 값 종류와 무관하게 발생 빈도만 집계하므로
Value컬럼이 NULL.
- Is_categorical 타입 — 원본 코드에서
df['Is_categorical'] == 1비교 전 타입 변환 없음. 스킬 버전에서pd.to_numeric(..., errors='coerce')및 SQLTRY_CAST로 수정.
- Std = NULL — 환자가 1명인 그룹은 표준편차가 NULL (샘플 표준편차 ddof=1).
- Weighted Fidelity 해석 — 값이 클수록 환자 1인당 평균적으로 더 많은 기록이 있음. 정상 범위는 데이터셋과 기관에 따라 다름.
References
- LYDUS 품질관리 프로그램 활용 가이드라인 (비공개 내부 문서)
- Original Python implementation: LYDUS_Fidelity.py (이성민 작성)
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingsrc/m4/skills/lydus/fidelity/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/28sungmin/m4-add-skills/fidelity)