Military doctors could reduce suicides among soldiers with psychiatric conditions by using a new screening system that flags those at highest risk of taking their own lives, a new study suggests.

The system — a computer program that rates more than 20 actuarial factors, including age at enlistment, history of violence and prescription drug use — would be the most rigorous suicide prediction model available, if it performs as expected in real-world settings. Most suicide screenings are questionnaires with virtually no predictive power and are dependent on truthful answers from people who often have reason to hide their intentions.

But the new study found that those it categorized as high-risk — some 5 percent of a sample of more than 40,000 soldiers who had been hospitalized for a mental health problem — were almost 15 times as likely to commit suicide in the year after being discharged from the hospital as the rest of the group.

The risk model is not likely to be immediately useful in civilian hospitals, which do not have nearly as much personal data on patients as the military does. The findings, from a consortium of military and academic researchers, were published Wednesday by the journal JAMA Psychiatry.