Leslie Hendrix spent 19 seasons playing medical examiner Elizabeth Rodgers on all four “Law & Order” series. You’d think playwright Jim Henry would have asked the star of his new thriller for some tips about the way the justice system works. Or just watched a few episodes of her show.

Because even the casual “L&O” viewer can tell that, as a procedural, “7th Monarch” is ludicrous.

Here we have a reclusive, 30-something savant, Miriam (Gretchen Hall), whose parents have disappeared. Having cashed their Social Security checks for three months, she’s visited by a dogged inspector, Raina (Hendrix), who suspects foul play.

The hook is that Miriam is a math whiz with photographic memory and instant recall — the title refers to an academic award she won. She’s basically a human computer, with matching social skills.

This premise isn’t any more of a stretch that the one in the TV series “Unforgettable,” in which a cop uses similar abilities to solve crimes.

But “7th Monarch” is the kind of play where the detective in charge of the case (Michael Cullen), the county prosecutor (Michael Rupert) and Miriam’s public defender (Matthew Humphreys) all work on the case together.

Out on bail, Miriam stays with Raina — never mind that she’s the case’s lead witness. Someone meekly mentions conflict of interest, but nobody pays attention.

As if this weren’t enough, the lawyer privately questions Miriam in front of Raina — the witness.

One implausibility after another rudely interrupts the show’s most interesting aspect: the relationship between the women. In what comes across like an oddly enjoyable medley of “Rain Man” and “The Miracle Worker,” Miriam and Raina slowly bond.

Even so, the playwright can’t help going overboard, saddling Miriam with way too much sob back story — between the abuse and the cutting, it’s one thing after another. Happily, Hall finds endurance and oddball humor in her character, and she’s well-matched with Hendrix’s businesslike but sympathetic Raina.