One of the evil details of the Electronic Health Records mandated by the ACA and the AMA’s standard format - they ALL ask if you own a gun.
When you’re at the primary care doctor, pediatrician, OBGYN - the records ALL ask this question, and if you don’t answer, they ask again next time because it flags the non-answer.
So you get a government database of who owns guns from the electronics health records along with any conditions that can be used to preclude ownership.
I was in an urgent care clinic about 2 years ago in the waiting room filling out all the insurance and medical history paper work when I saw a form that asked me if I kept guns in the home. The gun question was just one of about 10 questions such as asking if I had a swimming pool and other non medical questions. I drew a giant "N/A - Not Medical Info" on the form that would cover all the questions. I have been in there several times since and have not seen that form again so I assume they don't use it anymore.