-
Notifications
You must be signed in to change notification settings - Fork 189
[tools] populateage complete revamp #2630
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
Conversation
|
Old behaviour was designed for manually populating candidate ages after data-entry. This script needs testing on large data-sets @gluneau @sruthymathew123 can you please take a look at it ? |
|
@ridz1208: On running the script, I got the below error |
|
@ridz1208 The above candidate is a not active candidate, but have tables associated with it. |
|
@sruthymathew123 I cannot reproduce, lets look at it on your VM ? |
|
@ridz. The query in candidate class on line 61 is failing for the above candidate. That is why the script is failing. |
|
@sruthymathew123 please re-test |
|
PHP Fatal error: Uncaught Exception: Failed to retrieve data for timepoint (2418) in /var/www/loris/php/libraries/TimePoint.class.inc:142 |
|
@sruthymathew123 and now ? |
|
Sorry @ridz1208 PHP Warning: Missing argument 4 for LorisForm::createElement(), called in /var/www/loris/project/instruments/NDB_BVL_Instrument_edi.class.inc on line 473 and defined in /var/www/loris/php/libraries/LorisForm.class.inc on line 1809 |
|
|
||
| // Break if Date taken does not exist | ||
| if (!$DB->columnExists($inst, 'Date_taken')) { | ||
| continue; |
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.
should there be an error message printed here?
|
@driusan error added |
tools/fix_candidate_age.php
Outdated
| // get Age from instrument class | ||
| $calculatedAge = $instrument->getCandidateAge(); | ||
| $agemonths = $calculatedAge['year'] * 12 + $calculatedAge['mon'] + ($calculatedAge['day'] / 30); | ||
| $calculatedAgeMonths = (round($agemonths*10) / 10.0); |
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.
|
@gluneau could you give it a quick try when you have a minute. I removed the code duplication |
|
@kongtiaowang HELP MEEEE |
|
It failed - because this automation test find this |
|
@gluneau please re-test quickly, minor changes took place |
|
Has this been tested in the latest incarnation? It moved from "Needs Testing" without any indication on the PR that that happened.. |
|
Thank you 🙏 |
|
@Jkat believe me MY PLEASURE lol |
The populateage.php tool is completely useless in its current state.
This PR creates a new PHP script that fixes candidate ages.
New functionality has been added:
This tool is designed to fix automatically calculated ages in the databse instrument tables, additional functionality could be added if necessary