LNK-4704: Added SearchPost query type to FhirQueryModel.Query - #1382
Conversation
📝 WalkthroughWalkthroughThis pull request adds a new case to the Query switch expression in Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In
`@DotNet/DataAcquisition.Domain/Application/Models/Api/Configuration/FhirQueryModel.cs`:
- Around line 30-36: The switch composing the FHIR query string uses
user-controlled QueryParameters directly (in FhirQueryModel's QueryType switch),
risking XSS; sanitize each parameter before joining by applying
HtmlInputSanitizer.Sanitize() or SanitizeAndRemove() to items in QueryParameters
(and use the sanitized list in the Search, SearchPost, Read, and BulkDataPoll
branches) so the returned strings are safe for Admin UI rendering.
🧹 Nitpick comments (1)
DotNet/DataAcquisition.Domain/Application/Models/Api/Configuration/FhirQueryModel.cs (1)
30-37: Add XUnit coverage for the new SearchPost branch.The switch expression was modified; please add XUnit tests covering
FhirQueryType.SearchPost(and optionally the emptyResourceTypesguard) to prevent regressions. As per coding guidelines, each branch in a modified switch should have a unit test.
🛠️ Description of Changes
The new SearchPost query type was missing from FhirQueryModel.Query. This mostly affected the Admin UI not showing what the search criteria was for a query done using SearchPost.
🧪 Testing Performed
Generated a report and was able to see the query body show in the UI:

🧑🔬 Unit Testing
N/A
📓 Documentation Updated
N/A
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.