package Ġcom . pad cx . shared Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . content . Intent Ċ import Ġandroidx . appcompat . app . AppCompatActivity Ċ import Ġandroid . os . Bundle Ċ import Ġandroidx . lifecycle . ViewModel Providers Ċ import Ġandroidx . recyclerview . widget . Linear LayoutManager Ċ import Ġcom . google . android . material . sn ackbar . Snackbar Ċ import Ġcom . pad cx . shared . activity . Base Activity Ċ import Ġcom . pad cx . shared . adapters . Case Summary Question ListAdapter Ċ import Ġcom . pad cx . shared . adapters . Patient Detail ListAdapter Ċ import Ġcom . pad cx . shared . data . v os . Consult VO Ċ import Ġcom . pad cx . shared . data . v os . Question VO Ċ import Ġcom . pad cx . shared . mvp . present ers . Patient Details Presenter Ċ import Ġcom . pad cx . shared . mvp . present ers . Patient Details Presenter Impl Ċ import Ġcom . pad cx . shared . mvp . views . Patient Details View Ċ import Ġcom . pad cx . shared . utils . EXTRA _ CONS ULT ATION Ċ import Ġkotlinx . android . synt hetic . main . activity _ patient _ details .* Ċ Ċ class ĠPatient Details Activity Ġ: ĠBase Activity (), Patient Details View Ġ{ ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġfun Ġnew Intent ( context : ĠContext , consult : Consult VO ): Intent Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġintent Ġ= ĠIntent ( context , Patient Details Activity :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġintent . putExtra ( EXTRA _ CONS ULT ATION , consult ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn Ġintent ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġm Patient Details Presenter Ġ: ĠPatient Details Presenter ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġm Detail ListAdapter Ġ: ĠPatient Detail ListAdapter ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġm Special ity ListAdapter Ġ: ĠCase Summary Question ListAdapter ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġconsult Ġ: ĠConsult VO ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ ĠsetContentView ( R . layout . activity _ patient _ details ) ĊĊĠĠĠĠĠĠĠ Ġconsult Ġ= Ġintent . get Serializable Extra ( EXTRA _ CONS ULT ATION ) Ġas ĠConsult VO ĊĊĠĠĠĠĠĠĠ ĠsetUp Listener () ĊĠĠĠĠĠĠĠ ĠsetUp Presenter () ĊĠĠĠĠĠĠĠ ĠsetUp RecyclerView () ĊĊĠĠĠĠĠĠĠ Ġm Patient Details Presenter . on Ui Ready () ĊĠĠĠ Ġ} ĊĠĠĠ Ġprivate Ġfun ĠsetUp Listener () Ġ{ ĊĠĠĠĠĠĠĠ Ġiv Back . setOnClickListener Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġm Patient Details Presenter . on Tap Back () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠĠĠ Ġprivate Ġfun ĠsetUp Presenter () Ġ{ ĊĠĠĠĠĠĠĠ Ġm Patient Details Presenter Ġ= ĠViewModel Providers . of ( this ). get ( Patient Details Presenter Impl :: class . java ) ĊĠĠĠĠĠĠĠ Ġm Patient Details Presenter . init Presenter ( this ) ĊĠĠĠ Ġ} ĊĠĠĠ Ġprivate Ġfun ĠsetUp RecyclerView () Ġ{ ĊĠĠĠĠĠĠĠ Ġm Detail ListAdapter Ġ= ĠPatient Detail ListAdapter () ĊĠĠĠĠĠĠĠ Ġval Ġlayout Manager Ġ= ĠLinearLayoutManager ( this , Linear LayoutManager . VERTICAL , false ) ĊĠĠĠĠĠĠĠ Ġrv General Question . adapter Ġ= Ġm Detail ListAdapter ĊĠĠĠĠĠĠĠ Ġrv General Question . layout Manager Ġ= Ġlayout Manager ĊĊĠĠĠĠĠĠĠ Ġm Special ity ListAdapter Ġ= ĠCase Summary Question ListAdapter () ĊĠĠĠĠĠĠĠ Ġval Ġspecial ity LayoutManager Ġ= ĠLinearLayoutManager ( this , Linear LayoutManager . VERTICAL , false ) ĊĠĠĠĠĠĠĠ Ġrv Special ity Question . adapter Ġ= Ġm Special ity ListAdapter ĊĠĠĠĠĠĠĠ Ġrv Special ity Question . layout Manager Ġ= Ġspecial ity LayoutManager ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġdisplay Details () Ġ{ ĊĠĠĠĠĠĠĠ Ġ/* G lide . with ( this ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. load ( consult . patient ?. profile photo ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. into ( iv Patient ) */ ĊĠĠĠĠĠĠĠ Ġval Ġgeneral Questions Ġ: ĠMutable List < Question VO > Ġ= Ġarray ListOf () ĊĠĠĠĠĠĠĠ Ġval Ġspecial ity Questions Ġ: ĠMutable List < Question VO > Ġ= Ġarray ListOf () ĊĠĠĠĠĠĠĠ Ġval Ġquestion Ġ= ĠQuestion VO () ĊĠĠĠĠĠĠĠ Ġquestion . name Ġ= Ġ" áĢ ľ áĢ ° áĢ Ķ áĢ ¬ áĢ ¡ áĢ Ļ áĢ Ĭ áĢ º " ĊĠĠĠĠĠĠĠ Ġquestion . answer Ġ= Ġconsult . patient ?. name ĊĠĠĠĠĠĠĠ Ġgeneral Questions . add ( question ) ĊĊĠĠĠĠĠĠĠ Ġfor ( question Ġin Ġconsult . case Summary ?: Ġarray ListOf ()) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġif ( question . type Ġ== Ġ" General ") Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġgeneral Questions . add ( question ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} else Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġspecial ity Questions . add ( question ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġm Detail ListAdapter . set New Data ( general Questions ) ĊĠĠĠĠĠĠĠ Ġm Special ity ListAdapter . set New Data ( special ity Questions ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġnavigate To Chat () Ġ{ ĊĠĠĠĠĠĠĠ Ġfinish () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġshow Error ( error : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ ĠSn ackbar . make ( window . decor View , error , Snackbar . LENGTH _ LONG ). show () ĊĠĠĠ Ġ} Ċ }