This retrospective cohort study was conducted in Wuhan, China, using electronic medical record (EMR) data from the Wuhan Maternal and Children Healthcare Information Tracking System, which is a large integrated healthcare system including the information of maternal demographic characteristics, past histories, antenatal examinations and delivery information from 93 hospitals with obstetrics and gynecology departments and 121 primary health institutions in Wuhan. Eligible participants in this study should met the following criteria: (1) women who delivered a live singleton newborn without any birth defect within 28-41 weeks’ gestational age between June 1, 2015 and June 1, 2017; (2) lived in the urban area of Wuhan during the whole pregnancy and (3), at least had two weight records during early pregnancy, once earlier than 9 weeks of gestation and another should not later than 20weeks of gestation. Women who were younger than 16 years or older than 50 years at delivery were excluded. Also, participants with unknown anthropometric data (i.e. maternal height, pre-pregnancy weight and weight at delivery) were excluded.
A total of 110,078 electronic medical records were conducted and 83,096 participants met the eligibility criteria and were included in the study. 68,527 of them had at least two weight measurement records during 8-20 gestational weeks.
Assessment of study variables
Gestational age was calculated from the delivery date and the date of the last recorded normal menstrual period. Preterm delivery was defined as a delivery between 28 weeks 0 days and 36 weeks 6 days of gestation. We excluded very preterm deliveries (<28 weeks gestation) as there were few in this cohort.
We additionally categorized preterm term subtype as either spontaneous preterm birth, premature rupture of membranes (PROM), or medically indicated preterm birth, based on the records of clinical diagnosis reported by the obstetrician at birth. Medically indicated preterm birth was defined by either induction or caesarean section without uterine contractions or rupture of membranes prior to delivery. PROM was defined as birth with premature rupture of membranes, and spontaneous preterm birth was identified as early onset of delivery and no identifiable medical indication, without a PROM diagnosis.
Gender of the infants was obtained from birth records. Pre-pregnancy weight and height were self-reported at the first prenatal check up (usually in the first trimester). BMI before pregnancy was calculated by weight (kg) /height (m2) and then divided into four groups according to the recommendations of the Institute of Medicine (IOM) (2009): (1) underweight (<18.5 kg/m2); (2) normal weight (18.5-24.9 kg/m2); (3) overweight (25.0-29.9 kg/m2); and (4) obese (≥30 kg/m2).
Maternal weight at delivery was measured within 3 days before the delivery day, and the calculation of GWG was to subtract the maternal pre-pregnancy weight from the weight at delivery, and then classified according to the recommendations of the Institute of Medicine (IOM) (2009). GWG within the IOM recommendations was defined as 12.5-18 kg, 11.5-16 kg, 7-11.5 kg, and 5-9 kg respectively for underweight, normal weight, overweight, and obese women.
According to evidence from previous studies, the gestational BMI gain was divided into minimal (<5 kg/m2), moderate (5-10 kg/m2) and excessive (> 10 kg/m2). Every increase in BMI by 1 point is roughly equivalent to 2.5 kg in weight gain, using the average female weight and height at reproductive age (158 cm, 54 kg) in China .
We used average weekly weight gain between 8-20 weeks gestation to evaluate GWG during early pregnancy, which was calculated as the latest prenatal care weight before 20 weeks of gestation minus the first prenatal care weight(before 9weeks) divided by gestation age of the latest prenatal care (up to 20 weeks of gestation) and classified as class I (<200 g/week), class II (200-400 g/week), class III (400-600 g/week), and class IV (> 600 g/week). 
Unconditional logistic regression was used to calculate odds ratios (ORs), and 95% confidence intervals (CIs) to evaluate the association between PTB and pre-pregnancy BMI, GWG and gestational BMI gain. Models were adjusted for some potential confounders, including infant gender, birth weight, maternal age, parity，education level and models that evaluated maternal pre-pregnancy BMI and BMI/weight gain during pregnancy were mutually adjusted.
Analyses were further stratified by maternal pre-pregnancy BMI categories, and effect modifications with these variables were evaluated by including the relevant cross-product terms in the regression models. Linear trends were tested using the Wald test. Statistical analyses were conducted with SAS, version 9.4, (SAS Institute, Inc., Cary, North Carolina) and P values < 0.05 was considered statistically significant.