fhir-developer

Guides building FHIR R4 REST APIs with correct validation, status codes, and SMART authorization.

51|19|Updated Jan 4, 2025
One-click install
npx skills add https://github.com/HeliosSoftware/hfs --skill fhir-developer-heliossoftware
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: fhir-developer
Source: https://github.com/HeliosSoftware/hfs/tree/main/.claude/skills/fhir-developer
Command: npx skills add https://github.com/HeliosSoftware/hfs --skill fhir-developer-heliossoftware

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires fastapi, uvicorn, pydantic, httpx, pytest, and includes scripts (resource) and references (resource) components.

What problem does it solve? Building FHIR-compliant healthcare APIs requires precise knowledge of resource cardinality, value sets, HTTP status codes, and SMART on FHIR scopes; mistakes like requiring optional fields or returning wrong error codes break interoperability. ## Core Features & Use Cases - FHIR R4 Resource Guidance: Required fields, cardinality rules, value sets, and coding systems (LOINC, SNOMED, RxNorm, ICD-10) for Patient, Observation, Encounter, Condition, and MedicationRequest. - Validation & Error Handling: Correct HTTP status codes (422 for validation, 412 for ETag mismatch) and OperationOutcome error response patterns in FastAPI and Express. - SMART on FHIR & Bundles: OAuth scope syntax (v1/v2), backend services flow, transaction vs batch semantics, and search pagination. - Use Case: Scaffold a new FastAPI FHIR server with correct Pydantic v2 models and Patient CRUD endpoints using the included setup script. ## Quick Start Ask the assistant to create a FHIR Observation endpoint with proper validation and OperationOutcome error responses.

Frequently Asked Questions about fhir-developer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I validate FHIR resources and return correct error responses?▼

Validate only fields with cardinality starting with 1 (e.g., Observation.status and code), returning 422 Unprocessable Entity for missing or invalid values. Wrap all errors in an OperationOutcome resource with severity, code, and diagnostics, using the application/fhir+json content type.

What HTTP status codes should a FHIR REST API return?▼

Return 201 with a Location header on create, 204 on delete, 404 for missing resources, 412 for If-Match ETag mismatches, and 422 for validation failures. A common mistake is returning 400 for enum validation errors instead of 422.

How does SMART on FHIR scope syntax work?▼

SMART v2 scopes follow the pattern context/resource.permissions, such as patient/Observation.rs for read and search. Contexts are patient, user, or system; permissions are c, r, u, d, s. Legacy v1 scopes like patient/Patient.read map to patient/Patient.rs.

What is the difference between FHIR transaction and batch bundles?▼

Transaction bundles are atomic: all entries succeed or the entire bundle rolls back. Batch bundles process each entry independently, allowing partial success with per-entry status codes in the response.

Which fields are required on a FHIR Encounter resource?▼

Only status and class are required on Encounter in FHIR R4. The subject and period fields are 0..1 (optional), and class uses a Coding directly rather than a CodeableConcept.

Can I scaffold a FHIR API project with FastAPI automatically?▼

Yes, run the included scripts/setup_fhir_project.py with a project name to generate a FastAPI project containing Pydantic v2 FHIR models, OperationOutcome helpers, Patient CRUD endpoints, and basic tests.