SQL-on-FHIR review follow-ups: route guard + typed toJson#39
Open
aks129 wants to merge 1 commit into
Open
Conversation
Two focused fixes from the PR cqframework#25 review, targeting the sql-on-fhir collaboration branch: - Enforce the experimental feature flag at the route level (cqframework#23). The nav menu already gates the /sql link on experimental + developer; this adds a matching canActivate guard so direct URL navigation to /sql also respects the flag (redirects to / when off). Verified both states in-browser. - Replace the bare `as unknown as { toJson }` cast in TranslationService with a named ElmJsonEmitter interface, linking the upstream packaging issue (cqframework/clinical_quality_language#1768) where the @cqframework/cql cql-to-elm subpath ships .mjs with no paired `types`. Addresses the inline review comment. - .gitignore: ignore /.claude/ session worktrees/drafts. Docs and example relocation intentionally left out of this PR — those overlap with in-flight refactoring on this branch and are better settled at our touch-base. 146/146 tests pass; build clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two focused follow-ups from your review on #25, targeting the
sql-on-fhircollaboration branch (not master).Changes
1. Enforce the experimental feature flag at the route level (#23).
The nav menu already gates the
/sqllink onexperimental && developer(your 736c9ae), but the route itself was open — direct navigation to/sqlbypassed the flag. Added a matchingcanActivateguard (sql-on-fhir.guard.ts) that redirects to/when the flag is off. Verified both states in-browser:/sqlredirects to//sqlloads2. Replace the
toJson()cast with a typed interface (your inline comment — "should this be reported upstream?").Yes — filed cqframework/clinical_quality_language#1768: the
@cqframework/cql/cql-to-elmsubpath export ships.mjswith no pairedtypes, soCqlTranslator.toJson()isn't visible to consumers even though it's inkotlin/cql-to-elm.d.ts. Swapped the bareas unknown as { toJson }for a namedElmJsonEmitterinterface that links the issue.3.
.gitignore— ignore/.claude/session worktrees/drafts.Deliberately out of scope
services/sql-on-fhir/, etc.). Better to settle at our touch-base so I don't conflict with your changes.Test plan
npm test— 146/146 passnpm run build— clean/sqlguard verified in both flag statesRefs #23. References upstream cqframework/clinical_quality_language#1768.