Skip to content
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

[instrument_list/battery] Clean-up battery retrieval function #7167

Merged
merged 4 commits into from
Aug 26, 2021

Conversation

ridz1208
Copy link
Collaborator

@ridz1208 ridz1208 commented Dec 3, 2020

Brief summary of changes

  1. Removed getBatteryInstrumentList function from the instrument_list module and made it query the data from the correct place which is the NDB_BVL_Battery class
  2. Modified query in NDB_BVL_Battery to remove duplicate returns and avoid "jumpy" test_names depending on if an instrument_order is defined or not (see individual comments below for more details)
  3. Removed unused/inaccurate parameters for Battery functions in Battery class. The parameters STAGE, SUBPROJECTID and VISIT LABEL should all be queried from the session itself (Which was already mandatory to define. see _assertBatterySelected) but are also either completely unsued in these functions or not necessary at all.

Testing instructions (if applicable)

@jesscall @sruthymathew123 @zaliqarosli each of you should test this on at least a handful of timepoints since you all use different functionalities affecting the instrument list module

  • QPN uses instruments at the "Not Started" stage which might be affected by these modifications
  • IBIS has several test_batteries which diverge from the "defined batteries" which is what the now deleted function was added for in the first place (see Instrument_list query mod to left join on test battery #2006). Also can test compatibility with survey instruments
  • CCNA uses instrument ordering as well as manual addition of individual instruments to sessions

make sure:

  1. instrument ordering works when order is defined in the battery table
  2. if ordering is not defined for some or all of the instruments, order should default to Full Name displayed
  3. ALL instruments in the flag table for that session appear in the instrument_list module, even instruments which are not in the test_battery defined for that session (ie survey instruments and manually added instruments)
  4. Control panel properly checks that all instruments are complete in order to allow pass/fail changes and completion of the session (this functionality depends on being able to query all instruments of the session)

}

if (Utility::columnsHasNull('test_subgroups', 'group_order')) {
$query = "SELECT DISTINCT f.Test_name,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be converted to a group BY to avoid start next stage duplication issues

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this still need to be resolved?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes but its unrelated to the survey_accounts bug if thats what you were thinking

@ridz1208 ridz1208 added the State: Needs work PR awaiting additional work by the author to proceed label Dec 23, 2020
@zaliqarosli zaliqarosli added the State: Needs rebase PR that needs to be rebased to proceed (conflicts, wrong branch...) label Jan 11, 2021
@ridz1208 ridz1208 removed State: Needs rebase PR that needs to be rebased to proceed (conflicts, wrong branch...) State: Needs work PR awaiting additional work by the author to proceed labels Jan 20, 2021
@ridz1208
Copy link
Collaborator Author

@jesscall @CamilleBeau @pierre-p-s I need someone from CCNA to test this one, you guys have the more complex batteries and use all sorts of ordering.

read the description carefully, theres a bunch of clean up here and testing should be rigorous

@zaliqarosli
Copy link
Contributor

zaliqarosli commented Feb 11, 2021

@ridz1208 does this fix a specific issue? I am wondering if this PR indeed fixes the error you get when you try to 'Start Visit Stage' on a session that already has a survey created i.e. a test battery generated, blocking the rest of the instruments in the test battery from getting populated

@ridz1208
Copy link
Collaborator Author

@zaliqarosli no this might fix instruments not displaying in the same order when you load instrument_list multiple times. the issue you are talking about was however fixed in a different PR

Copy link
Contributor

@pierre-p-s pierre-p-s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and the ordering seemed to be working. Pass fail function worked as intended.

Comment on lines +314 to +336
AND (s.SubprojectID=b.SubprojectID OR b.SubprojectID IS NULL)
AND (s.Visit_label=b.Visit_label OR b.Visit_label IS NULL)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you check for Null subproject IDs or visit labels?
Shouldnt the instruments in the test battery always have those information?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// get the list of instruments
$rows = $DB->pselect($query, $qparams);

// return all the data selected
return $rows;
} // end getBatteryVerbose()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There s the same thing line 284 for the getBattery function

@cmadjar
Copy link
Collaborator

cmadjar commented Jun 8, 2021

@ridz1208 can you rebase and integrate Pierre's feedback? Thanks!

@ridz1208 ridz1208 force-pushed the battery_in_the_wrong_place branch from 7acf8a7 to ad121d0 Compare June 15, 2021 12:35
@ridz1208
Copy link
Collaborator Author

@pierre-p-s please re-review/re-test

@zaliqarosli if you can find some time to test (see description for more)

@pierre-p-s pierre-p-s added the Passed manual tests PR has been successfully tested by at least one peer label Jun 28, 2021
@pierre-p-s
Copy link
Contributor

Manual test and review worked.

However we found an issue in the patch 2020-02-10_NewModulePermissions.sql in SQL/New_patches with @ridz1208. Should I make an issue?

@ridz1208
Copy link
Collaborator Author

@pierre-p-s let's investigate that together for another 10 minutes before doing that.

@ridz1208
Copy link
Collaborator Author

ridz1208 commented Aug 5, 2021

@zaliqarosli waiting on your testing

@zaliqarosli
Copy link
Contributor

testing on QPN data:

  • instruments defined at the "Not Started" stage populated in the test battery table on instrument_list page i.e. not affected by changes in this PR
  • instrument ordering and default ordering by Full Name if instr_order field is NULL works as described in this PR
  • survey instruments (not defined in test_battery) show up on instrument_list page

failed:

  • I am able to set Session BVL QC status to 'Complete' even if instruments are 'In progress'. PR description suggests I shouldn't be able to do this. @ridz1208 is that right?

@ridz1208
Copy link
Collaborator Author

@zaliqarosli testing ITEM 4 involves making sure you can only toggle the VISIT to pass or fail when all instruments are set to complete. Not BVL QC status nor BVL QC type if that's the only issue you found it means this passes tests

Copy link
Contributor

@zaliqarosli zaliqarosli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

passes testing

@ridz1208
Copy link
Collaborator Author

@driusan all urs

@driusan driusan merged commit 697f13d into aces:main Aug 26, 2021
@ridz1208 ridz1208 added this to the 24.0.0 milestone Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Passed manual tests PR has been successfully tested by at least one peer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants