Analyze a cohort of patients from FHIR endpoints to find care gaps and patterns. Use when asked to compare patients, find quality gaps, or analyze a population.
npx skills add https://github.com/NVIDIA/dgx-spark-playbooks --skill cohort-compare
Analyze a patient cohort: $ARGUMENTS
Use your fhir-basics skill to query FHIR endpoints. Use your clinical-knowledge skill to identify care gaps and apply correct thresholds. Use your analysis-methods skill to write correct Python analysis code.
python (NOT python3).subprocess.run(["curl", "-sf", "--max-time", "30", url], capture_output=True, text=True) -- the requests library does NOT work through the sandbox proxy. See the fhir-basics skill for the fhir_get helper pattern./tmp/<name>.py, run it once, interpret the output.GET /Condition?code={snomed_code}&_count=200 and follow pagination links to get all matching Condition resources. Extract unique patient IDs from entry[].resource.subject.reference. Report the cohort size.get_latest_labs_batch(loinc_code, patient_ids) to fetch ALL observations for the LOINC code in one call and filter client-side. This queries GET /Observation?code={loinc_code}&_count=500&_sort=-date without a patient filter, then builds a dict keyed by patient ID. Handle both valueQuantity (numeric) and valueString (text) formats. For blood pressure, query the BP panel code 85354-9 in batch and parse components.get_all_medications_batch(patient_ids) to fetch GET /MedicationRequest?status=active&_count=500 in one call, then filter to cohort patients client-side.for pid in patient_ids: loop that makes FHIR HTTP calls inside the loop. The sandbox proxy adds 1-3s latency per call. With 24 patients x 4 LOINC codes = 96 calls = 5+ minutes. Batching brings this to 4-6 total calls = 30 seconds.patient_id (string){lab_name} (float or None)lab_date (string)on_target_med (boolean -- True if the patient is on the specified medication class)medications (comma-separated string of all active med names)med_count (int)plt.style.use('dark_background'), primary color #76B900, background #1a1a1adpi=150Condition: Type 2 Diabetes (SNOMED 44054006)
Lab: HbA1c (LOINC 4548-4)
Threshold: > 9.0%
Gap medication: insulin or GLP-1 agonist
Quality measure: CMS122v12 (poor glycemic control)
INSULIN_AND_GLP1 = ["insulin", "liraglutide", "semaglutide", "dulaglutide",
"exenatide", "tirzepatide", "victoza", "ozempic",
"trulicity", "byetta", "mounjaro", "rybelsus"]
def is_on_insulin_or_glp1(med_list):
med_lower = [m.lower() for m in med_list]
return any(drug in med_text for drug in INSULIN_AND_GLP1 for med_text in med_lower)
Condition: Essential Hypertension (SNOMED 38341003)
Lab: Systolic BP (LOINC 8480-6) -- use component Observation pattern
Threshold: >= 140 mmHg
Gap medication: any antihypertensive
Quality measure: CMS165v12 (controlling high blood pressure)
Note: Use get_latest_bp() from the analysis-methods skill to handle both BP panel (85354-9) and standalone systolic Observations.
ANTIHYPERTENSIVES = ["lisinopril", "enalapril", "ramipril", "benazepril",
"losartan", "valsartan", "irbesartan", "olmesartan", "telmisartan",
"amlodipine", "nifedipine", "diltiazem",
"metoprolol", "atenolol", "carvedilol", "bisoprolol",
"hydrochlorothiazide", "hctz", "chlorthalidone",
"furosemide", "spironolactone"]
def is_on_antihypertensive(med_list):
med_lower = [m.lower() for m in med_list]
return any(drug in med_text for drug in ANTIHYPERTENSIVES for med_text in med_lower)
Integration with protocols.io API for managing scientific protocols. This skill should be used when working with protocols.io to search, create, update, or publish protocols; manage protocol steps and materials; handle discussions and comments; organize workspaces; upload and manage files; or integrate protocols.io functionality into workflows. Applicable for protocol discovery, collaborative protocol development, experiment tracking, lab protocol management, and scientific documentation.
Analyzes job descriptions and generates tailored resumes that highlight relevant experience, skills, and achievements to maximize interview chances
Generate Excalidraw diagrams from natural language descriptions. Use when asked to "create a diagram", "make a flowchart", "visualize a process", "draw a system architecture", "create a mind map", or "generate an Excalidraw file". Supports flowcharts, relationship diagrams, mind maps, and system architecture diagrams. Outputs .excalidraw JSON files that can be opened directly in Excalidraw.
Build and distribute Expo development clients locally or via TestFlight
Use when you have a written implementation plan to execute in a separate session with review checkpoints
Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.
Benchling R&D platform integration. Access registry (DNA, proteins), inventory, ELN entries, workflows via API, build Benchling Apps, query Data Warehouse, for lab data management automation.
Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.
Take nvidia/cohort-compare from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.