"Hysteria" is a fun fling of a movie about medical science at its shakiest. Literally.

This amusing period comedy chronicles the invention of the vibrator in the late Victorian era, when doctors used early versions of the electrical device to bring women to sexual satisfaction. This was done in the name of treating women thought to be suffering from “hysteria,” a vague diagnostic catch-all that covered pretty much all female complaints from melancholia to mania.

The male doctors, unable even to envision what to them was the then-preposterous notion that women might have sexual needs or could achieve actual orgasm, viewed the vibrator as a scientific device that relieved female patients of built-up, ahem, pressure, leaving them calm and appropriately docile.

As Mortimer Granville (Hugh Dancy), the initially priggish but idealistic young English doctor who first uses the vibrator in “Hysteria,” claims, “It’s strictly a medical treatment that stimulates the nervous system.”

Tell that to the scores of eager female patients crowding his waiting room.

The medical use of electrical vibrators by doctors to cure women’s “hysteria” in the 1800s was also the subject of “In the Next Room,” a well-reviewed, emotionally complex play by Sarah Ruhl that was done on Broadway in 2009 and at South Coast Repertory in Costa Mesa, Ca. in 2010.

Director Tanya Wexler takes a lighter approach in this — let’s just say it — feel good comedy. “Hysteria” is actually more of a romantic comedy, since a major component of its story is how Mortimer finds himself engaged to Emily Dalrymple (Felicity Jones), a proper Victorian maiden, while strongly attracted to radical Charlotte Dalrymple (Maggie Gyllenhaal), her social activist older sister. Both women are the daughters of the pompous, successful establishment physician (Jonathan Pryce) for whom Mortimer works as a junior partner in London.

When a wealthy inventor friend (Rupert Everett) develops the vibrator, Mortimer is quick to grasp its medical potential. He and his fellow physicians had been manually masturbating their female patients before, a practice that required lengthy sessions until patients found relief and which led to cramps and soreness problems from repetitive use in the physician’s fingers and hands. The “percussor,” as Mortimer dubs his vibrator, cuts the time spent with patients down to minutes and relieves the physical stress on the doctor.

“Hysteria” conveys all of this with admirable economy and humor. Just as Mortimer here performs his buzzy medical magic from behind decorous partial curtains which shield the patient from actual view, so the movie deftly suggests more than it actually specifies either visually or verbally.

Dancy makes for an appealing leading man, all shy charm and embarrassment, while Gyllenhaal provides a lively foil, her character merrily challenging Mortimer with her progressive views at every turn.

Historical note: There was an actual J. Mortimer Granville who devised a medical vibrator in 1880, but the movie does little more than appropriate his name, invention and era. The real Granville specified that his vibrators were to be used to relieve commonplace muscle aches and vociferously objected when medical peers began applying his massagers to women’s private parts. (For everything you ever wanted to know about sexually-flavored medical treatment for women during that era, click here.)