Skip to content

Salient Field Extension

Canonical../StructureDefinition/salient-field
Statusdraft · 1.26.0
BaseExtension (constraint)
ContextStructureDefinition (element)
SourceFSH · JSON

One salient synthesized accessor on a profile: a named, typed FHIRPath value expression over the resource. Drives the reader/render surface (the AI chart) and the facade's salient accessors, distinct from the validation-scoped element set.

FSH

The authored source of truth: extensions/SalientField.fsh (edit on GitHub). One FSH file may define several related artifacts.

// SalientField.fsh
// Declares one SALIENT synthesized accessor on a profile: a named, typed FHIRPath VALUE expression
// over the resource. Salience is "what matters about a resource" — the reader/render surface the
// AI chart and the facade's salient accessors are code-generated from (TypedFhir facade codegen),
// distinct from the validation-scoped element set. Applied at the StructureDefinition level as a
// repeating extension (one per salient field); authored terse via the `Salient` RuleSet.

Extension: SalientField
Id: salient-field
Title: "Salient Field"
Description: "One salient synthesized accessor on a profile: a named, typed FHIRPath value expression over the resource. Drives the reader/render surface (the AI chart) and the facade's salient accessors, distinct from the validation-scoped element set."
* ^url = "../StructureDefinition/salient-field"
* ^status = #draft
* ^context[0].type = #element
* ^context[0].expression = "StructureDefinition"
// PROSE. A salient field carries the SAME three prose fields an ElementDefinition does --
// `short`, `definition`, `comment` -- rather than one lumped "description". A salient field is a
// documented member of the profile's surface, so it is describable in the same vocabulary as an
// element, and every consumer then already knows which one it wants: the docs table renders
// `short`, the generated docstring and the pydantic schema carry `definition`, and `comment` earns
// the "there is more here" marker beside the row. A single combined field would have forced each
// consumer to guess which audience the text was written for.
//
// All three are OPTIONAL and INHERIT from the element the expression references when absent (see
// `collectSalient` in TypedFhir's facade-spec.ts), so an element-backed field like `gender` needs
// no prose at all. Overriding earns its keep on DERIVED expressions: the leaf element of
// `name.where(use='official').given.first()` describes given names in general and says nothing
// about official-use filtering, and `comment` is where that context belongs.
* extension contains
    key 1..1 MS and
    expression 1..1 MS and
    type 0..1 and
    chartName 0..1 and
    short 0..1 and
    definition 0..1 and
    comment 0..1
* extension[key].value[x] only code
* extension[key] ^short = "The accessor name (snake_cased in the facade)"
* extension[expression].value[x] only string
* extension[expression] ^short = "A restricted FHIRPath VALUE expression over the resource (raw FHIR)"
* extension[type].value[x] only code
* extension[type] ^short = "The scalar return type (FieldKind: string | code | dateTime | integer | boolean)"
* extension[chartName].value[x] only string
* extension[chartName] ^short = "The rendered attribute name (defaults to key)"
* extension[short].value[x] only string
* extension[short] ^short = "One-line summary, as ElementDefinition.short. Inherited from the referenced element when absent"
* extension[definition].value[x] only markdown
* extension[definition] ^short = "Full definition, as ElementDefinition.definition. Carried into the generated docstring and the pydantic schema, so this is the text an LLM reads"
* extension[comment].value[x] only markdown
* extension[comment] ^short = "Usage notes, as ElementDefinition.comment. Where to say what a derived expression does that its leaf element does not"
* url 1..1
* value[x] 0..0