A federal judge on Friday gave John W. Hinckley's doctors more flexibility to help the would-be presidential assassin rejoin society.

Hinckley, who said he shot President Reagan to impress actress Jodie Foster, was found not guilty by reason of insanity in 1982. Testimony at trial indicated he suffered from depression and a psychotic disorder that led to an obsession with Foster and he was committed to a psychiatric hospital.

Officials at St. Elizabeths Hospital here sought to loosen restrictions on how far in advance they must alert the Secret Service when they take Hinckley into the community to attend baseball games, the theater and other events.

Such outings would allow doctors to observe Hinckley in social situations and get him more comfortable in public, the hospital said.

The hospital receives unsold tickets to such events on very short notice but, under a 1987 agreement, hospital officials were required to alert the Secret Service of any outings two weeks in advance. That made Hinckley unable to attend.

Over the objection of the government, U.S. District Judge Paul L. Friedman said Friday that the hospital need only give the Secret Service four days notice when it plans to take Hinckley off hospital grounds.

Friedman also is considering whether to allow Hinckley to make more frequent and lengthy unsupervised visits to his family's home in Virginia. Prosecutors have opposed that request as well.

Hinckley shot Reagan, press secretary James Brady, a Secret Service agent and a Washington policeman March 30, 1981 as the president emerged from a hotel.