Skip to content

[ENG-558] feat:added created by filter for questionnaire responses#3695

Open
nandkishorr wants to merge 1 commit into
developfrom
ENG-558-add-created-by-filter-for-questionnaire-response
Open

[ENG-558] feat:added created by filter for questionnaire responses#3695
nandkishorr wants to merge 1 commit into
developfrom
ENG-558-add-created-by-filter-for-questionnaire-response

Conversation

@nandkishorr

@nandkishorr nandkishorr commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Proposed Changes

-Added created by filter for questionnaire responses.

Associated Issue

Merge Checklist

  • Tests added/fixed
  • Update docs in /docs
  • Linting Complete
  • Any other necessary step

Only PR's with test cases included and passing lint and test pipelines will be reviewed

@ohcnetwork/care-backend-maintainers @ohcnetwork/care-backend-admins

Summary by CodeRabbit

  • New Features
    • Added a new filter for questionnaire responses, allowing results to be narrowed down by the creator’s external ID.

@nandkishorr nandkishorr self-assigned this Jun 25, 2026
@nandkishorr nandkishorr requested a review from a team as a code owner June 25, 2026 17:13
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 3ea385bf-8dee-436a-8f64-867468b4d12a

📥 Commits

Reviewing files that changed from the base of the PR and between c8baced and 7f9aa69.

📒 Files selected for processing (1)
  • care/emr/api/viewsets/questionnaire_response.py

📝 Walkthrough

Walkthrough

QuestionnaireResponseFilters now accepts a created_by UUID query parameter and filters by created_by__external_id.

Changes

Questionnaire response filtering

Layer / File(s) Summary
Add created_by filter
care/emr/api/viewsets/questionnaire_response.py
QuestionnaireResponseFilters maps created_by to created_by__external_id with a UUIDFilter.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the new questionnaire response created_by filter and matches the change.
Description check ✅ Passed The description follows the template sections and includes the proposed change, associated issue, and merge checklist.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ENG-558-add-created-by-filter-for-questionnaire-response

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.

@greptile-apps

greptile-apps Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds a created_by filter to QuestionnaireResponseFilters, allowing API consumers to narrow questionnaire responses by the UUID of the user who created them.

  • A single filters.UUIDFilter(field_name="created_by__external_id") line is added, matching the established pattern used in invoice.py, payment_reconciliation.py, charge_item.py, and several inventory viewsets.
  • The created_by field is inherited from EMRBaseModel, so no model changes are needed and the ORM traversal is valid.

Confidence Score: 5/5

Minimal, targeted change that adds a read-only filter field following an already-established pattern; no risk of data mutation or permission bypass.

The single-line addition is a straightforward read filter. The field (created_by__external_id) is correctly inherited from EMRBaseModel, the filter type (UUIDFilter) matches every analogous filter in the codebase, and the existing authorization logic in get_queryset is untouched.

No files require special attention.

Important Files Changed

Filename Overview
care/emr/api/viewsets/questionnaire_response.py Adds created_by UUID filter to QuestionnaireResponseFilters; pattern is consistent with other viewsets in the codebase and the field is inherited from EMRBaseModel.

Reviews (1): Last reviewed commit: "feat:added created by filter for questio..." | Re-trigger Greptile

@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.56%. Comparing base (c8baced) to head (7f9aa69).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3695   +/-   ##
========================================
  Coverage    79.55%   79.56%           
========================================
  Files          479      479           
  Lines        22996    22997    +1     
  Branches      2378     2378           
========================================
+ Hits         18295    18298    +3     
+ Misses        4096     4095    -1     
+ Partials       605      604    -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 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.

1 participant