Skip to content

[DRAFT] Add normalized FHIR query shape to SQL comments - #5795

Draft
Mikael Weaver (mikaelweave) wants to merge 3 commits into
mainfrom
personal/mikaelw/log-normalized-fhir-query
Draft

[DRAFT] Add normalized FHIR query shape to SQL comments#5795
Mikael Weaver (mikaelweave) wants to merge 3 commits into
mainfrom
personal/mikaelw/log-normalized-fhir-query

Conversation

@mikaelweave

Copy link
Copy Markdown
Contributor

Build a bounded, value-free query shape in SearchOptionsFactory from the resolved search scope and accepted parameter names. Preserve modifiers, chains, controls, and repeated names; sort ordinally; replace unsupported names with a fixed marker; and sanitize comment-breaking content.

Append the shape to existing SQL parameter-hash comments without changing query semantics or the custom-query hash, including SQL with multiple hash comments. Document the covered search path and add focused normalization, factory, SQL-generation, and hash-compatibility tests.

Description

Describe the changes in this PR.

Related issues

Addresses [issue #].

Testing

Describe how this change was tested.

FHIR Team Checklist

  • Update the title of the PR to be succinct and less than 65 characters
  • Add a milestone to the PR for the sprint that it is merged (i.e. add S47)
  • Tag the PR with the type of update: Bug, Build, Dependencies, Enhancement, New-Feature or Documentation
  • Tag the PR with Open source, Azure API for FHIR (CosmosDB or common code) or Azure Healthcare APIs (SQL or common code) to specify where this change is intended to be released.
  • Tag the PR with Schema Version backward compatible or Schema Version backward incompatible or Schema Version unchanged if this adds or updates Sql script which is/is not backward compatible with the code.
  • When changing or adding behavior, if your code modifies the system design or changes design assumptions, please create and include an ADR.
  • CI is green before merge Build Status
  • Review squash-merge requirements

Semver Change (docs)

Patch|Skip|Feature|Breaking (reason)

Build a bounded, value-free query shape in SearchOptionsFactory from the resolved search scope and accepted parameter names. Preserve modifiers, chains, controls, and repeated names; sort ordinally; replace unsupported names with a fixed marker; and sanitize comment-breaking content.

Append the shape to existing SQL parameter-hash comments without changing query semantics or the custom-query hash, including SQL with multiple hash comments. Document the covered search path and add focused normalization, factory, SQL-generation, and hash-compatibility tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Calculate the existing custom-query hash before adding the value-free FHIR shape, pass parsed parameter names directly to normalization, and remove annotation parsing from the hash calculator.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add a standalone value-free FHIR query comment when no parameter hash comment is generated, including query-plan reuse mode. Preserve custom-query hashing against the original unannotated SQL.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.99%. Comparing base (5228336) to head (8f86363).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5795      +/-   ##
==========================================
+ Coverage   78.94%   78.99%   +0.04%     
==========================================
  Files        1016     1017       +1     
  Lines       36910    36945      +35     
  Branches     5616     5628      +12     
==========================================
+ Hits        29139    29184      +45     
+ Misses       6388     6379       -9     
+ Partials     1383     1382       -1     

see 10 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

3 participants