# fhir-developer-skill

Guides FHIR R4 API development across healthcare endpoints: handles resource validation, OperationOutcome errors, standard status codes, and coding systems.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 663 installs · ★ 431
- Author: anthropics · official Anthropic repository
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/anthropics/healthcare/tree/HEAD/plugins/healthcare/skills/fhir-developer/SKILL.md
- Updated: 2026-08-27
- HTML: https://affpapa.org/en/nevibecode/skills/fhir-developer-skill

## What it does

This skill provides structural rules for building healthcare REST endpoints following FHIR R4. It details resource layouts for Patient, Observation, Encounter, Condition, and MedicationRequest. Inside are concrete validation snippets for Python FastAPI using Pydantic v2 literals and TypeScript Express, paired with `application/fhir+json` responses.

Field validation strictly depends on cardinality. Only fields marked `1..1` or `1..*` are enforced as required. For instance, Encounter leaves `subject` and `period` optional under `0..1` cardinality, so rejecting payloads without them is an error. Invalid enum values or missing required fields return a 422 Unprocessable Entity status with an OperationOutcome payload. When an If-Match ETag check fails, the API responds with 412 Precondition Failed rather than 400.

The guide also maps canonical terminology URIs for LOINC, SNOMED CT, RxNorm, and ICD-10, alongside common vital sign identifiers. It prepares agents to wire up SMART on FHIR OAuth scopes and manage batch operations without misinterpreting FHIR requirements.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add anthropics/healthcare --skill fhir-developer-skill -a claude-code
```
```bash
npx skills add anthropics/healthcare --skill fhir-developer -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/fhir-developer/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/fhir-developer/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add anthropics/healthcare --skill fhir-developer -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/fhir-developer/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add anthropics/healthcare --skill fhir-developer -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/fhir-developer/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install anthropics/healthcare fhir-developer
```

2. **Manually: put the files in place**
- File: `.github/skills/fhir-developer/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add anthropics/healthcare --skill fhir-developer -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/anthropics/healthcare --path plugins/healthcare/skills/fhir-developer
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/fhir-developer/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add anthropics/healthcare --skill fhir-developer -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/anthropics/healthcare/tree/HEAD/plugins/healthcare/skills/fhir-developer/SKILL.md

## When to use it
- validate FHIR R4 payloads in FastAPI or Express
- generate compliant OperationOutcome responses with 422 status
- reference standard terminology URLs for LOINC, SNOMED, and ICD-10
- enforce required fields strictly by schema cardinality

## Example prompts
- Write a POST /Observation endpoint in FastAPI with enum validation and OperationOutcome errors.
- Create a Pydantic v2 model for a FHIR Patient resource using Literal types for gender.
- Handle If-Match ETag checks for an Encounter endpoint returning 412 Precondition Failed on mismatch.

## Similar
- [fastapi-developer](https://affpapa.org/en/nevibecode/agents/fastapi-developer.md) — subagent · ★ 26065
- [fastapi-python](https://affpapa.org/en/nevibecode/skills/fastapi-python.md) — skill · 13900 installs
- [fastapi-patterns](https://affpapa.org/en/nevibecode/skills/fastapi-patterns.md) — skill · 4900 installs
- [stripe-webhooks](https://affpapa.org/en/nevibecode/skills/stripe-webhooks.md) — skill · 595 installs
- [api-smoke-testing](https://affpapa.org/en/nevibecode/skills/api-smoke-testing.md) — skill · 495 installs
- [fastapi-development](https://affpapa.org/en/nevibecode/skills/fastapi-development.md) — skill · 618 installs

From the same set: [anthropics/healthcare](https://affpapa.org/en/nevibecode/by/anthropics/healthcare.md) — 3 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
