Allowing external modifications on study boxes data
This commit is contained in:
parent
c1d500a92b
commit
43a7e8151a
@ -10,8 +10,12 @@
|
||||
<div class="study-modality-text" style="{{modalityStyle studyData.modalities}}">{{studyData.modalities}}</div>
|
||||
</div>
|
||||
<div class="study-text">
|
||||
<div class="study-date">{{formatDA studyData.studyDate 'D-MMM-YYYY'}}</div>
|
||||
<div class="study-description">{{studyData.studyDescription}}</div>
|
||||
{{#if (or isLoaded hasDescriptionAndDate)}}
|
||||
<div class="study-date">{{formatDA studyData.studyDate 'D-MMM-YYYY'}}</div>
|
||||
<div class="study-description">{{studyData.studyDescription}}</div>
|
||||
{{else}}
|
||||
<div class="study-availability">{{#if eq studyAvailable false}}N/A{{else}}Click to load{{/if}}</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{/let}}
|
||||
|
||||
@ -15,6 +15,15 @@ Template.studyBrowserItem.onCreated(() => {
|
||||
|
||||
instance.studyData = new ReactiveVar(studyInformation);
|
||||
|
||||
// Try to load the study data from an external source if available
|
||||
if (OHIF.studies.getStudyBoxData) {
|
||||
OHIF.studies.getStudyBoxData(studyInformation).then(studyData => {
|
||||
if (!instance.loaded.get()) {
|
||||
instance.studyData.set(studyData);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
instance.studyMetadata = null;
|
||||
instance.getStudyMetadata = () => {
|
||||
instance.loading.dep.depend();
|
||||
@ -90,6 +99,11 @@ Template.studyBrowserItem.helpers({
|
||||
return Template.instance().loaded.get();
|
||||
},
|
||||
|
||||
hasDescriptionAndDate() {
|
||||
const studyData = Template.instance().studyData.get();
|
||||
return studyData.studyDescription && studyData.studyDate;
|
||||
},
|
||||
|
||||
isLoading() {
|
||||
return Template.instance().loading.get();
|
||||
},
|
||||
|
||||
15
Packages/ohif-studies/imports/client/lib/getStudyBoxData.js
Normal file
15
Packages/ohif-studies/imports/client/lib/getStudyBoxData.js
Normal file
@ -0,0 +1,15 @@
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
/**
|
||||
* Overridable namespace to allow getting study boxes data externally.
|
||||
*
|
||||
* The function must handle the first parameter as a studyInformation object containing at least the
|
||||
* studyInstanceUid attribute.
|
||||
*
|
||||
* Shall return a promise that will be resolved with an object containing those attributes:
|
||||
* - studyInstanceUid {String}: copy of studyInformation.studyInstanceUid
|
||||
* - modalities {String}: 2 uppercase letters for each modality split by any non-alphabetical char(s)
|
||||
* - studyDate {String}: date formatted as YYYYMMDD
|
||||
* - studyDescription {String}: study description string
|
||||
*/
|
||||
OHIF.studies.getStudyBoxData = false;
|
||||
@ -1,4 +1,5 @@
|
||||
import './classes';
|
||||
import './getStudyBoxData';
|
||||
import './loadStudy';
|
||||
import './retrieveStudiesMetadata';
|
||||
import './retrieveStudyMetadata';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user