A person who is or has ever been diagnosed and confined or sentenced by a court of competent jurisdiction to a hospital or other institution in this state or elsewhere is prohibited from buying a firearm or from having one in possession or under control.