cohort-compare
Installation
SKILL.md
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.
Execution Rules
- Do NOT explore the workspace or list files. Begin the analysis immediately.
- Write ONE Python script that does everything: FHIR queries, analysis, chart, and summary.
- Write the script correctly the first time. Do NOT write a draft and then edit it.
- Run it with
python(NOTpython3). - All HTTP calls must use
subprocess.run(["curl", "-sf", "--max-time", "30", url], capture_output=True, text=True)-- therequestslibrary does NOT work through the sandbox proxy. See the fhir-basics skill for thefhir_gethelper pattern. - Save the script to
/tmp/<name>.py, run it once, interpret the output.
Steps
- Identify the cohort -- Query
GET /Condition?code={snomed_code}&_count=200and follow pagination links to get all matching Condition resources. Extract unique patient IDs fromentry[].resource.subject.reference. Report the cohort size.