sc3/cookcountyjail — pull request #117 by bepetersn (2013-08-13 08:14:07+00:00)
Title: Unique hash IDs for all persons in the CCJ system

Herein I've implemented a hash based on an inmate's name, birthdate, race, and gender to create a (hopefully) universally unique identifer for persons who enter the CCJ system, outside of their status as inmates for particular stays in that system. The expectation is that over time we will begin to see the phenomenon of recidivism, or people returning to jail. This hash value is the new primary key for our inmate object, while almost all of the fields previously associated with our inmate object are now associated with a particular `JailStay` object.

You can access a list of `JailStay` objects associated with an inmate by calling `list(inmate.jail_history.all())` for all list capability (e.g. negative indexing, to get the last JailStay for example), OR just `inmate.jail_history.all()`.

I don't THINK I've broken anything with this code. Much credit to Norbert's earlier decoupling of our code via inmate_details and inmate_utils on that count. Also credit to Wil and probably Dave for how charges_history and housing_history are set up, as I used these as a guide.

And now we just need to add this to our API...