That isn’t easy because you’d have to use relevance that looks for a pending restart from one of those patches specifically, or you’d have to find the installdate of every one of those patches and if any of them are more recent than the last reboot, then it need to reboot for it to take effect.
There isn’t a simple answer to what you are asking, but this is close: You would be better off looking at the version of the affected file, because it should be the case that if that file is older than the minimum needed to not be vulnerable, but the patch has been applied, then that should mean a reboot is required.
Update: Like this: WannaCry Vulnerability: Custom Analysis created to detect for Vulnerability referenced in MS17-010
@Sreehari Everyone who responds in this forum is volunteering their time. If you have an immediate need, you should pay for Professional Services, otherwise we will do our best to help you figure out a solution to your problem, but on our own time.