Biomimetic synthesis of Mg-substituted hydroxyapatite nanocomposites and three-dimensional printing of composite scaffolds for bone regeneration.