The diagram below displays the full logic of which patient state changes are allowed and the effect on automatic updating of search results. 

@startuml
start
:API/GUI; 
note right: Patient registry

:Create patient; 
:Patient status = "NEW"; 
note right: Patient status cannot be changed
split 
  switch (Change status) 
  case (PRE, SUS or ACT) 
    :Not allowed;
    stop
  case (STP) 
    :Patient status = "STP";
    stop
  endswitch
split again 
:Start search;
:Patient status = "PRE" \n\
No automatic updates of search results; 
note right: Patient status changed happened automatically due to start search
repeat
  switch (Change status) 
    case (NEW, PRE) 
      if (current state) is (PRE) then 
      else (\n\n\nSTP, SUS or ACT\n\n)
        :Not allowed;
        stop
      endif
    case (SUS)  
      :Patient status = "SUS" \n\
No automatic updates of search results \n\
Previous search results remain available; 
    case (ACT)  
      :Patient status = "ACT" \n\
Automatic updates of search results; 
    case (STP) 
      :Patient status = "STP"\nAll search results removed;
    endswitch
repeat while (change status again?) is (yes) 
->no;
stop
@enduml