Work on refactoring measurements out of Lesion Tracker package
- Removed AssociatedStudies Collection - Measurement API is generated from configuration files - Data exchange methods are defined in configuration
This commit is contained in:
1 parent
c511edd419
commit
ab4d4c9008
537 files changed
+5122
-3545
No files matched your search
@@ -0,0 +1,17 @@
|
||||
<template name="caseProgress">
|
||||
<div class="caseProgress">
|
||||
{{#unless progressComplete}}
|
||||
{{>radialProgressBar isLocked=isLocked progressPercent=progressPercent progressText=progressText}}
|
||||
{{ /unless }}
|
||||
{{#if isLocked}}
|
||||
<div class="caseProgressStatus">
|
||||
<h5>Locked</h5>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if progressComplete}}
|
||||
<div class="caseProgressStatus">
|
||||
<button class="btn js-finish-case">Enter response</button>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,97 @@
|
||||
import { MeasurementsConfiguration } from 'meteor/ohif:measurements/both/configuration/measurements';
|
||||
|
||||
const config = MeasurementsConfiguration.getConfiguration();
|
||||
|
||||
Template.caseProgress.onCreated(() => {
|
||||
const instance = Template.instance();
|
||||
|
||||
instance.progressPercent = new ReactiveVar();
|
||||
instance.progressText = new ReactiveVar();
|
||||
instance.isLocked = new ReactiveVar();
|
||||
});
|
||||
|
||||
Template.caseProgress.onRendered(() => {
|
||||
const instance = Template.instance();
|
||||
|
||||
// Stop here if we have no current timepoint ID (and therefore no defined timepointAPI)
|
||||
if (!instance.data.timepointApi) {
|
||||
instance.progressPercent.set(100);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the current timepoint
|
||||
const current = instance.data.timepointApi.current();
|
||||
if (!current) {
|
||||
instance.progressPercent.set(100);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!current.timepointId) {
|
||||
instance.progressPercent.set(100);
|
||||
return;
|
||||
}
|
||||
|
||||
instance.isLocked.set(current.isLocked);
|
||||
|
||||
// Retrieve the initial number of targets left to measure at this
|
||||
// follow-up. Note that this is done outside of the reactive function
|
||||
// below so that new lesions don't change the initial target count.
|
||||
const withPriors = true;
|
||||
const totalTargets = 10; //instance.data.measurementApi.targets(withPriors).length;
|
||||
|
||||
// If we're currently reviewing a Baseline timepoint, don't do any
|
||||
// progress measurement.
|
||||
if (current.timepointType === 'baseline') {
|
||||
instance.progressPercent.set(100);
|
||||
} else {
|
||||
// Setup a reactive function to update the progress whenever
|
||||
// a measurement is made
|
||||
instance.autorun(() => {
|
||||
// Obtain the number of Measurements for which the current Timepoint has
|
||||
// no Measurement data
|
||||
const numRemainingMeasurements = 5; //instance.data.measurementApi.unmarked().length;
|
||||
|
||||
// Update the Case Progress text with the remaining measurement count
|
||||
instance.progressText.set(numRemainingMeasurements);
|
||||
|
||||
// Calculate the Case Progress as a percentage in order to update the
|
||||
// radial progress bar
|
||||
const numMeasurementsMade = Math.max(totalTargets - numRemainingMeasurements, 0);
|
||||
const progressPercent = Math.round(100 * numMeasurementsMade / totalTargets);
|
||||
instance.progressPercent.set(progressPercent);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Template.caseProgress.helpers({
|
||||
progressPercent() {
|
||||
return Template.instance().progressPercent.get();
|
||||
},
|
||||
|
||||
progressText() {
|
||||
return Template.instance().progressText.get();
|
||||
},
|
||||
|
||||
isLocked() {
|
||||
return Template.instance().isLocked.get();
|
||||
},
|
||||
|
||||
progressComplete() {
|
||||
const instance = Template.instance();
|
||||
if (!instance.data.timepointApi) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const progressPercent = instance.progressPercent.get();
|
||||
return progressPercent === 100;
|
||||
}
|
||||
});
|
||||
|
||||
Template.caseProgress.events({
|
||||
'click .js-finish-case'() {
|
||||
const instance = Template.instance();
|
||||
console.log('Case Finished!');
|
||||
switchToTab('studylistTab');
|
||||
instance.data.measurementApi.storeMeasurements();
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,32 @@
|
||||
@import "{design}/app"
|
||||
|
||||
.caseProgress
|
||||
transition(all 0.3 ease)
|
||||
|
||||
.radialProgress
|
||||
display: inline-block
|
||||
float:left
|
||||
|
||||
.caseProgressStatus
|
||||
display: inline-block
|
||||
float: left
|
||||
margin-left: 22px
|
||||
|
||||
h5
|
||||
theme('color', '$textPrimaryColor')
|
||||
line-height: 46px
|
||||
margin: 0
|
||||
font-size: 15px
|
||||
font-weight: bold
|
||||
|
||||
button.btn
|
||||
theme('background-color', '$activeColor')
|
||||
theme('border', '1px solid $uiBorderColorActive')
|
||||
color: #000
|
||||
cursor: pointer
|
||||
font-size: 15px
|
||||
font-weight: bold
|
||||
height: 37px
|
||||
margin-top: 6px
|
||||
text-align: center
|
||||
width: 126px
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
<template name="radialProgressBar">
|
||||
<div class="radialProgress">
|
||||
<svg id="svg"
|
||||
width="46"
|
||||
height="46"
|
||||
viewPort="0 0 50 50"
|
||||
version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
|
||||
<!-- stroke-dasharray is 2 * PI * radius !-->
|
||||
<circle r="21"
|
||||
cx="23"
|
||||
cy="23"
|
||||
fill="transparent"
|
||||
stroke-dasharray="131.9469"
|
||||
stroke-dashoffset="0">
|
||||
</circle>
|
||||
{{#unless isLocked}}
|
||||
<circle id="bar"
|
||||
r="21"
|
||||
cx="23"
|
||||
cy="23"
|
||||
fill="transparent"
|
||||
stroke-dasharray="131.9469"
|
||||
style="stroke-dashoffset: {{progressRadius}}px;">
|
||||
</circle>
|
||||
{{/unless}}
|
||||
</svg>
|
||||
<div class="progressText">
|
||||
{{#if isLocked}}
|
||||
<svg class="locked">
|
||||
<use xlink:href=/packages/ohif_viewerbase/assets/icons.svg#icon-status-lock></use>
|
||||
</svg>
|
||||
{{else}}
|
||||
{{#if progressComplete}}
|
||||
<svg class="complete">
|
||||
<use xlink:href=/packages/ohif_viewerbase/assets/icons.svg#icon-status-complete></use>
|
||||
</svg>
|
||||
{{else}}
|
||||
{{progressText}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
Template.radialProgressBar.helpers({
|
||||
progressComplete() {
|
||||
const instance = Template.instance();
|
||||
return instance.data.progressPercent === 100;
|
||||
},
|
||||
|
||||
progressRadius() {
|
||||
var radius = 21 * 2 * Math.PI;
|
||||
const instance = Template.instance();
|
||||
var percentLeft = (100 - instance.data.progressPercent) / 100;
|
||||
return percentLeft * radius;
|
||||
}
|
||||
});
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
@import "{design}/app"
|
||||
|
||||
$circleSize = 46px
|
||||
|
||||
.radialProgress
|
||||
position: relative
|
||||
height: $circleSize
|
||||
width: $circleSize
|
||||
vendorize(box-shadow, 0 0 1em black)
|
||||
border-radius: 100%
|
||||
|
||||
#svg circle
|
||||
stroke-dashoffset: 0
|
||||
theme('stroke', '$uiBorderColorDark')
|
||||
stroke-width: 3px
|
||||
vendorize(transition, stroke-dashoffset 1s linear)
|
||||
|
||||
#svg #bar
|
||||
theme('stroke', '$activeColor')
|
||||
vendorize(transform, rotate(270deg))
|
||||
vendorize(transform-origin, center center)
|
||||
|
||||
.progressText
|
||||
position: absolute
|
||||
width: $circleSize
|
||||
height: $circleSize
|
||||
line-height: $circleSize
|
||||
font-weight: 700
|
||||
font-size: 17px
|
||||
text-align: center
|
||||
theme('color', '$activeColor')
|
||||
top: 0
|
||||
|
||||
svg
|
||||
theme('fill', '$activeColor')
|
||||
left: 50%
|
||||
position: absolute
|
||||
theme('stroke', '$activeColor')
|
||||
top: 50%
|
||||
transform(translateX(-50%) translateY(-50%))
|
||||
|
||||
&.locked
|
||||
width: 16px
|
||||
height: 21px
|
||||
|
||||
&.complete
|
||||
width: 27px
|
||||
height: 27px
|
||||
Reference in new issue
Block a user