Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It displays centers for both 45+ and 18+. This will not work in a scenario where min_age_booking is above 45 and if the location you are searching for opens up slots for only 18+, it will try to book that and throw an error. Refer this
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.
Dosen't 18+ means anyone above 18? or is those centers only for 18-45 only. If 18+ centers is only for 18-45 then, then this will end up with the error for person aboue 45. But that opens up a new question then what does 40+ (and other age classes) mean? 40-45?
But if 18+ means anyone above 18, then in the current function
filter_centers_by_age
(in the main branch) will filter out 40+ sessions for a person with age 42. Also, if this is the case I don't think we need the functionfilter_centers_by_age
altogether as theviable_options
function clearly filters the sessions based on age.Can you clarify if booking a 18+ session for a person with age above 45 will result in an error? If not can I remove the
filter_centers_by_age
function altogether and add it to this PR?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.
No it doesn't. CoWIN has 2 age grps 18-44 and 45+(and now 40-44 is also there which is very rare)
filter_centers_by_age prints the available centers according to age and then viable option filters them according to dose_no,fee_type and min slots. So no we can't remove it since viable options will not filter by age. Are you suggesting we should merge these 2 functions.
Yes it does give you an error
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.
I disagree with this. This is the data I got from the Ernakulam (Kerala) district data for the date
08-07-2021
for number of session and min_age_limit for each session.So, I think in some regions there are more age ranges. Also as mentioned here, there are other age limits too.
I think the function filters according to age as seen in this line. But if there is a problem like the error you mentioned is there with age classes, I accept that a filter like
filter_centers_by_age
function is needed . But then why is theviable_options
function again filtering based on age?But even as such the issue #494 still exists but I am closing this PR.
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.
Yeah I saw that the age group filters on portal end are still 18-44 and 45+. 40+ is actually for 40-44 and is displayed under 18-44

They should actually have a field for max age as well, then it would be easier to filter them out.
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.
I agree, there is no point in filtering out by age again in viable options since we are already doing that in filter_centers_by_age func
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.
It seems like there are very few centers like these with these varying age grp restrictions. So as of now we can hold off this PR and keep issue #494 open.
We probably need to see the min and max limit of every age group and accordingly need to implement the logic