A system and method for automatically generating patient-specific and grammatically correct electronic medical records is disclosed. The thin film photovoltaic device has a substrate, a thin film layer formed on the substrate and first and second electrodes formed on one side of the thin film layer. For this purpose, electromagnetic stirring is performed so that the inclining angle of the primary dendrite within 10 mm of a billet surface layer is increased to be not less than 10\xb0.