<template name="studyBrowserItem">
    <div class="study-browser-item {{this.studyItemClass}} {{#if isActive}}active{{/if}} {{#if isLoading}}loading{{/if}}" data-uid="{{this.studyInformation.studyInstanceUid}}">
        <div class="study-item">
            {{#if isLoading}}
                {{>loadingText}}
            {{/if}}
            {{#let studyData=instance.studyData.get}}
                <div class="study-item-box">
                    <div class="study-modality">
                        <div class="study-modality-text" style="{{modalityStyle studyData.modalities}}">{{studyData.modalities}}</div>
                    </div>
                    <div class="study-text">
                        {{#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}}
        </div>
        {{#if this.studyChildTemplate}}
            {{#if and (not isLoading) instance.studyData.get instance.loaded}}
                {{>Template.dynamic template=this.studyChildTemplate data=(clone this)}}
            {{/if}}
        {{/if}}
    </div>
</template>
