Skip to content

Commit 14b26c7

Browse files
authored
[instruments] Display Candidate Age at Death if postMortem is true (#8362)
- fixes the Candidate Age at Death field label and Data Dictionary item for LINST instruments - adds postMortem functionality for LINST instruments - solidifies workflow for when Candidate Age at Death is displayed vs. Candidate Age (only when postMortem variable is set to true, and is independent of whether candidate has DoD or not - it is truly an instrument configuration and not dependent on instrument/candidate data) - adds this workflow/configuration to the instruments module testplan and readme
1 parent 506b920 commit 14b26c7

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

modules/instruments/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ and put in the `project/instruments`.
3434
Individual instruments may contain their own configurations (such
3535
as requiring tables to be created or lookup tables.)
3636

37+
If the instrument is administered after the candidate's death,
38+
the `postMortem` variable can be set to true within the
39+
`NDB_BVL_Instrument` class or the `postmortem` tag set to true
40+
within the linst instrument meta file. This configuration
41+
determines which candidate age is displayed as part of the
42+
metadata fields: `Candidate Age (Months)` or
43+
`Candidate Age at Death (Months)`.
44+
3745
## Interactions with LORIS
3846

3947
The survey module uses instruments of the same format as data entry

modules/instruments/test/TestPlan.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ saved data stays the same. The data that wasn't saved should be lost.
2121
6. Make sure that the 'Delete instrument data' button on the left pane is only visible when the user
2222
has the 'Send to DCC' permission.
2323
7. Click on the 'Delete instrument data' button and check if the instrument's data is cleared.
24-
8. Select a candidate with a Date Of Death (DoD) or put one in for a candidate as needed, then select an
25-
instrument for that candidate. Enter a date (same a step 4) posterior to the DoD. Refresh the page and check that the
26-
'Candidate age' label change to 'Candidate Age at Death'.
24+
8. Check that an instrument with the `postMortem` variable set to true displays the label
25+
'Candidate Age at Death (Months)' instead of 'Candidate Age (Months)'. To set the `postMortem` variable
26+
for PHP instruments, assign the variable within the instrument's PHP class; for LINST instruments,
27+
include `postmortem{@}true` in the instrument's meta file.
2728
9. Check that access restriction in `config.xml` work.
2829
- In the `<instrumentPermissions>` section of `config.xml`
2930
- set the `<useInstrumentPermissions>` to `true`

php/libraries/NDB_BVL_Instrument_LINST.class.inc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class NDB_BVL_Instrument_LINST extends \NDB_BVL_Instrument
108108
$this->dictionary,
109109
[
110110
new DictionaryItem(
111-
$this->testName.'_Candidate_age',
111+
$this->testName.'_Candidate_Age',
112112
'Candidate Age (Months)',
113113
$scope,
114114
new \LORIS\Data\Types\Duration(),
@@ -120,14 +120,14 @@ class NDB_BVL_Instrument_LINST extends \NDB_BVL_Instrument
120120
} else {
121121
$this->addScoreColumn(
122122
'Candidate_Age',
123-
'Candidate_Age_at_Death'
123+
'Candidate Age at Death (Months)'
124124
);
125125
$this->dictionary = array_merge(
126126
$this->dictionary,
127127
[
128128
new DictionaryItem(
129-
$this->testName.'_Candidate_age',
130-
'Candidate Age At Death (Months)',
129+
$this->testName.'_Candidate_Age',
130+
'Candidate Age at Death (Months)',
131131
$scope,
132132
new \LORIS\Data\Types\Duration(),
133133
new Cardinality(Cardinality::SINGLE),
@@ -923,6 +923,9 @@ class NDB_BVL_Instrument_LINST extends \NDB_BVL_Instrument
923923
case 'jsondata':
924924
$this->jsonData = trim($pieces[1]) === 'true';
925925
break;
926+
case 'postmortem':
927+
$this->postMortem = trim($pieces[1]) === 'true';
928+
break;
926929
default:
927930
break;
928931
}

0 commit comments

Comments
 (0)