The District man charged with shooting a Whole Foods cashier in the face during a robbery had stopped taking psychiatric medication prescribed to him in 2013 because he told her he “thought he was sane,” a D.C. psychologist wrote in her report to federal prosecutors and judges in D.C. Superior Court.

As a result of the evaluation, a judge on Thursday ordered that Michael Whatley Jr. should be transferred from the D.C. jail to St. Elizabeths, the District’s psychiatric hospital, for a 30-day evaluation.

The psychologist wrote in the report, completed after a brief examination, that she needed more time to determine whether Whatley, 28, was suffering from a mental illness, which could make him incompetent to stand trial in the Dec. 2 shooting.

According to police, at about 10:45 a.m. that Sunday, Whatley entered the Whole Foods market in the newly gentrified H Street NE neighborhood, walked up to a cashier, pulled out a gun and demanded money.

Police said the cashier tried to open the register, but failed — at which point, they said, Whatley shot the cashier twice in the chest. As the two began to wrestle, the cashier was shot in the mouth.

The cashier broke free and ran as police said the gunman fired three more times, sending frightened shoppers scattering for cover along the normally bustling sidewalk, police said. The cashier suffered non-life-threatening injuries.

In her four-page report, District psychologist Teresa Grant wrote that it was not the first time she had evaluated Whatley. She said she also had seen him following his arrest in a 2013 assault case, and that he was then diagnosed with bipolar disorder.

Grant wrote that during a Dec. 10 meeting with Whatley, he told her that after he was released from St. Elizabeths following his 2013 examination, he stopped taking his medication because “he thought he was sane.”

During the 25-minute meeting, Grant wrote that Whatley’s conversation was “compromised by irrational ideations” and that he “rambled.” Grant also said in the report that Whatley was “highly agitated and hostile” and that he threatened her, which caused U.S. marshals to intervene.

In 2012, Whatley was profiled by The Washington Post about his efforts to avoid violence by turning to writing poetry about his life.

In the 2013 incident that led to his arrest, police said Whatley was apprehended while riding aboard a Metrobus with a gun. He shouted to police, “You looking for the king?” He was found incompetent and then later competent to stand trial; the charges were dismissed.

In 2015 he was charged with assault on a police officer after authorities said he threw a flower pot at an officer in a hospital hallway and then tried to grab the officer’s gun while biting his arm. He was convicted and sentenced to 60 days in jail, with all but five days suspended.

Another hearing was scheduled for Jan. 17, at which point St. Elizabeths doctors will determine whether Whatley is competent to move forward with the case or should remain at the hospital.