Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
Fixed bug with listing of cloned patients in patient bank
Browse files Browse the repository at this point in the history
  • Loading branch information
pkmitre committed Jan 29, 2015
1 parent fd48fb7 commit 7c6454e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</label>
</div>
<div class="patient-user-icon">
<span class="fa-stack" aria-hidden="true">
<span class="fa-stack{{#if localClone}} cloned{{/if}}" aria-hidden="true">
<i class="fa fa-circle fa-stack-2x" aria-hidden="true"></i>
<i class="fa fa-user fa-stack-1x" aria-hidden="true"></i>
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ class Thorax.Views.PatientBankView extends Thorax.Views.BonnieView
@bankFilterView.enableFiltering()
@showFilteredPatientCount()
@showSelectedCoverage()
myPatients = @model.get('patients').where({'is_shared': true}).map (p) -> p.id # your patients in this measure
myDifferences = @differences.filter (d) -> _(myPatients).contains d.result.patient.id
#find associated dom elements and set class 'cloned'
_(myDifferences).each (d) -> @$('[data-model-cid="'+d.cid+'"]').find('.patient-user-icon > .fa-stack').addClass('cloned')

populations = @model.get('populations')
@currentPopulation = populations.first()
Expand Down Expand Up @@ -108,9 +104,11 @@ class Thorax.Views.PatientBankView extends Thorax.Views.BonnieView
@bankFilterView.appliedFilters.all (filter) -> filter.apply(patient)

differenceContext: (difference) ->
patient = difference.result.patient
_(difference.toJSON()).extend
patient: difference.result.patient.toJSON()
patient: patient.toJSON()
cms_id: @model.get('cms_id')
localClone: patient.get('user_id') == bonnie.currentUserId

showFilteredPatientCount: ->
@$('.patient-count').text "("+@$('.shared-patient:visible').length+")" # thorax 'filters' models with $.hide and $.show
Expand Down

0 comments on commit 7c6454e

Please sign in to comment.