package Ġorg . simple . clin ic . recent pat ients view Ċ Ċ import Ġcom . spotify . mob ius . rx 2 . Rx Mob ius Ċ import Ġdagger . ass isted . Ass isted Ċ import Ġdagger . ass isted . Ass isted Factory Ċ import Ġdagger . ass isted . Ass isted Inject Ċ import Ġio . reactivex . Observable Ċ import Ġio . reactivex . Observable Transformer Ċ import Ġorg . simple . clin ic . facility . Facility Ċ import Ġorg . simple . clin ic . patient . Patient Repository Ċ import Ġorg . simple . clin ic . util . scheduler . Schedulers Provider Ċ Ċ class ĠLatest Recent Pat ients Effect Handler Ġ@ Ass isted Inject Ġconstructor ( ĊĠĠĠ Ġprivate Ġval Ġs chedulers : ĠS chedulers Provider , ĊĠĠĠ Ġprivate Ġval Ġpatient Repository : ĠPatient Repository , ĊĠĠĠ Ġprivate Ġval Ġcurrent Facility Changes : ĠObservable < Facility >, ĊĠĠĠ Ġ@ Ass isted Ġprivate Ġval Ġui Actions : ĠLatest Recent Pat ients Ui Actions Ċ ) Ġ{ ĊĊĠ Ġ@ Ass isted Factory ĊĠ Ġinterface ĠFactory Ġ{ ĊĠĠĠ Ġfun Ġcreate ( ui Actions : ĠLatest Recent Pat ients Ui Actions ): ĠLatest Recent Pat ients Effect Handler ĊĠ Ġ} ĊĊĠ Ġfun Ġbuild (): ĠObservable Transformer < Latest Recent Pat ients Effect , ĠLatest Recent Pat ients Event > Ġ{ ĊĠĠĠ Ġreturn ĠRx Mob ius ĊĠĠĠĠĠĠĠ Ġ. subtype Effect Handler < Latest Recent Pat ients Effect , ĠLatest Recent Pat ients Event >() ĊĠĠĠĠĠĠĠ Ġ. add Transformer ( Load Recent Pat ients :: class . java , Ġload Recent Pat ients ()) ĊĠĠĠĠĠĠĠ Ġ. add Consumer ( Open Patient Summary :: class . java , Ġ{ Ġui Actions . open Patient Summary ( it . patient Uuid ) Ġ}, Ġs chedulers . ui ()) ĊĠĠĠĠĠĠĠ Ġ. addAction ( Open All Recent Pat ients Screen :: class . java , Ġui Actions :: open Recent Pat ients Screen , Ġs chedulers . ui ()) ĊĠĠĠĠĠĠĠ Ġ. build () ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġload Recent Pat ients (): ĠObservable Transformer < Load Recent Pat ients , ĠLatest Recent Pat ients Event > Ġ{ ĊĠĠĠ Ġreturn ĠObservable Transformer Ġ{ Ġeffects Ġ-> ĊĠĠĠĠĠ Ġeffects ĊĠĠĠĠĠĠĠĠĠ Ġ. switch Map Ġ{ Ġeffect Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcurrent Facility Changes ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. subscribe On ( schedul ers . io ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. switch Map Ġ{ Ġpatient Repository . recent Pat ients ( it . uuid , Ġeffect . count ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. map (:: Recent Pat ients Loaded ) ĊĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠ Ġ} Ċ } Ċ