FHIRPath: Unterminated String Literal
A string literal was opened with a single quote but never closed before the expression ended. The lexer ran out of input while still inside the string.
FHIRPath · Error
The error
Unterminated string literalWhy it happens
A missing closing quote, or an apostrophe inside the string that was not escaped and prematurely matched, throwing off the quote balance.
How to fix it
Close the string with a matching single quote. FHIRPath uses single quotes for string literals. Escape an internal apostrophe with a backslash (\') so it does not end the string early.
Example
The snippet below triggers the error:
Patient.name.where(use = 'officialThe corrected version:
Patient.name.where(use = 'official')Frequently asked questions
Does FHIRPath use single or double quotes?
Single quotes for string literals. Double quotes are used for delimited identifiers, not strings. Mixing them up is a common source of unterminated-string errors.