My friend Debbie Cabaniss et al got around to writing this book before I got around to it: Psychodynamic Formulation.
I have written about Psychiatric diagnosis often here, and I re-post my pieces each year. It is a complicated topic, because Psychiatric complaints originate from all sorts of sources and usually multiple sources, and an exhaustive psychodynamic formulation is not always relevant to minor life problems.
When it is relevant, a serious formulation is a difficult thing to do unless one just casually links history to current complaints. That's not a real formulation.
The current fad in Psychiatry is the DSM, which a robot could do. In many situations a DSM "diagnosis" is nothing more than a list of complaints useful only for an insurance claim and has nothing to do with understanding an individual person.