package Ġorg . dh is 2 . use sc ases . te i Dashboard . dashboard fragments . indicators Ċ Ċ import Ġd his 2 . org . analytics . charts . Charts Ċ import Ġd his 2 . org . analytics . charts . ui . Analytics Model Ċ import Ġd his 2 . org . analytics . charts . ui . Chart Model Ċ import Ġio . reactivex . Flow able Ċ import Ġio . reactivex . functions . Function 3 Ċ import Ġorg . dh is 2 . data . forms . data entry . Rule Engine Repository Ċ import Ġorg . dh is 2 . utils . D his TextUtils Ċ import Ġorg . dh is 2 . utils . resources . ResourceManager Ċ import Ġorg . h isp . dh is . android . core . D 2 Ċ Ċ class ĠTracker Analytics Repository ( ĊĠĠĠ Ġd 2 : ĠD 2 , ĊĠĠĠ Ġrule Engine Repository : ĠRule Engine Repository , ĊĠĠĠ Ġval Ġcharts : ĠChart s ?, ĊĠĠĠ Ġprogram Uid : ĠString , ĊĠĠĠ Ġval Ġte i Uid : ĠString , ĊĠĠĠ Ġresource Manager : ĠResourceManager Ċ ) Ġ: ĠBase Indicator Repository ( d 2 , Ġrule Engine Repository , Ġprogram Uid , Ġresource Manager ) Ġ{ ĊĊĠĠĠ Ġval Ġenrollment Uid : ĠString ĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ Ġvar Ġenrollment Repository Ġ= Ġd 2 . enrollment Module (). enroll ments () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. by Tracked Entity Instance (). eq ( te i Uid ) ĊĠĠĠĠĠĠĠ Ġif Ġ(! D his TextUtils . isEmpty ( program Uid )) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġenrollment Repository Ġ= Ġenrollment Repository . by Program (). eq ( program Uid ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġenrollment Uid Ġ= Ġif Ġ( enrollment Repository . one (). blocking Get () Ġ== Ġnull ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ"" ĊĠĠĠĠĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġenrollment Repository . one (). blocking Get (). uid () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġfetch Data (): ĠFlow able < List < Analytics Model >> Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠFlow able . zip < List < Analytics Model > ?, ĊĠĠĠĠĠĠĠĠĠĠĠ ĠList < Analytics Model > ?, ĊĠĠĠĠĠĠĠĠĠĠĠ ĠList < Analytics Model >, ĊĠĠĠĠĠĠĠĠĠĠĠ ĠList < Analytics Model >>( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġget Indicators ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ! D his TextUtils . isEmpty ( enrollment Uid ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) Ġ{ Ġindicator Uid Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġd 2 . program Module () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. program Indicator Engine (). get Enrollment Program Indicator Value ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġenrollment Uid , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġindicator Uid ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ}, ĊĠĠĠĠĠĠĠĠĠĠĠ Ġget Rules Indicators (), ĊĠĠĠĠĠĠĠĠĠĠĠ ĠFlow able . just ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcharts ?. ge Enrollment Charts ( enrollment Uid )?. map Ġ{ ĠChart Model ( it ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ), ĊĠĠĠĠĠĠĠĠĠĠĠ ĠFunction 3 Ġ{ Ġindicators , Ġrule Indicators , Ġcharts Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġarrange Sections ( indicators , Ġrule Indicators , Ġcharts ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} Ċ } Ċ