-
Notifications
You must be signed in to change notification settings - Fork 195
[dataquery/dictionary] Remove instruments and visits that the user doesnt have access to #9903
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
[dataquery/dictionary] Remove instruments and visits that the user doesnt have access to #9903
Conversation
| * @return array of study visits in the format array('VL' => 'VL') | ||
| * where VL is the visit label | ||
| */ | ||
| public function getVisits(): array |
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.
@skarya22 this is purely out of personal preference and not at all blocking:
I would use this opportunity to create a getVisits() function in the Project class which knows how to get the visits itself instead of doing these loops through projects...cohorts...visits.
That being said, the efficiency of the code below is basically one query per project per cohort, if you choose to add the function to the project class, you could choose to use getVisitsProjectCohort() from the VisitController class to make it an efficiency of one query per project. ORR if you choose not to create the Projec::getvisits() function you could use getVisitsProjectCohort() from the VisitController class here directly to make it an efficiency of just 1 query!
I'll leave it up to you
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.
|
@skarya22 code looks good! Instruments are fetched from the session/flag table so that's the correct list One comment would be that I'm not sure any of your changes address the visit list displayed next to the field itself when it's chosen. I think the scenario I'm thinking of is, an instrument is administered at multiple visits by different projects (even think of categories like imaging that apply to all visits) when the user selects the category, even though the default visits will be narrowed down to the user's list, the visits for each field still show the entire list of visits for which data exists. If I'm not mistaken ofcourse |
…move_irrelevant_visits_instruments
…move_irrelevant_visits_instruments
GeorgeMurad
left a comment
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.
LGTM
Brief summary of changes
candidate_list/php/candidate_list.class.inchas no affect on anything but the version in options.class.inc is used instead. I deleted the contents of the function because it was code duplication and was confusingupdate test_names set ID = 5 where Test_name = 'aosi'A user with just Project Rye



Testing instructions (if applicable)
Link(s) to related issue(s)