Skip to content

SQL-on-FHIR review follow-ups: route guard + typed toJson#39

Open
aks129 wants to merge 1 commit into
cqframework:sql-on-fhirfrom
aks129:sql-on-fhir-review-followup
Open

SQL-on-FHIR review follow-ups: route guard + typed toJson#39
aks129 wants to merge 1 commit into
cqframework:sql-on-fhirfrom
aks129:sql-on-fhir-review-followup

Conversation

@aks129
Copy link
Copy Markdown
Collaborator

@aks129 aks129 commented May 27, 2026

Two focused follow-ups from your review on #25, targeting the sql-on-fhir collaboration branch (not master).

Changes

1. Enforce the experimental feature flag at the route level (#23).
The nav menu already gates the /sql link on experimental && developer (your 736c9ae), but the route itself was open — direct navigation to /sql bypassed the flag. Added a matching canActivate guard (sql-on-fhir.guard.ts) that redirects to / when the flag is off. Verified both states in-browser:

  • flags off → /sql redirects to /
  • flags on → /sql loads

2. 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-elm subpath export ships .mjs with no paired types, so CqlTranslator.toJson() isn't visible to consumers even though it's in kotlin/cql-to-elm.d.ts. Swapped the bare as unknown as { toJson } for a named ElmJsonEmitter interface that links the issue.

3. .gitignore — ignore /.claude/ session worktrees/drafts.

Deliberately out of scope

Test plan

  • npm test — 146/146 pass
  • npm run build — clean
  • Manual: /sql guard verified in both flag states

Refs #23. References upstream cqframework/clinical_quality_language#1768.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant