Derivation and external validation of risk stratification models for severe maternal morbidity using prenatal encounter diagnosis codes