package Ġuk . n hs . n hs x . covid 1 9 . android . app . test ordering Ċ Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . state . Isolation Logical State Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . test ordering . TestResult ViewState . Positive Continue Isolation Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . test ordering . TestResult ViewState . Positive Continue Isolation No Change Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . test ordering . TestResult ViewState . Positive Will Be In Isolation Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . test ordering . TestResult ViewState . Positive Will Be In Isolation And Order Test Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . test ordering . TestResult ViewState . Positive W ont Be In Isolation Ċ import Ġjava . time . Clock Ċ import Ġjavax . inject . Inject Ċ Ċ class ĠCompute TestResult ViewState On Positive Ġ@ Inject Ġconstructor ( ĊĠĠĠ Ġprivate Ġval Ġis Key Submission Supported : ĠIs Key Submission Supported , ĊĠĠĠ Ġprivate Ġval Ġevaluate TestResult Button Action : ĠEvaluate TestResult Button Action , ĊĠĠĠ Ġprivate Ġval Ġclock : ĠClock Ċ ) Ġ{ ĊĠĠĠ Ġoperator Ġfun Ġinvoke ( ĊĠĠĠĠĠĠĠ Ġcurrent State : ĠI sol ation Logical State , ĊĠĠĠĠĠĠĠ ĠnewState : ĠI sol ation Logical State , ĊĠĠĠĠĠĠĠ Ġtest Result : ĠReceived TestResult ĊĠĠĠ Ġ): ĠTest Result ViewState Ġ= ĊĠĠĠĠĠĠĠ Ġif Ġ( newState . isActive Isolation ( clock )) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ( test Result . requires Conf ir mat ory Test Ġ&& Ġ! is Key Submission Supported ( test Result )) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġwhen Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcurrent State . has Active Confirmed Positive TestResult ( clock ) Ġ-> ĠPositive Continue Isolation No Change ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠnewState . has Completed Positive TestResult () Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġmain State When Positive New State Is Is ol ating ( currentState , ĠnewState , Ġtest Result ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġelse Ġ-> ĠPositive Will Be In Isolation And Order Test ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} Ġelse Ġmain State When Positive New State Is Is ol ating ( currentState , ĠnewState , Ġtest Result ) ĊĠĠĠĠĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠPositive W ont Be In Isolation ( evaluate TestResult Button Action ( currentState , ĠnewState , Ġtest Result )) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġmain State When Positive New State Is Is ol ating ( ĊĠĠĠĠĠĠĠ Ġcurrent State : ĠI sol ation Logical State , ĊĠĠĠĠĠĠĠ ĠnewState : ĠI sol ation Logical State , ĊĠĠĠĠĠĠĠ Ġtest Result : ĠReceived TestResult ĊĠĠĠ Ġ): ĠTest Result ViewState Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġbutton Action Ġ= Ġevaluate TestResult Button Action ( currentState , ĠnewState , Ġtest Result ) ĊĊĠĠĠĠĠĠĠ Ġreturn Ġif Ġ( currentState . isActive Isolation ( clock )) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠPositive Continue Isolation ( button Action ) ĊĠĠĠĠĠĠĠ Ġ} Ġelse ĠPositive Will Be In Isolation ( button Action ) ĊĠĠĠ Ġ} Ċ } Ċ