Skip to content

CompartmentDefinition resource (FHIR R4)

CompartmentDefinition is the FHIR R4 resource for a compartment definition that defines how resources are accessed on a server.

ResourceCompartmentDefinition
FHIR versionR4 (4.0.1)
Canonical URLhttp://hl7.org/fhir/StructureDefinition/CompartmentDefinition
Required elementsurl (1..1), name (1..1), status (1..1), code (1..1), search (1..1)

Example

{
  "resourceType": "CompartmentDefinition",
  "id": "compartmentdefinition-ea652d6fca216835dbc8ea9e4b8a8268",
  "url": "http://example.org/pidgeon/synthetic",
  "name": "Synthetic value",
  "status": "draft",
  "code": "Patient",
  "search": true
}

Generated by the Pidgeon engine: pidgeon generate CompartmentDefinition --seed 20260722.

Validation context

  • strict pidgeon validate grades a CompartmentDefinition instance against the base R4 structure definition: missing required elements raise REQUIRED_FIELD_MISSING and cardinality violations raise CARDINALITY_MIN or CARDINALITY_MAX.(REQUIRED_FIELD_MISSING)

This answer, in your terminal

pidgeon lookup CompartmentDefinition

Wire it into your AI agent:

claude mcp add pidgeon -- npx -y @pidgeonhealth/mcp

Download Post free to browse this reference with generation attached.

FHIR® R4 © Health Level Seven International. FHIR R4 specification content is used under its CC0 license; this page is a derivative work and is not endorsed by HL7 International.

HL7® and FHIR® are registered trademarks of Health Level Seven International.

Published by Pattern Engine LLC (Pidgeon Health).

Rendered from the same machine-readable definitions the Pidgeon engine validates against. Exported from the Pidgeon engine's FHIR R4 definitions (CC0); example generated with seed 20260722.