28sungmin/m4-add-skills/note-fidelity

Claude Code and agent skill by 28sungmin/m4-add-skills

Trust tier 3
  • community
Source check pending

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-fidelity

SKILL.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

TypeMapping_info_1Supported Mapping_info_2 codes
Clinical notenote_clinicalADM, DIS, SUR, EME
Radiology reportnote_radACT, 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
CodeNote TypeTemplate Items
ADMAdmission noteAdmission department, Chief complaint, Present illness, Past medical history, Social & Family history, Physical examination, Review of systems, Diagnosis, Treatment plan
DISDischarge summaryAdmission/Discharge department, Discharge reason, Diagnosis, Summary of progression, Medical prescription, Surgery or procedure, Treatment result, Discharge plan, Discharge form
SURSurgery notePre/Postoperative diagnosis, Pre/Postoperative procedure, Type of anesthesia, Operative findings, Surgical procedure
EMEEmergency noteVisit information, Past medical history, Medication history, Present illness, Examination findings, Presumptive diagnosis, Treatment plan
Radiology Reports
CodeModalityTemplate Items (examples)
ACTCT abdomenLiver, Gallbladder, Spleen, Pancreas, Adrenals, Kidneys, Bowel, ...
BCTCT brainExtra-axial spaces, Ventricular system, Cerebral parenchyma, ...
CCTCT chestPulmonary Parenchyma, Pleural Space, Heart and Pericardium, ...
SCTCT spineAlignment, Bones, Intervertebral Discs, Spinal canal, ...
CXRX-ray chestLungs, Heart, Mediastinum, Pleural Spaces, Osseous Structures
AXRX-ray abdomenBowel gas pattern, Abnormal calcifications, Bones, Others
SXRX-ray spineAlignment, Vertebral bodies, Intervertebral spaces, Soft Tissues
ECHEchocardiographyLeft/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

FileDescription
note_fidelity_total.txtOverall Note Fidelity (%)
note_fidelity_summary.csvPer-(Mapping_info_1, Mapping_info_2): Count, mean, std fidelity
note_fidelity_total_detail.csvPer-note: LLM response + fidelity score
note_fidelity_plot.pngBox plot of fidelity by note category

How to Run

python
import pandas as pd
from scripts.note_fidelity import get_note_fidelity
quiq = pd.read_csv("/path/to/quiq.csv")
df_clinical, df_radiology, result_df, summary_df, \
mean_clinical, std_clinical, mean_radiology, std_radiology = get_note_fidelity(
quiq=quiq
)
mean_fidelity = round(result_df['Fidelity_results'].mean(), 2)
print(f"Note Fidelity (%) = {mean_fidelity}")
print(f"Clinical: {mean_clinical} ± {std_clinical}")
print(f"Radiology: {mean_radiology} ± {std_radiology}")
As a script with config
yaml
# config.yaml
quiq_path: /path/to/quiq.csv
save_path: /path/to/output
bash
python scripts/note_fidelity.py --config config.yaml

Critical Notes

  1. 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.
  1. Invalid mapping — notes with Mapping_info_2 codes not in the template list return "Invalid mapping or template missing" and are excluded from scoring.
  1. Note Fidelity vs Note Accuracy — Fidelity measures what items are present (template completeness); Accuracy measures whether the content is correct (error detection).
  1. 원본 코드 개선 사항:
  • process_row + retry_process_row inner 함수가 _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 (스킬 이름과 일관성)
  • 템플릿/매핑 딕셔너리를 모듈 수준 상수로 분리
  1. 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

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/28sungmin/m4-add-skills/note-fidelity/badge)](https://verified-skill.com/skills/28sungmin/m4-add-skills/note-fidelity)

Something wrong with this skill or its page? Tell us.