-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds functionality for last_consultation_admitted_bed_type_list
in discharge patient filters
#2204
Conversation
QA test failed, @skks1212 make the necessary fixes |
…charge-admitted-to-filter
QA test failed, @skks1212 make the necessary fixes |
…charge-admitted-to-filter
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2204 +/- ##
===========================================
+ Coverage 65.49% 65.50% +0.01%
===========================================
Files 243 243
Lines 14054 14070 +16
Branches 1949 1952 +3
===========================================
+ Hits 9204 9217 +13
- Misses 4464 4465 +1
- Partials 386 388 +2 ☔ View full report in Codecov by Sentry. |
LGTM |
…charge-admitted-to-filter
@skks1212 can you modify the test as requested before proceeding to further review |
@sainak made requested changes, please review |
queryset = ( | ||
PatientRegistration.objects.select_related( | ||
PatientRegistration.objects.annotate( | ||
last_discharge_consultation__id=Subquery( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You dont need to explicitly specify it as a subquery, it should automatically understand that its a subquery.
ids = Something.objects.values_list('id', flat=True)
SomethingElse.objects.filter(something_id__in=ids)
Will only have one query.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But will it not be required to use OuterRef?
…charge-admitted-to-filter
Lint failing but I have no idea why.
These files are not related to the PR |
filters.DjangoFilterBackend, | ||
rest_framework_filters.OrderingFilter, | ||
PatientCustomOrderingFilter, | ||
) | ||
filterset_class = PatientFilterSet | ||
filterset_class = DischargePatientFilterSet | ||
queryset = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shivankacker This seems like a pretty complex query. Can you add a simple comment about what this filter does?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anroopak I have added some documentation for the filter, please have a look
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignore this approval
Proposed Changes
last_consultation_admitted_bed_type_list
filter in Discharge Patient ViewsetAssociated Issue
Merge Checklist
/docs
Only PR's with test cases included and passing lint and test pipelines will be reviewed
@coronasafe/care-backend-maintainers @coronasafe/care-backend-admins