Antecedent factors independently associated with delirium onset were restraint use ( hazard ratio , 1.87 ; 95 % CI , 1.33-2 .63 ; p = 0.0003 ) , antipsychotic administration ( hazard ratio , 1.67 ; 95 % CI , 1.005-2 .767 ; p = 0.047 ) , and midazolam dose ( hazard ratio , 0.998 ; 95 % CI , 0.997-1 .0 ; p = 0.049 ) .