That’s the lesson a Manhattan hospital learned the hard way after a disgruntled computer geek was busted for allegedly hacking into its internal computer network, including patient information and test results.

Jason Wang, 45, of Long Island, wreaked havoc with the computer system at North General Hospital in Harlem after he was fired by officials there in September 2009 and proceeded to hack into the network, according to a criminal complaint filed by Manhattan DA Cyrus Vance Jr. yesterday.

Wang is also charged with using a doctor’s password and credentials to send a scathing e-mail to other hospital staffers, accusing Michele Prisco, North General’s vice president and chief information officer, of being a “racist.”

The attacks on the hospital’s information system and the e-mail ripping Prisco occurred just days after Wang was canned by North General on Sept. 11, 2009.

The system contains all the hospital’s confidential information, including patient data, accounts and test results.

Prisco did not return calls for comment. A hospital spokeswoman declined comment.

Wang was arrested Friday and charged with one count each of computer trespass, unauthorized use of a computer, and fourth-degree computer tampering.