FHIR / sushi

SUSHI (aka "SUSHI Unshortens Short Hand Inputs") is a reference implementation command-line interpreter/compiler for FHIR Shorthand (FSH).
Apache License 2.0
145 stars 44 forks source link

Improve parsing of date-like names #1352

Closed cmoesel closed 1 year ago

cmoesel commented 1 year ago

This PR allows FSH entities to have names that resemble dates or datetimes, such as 2000, 2000-10, 2000-10-30, etc. Prior to this PR, SUSHI would fail to parse these names.

To support this, the following changes were made to the parser grammar g4 file:

Note that name and path now have identical definitions in the grammar. I decided to leave them both in place rather than consolidating to one since they are semantically distinct and could diverge in the future. But... let me know if you disagree.

I've run a full regression and confirmed that this does not result in any changes to existing repos.

This issue was reported on Zulip here: https://chat.fhir.org/#narrow/stream/215610-shorthand/topic/Certain.20pattern.20not.20allowed.20in.20names.2Finvariants.3F/near/391919370