If you are not afraid of using basic COS functionality:
your reload method raises a LOCK ^myRELOAD  
and drops it with completion LOCK -^myRELOAD

Your check utility does the same but with a timeout LOCK ^myRELOAD:0
if it fails - signaled by $TEST=0  you loop and hang around and retry
for success $TEST=1 you go on but release your successful LOCK immediately
not to block anyone else.
 

According to your JSON model, I would assume this to start:
(sory had no chance to test myself)

Class Test.GEOMETRIEPOINT Extends (%SerialObject, %JSON.Adaptor, %XML.Adaptor) 
{

Property "GEO_TAB_COORDONNES" As list Of %Float;
}

Class Test.GEOMETRIELINE Extends (%SerialObject, %JSON.Adaptor, %XML.Adaptor)
{

Property "GEOMETRIE_LINE" As list Of GEOMETRIEPOINT;
}

Class Test.POLYGON Extends (%Persistent,%JSON.Adaptor, %XML.Adaptor)
{

Property "GEOMETRIE_POLYGON" As list Of GEOMETRIELINE;
{

You have to blame the designers of the language back in the 60ties of last century.
it was even an ANSI Standart then.
And it is backward compatible and the code of the 60ties still can run unchanged!

it's an interesting line:

patient0 = Patient.parse_obj(patients_resources.search(family='familyname',given='givenname1').first().serialize())

I miss some checks if the search was successful.
Because NONE indicates a missing content.
If search(family='familyname',given='givenname1')
fails you receive NONE and this can't be serialized.  
COS would just return NullString """
 

  • if you have access to the CSP or ZEN page you may just check the user name in method OnPreHTTP or similar, and redirect him to the moon.
  • if can't touch the page then rename it and create a filter page that does a server-side redirect for everyone except the banned user. .