$titre_ = "Mademoiselle"; } if ($mbPatient->civilite == "mme") { $titre_ = "Madame"; } } $transTitre["Monsieur"] = "1"; $transTitre["Madame"] = "2"; $transTitre["Mademoiselle"] = "3"; $transTitre["Enfant garçon"] = "4"; $transTitre["Enfant fille"] = "5"; $transTitre["Bébé garçon"] = "6"; $transTitre["Bébé fille"] = "7"; $transTitre["Docteur"] = "8"; $transTitre["Doctoresse"] = "A"; $doc->setDocument("tmp/Prescription-" . $mbPrescription->_id . ".xml"); // Creation de la prescription $prescription = $doc->addElement($doc, "Prescription"); // Prescription --> Numero $num_prat = str_pad($idSantePratCode4->id400, 4, '0', STR_PAD_LEFT); $num_presc = $idexPresc; $num_presc %= 1000; $num_presc = str_pad($num_presc, 4, '0', STR_PAD_LEFT); $numero = $doc->addElement($prescription, "numero", $num_prat . $num_presc); // Prescription --> Patient $patient = $doc->addElement($prescription, "Patient"); $nom = $doc->addElement($patient, "nom", $mbPatient->nom); $prenom = $doc->addElement($patient, "prenom", $mbPatient->prenom); $titre = $doc->addElement($patient, "titre", $transTitre[$titre_]); $sexe = $doc->addElement($patient, "sexe", $transSexe[$mbPatient->sexe]); $datenaissance = $doc->addElement($patient, "datenaissance", CMbDT::format($mbPatient->naissance, "%Y%m%d"));