A federal judge has ordered the Oregon Department of Corrections to house transgender women in state prisons based on their gender identity and only after completing safety assessments on each case.