Skip to content

LNK-4434: Restore "Query" Description Getter on FhirQueryModel - #1240

Merged
nvmLantana merged 2 commits into
devfrom
nvm/LNK-4434_RestoreQueryDescOnModel
Nov 6, 2025
Merged

LNK-4434: Restore "Query" Description Getter on FhirQueryModel#1240
nvmLantana merged 2 commits into
devfrom
nvm/LNK-4434_RestoreQueryDescOnModel

Conversation

@nvmLantana

@nvmLantana nvmLantana commented Nov 6, 2025

Copy link
Copy Markdown
Contributor

🛠️ Description of Changes

Please provide a high-level overview of the changes included in this PR.

🧪 Testing Performed

Please describe the testing that was performed on the changes included in this PR.

🧑‍🔬 Unit Testing

  • I have written or updated unit tests to cover my changes

📓 Documentation Updated

Please update any relevant sections in the project documentation that were impacted by the changes in the PR.

Summary by CodeRabbit

  • New Features
    • Added intelligent query string generation that automatically constructs appropriate queries based on operation type (Search, Read, and Bulk Data operations).

@coderabbitai

coderabbitai Bot commented Nov 6, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

This change adds a computed Query property to FhirQueryModel that constructs a query string from existing fields based on the query type (Search, Read, BulkDataRequest, or BulkDataPoll), enabling display of queries in the Acquisition Log Details section.

Changes

Cohort / File(s) Change Summary
Query Property Addition
DotNet/DataAcquisition.Domain/Application/Models/Api/Configuration/FhirQueryModel.cs
Introduces a new public Query property that computes a query string from ResourceTypes, QueryType, and QueryParameters. Returns formatted strings for Search ("ResourceType?params"), Read ("ResourceType/params"), BulkDataRequest ("BulkDataRequest"), BulkDataPoll (params only), or empty string as fallback.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Verify the query string construction logic matches expected formats for each QueryType
  • Confirm the property correctly handles edge cases (empty ResourceTypes, null QueryParameters)
  • Validate alignment with UI requirements for displaying acquisition queries

Suggested reviewers

  • smailliwcs
  • dvargaslantana

Poem

🐰 A query lost in silent code, now springs to light,
No more mystery in the logs—each search takes flight!
From ResourceTypes to Parameters so fine,
The Acquisition Details now display and shine! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is a blank template with no actual content filled in; all sections are empty. Fill in the Description of Changes, Testing Performed, unit testing status, and Documentation Updated sections with relevant details.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly references the issue (LNK-4434) and summarizes the main change: restoring a Query property getter on FhirQueryModel.
Linked Issues check ✅ Passed The code change adds the Query getter to FhirQueryModel, which directly addresses the LNK-4434 issue of displaying queries in the Acquisition Log Details UI.
Out of Scope Changes check ✅ Passed The change is limited to adding the Query property to FhirQueryModel and is directly related to the linked issue objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch nvm/LNK-4434_RestoreQueryDescOnModel

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 53bdfa6 and b011f0f.

📒 Files selected for processing (1)
  • DotNet/DataAcquisition.Domain/Application/Models/Api/Configuration/FhirQueryModel.cs (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.cs

⚙️ CodeRabbit configuration file

**/*.cs: The HtmlInputSanitizer class's Sanitize() and SanitizeAndRemove() methods should be used when dealing with string query parameters from REST requests.

Files:

  • DotNet/DataAcquisition.Domain/Application/Models/Api/Configuration/FhirQueryModel.cs
**

⚙️ CodeRabbit configuration file

**: Pull requests that have "TECH_DEBT" in the title should only contain changes related to typos, unused code, linter/IDE suggestions, swagger specification updates,
and logging improvements. These TECH_DEBT PRs must not affect core functionality. All PRs that are not considered technical debt must include information on what
testing was performed in the description of the PR. If it does not, ask the author to provide details on what testing was performed.
When reviewing code, suggest unit tests using XUnit in the following scenarios:

  • If/Else or Switch/Case blocks are introduced or modified — ensure each branch has a corresponding unit test.
  • Logic that depends on service or interface configuration — suggest tests to validate different implementations are correctly resolved.
  • No network activity (HTTP calls, sockets, etc.) should appear in unit tests. Recommend using mocks (via Moq) for any external communication.
    Large unit tests should be avoided; keeping unit tests small and focused on targeted business logic (i.e. string sanitization)

**: Pull requests that have DOCS in the title should only contain changes related to documentation within the /docs folder or in .md files through-out the code-base. The description
of the PR should specify what documentation was updated. Documentation updates should use EventCatalog.dev structure, where service-specific functionality should be described
in the service's index.mdx (i.e. /services/XXX/index.mdx or /domains/XXX/services/YYY/index.mdx). Configurations that are shared by multiple services should be
reflected in the /docs/docs/config files.

Files:

  • DotNet/DataAcquisition.Domain/Application/Models/Api/Configuration/FhirQueryModel.cs
🧬 Code graph analysis (1)
DotNet/DataAcquisition.Domain/Application/Models/Api/Configuration/FhirQueryModel.cs (1)
DotNet/DataAcquisition.Domain/Infrastructure/Models/Enums/FhirQueryType.cs (1)
  • FhirQueryType (18-28)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Unit Tests for DotNet
  • GitHub Check: Unit Tests for Java
  • GitHub Check: Smoke Test with Docker Compose
  • GitHub Check: Integration Tests
  • GitHub Check: Analyze (java-kotlin)
  • GitHub Check: Analyze (csharp)
🔇 Additional comments (1)
DotNet/DataAcquisition.Domain/Application/Models/Api/Configuration/FhirQueryModel.cs (1)

23-39: Missing PR testing documentation; latent bug in Read query logic; unit tests required.

  1. PR description missing testing information: Per the PR template, the "🧪 Testing Performed" section requires a description of testing. Please provide details on what testing was performed for this change.

  2. Read query logic has a latent bug: The Read case at line 33 constructs {ResourceTypes[0]}/{string.Join("&", QueryParameters)}. Per FHIR specification, a Read operation uses the format GET [base]/[type]/[id]—only a single ID, not query parameters joined with &. While the ExecuteRead service currently bypasses this property and doesn't trigger the bug, the logic is semantically incorrect. If QueryParameters is populated for a Read query or the Query property is used differently in the future, this produces malformed FHIR URLs. Consider either:

    • Adding a guard to throw when Read is used with non-empty QueryParameters, or
    • Extracting only the first parameter as the ID for Read queries
  3. Unit tests needed: Per coding guidelines, switch/case blocks require unit tests covering each branch:

    • Search with various parameters
    • Read with empty parameters (current case)
    • BulkDataPoll parameter joining
    • ResourceTypes empty returns empty string
    • Each default case behavior

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@arianamihailescu arianamihailescu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like necessary

@nvmLantana
nvmLantana merged commit c2a571a into dev Nov 6, 2025
18 checks passed
@nvmLantana
nvmLantana deleted the nvm/LNK-4434_RestoreQueryDescOnModel branch November 6, 2025 17:33
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