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,19 @@
<template name="associationModal">
<div class="modal" id="associationModal" tabindex="-1" role="dialog" aria-labelledby="associationModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="associationModalLabel">Study Association</h4>
</div>
<div class="modal-body">
{{ >studyAssociationTable }}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" id="saveAssociations" data-dismiss="modal" data-toggle="modal" data-target="#associationModal">Save</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
</div>
</div>
</div>
</div>
</template>
@@ -0,0 +1,5 @@
Template.associationModal.events({
'click #saveAssociations': function(e) {
log.info("Saving associations");
}
});
@@ -0,0 +1,3 @@
#associationModal
.modal-dialog
width: 80%
@@ -12,6 +12,12 @@ function closeHandler() {
setFocusToActiveViewport();
}
/**
* Displays the confirmation dialog template and the removable backdrop element
*
* @param doneCallback A callback
* @param options
*/
showConfirmDialog = function(doneCallback, options) {
// Show the backdrop
options = options || {};
@@ -24,9 +24,6 @@ function setLesionNumberCallback(measurementData, eventData, doneCallback) {
return;
}
// TODO: Get patientId
// TODO: add measurement data according to patientId to get correct lesion number for each patient
measurementData.timepointID = timepoint.timepointID;
// Get a lesion number for this lesion, depending on whether or not the same lesion previously
@@ -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
+7 -7
View File
@@ -30,9 +30,9 @@ getLineIntersection = function(point1, point2, point3, point4) {
* same side of line 1, the line segments do not intersect.
*/
if (r3 != 0 &&
r4 != 0 &&
sign(r3) == sign(r4)) {
if (r3 !== 0 &&
r4 !== 0 &&
sign(r3) === sign(r4)) {
intersectionPoint.x = 0;
intersectionPoint.y = 0;
intersectionPoint.intersected = false;
@@ -55,9 +55,9 @@ getLineIntersection = function(point1, point2, point3, point4) {
* not intersect.
*/
if (r1 != 0 &&
r2 != 0 &&
sign(r1) == sign(r2)) {
if (r1 !== 0 &&
r2 !== 0 &&
sign(r1) === sign(r2)) {
intersectionPoint.x = 0;
intersectionPoint.y = 0;
intersectionPoint.intersected = false;
@@ -103,7 +103,7 @@ getDistanceFromPointToLine = function(ptTest, pt1, pt2) {
var dy = pt2.y - pt1.y;
// It's a point, not a line
if (dx == 0 && dy == 0) {
if (dx === 0 && dy === 0) {
ptNearest.x = pt1.x;
ptNearest.y = pt1.y;
} else {
+8
View File
@@ -36,6 +36,10 @@ Package.onUse(function(api) {
bare: true
});
api.addFiles('client/components/associationModal/associationModal.html', 'client');
api.addFiles('client/components/associationModal/associationModal.styl', 'client');
api.addFiles('client/components/associationModal/associationModal.js', 'client');
api.addFiles('client/components/lesionLocationDialog/lesionLocationDialog.html', 'client');
api.addFiles('client/components/lesionLocationDialog/lesionLocationDialog.js', 'client');
api.addFiles('client/components/lesionLocationDialog/lesionLocationDialog.styl', 'client');
@@ -63,6 +67,10 @@ Package.onUse(function(api) {
api.addFiles('client/components/studyDateList/studyDateList.styl', 'client');
api.addFiles('client/components/studyDateList/studyDateList.js', 'client');
api.addFiles('client/components/studyAssociationTable/studyAssociationTable.html', 'client');
api.addFiles('client/components/studyAssociationTable/studyAssociationTable.styl', 'client');
api.addFiles('client/components/studyAssociationTable/studyAssociationTable.js', 'client');
api.addFiles('client/components/confirmDeleteDialog/confirmDeleteDialog.html', 'client');
api.addFiles('client/components/confirmDeleteDialog/confirmDeleteDialog.styl', 'client');
api.addFiles('client/components/confirmDeleteDialog/confirmDeleteDialog.js', 'client');