← ReferenceStandards

What is Slicing?

Slicing splits a repeating element (like identifier[] or coding[]) into named sub-types, each with its own cardinality and constraints. It is used in profiles when different entries in a repeating element have different rules.

The problem slicing solves

A Patient can have multiple identifiers: a national ID, a hospital number, a passport number. Base FHIR says identifier 0..*— any number, any content. A profile might need to say: "the national ID is 0..1 and must use this specific OID, but other identifiers are still allowed." Slicing expresses this.

Slicing structure

  • slicing.discriminator — how entries are assigned to slices. Common discriminator types: value (match by element value), pattern (match by pattern), type (match by data type), exists (match by presence)
  • slicing.rulesopen: unmatched entries allowed (most common) / closed: only defined slices allowed / openAtEnd: defined slices first, then open
  • Each slice is a named element with its own cardinality, path, and constraints

FhirSkPatient — identifier slice by system

"element": [
  {
    "id": "Patient.identifier",
    "path": "Patient.identifier",
    "slicing": {
      "discriminator": [{ "type": "value", "path": "system" }],
      "rules": "open"
    },
    "min": 1
  },
  {
    "id": "Patient.identifier:nationalId",
    "path": "Patient.identifier",
    "sliceName": "nationalId",
    "max": "1"
  },
  {
    "id": "Patient.identifier:nationalId.system",
    "path": "Patient.identifier.system",
    "fixedUri": "urn:oid:2.16.840.1.113883.2.9.4.3.2",
    "min": 1
  }
]