Skip to content

Correctness Rules

Correctness rules ensure that your FSH code complies with the FHIR specification and prevent syntax errors, semantic violations, and runtime issues.

Name: Invalid Keyword Severity: 🔴 Error Fixable: Yes Implementation: GritQL

Detects invalid or misspelled FSH keywords like ‘Profil’ instead of ‘Profile’

Tags: correctness, keywords

Configuration:

{
"linter": {
"rules": {
"correctness/invalid-keyword": "error"
}
}
}

Learn more: Invalid Keyword


Name: Malformed Alias Severity: 🔴 Error Fixable: Yes Implementation: GritQL

Detects malformed alias declarations with syntax errors

Tags: correctness, alias

Configuration:

{
"linter": {
"rules": {
"correctness/malformed-alias": "error"
}
}
}

Learn more: Malformed Alias


Name: Invalid Caret Path Severity: 🔴 Error Fixable: No Implementation: GritQL

Detects invalid caret path syntax in FSH rules

Tags: correctness, caret, path

Configuration:

{
"linter": {
"rules": {
"correctness/invalid-caret-path": "error"
}
}
}

Learn more: Invalid Caret Path


Name: Missing Profile ID Severity: 🔴 Error Fixable: No Implementation: GritQL

Detects profile declarations without proper identifiers

Tags: correctness, profile, id

Configuration:

{
"linter": {
"rules": {
"correctness/missing-profile-id": "error"
}
}
}

Learn more: Missing Profile ID


Name: Invalid Identifier Severity: 🔴 Error Fixable: Yes Implementation: GritQL

Detects invalid identifier syntax in FSH files

Tags: correctness, identifier

Configuration:

{
"linter": {
"rules": {
"correctness/invalid-identifier": "error"
}
}
}

Learn more: Invalid Identifier


Name: Invalid Slicing Severity: 🔴 Error Fixable: No Implementation: GritQL

Detects invalid slicing rule syntax and semantic issues

Tags: correctness, slicing

Configuration:

{
"linter": {
"rules": {
"correctness/invalid-slicing": "error"
}
}
}

Learn more: Invalid Slicing


Name: Invalid Constraint Severity: 🔴 Error Fixable: No Implementation: GritQL

Detects invalid constraint expressions and FHIRPath syntax

Tags: correctness, constraint, fhirpath

Configuration:

{
"linter": {
"rules": {
"correctness/invalid-constraint": "error"
}
}
}

Learn more: Invalid Constraint


Name: Missing Parent Profile Severity: 🟡 Warning Fixable: Yes Implementation: GritQL

Detects profiles without explicit parent profile declarations

Tags: correctness, profile, parent

Configuration:

{
"linter": {
"rules": {
"correctness/missing-parent-profile": "warn"
}
}
}

Learn more: Missing Parent Profile


Name: Invalid Status Severity: 🔴 Error Fixable: Yes Implementation: GritQL

Detects invalid status values in FHIR resource metadata

Tags: correctness, metadata, status

Configuration:

{
"linter": {
"rules": {
"correctness/invalid-status": "error"
}
}
}

Learn more: Invalid Status


Name: Profile Assignment Present Severity: 🟡 Warning Fixable: No Implementation: AST

Ensures that profiles have ^status and ^abstract assignments, and Parent declarations

Tags: correctness, profile, metadata

Configuration:

{
"linter": {
"rules": {
"correctness/profile-assignment-present": "warn"
}
}
}

Learn more: Profile Assignment Present


Name: Extension Context Missing Severity: 🔴 Error Fixable: No Implementation: AST

Ensures that extensions have ^context specifications indicating where they can be applied

Tags: correctness, extension, context

Configuration:

{
"linter": {
"rules": {
"correctness/extension-context-missing": "error"
}
}
}

Learn more: Extension Context Missing