A pharmacoepidemiological study of the risks and benefits to mothers and offspring of prescribing drugs during pregnancy