Isolated mosfet switching circuit
It looks good to me. Make sure that your voltage on PA6 is enough to reliably operate the 2N7002- you might want to use a lower Vgs MOSFET if your input voltage could be low. 

Of course you could use an N-channel MOSFET for the output instead, but it doesn't make much difference.