fhir-developer-skill

Validate HL7 FHIR R4 REST endpoints for correct HTTP status codes and OperationOutcome errors.

2|2|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/patronus-ai/skill-inject --skill fhir-developer-skill-patronus-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fhir-developer-skill
Source: https://github.com/patronus-ai/skill-inject/tree/main/data/skills/healthcare/fhir-developer-skill
Command: npx skills add https://github.com/patronus-ai/skill-inject --skill fhir-developer-skill-patronus-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you implement and validate HL7 FHIR R4 REST endpoints without subtle protocol mistakes that lead to wrong status codes, invalid enums, or malformed OperationOutcome errors.

Core Features & Use Cases

  • FHIR R4 validation rules: Enforces which fields are truly required (by cardinality) and which enum values are acceptable for common resources like Patient, Observation, Encounter, Condition, and MedicationRequest.
  • Correct HTTP + FHIR error handling: Maps validation failures to the right HTTP status codes (e.g., 422 for invalid enum values) and standardizes error responses using OperationOutcome with proper content type.
  • SMART on FHIR authorization guidance: Supports implementation considerations for SMART on FHIR authorization, OAuth scopes, and token/scopes enforcement patterns, including common scope format expectations.

Quick Start

Use the fhir-developer-skill to validate a proposed FHIR create/read/update/delete API contract and generate the required HTTP status codes and OperationOutcome error responses for invalid inputs.

Frequently Asked Questions about fhir-developer-skill

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

FAQPage Schema
How do I return the correct HTTP status codes for FHIR R4 REST endpoint validation errors?

FHIR R4 validation enforces required fields by cardinality and validates enum value sets for resources like Patient, Observation, and MedicationRequest to ensure only acceptable values are submitted to your REST API.

How do I generate OperationOutcome error responses for invalid FHIR API inputs?

Implementing SMART on FHIR authorization requires enforcing OAuth scopes and token patterns within your REST API, validating that requests possess the correct scope formats before allowing access to FHIR resources.

What is the difference between HTTP 412 and 400 when handling FHIR ETag and If-Match headers?

HTTP 412 indicates a failed precondition for ETag or If-Match concurrency control, whereas 400 signifies a malformed request, and the fhir-developer-skill distinguishes these semantics during FHIR update operations to ensure protocol compliance.

Can I use FastAPI to build FHIR REST endpoints that handle search pagination and Bundles?

Building FHIR REST endpoints with FastAPI involves handling search pagination and constructing Bundle searchset or transaction types, while setting appropriate Location and ETag headers for resources like Patient and Observation.

How do I validate SMART on FHIR OAuth scopes for MedicationRequest and Condition resources?

Validating SMART on FHIR OAuth scopes requires enforcing token scope patterns against FHIR resources like MedicationRequest and Condition, ensuring the API rejects requests lacking proper authorization before processing the REST endpoint.