28sungmin/m4-add-skills/note-fidelity
Claude Code and agent skill by 28sungmin/m4-add-skills
- community
Checking that the SKILL.md file is still in the repository.
Evaluate completeness (fidelity) of unstructured clinical notes and radiology reports in a QUIQ-format table. Uses Claude CLI to check whether required template items are mentioned in each note. No API key required. Use for LYDUS data quality assessment of note_clinical and note_rad variables.
Install
npx vskill@latest install 28sungmin/m4-add-skills/note-fidelitySKILL.md
Note Fidelity
Evaluates the completeness (fidelity) of unstructured clinical notes and radiology reports by asking an LLM whether each required template item is present in the note. Covers clinical notes (note_clinical) and radiology reports (note_rad).
When to Use This Skill
- After QUIQ conversion, to assess whether clinical notes contain all expected structured items
- To detect notes that are missing key sections (e.g., no "Diagnosis" in an admission note)
- As part of LYDUS quality management assessment
SQL Support
Not applicable. Requires Claude CLI for note content analysis.
Filtering Logic
| Type | Mapping_info_1 | Supported Mapping_info_2 codes | |
|---|---|---|---|
| Clinical note | note_clinical | ADM, DIS, SUR, EME | |
| Radiology report | note_rad | ACT, BCT, CCT, SCT, CXR, AXR, SXR, ECH |
Notes with unrecognized Mapping_info_2 codes are skipped ("Invalid mapping or template missing").
Report Templates
Clinical Notes
| Code | Note Type | Template Items | |
|---|---|---|---|
| ADM | Admission note | Admission department, Chief complaint, Present illness, Past medical history, Social & Family history, Physical examination, Review of systems, Diagnosis, Treatment plan | |
| DIS | Discharge summary | Admission/Discharge department, Discharge reason, Diagnosis, Summary of progression, Medical prescription, Surgery or procedure, Treatment result, Discharge plan, Discharge form | |
| SUR | Surgery note | Pre/Postoperative diagnosis, Pre/Postoperative procedure, Type of anesthesia, Operative findings, Surgical procedure | |
| EME | Emergency note | Visit information, Past medical history, Medication history, Present illness, Examination findings, Presumptive diagnosis, Treatment plan |
Radiology Reports
| Code | Modality | Template Items (examples) | |
|---|---|---|---|
| ACT | CT abdomen | Liver, Gallbladder, Spleen, Pancreas, Adrenals, Kidneys, Bowel, ... | |
| BCT | CT brain | Extra-axial spaces, Ventricular system, Cerebral parenchyma, ... | |
| CCT | CT chest | Pulmonary Parenchyma, Pleural Space, Heart and Pericardium, ... | |
| SCT | CT spine | Alignment, Bones, Intervertebral Discs, Spinal canal, ... | |
| CXR | X-ray chest | Lungs, Heart, Mediastinum, Pleural Spaces, Osseous Structures | |
| AXR | X-ray abdomen | Bowel gas pattern, Abnormal calcifications, Bones, Others | |
| SXR | X-ray spine | Alignment, Vertebral bodies, Intervertebral spaces, Soft Tissues | |
| ECH | Echocardiography | Left/Right ventricle, Left/Right atrium, Aortic/Mitral/Tricuspid/Pulmonic valve, Pericardium, Aorta, ... |
Scoring Logic
LLM response classifies each template item as mentioned or not mentioned.
Fidelity Score (%) = (1 - not_mentioned / total_items) × 100
- Clinical: items extracted via regex
:\s*("[^"]+"|[^:\n]+) - Radiology: items extracted by splitting on newlines
Overall Note Fidelity = unweighted mean across all scored notes.
Output
| File | Description | |
|---|---|---|
note_fidelity_total.txt | Overall Note Fidelity (%) | |
note_fidelity_summary.csv | Per-(Mapping_info_1, Mapping_info_2): Count, mean, std fidelity | |
note_fidelity_total_detail.csv | Per-note: LLM response + fidelity score | |
note_fidelity_plot.png | Box plot of fidelity by note category |
How to Run
As a script with config
Critical Notes
- Retry logic — each LLM call retries up to 3 times on failure. Rows still failing after retries are recorded as "Failed after retries" and excluded from scoring.
- Invalid mapping — notes with
Mapping_info_2codes not in the template list return "Invalid mapping or template missing" and are excluded from scoring.
- Note Fidelity vs Note Accuracy — Fidelity measures what items are present (template completeness); Accuracy measures whether the content is correct (error detection).
- 원본 코드 개선 사항:
process_row+retry_process_rowinner 함수가_run_clinical/_run_radiology양쪽에 중복 →_call_with_retry공통 함수로 통합- 오타 수정:
Present ilness→Present illness,Familty history→Family history,Physical exammination→Physical examination get_unstructured_fidelity→get_note_fidelity(스킬 이름과 일관성)- 템플릿/매핑 딕셔너리를 모듈 수준 상수로 분리
- Dependencies —
pandas,seaborn,matplotlib,tqdm(LLM: Claude CLI via subprocess)
References
- LYDUS 품질관리 프로그램 활용 가이드라인 (비공개 내부 문서)
- Original Python implementation: LYDUS_Note_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/note-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/note-fidelity)