Skip to content

Commit

Permalink
Merge pull request #11 from zaliqarosli/2020-02-05-DisplayInstCandAge…
Browse files Browse the repository at this point in the history
…InYears

[Instrument] Change Candidate Age display to 'Years'
  • Loading branch information
zaliqarosli authored Feb 5, 2020
2 parents f953497 + 88af636 commit 3a25a24
Show file tree
Hide file tree
Showing 3 changed files with 931 additions and 2 deletions.
2 changes: 1 addition & 1 deletion instruments/NeuropsychologyEvaluation.linst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
table{@}NeuropsychologyEvaluation
title{@}Neuropsychology Evaluation
date{@}Date_taken{@}Date of Administration{@}2014{@}2030
static{@}Candidate_Age{@}Candidate Age (Months)
static{@}Candidate_Age{@}Candidate Age (Years)
static{@}Window_Difference{@}Window Difference (+/- Days)
select{@}Examiner{@}Examiner{@}NULL=>''
header{@}{@}Memory
Expand Down
7 changes: 6 additions & 1 deletion libraries/NDB_BVL_Instrument.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,11 @@ abstract class NDB_BVL_Instrument extends NDB_Page
$this->dateTimeFields = array("Date_taken");
}

// Convert Candidate_Age from months to years for display
if (!empty($defaults['Candidate_Age'])) {
$defaults['Candidate_Age'] = $this->getCandidateAge()['year'];
}

if (isset($defaults['Window_Difference'])
&& $defaults['Window_Difference'] != 0
) {
Expand Down Expand Up @@ -846,7 +851,7 @@ abstract class NDB_BVL_Instrument extends NDB_Page
if (strrpos($this->testName, '_proband') === false) {
$this->addScoreColumn(
'Candidate_Age',
'Candidate Age (Months)'
'Candidate Age (Years)'
);
$this->addScoreColumn(
'Window_Difference',
Expand Down
Loading

0 comments on commit 3a25a24

Please sign in to comment.