By Laura Davies, MD
This summer, I spent my time developing an app. I live in San Fransisco as a forensic psychiatrist with experience in medical AI and I’m aware of the challenges at the intersection of mental health, law, and technology. This summer, I decided to tackle a persistent issue I've observed in the California court system: the inconsistent quality of California PC1368 competency to stand trial reports.
Having worked with these reports for over 15 years, I knew that forensic experts didn't always address all the specific requirements outlined in the code. This oversight often led to delays in court proceedings, frustrated judges, and a growing backlog of cases. More importantly, it kept defendants in jail longer than necessary while awaiting appropriate reports.
I saw an opportunity to make things better. Of course, it was an app. The requirements for these reports were limited and standardized. The concept was straightforward: develop an application that could analyze competency reports, identify missing elements, and provide constructive feedback to the experts. This was a natural fit for AI.
However, none of the identifiable data could be released to the “data sea” of AI. Data security and preservation of confidentiality were non-negotiable. This made the execution far more complex than I had thought it would be.
I designed a system that prioritizes privacy and security. The app works as follows: A court clerk securely uploads the PDF report via a secure website. It is securely sent to private-ai.com, a platform specializing in data anonymization. The report is immediately de-identified, stripping away all personal information. This anonymized version is then processed by ChatGPT, which I've instructed with specific guidelines to analyze the report based on PC1368 criteria.
Once the analysis is complete, the original report is permanently deleted from private-ai.com, ensuring no trace of the sensitive data remains. The clerk receives a detailed, professionally worded email highlighting areas that the expert might need to address. This email can be sent directly to the expert for revisions and helps the court determine if a new evaluation is necessary. There is no identifying information in this email; each court system can select whether they would like to add anything. Notably, experts tend to write fewer than one report per month so it would be unlikely that there would be any confusion.
I tried to develop the app independently, learning various systems for “no-code AI.” Writing the prompts for ChatGPT was easy. Finding a legitimate site for de-identification and collaborating with their programmers was achievable. Securely uploading files and transmitting them to and from the data anonymization site (private-ai.com) completely overwhelmed me. At that point I enlisted computer science students. It was a win-win: I had a secure app, and they had their first consulting project.
I now have a working prototype which I have demonstrated to a Mental Health Court. Because I had consulted with the clerks and the Judge prior to designing the app, I was able to minimize the steps that they would have to take to use it. One of the clerks noted that it would make it easier to actually “check the box” of whether the expert had said the patient was competent to stand trial. He said that some reports are up to 27 pages long, and do not have a clear statement answering the main question. It will also make the orders for the administration of psychotropic medications easier, since each of the competency requirements must be addressed.
While it is a pilot and still needs to clear the approval process, the potential impact is significant. This tool could lead to faster case processing, more comprehensive reports, and ultimately, a fairer judicial process for defendants. It will help clarify many psychiatric terms and nuances by ensuring that they are standardized for the court. By combining my knowledge of psychiatry, law, and AI, I was able to work with a team to create a tool that respects patient privacy while potentially improving the efficiency and fairness of the legal system.
Comments