Skip to content

Constrain query and view operation parameters to their profiles - #374

Merged
johngrimes merged 1 commit into
mainfrom
constrain-query-params
Jun 26, 2026
Merged

Constrain query and view operation parameters to their profiles#374
johngrimes merged 1 commit into
mainfrom
constrain-query-params

Conversation

@johngrimes

@johngrimes johngrimes commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Resolves the loose typing reported in #367, plus the agreed consistency expansion across the matching view parameters. The query- and view-bearing parameters in the four data operations were typed too broadly, so the machine-readable OperationDefinitions permitted a reference to, or an inline copy of, any resource where only a SQLQuery/SQLView or a ViewDefinition is meaningful.

This constrains them in input/fsh/operations.fsh:

  • Query parameters (queryReference, queryResource in $sqlquery-run and $sqlquery-export) gain a targetProfile of both the SQLQuery and SQLView profiles (any-of), the inline parameters are typed Library, and their documentation - along with the $sqlquery-export query umbrella - now names both profiles rather than SQLQuery alone.
  • View parameters (viewReference across the operations, and the inline viewResource in both export operations) gain a targetProfile of ViewDefinition, with the inline parameters narrowed from Resource to CanonicalResource to match the existing $viewdefinition-run viewResource precedent.
image

Closes #367.

Tighten the loosely-typed query- and view-bearing parameters across the
four data operations so the machine-readable OperationDefinitions match
their stated intent (issue #367).

The query parameters (queryReference, queryResource in $sqlquery-run and
$sqlquery-export) now carry a targetProfile of both the SQLQuery and
SQLView profiles, with the inline parameters typed Library, and their
documentation names both profiles. The view parameters (viewReference
everywhere, and the inline viewResource in both export operations) now
carry a targetProfile of ViewDefinition, with the inline parameters
narrowed from Resource to CanonicalResource to match the existing
$viewdefinition-run viewResource precedent. patient, group and source
are left unchanged.

This is a constraining change (constitution IV): the parameters move
from unconstrained to profiled. Because the documentation always
described a SQLQuery or SQLView Library or a ViewDefinition, and the
guide is pre-publication (2.1.0-pre), no conforming caller is broken.
@johngrimes
johngrimes marked this pull request as ready for review June 22, 2026 21:38
@johngrimes
johngrimes requested review from niquola and smunini June 22, 2026 21:38
@johngrimes
johngrimes merged commit 07e999c into main Jun 26, 2026
1 check passed
@johngrimes
johngrimes deleted the constrain-query-params branch June 26, 2026 10:41
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.

Constrain queryReference and queryResource to SQLQuery or SQLView in sqlquery-run and sqlquery-export

2 participants