- Add "Study Not Found" message
- Hide loading text after WorklistSearch method is called
This commit is contained in:
parent
fb7024d20e
commit
1dc7eb71c0
@ -0,0 +1,5 @@
|
|||||||
|
<template name="studyNotFound">
|
||||||
|
<div class="studyNotFound">
|
||||||
|
<h5>Study not found</h5>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
.studyNotFound
|
||||||
|
margin: 30px
|
||||||
|
|
||||||
|
h5
|
||||||
|
text-align: center
|
||||||
|
color: #888888
|
||||||
@ -41,6 +41,9 @@ Package.onUse(function(api) {
|
|||||||
api.addFiles('client/components/basic/loadingText/loadingText.html', 'client');
|
api.addFiles('client/components/basic/loadingText/loadingText.html', 'client');
|
||||||
api.addFiles('client/components/basic/loadingText/loadingText.styl', 'client');
|
api.addFiles('client/components/basic/loadingText/loadingText.styl', 'client');
|
||||||
|
|
||||||
|
api.addFiles('client/components/basic/studyNotFound/studyNotFound.html', 'client');
|
||||||
|
api.addFiles('client/components/basic/studyNotFound/studyNotFound.styl', 'client');
|
||||||
|
|
||||||
api.addFiles('client/components/basic/removableBackdrop/removableBackdrop.html', 'client');
|
api.addFiles('client/components/basic/removableBackdrop/removableBackdrop.html', 'client');
|
||||||
api.addFiles('client/components/basic/removableBackdrop/removableBackdrop.styl', 'client');
|
api.addFiles('client/components/basic/removableBackdrop/removableBackdrop.styl', 'client');
|
||||||
|
|
||||||
|
|||||||
@ -44,11 +44,15 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody id="studyListData">
|
<tbody id="studyListData">
|
||||||
{{#each studies}}
|
{{#each studies}}
|
||||||
{{ >worklistStudy }}
|
{{>worklistStudy }}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
{{ #unless studies.count }}
|
{{#if showLoadingText}}
|
||||||
{{ >loadingText }}
|
{{>loadingText}}
|
||||||
{{ /unless }}
|
{{/if}}
|
||||||
|
|
||||||
|
{{#if showNotFoundMessage}}
|
||||||
|
{{>studyNotFound}}
|
||||||
|
{{/if}}
|
||||||
</template>
|
</template>
|
||||||
@ -1,3 +1,5 @@
|
|||||||
|
Session.setDefault("searchResults", {showLoadingText: true, showNotFoundMessage: false});
|
||||||
|
|
||||||
Template.worklistResult.helpers({
|
Template.worklistResult.helpers({
|
||||||
/**
|
/**
|
||||||
* Returns a sorted instance of the WorklistStudies Collection
|
* Returns a sorted instance of the WorklistStudies Collection
|
||||||
@ -10,6 +12,15 @@ Template.worklistResult.helpers({
|
|||||||
studyDate: 1
|
studyDate: 1
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
showLoadingText: function() {
|
||||||
|
return Session.get("searchResults").showLoadingText;
|
||||||
|
},
|
||||||
|
|
||||||
|
showNotFoundMessage: function() {
|
||||||
|
return Session.get("searchResults").showNotFoundMessage;
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -73,6 +84,12 @@ function convertStringToStudyDate(dateStr) {
|
|||||||
* Inserts the identified studies into the WorklistStudies Collection
|
* Inserts the identified studies into the WorklistStudies Collection
|
||||||
*/
|
*/
|
||||||
function search() {
|
function search() {
|
||||||
|
// Show loading message
|
||||||
|
var searchResults = Session.get("searchResults");
|
||||||
|
searchResults.showLoadingText = true;
|
||||||
|
searchResults.showNotFoundMessage = false;
|
||||||
|
Session.set("searchResults", searchResults);
|
||||||
|
|
||||||
// Create the filters to be used for the Worklist Search
|
// Create the filters to be used for the Worklist Search
|
||||||
filter = {
|
filter = {
|
||||||
patientName: getFilter($('input#patientName').val()),
|
patientName: getFilter($('input#patientName').val()),
|
||||||
@ -94,6 +111,10 @@ function search() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Hide loading text
|
||||||
|
searchResults.showLoadingText = false;
|
||||||
|
Session.set("searchResults", searchResults);
|
||||||
|
|
||||||
if (!studies) {
|
if (!studies) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -110,6 +131,14 @@ function search() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (WorklistStudies.find().count() === 0) {
|
||||||
|
// Show notFound text
|
||||||
|
searchResults.showNotFoundMessage = true;
|
||||||
|
Session.set("searchResults", searchResults);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user