Work-in-progress on study/timepoint association modal and multi-study selection (LT-60, LT-116)

This commit is contained in:
Erik Ziegler committed 2016-01-12 21:56:40 +01:00
1 parent 10be1b0336
commit 41b75de814
21 files changed
+505 -58

No files matched your search

@@ -0,0 +1,50 @@
<template name="studyAssociationTable">
<div id="studyAssociationTable">
<div class="row">
<div class="col-md-12">
<h4>Instructions</h4>
<p>Associate the selected studies with timepoints in the clinical trial.</p>
</div>
</div>
<table class="table table-striped">
<thead>
<tr>
<th class="center">Include Study?</th>
<th class="center">Study Date</th>
<th class="center">Study Description</th>
<th class="center">Timepoint Type</th>
</tr>
</thead>
<tbody>
{{ #each relevantStudies }}
<tr>
<td class="center">
<input type="checkbox" class="includeStudy" checked/>
</td>
<td class="center">
{{ #if autoselected}}
<p class="studyDate autoselected"
title="This study was automatically added to your list due to its
similarity with your other selected studies">
{{formatDA studyDate}}
</p>
{{ else }}
<p class="studyDate">{{formatDA studyDate}}</p>
{{ /if }}
</td>
<td>
<p>{{studyDescription}}</p>
</td>
<td class="timepointOptions center">
{{ #each timepointOptions }}
<label><input type="radio" name="{{_id}}" value={{type}}> {{name}}</label>
{{ /each }}
</td>
</tr>
{{ /each }}
</tbody>
</table>
</div>
</template>
@@ -0,0 +1,36 @@
function autoSelectStudies() {
return [];
}
Template.studyAssociationTable.helpers({
/**
* This helpers includes the user-selected and autoselected studies
* to be associated.
*
* @returns {Array.<T>}
*/
relevantStudies: function() {
var userSelectedStudies = WorklistSelectedStudies.find().fetch() || [];
var autoselected = autoSelectStudies(userSelectedStudies);
return userSelectedStudies.concat(autoselected);
},
/**
* This helper returns the list of Timepoint types the user can set for this study
*
* @returns {Array.<T>}
*/
timepointOptions: function() {
return [
{
value: 'baseline',
name: 'Baseline'
},
{
value: 'followup',
name: 'Follow-up'
}
];
}
});
//trial criteria!
@@ -0,0 +1,16 @@
#studyAssociationTable
.header
text-align: center
.center
text-align: center
table
tbody
tr
td.timepointOptions
input
margin: 0 3px
label
padding: 0 5px