fhir-structuredefinition

Explain FHIR StructureDefinition and ElementDefinition components for validation.

2|Updated Feb 14, 2025
One-click install
npx skills add https://github.com/gofhir/validator --skill fhir-structuredefinition
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fhir-structuredefinition
Source: https://github.com/gofhir/validator/tree/main/.claude/skills/fhir-structuredefinition
Command: npx skills add https://github.com/gofhir/validator --skill fhir-structuredefinition

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide to understanding and working with FHIR StructureDefinitions and ElementDefinitions, crucial for FHIR data validation and manipulation.

Core Features & Use Cases

  • StructureDefinition Anatomy: Understand the components of a StructureDefinition, including kind, type, baseDefinition, snapshot, and differential.
  • ElementDefinition Deep Dive: Learn about path, min, max, type, binding, constraint, fixed[x], pattern[x], and slicing.
  • Use Case: When debugging why a FHIR resource fails validation, use this Skill to inspect the relevant StructureDefinition and ElementDefinition to pinpoint the exact rule being violated.

Quick Start

Explain the anatomy of a FHIR StructureDefinition.

Frequently Asked Questions about fhir-structuredefinition

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

FAQPage Schema
How do I debug a FHIR resource that fails validation?

To debug FHIR validation failures, inspect the StructureDefinition and ElementDefinition to pinpoint the exact rule being violated. Check elements like path, cardinality, type, binding, and constraints to identify mismatches in your resource data.

What is the difference between snapshot and differential in a FHIR StructureDefinition?

In a FHIR StructureDefinition, the differential section contains only the changes from the base definition, while the snapshot section provides the complete, resolved list of all elements. The snapshot is typically used for validation and data manipulation.

How do I use ElementDefinition slicing in FHIR profiling?

In FHIR profiling, ElementDefinition slicing divides a set of repeated elements into distinct groups to enforce specific constraints on each slice. You define slicing rules using the slicing element within an ElementDefinition to differentiate and validate repeating data segments.

How does FHIRPath work with StructureDefinition constraints?

FHIRPath expressions are used within StructureDefinition constraints to define custom validation rules. They allow you to evaluate logical conditions against the resource data, ensuring that specific elements meet complex criteria beyond standard cardinality and type checks.

What are the key components of a FHIR StructureDefinition?

Key components of a FHIR StructureDefinition include kind, type, baseDefinition, snapshot, and differential. These elements define whether the resource is a profile or extension, its base structure, and the resolved or differential list of ElementDefinitions for validation.