Learning Causal Hazard Ratio with Endogeneity