The ROOT_NODE keyword list (used to recognise FHIR resource type names as path root tokens) is hardcoded from R4. This causes two classes of problems:
R5-only resources are absent
New R5 resources such as ActorDefinition, Requirements, Transport, SubscriptionStatus,
SubscriptionTopic, TestPlan, GenomicStudy, FormularyItem, InventoryReport, and
NutritionProduct are not in the list. FHIRPath expressions starting with any of these type
names will fail to parse as root paths when working against R5 resources.
R4-only removed resources are still present
Resources removed in R5 (e.g. CatalogEntry, MedicinalProduct, all MedicinalProduct*
variants, SubstanceSpecification, SubstanceNucleicAcid, SubstancePolymer, etc.) remain
in the list. Since the lexer is shared across all releases this pollutes the keyword vocabulary.
Suggested fix
The ROOT_NODE list should be generated per FHIR release from the type registry rather than
hardcoded. The lexer (or parser) should receive the active release context so it can use the
appropriate set of resource type names. A quick interim fix would be to take the union of R4
and R5 names so neither release is broken, while the proper fix builds the list dynamically.
Alternatively, the union could be kept and a dynamic check against the registry could be done at the Root.evaluate() class-level,
The
ROOT_NODEkeyword list (used to recognise FHIR resource type names as path root tokens) is hardcoded from R4. This causes two classes of problems:R5-only resources are absent
New R5 resources such as
ActorDefinition,Requirements,Transport,SubscriptionStatus,SubscriptionTopic,TestPlan,GenomicStudy,FormularyItem,InventoryReport, andNutritionProductare not in the list. FHIRPath expressions starting with any of these typenames will fail to parse as root paths when working against R5 resources.
R4-only removed resources are still present
Resources removed in R5 (e.g.
CatalogEntry,MedicinalProduct, allMedicinalProduct*variants,
SubstanceSpecification,SubstanceNucleicAcid,SubstancePolymer, etc.) remainin the list. Since the lexer is shared across all releases this pollutes the keyword vocabulary.
Suggested fix
The
ROOT_NODElist should be generated per FHIR release from the type registry rather thanhardcoded. The lexer (or parser) should receive the active release context so it can use the
appropriate set of resource type names. A quick interim fix would be to take the union of R4
and R5 names so neither release is broken, while the proper fix builds the list dynamically.
Alternatively, the union could be kept and a dynamic check against the registry could be done at the
Root.evaluate()class-level,