Doesn't make sense to reset in previous state. You're resetting door opened flag there. I'm talking about patient connect confirm flag used in if statement above.
Can we shift this into app/driver level code, so that every time we don't touch hal code when we add any new init code? thinking about additional level abstraction (One Init function calls all of these inits and that alone be exposed to hal.) ??