package Ġcom . son phil . can ad are calls ands afety alerts . data . api . mapper Ċ Ċ import Ġandroid . webkit . URL Util Ċ import Ġcom . son phil . can ad are calls ands afety alerts . data . api . model . details . Api Re call Details Panel Ċ import Ġcom . son phil . can ad are calls ands afety alerts . data . api . model . details . Api Re call Details Response Ċ import Ġcom . son phil . can ad are calls ands afety alerts . data . api . model . recent . Api Re call Ċ import Ġcom . son phil . can ad are calls ands afety alerts . data . api . model . recent . Api Recent Re calls Response Ċ import Ġcom . son phil . can ad are calls ands afety alerts . data . api . model . search . Api Search Response Ċ import Ġcom . son phil . can ad are calls ands afety alerts . data . api . model . search . Api SearchResult Ċ import Ġcom . son phil . can ad are calls ands afety alerts . domain . model . Category Ċ import Ġcom . son phil . can ad are calls ands afety alerts . domain . model . Re call Ċ import Ġcom . son phil . can ad are calls ands afety alerts . domain . model . Re call And Basic Information And Details Sections And Images Ċ import Ġcom . son phil . can ad are calls ands afety alerts . domain . model . Re call Details Basic Information Ċ import Ġcom . son phil . can ad are calls ands afety alerts . domain . model . Re call Details Section Ċ import Ġcom . son phil . can ad are calls ands afety alerts . domain . model . Re call Details Section Type Ċ import Ġcom . son phil . can ad are calls ands afety alerts . domain . model . Re call Image Ċ Ċ /** Ċ Ġ* ĠCreated Ġby ĠSon phil Ġon Ġ 0 1 - 0 2 - 2 0 . Ċ Ġ*/ Ċ Ċ fun ĠApi Re call . to Re call () Ġ= ĠRe call ( ĊĠĠĠ Ġcategory . first (). to Category (), ĊĠĠĠ Ġdate Published ?. times ( 1 0 0 0 L ), ĊĠĠĠ Ġrecall Id , ĊĠĠĠ Ġtitle , ĊĠĠĠ Ġapi Url Ċ ) Ċ Ċ fun ĠList < Api Re call >. to Re calls () Ġ= Ġmap Ġ{ Ġit . to Re call () Ġ} Ċ Ċ fun ĠApi Recent Re calls Response . to Re calls (): ĠList < Re call > Ġ= Ġresults . all ?. to Re calls (). or Empty () Ċ Ċ fun ĠApi SearchResult . to Re call () Ġ= ĠRe call ( ĊĠĠĠ Ġcategory . first (). to Category (), ĊĠĠĠ Ġdate Published ?. times ( 1 0 0 0 L ), ĊĠĠĠ Ġrecall Id , ĊĠĠĠ Ġtitle , ĊĠĠĠ Ġurl Ċ ) Ċ Ċ fun ĠApi Search Response . to Re calls (): ĠList < Re call > Ġ= Ġresults . or Empty (). map Ġ{ Ġit . to Re call () Ġ} Ċ Ċ fun ĠApi Re call Details Panel . to Re call Details Section ( recall : ĠRe call ): ĠRe call Details Section Ġ{ ĊĠĠĠ Ġval Ġtype Ġ= ĠRe call Details Section Type ĊĠĠĠĠĠĠĠ Ġ. values () ĊĠĠĠĠĠĠĠ Ġ. find Ġ{ Ġtype Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtype . name . equals ( panel Name , Ġtrue ) ĊĠĠĠĠĠĠĠ Ġ} Ġ?: ĠRe call Details Section Type . OTHER ĊĊĠĠĠ Ġreturn ĠRe call Details Section ( ĊĠĠĠĠĠĠĠ Ġrecall . id , ĊĠĠĠĠĠĠĠ Ġpanel Name , ĊĠĠĠĠĠĠĠ Ġtype , ĊĠĠĠĠĠĠĠ Ġthis . title , ĊĠĠĠĠĠĠĠ Ġthis . text Ġ?: Ġ"" ĊĠĠĠ Ġ) Ċ } Ċ Ċ fun ĠList < Api Re call Details Panel > ?. to Re call Details Sections ( ĊĠĠĠ Ġrecall : ĠRe call , ĊĠĠĠ Ġignored Panels Names : ĠSet < String > Ġ= Ġset Of ( ĊĠĠĠĠĠĠĠ Ġ" images ", ĊĠĠĠĠĠĠĠ Ġ" media _ en qui ries ", ĊĠĠĠĠĠĠĠ Ġ" id _ numbers ", ĊĠĠĠĠĠĠĠ Ġ" product _" ĊĠĠĠ Ġ) Ċ ): ĠList < Re call Details Section > Ġ= Ġor Empty () ĊĠĠĠ Ġ. filter Ġ{ Ġpanel Ġ-> ĊĠĠĠĠĠĠĠ Ġval Ġcontains Table Ġ= Ġpanel . text ?. contains ("< table ") ĊĊĠĠĠĠĠĠĠ Ġ! ignored Panels Names . any Ġ{ Ġpanel . panel Name . startsWith ( it , Ġtrue ) Ġ} Ġ&& ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcontains Table Ġ== Ġfalse Ġ// ĠIgnore Ġtexts Ġwith Ġtables Ġuntil Ġwe Ġimplement Ġa Ġway Ġto Ġdisplay Ġthem Ġproperly ĊĠĠĠ Ġ}. map Ġ{ Ġpanel Ġ-> ĊĠĠĠĠĠĠĠ Ġpanel . to Re call Details Section ( recall ) ĊĠĠĠ Ġ} Ċ Ċ fun ĠApi Re call Details Panel . to Re call Details Images ( ĊĠĠĠ Ġrecall : ĠRe call , ĊĠĠĠ Ġapi BaseUrl : ĠString Ċ ) Ġ= Ġdata ?. map Ġ{ Ġapi Image Ġ-> ĊĠĠĠ ĠRe call Image ( ĊĠĠĠĠĠĠĠ Ġrecall . id , ĊĠĠĠĠĠĠĠ Ġapi Image . full Url . processed Url ( api BaseUrl ), ĊĠĠĠĠĠĠĠ Ġapi Image . thumb Url . processed Url ( api BaseUrl ), ĊĠĠĠĠĠĠĠ Ġapi Image . title ĊĠĠĠ Ġ) Ċ }. or Empty () Ċ Ċ /** Ċ Ġ* ĠAt tempts Ġto Ġfix Ġthe ĠURL Ġprovided Ġby Ġthe ĠAPI Ċ Ġ* Ċ Ġ* ĠExamples Ġof ĠURLs Ġsent Ġby Ġthe ĠAPI : Ċ Ġ* Ċ Ġ* Ġ 1 ) Ġ/ recall - alert - r app el - avis / inspection / 2 0 2 0 / assets / http :// www qa . inspection . gc . ca / D AM / D AM - recall - r app el / ST AGING / images - images / 2 0 2 0 0 2 2 1 a _ 1 5 8 2 3 3 0 6 8 9 1 9 0 _ f ra . jpg Ċ Ġ* Ġ 2 ) Ġ/ recall - alert - r app el - avis / hc - sc / 2 0 2 0 / assets / ra - 7 2 3 3 5 - 0 1 _ s _ fs _ 3 _ 2 0 2 0 0 2 1 4 - 1 5 0 6 3 5 _ 1 7 _ fr . jpg Ċ Ġ* Ċ Ġ* ĠFor Ġthe Ġfirst Ġcase , Ġwe Ġneed Ġto Ġremove Ġthe Ġfirst Ġpart Ġand Ġremove Ġ" qa " Ġfrom Ġthe ĠURL Ġand Ġuse Ġhttps . Ċ Ġ* ĠFor Ġthe Ġsecond Ġcase , Ġwe Ġsimply Ġneed Ġto Ġadd Ġthe Ġbase Ġurl Ġat Ġthe Ġbeginning . Ċ Ġ*/ Ċ private Ġfun ĠString . processed Url ( api BaseUrl : ĠString ): ĠString Ġ{ ĊĠĠĠ Ġval Ġdelimiter Ġ= Ġ" http " ĊĊĠĠĠ Ġif Ġ( contains ( delimiter )) Ġ{ ĊĠĠĠĠĠĠĠ Ġvar Ġurl Ġ= Ġdelimiter Ġ+ Ġthis . split ( delimiter ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. last () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. replace First (" qa ", Ġ"") ĊĊĠĠĠĠĠĠĠ Ġif Ġ(! URL Util . is Https Url ( url )) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġurl Ġ= Ġurl . replace First (" http :// ", Ġ" https :// ") ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġreturn Ġurl ĊĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġapi BaseUrl Ġ+ Ġthis ĊĠĠĠ Ġ} Ċ } Ċ Ċ fun ĠList < Api Re call Details Panel > ?. to Re call Details Images ( ĊĠĠĠ Ġrecall : ĠRe call , ĊĠĠĠ Ġapi BaseUrl : ĠString Ċ ) Ġ= Ġthis ĊĠĠĠ Ġ? . find Ġ{ Ġpanel Ġ-> ĊĠĠĠĠĠĠĠ Ġpanel . title . equals (" images ", Ġtrue ) Ġ&& Ġpanel . data Ġ!= Ġnull ĊĠĠĠ Ġ} ?. to Re call Details Images ( recall , Ġapi BaseUrl ) ĊĠĠĠ Ġ. or Empty () Ċ Ċ fun ĠApi Re call Details Response . to Basic Information ( recall : ĠRe call ) Ġ= ĠRe call Details Basic Information ( ĊĠĠĠ Ġrecall . id , ĊĠĠĠ Ġrecall Id , ĊĠĠĠ Ġurl , ĊĠĠĠ Ġtitle , ĊĠĠĠ ĠstartDate , ĊĠĠĠ Ġdate Published Ċ ) Ċ Ċ fun ĠApi Re call Details Response . to Re call And Details Sections And Images ( ĊĠĠĠ Ġrecall : ĠRe call , ĊĠĠĠ Ġapi BaseUrl : ĠString Ċ ) Ġ= ĊĠĠĠ ĠRe call And Basic Information And Details Sections And Images ( ĊĠĠĠĠĠĠĠ Ġrecall , ĊĠĠĠĠĠĠĠ Ġbasic Information Ġ= Ġthis . to Basic Information ( recall ), ĊĠĠĠĠĠĠĠ Ġdetails Sections Ġ= Ġpanels . to Re call Details Sections ( recall ), ĊĠĠĠĠĠĠĠ Ġimages Ġ= Ġpanels . to Re call Details Images ( recall , Ġapi BaseUrl ) ĊĠĠĠ Ġ) Ċ Ċ private Ġfun ĠInt . to Category (): ĠCategory Ġ= ĠCategory . values (). find Ġ{ ĊĠĠĠ Ġit . value Ġ== Ġthis Ċ } Ġ?: ĠCategory . MIS CELL AN EO US Ċ