analyzeExpression('Observation.valueQuantity', opts)
// Element 'valueQuantity' is not defined on FHIR.Observation
analyzeExpression('Patient.name.given.substring(1)', opts)
// substring() expects a collection with a single item as input (spec §11)
Typos, choice-key misuse, singleton misuse, equality that can never hold — the whole
class TypeScript's type system can't express. The §11 analyzer reads the expression
against the FHIR model and reports them without touching data. It ships two ways to run:
fhirpath-check, a CLI that scans your .ts/.js files
for FHIRPath literals (tags, compile(), evaluate()) and exits
non-zero on any finding — drop it into a CI step; and
fhirpath/no-invalid-expressions, an ESLint flat-config rule that flags the
same literals inline in your editor and fails eslint. This is the layer the
playground above runs live.