diff --git a/packages/openchs-android/src/service/IndividualService.js b/packages/openchs-android/src/service/IndividualService.js index ec6b867c4..99ad1d6e7 100644 --- a/packages/openchs-android/src/service/IndividualService.js +++ b/packages/openchs-android/src/service/IndividualService.js @@ -44,7 +44,7 @@ class IndividualService extends BaseService { init() { this.encounterService = this.getService(EncounterService); this.entityApprovalStatusService = this.getService(EntityApprovalStatusService); - this.hideTotalForProgram = this.getService(OrganisationConfigService).hasHideTotalForProgram(); + this.hideTotalForProgram = this.getService(OrganisationConfigService).hasHideTotalForProgram; } search(criteria) { @@ -135,7 +135,7 @@ class IndividualService extends BaseService { } allInWithFilters = (ignored, queryAdditions, programs = [], encounterTypes = []) => { - if(_.isEmpty(encounterTypes) && (!this.hideTotalForProgram || _.isEmpty(programs))) { + if(_.isEmpty(encounterTypes) && (!this.hideTotalForProgram() || _.isEmpty(programs))) { return this.allIn(ignored, queryAdditions); } return null; diff --git a/packages/openchs-android/src/service/OrganisationConfigService.js b/packages/openchs-android/src/service/OrganisationConfigService.js index ade376036..7ba463631 100644 --- a/packages/openchs-android/src/service/OrganisationConfigService.js +++ b/packages/openchs-android/src/service/OrganisationConfigService.js @@ -59,7 +59,7 @@ class OrganisationConfigService extends BaseService { return this.getSettings().maxAddressDisplayInlineCount || 30; } - hasHideTotalForProgram() { + hasHideTotalForProgram = () => { return this.getSettings().hideTotalForProgram === undefined || this.getSettings().hideTotalForProgram ; } }