.claude/skills/fhir-bulk-data/SKILL.md
Expert guidance for implementing FHIR Bulk Data Access (Flat FHIR) following the HL7 specification. Use this skill when implementing bulk data export from FHIR servers, building bulk data clients, working with the $export operation, handling NDJSON output files, implementing asynchronous polling workflows, or integrating with SMART Backend Services authorisation. Trigger keywords include "bulk data", "bulk export", "$export", "NDJSON", "bulk FHIR", "async export", "flat FHIR", "Patient/$export", "Group/$export", "system export".
npx skillsauth add aehrc/pathling fhir-bulk-dataInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Expert guidance for implementing the FHIR Bulk Data Access (Flat FHIR) specification v3.0.0.
Bulk Data Access enables efficient export of large FHIR datasets through an asynchronous request pattern. Instead of making thousands of individual API calls, clients initiate a single export operation and poll for completion.
Specification: http://hl7.org/fhir/uv/bulkdata/
Three endpoints support bulk export:
| Endpoint | Scope |
| --------------------------- | ------------------------------------- |
| [base]/Patient/$export | All data for all patients |
| [base]/Group/[id]/$export | Data for patients in a specific group |
| [base]/$export | System-level export (all resources) |
Client Server
│ │
│─── POST [endpoint]/$export ───────────►│
│ Accept: application/fhir+json │
│ Prefer: respond-async │
│ │
│◄── 202 Accepted ──────────────────────│
│ Content-Location: [status-url] │
│ │
│─── GET [status-url] ──────────────────►│ ─┐
│◄── 202 Accepted (X-Progress: 50%) ────│ │ Poll until
│ Retry-After: 120 │ │ complete
│ │ ─┘
│─── GET [status-url] ──────────────────►│
│◄── 200 OK ────────────────────────────│
│ [Complete manifest JSON] │
│ │
│─── GET [file-url] ────────────────────►│ ─┐
│◄── 200 OK (NDJSON content) ───────────│ │ Download
│ │ ─┘ files
│─── DELETE [status-url] ───────────────►│
│◄── 202 Accepted ──────────────────────│
| Parameter | Type | Description |
| ----------------------- | ------- | -------------------------------------------------- |
| _outputFormat | string | Output format. Default: application/fhir+ndjson |
| _since | instant | Include resources modified after this timestamp |
| _until | instant | Include resources modified before this timestamp |
| _type | string | Comma-delimited resource types to include |
| _elements | string | Comma-delimited elements to include (experimental) |
| _typeFilter | string | FHIR search queries to filter resources |
| includeAssociatedData | code | Include additional data sets (experimental) |
| organizeOutputBy | string | Organise files by resource type instances |
| allowPartialManifests | boolean | Enable paginated manifests |
GET [base]/Patient/$export?_type=Patient,Observation,Condition&_since=2024-01-01T00:00:00Z HTTP/1.1
Accept: application/fhir+json
Prefer: respond-async
Authorization: Bearer [token]
Or as POST with Parameters:
POST [base]/Patient/$export HTTP/1.1
Content-Type: application/fhir+json
Accept: application/fhir+json
Prefer: respond-async
Authorization: Bearer [token]
{
"resourceType": "Parameters",
"parameter": [
{"name": "_type", "valueString": "Patient,Observation,Condition"},
{"name": "_since", "valueInstant": "2024-01-01T00:00:00Z"}
]
}
Success returns 202 Accepted with Content-Location header pointing to the status endpoint.
Poll the status URL using exponential backoff. Respect Retry-After headers.
| Status | Meaning |
| -------------- | ----------------------------------------------- |
| 202 Accepted | In progress. Check X-Progress for percentage. |
| 200 OK | Complete. Body contains the output manifest. |
| 4XX/5XX | Error. Body contains OperationOutcome. |
{
"transactionTime": "2024-06-15T10:30:00Z",
"request": "[original request URL]",
"requiresAccessToken": true,
"output": [
{
"type": "Patient",
"url": "https://example.org/bulk/file1.ndjson",
"count": 1000
},
{
"type": "Observation",
"url": "https://example.org/bulk/file2.ndjson",
"count": 50000
}
],
"deleted": [],
"error": [],
"link": [{ "relation": "next", "url": "[next manifest page]" }]
}
Output files use Newline Delimited JSON. Each line is a complete, valid JSON object representing one FHIR resource.
{"resourceType":"Patient","id":"p1","name":[{"family":"Smith"}]}
{"resourceType":"Patient","id":"p2","name":[{"family":"Jones"}]}
Rules:
\n (optionally preceded by \r)application/x-ndjson or application/fhir+ndjsonBulk Data servers should implement SMART Backend Services authorisation (OAuth 2.0 client credentials flow with JWT assertion).
See references/authorization.md for implementation details.
Servers return OperationOutcome resources for errors:
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "error",
"code": "processing",
"diagnostics": "Export failed: insufficient permissions"
}
]
}
Common error scenarios:
429 Too Many Requests: Rate limited. Respect Retry-After.401 Unauthorized: Token expired or invalid.404 Not Found: Export job deleted or never existed.After downloading all files, send DELETE to the status URL to signal completion and allow server cleanup.
Servers declare bulk data support in their CapabilityStatement:
{
"instantiates": [
"http://hl7.org/fhir/uv/bulkdata/CapabilityStatement/bulk-data"
]
}
tools
Expert guidance for using WireMock in Java applications for HTTP API mocking and testing. Use this skill when the user asks to mock HTTP APIs, create API stubs, test REST clients, simulate network faults, verify HTTP requests, or integrate WireMock with Spring Boot. Trigger keywords include "wiremock", "mock http", "stub api", "http mock", "api testing", "rest mock", "simulate fault", "verify request", "spring boot wiremock".
documentation
Expert guidance for implementing SQL on FHIR v2 ViewDefinitions and operations to create portable, tabular projections of FHIR data. Use this skill when the user asks to create ViewDefinitions, flatten FHIR resources into tables, write FHIRPath expressions for data extraction, implement forEach/forEachOrNull/repeat patterns for unnesting, create where clauses for filtering, use constants in view definitions, combine data with unionAll, execute ViewDefinitions with $run or $export operations, or implement SQL on FHIR server capabilities. Trigger keywords include "ViewDefinition", "SQL on FHIR", "flatten FHIR", "tabular FHIR", "FHIR to SQL", "FHIR analytics", "FHIRPath columns", "unnest FHIR", "$viewdefinition-run", "$export", "view runner", "repeat", "recursive", "QuestionnaireResponse".
development
Expert guidance for working with the Apache Spark Catalyst query optimisation framework. Use this skill when working with Spark SQL internals, creating custom expressions, implementing query optimisations, working with logical/physical plans, or extending Catalyst. Trigger keywords include "catalyst", "spark sql", "expression", "logical plan", "physical plan", "tree node", "query optimisation", "rule executor", "analyzer", "optimizer", "code generation".
development
Expert guidance for using the SonarCloud API to interact with code quality analysis, projects, issues, quality gates, and metrics. Use this skill when making API calls to SonarCloud, automating code quality workflows, retrieving analysis results, managing projects programmatically, or integrating SonarCloud with CI/CD pipelines. Trigger keywords include "SonarCloud", "SonarCloud API", "code quality API", "SonarQube Cloud", "quality gate", "code analysis API", "SonarCloud measures", "SonarCloud issues".