1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
| PROCEDURE Import()
// Déclaration des variables
nbLigneIntervention est un entier
nxlsIntervention est un entier
sFichierCrypté_Intervention est une chaîne = SAI_Importation
sFichierIntervention_NoExtension est une chaîne
sFichierDonnee_Intervention est une chaîne
// On décrypte le fichier "XLS"
sFichierIntervention_NoExtension = Gauche(sFichierCrypté_Intervention, Taille(sFichierCrypté_Intervention) - 3)
fDécrypte(sFichierCrypté_Intervention, sFichierIntervention_NoExtension + "xls", CS_PASSWORD, crypteSécurisé, Faux)
// On ouvre le fichier XLS
sFichierDonnee_Intervention = xlsOuvre(sFichierIntervention_NoExtension + "xls")
nxlsIntervention = sFichierDonnee_Intervention
//On compte le nombre d'interventions du fichier
nbLigneIntervention = xlsNbLigne(nxlsIntervention)
// On change le curseur en "SABLIER"
Sablier(Vrai)
HGèreIntégrité("*", "*", hCardinalité + hEnModification + hEnSuppression, Faux)
HGèreDoublon(client,"*",Faux)
POUR t=2 A nbLigneIntervention
// On filtre le fichier sur les deux conditions
HFiltre(client, "Nom='"+xlsDonnée(nxlsIntervention,t,5)+"'")
// on lit le premier enregistrement (s'il en existe un) qui correspond aux conditions...
HLitPremier(client, hRespecteFiltre)
// Si HEnDehors alors cela veut dire qu'il n'y en a aucun, on peut donc ajouter
SI HEnDehors() ALORS
client.IDclient = xlsDonnée(nxlsIntervention,t,1)
client.Nom = xlsDonnée(nxlsIntervention,t,5)
client.Archiver = xlsDonnée(nxlsIntervention,t,116)
client.PathsConnues = xlsDonnée(nxlsIntervention,t,117)
client.Date_naissance = xlsDonnée(nxlsIntervention,t,118)
client.Sexe = xlsDonnée(nxlsIntervention,t,119)
SI PAS HAjoute(client) ALORS
ErreurInfo(errComplet)
FIN
FIN
// On filtre le fichier sur les deux conditions
HFiltre(Intervention, "Nom='" + xlsDonnée(nxlsIntervention,t,5) +"'" + " ET Date_int='"+ xlsDonnée(nxlsIntervention,t,6) +"'")
// on lit le premier enregistrement (s'il en existe un) qui correspond aux conditions...
HLitPremier(Intervention, hRespecteFiltre)
// Si HEnDehors alors cela veut dire qu'il n'y en a aucun, on peut donc ajouter
SI HEnDehors() ALORS
Intervention.IDclient = client.IDclient
Intervention.IDIntervention = xlsDonnée(nxlsIntervention,t,2)
Intervention.IDEtablissement = xlsDonnée(nxlsIntervention,t,3)
Intervention.IDClasses = xlsDonnée(nxlsIntervention,t,4)
Intervention.Nom = xlsDonnée(nxlsIntervention,t,5)
Intervention.Date_int = xlsDonnée(nxlsIntervention,t,6)
Intervention.Etablissement = xlsDonnée(nxlsIntervention,t,7)
Intervention.Rs = xlsDonnée(nxlsIntervention,t,8)
Intervention.Classes = xlsDonnée(nxlsIntervention,t,9)
Intervention.Tel = xlsDonnée(nxlsIntervention,t,10)
Intervention.Famille = xlsDonnée(nxlsIntervention,t,11)
Intervention.Intervention = xlsDonnée(nxlsIntervention,t,12)
Intervention.Motifs = xlsDonnée(nxlsIntervention,t,13)
Intervention.Difficultes = xlsDonnée(nxlsIntervention,t,14)
Intervention.Poids_imc = xlsDonnée(nxlsIntervention,t,15)
Intervention.Taille_imc = xlsDonnée(nxlsIntervention,t,16)
Intervention.Imc = xlsDonnée(nxlsIntervention,t,17)
Intervention.Acuite_visuelle = xlsDonnée(nxlsIntervention,t,18)
Intervention.Vision_couleur = xlsDonnée(nxlsIntervention,t,19)
Intervention.Lang = xlsDonnée(nxlsIntervention,t,20)
Intervention.Audition = xlsDonnée(nxlsIntervention,t,21)
Intervention.Dents = xlsDonnée(nxlsIntervention,t,22)
Intervention.Equilibre = xlsDonnée(nxlsIntervention,t,23)
Intervention.Lateralite = xlsDonnée(nxlsIntervention,t,24)
Intervention.Vaccination = xlsDonnée(nxlsIntervention,t,25)
Intervention.Pathologies_depistes = xlsDonnée(nxlsIntervention,t,26)
Intervention.Actions_Amenagements = xlsDonnée(nxlsIntervention,t,27)
Intervention.Suivi = xlsDonnée(nxlsIntervention,t,28)
Intervention.Suites = xlsDonnée(nxlsIntervention,t,29)
Intervention.Avis_enseignant = xlsDonnée(nxlsIntervention,t,30)
Intervention.Conclusion = xlsDonnée(nxlsIntervention,t,31)
Intervention.Amenagement = xlsDonnée(nxlsIntervention,t,32)
Intervention.Avis = xlsDonnée(nxlsIntervention,t,33)
Intervention.A_voir = xlsDonnée(nxlsIntervention,t,34)
Intervention.Carnet_de_sante = xlsDonnée(nxlsIntervention,t,35)
Intervention.Non_vu = xlsDonnée(nxlsIntervention,t,36)
Intervention.Parents = xlsDonnée(nxlsIntervention,t,37)
Intervention.RAS = xlsDonnée(nxlsIntervention,t,38)
Intervention.Recours_soins = xlsDonnée(nxlsIntervention,t,39)
Intervention.A_revoir = xlsDonnée(nxlsIntervention,t,40)
Intervention.Mois = xlsDonnée(nxlsIntervention,t,41)
Intervention.Annee = xlsDonnée(nxlsIntervention,t,42)
Intervention.Date_a_revoir = xlsDonnée(nxlsIntervention,t,43)
Intervention.TL = xlsDonnée(nxlsIntervention,t,44)
Intervention.M = xlsDonnée(nxlsIntervention,t,45)
Intervention.E = xlsDonnée(nxlsIntervention,t,46)
Intervention.C = xlsDonnée(nxlsIntervention,t,47)
Intervention.CM = xlsDonnée(nxlsIntervention,t,48)
Intervention.CTL = xlsDonnée(nxlsIntervention,t,49)
Intervention.Alouette1 = xlsDonnée(nxlsIntervention,t,50)
Intervention.Alouette2 = xlsDonnée(nxlsIntervention,t,51)
Intervention.Elocution = xlsDonnée(nxlsIntervention,t,52)
Intervention.Graphisme = xlsDonnée(nxlsIntervention,t,53)
Intervention.Lecture = xlsDonnée(nxlsIntervention,t,54)
Intervention.Comprehension_lecture = xlsDonnée(nxlsIntervention,t,55)
Intervention.Orthographe = xlsDonnée(nxlsIntervention,t,56)
Intervention.Calcul = xlsDonnée(nxlsIntervention,t,57)
Intervention.Conscience_phonologique = xlsDonnée(nxlsIntervention,t,58)
Intervention.Empan = xlsDonnée(nxlsIntervention,t,59)
Intervention.Discrimination_visuelle = xlsDonnée(nxlsIntervention,t,60)
Intervention.Attention = xlsDonnée(nxlsIntervention,t,61)
Intervention.Conners = xlsDonnée(nxlsIntervention,t,62)
Intervention.Orientation_temporo_spatiale = xlsDonnée(nxlsIntervention,t,63)
Intervention.Conclu_langage = xlsDonnée(nxlsIntervention,t,64)
Intervention.Neuropediatre = xlsDonnée(nxlsIntervention,t,65)
Intervention.Psy_scolaire = xlsDonnée(nxlsIntervention,t,66)
Intervention.Autres_competences = xlsDonnée(nxlsIntervention,t,67)
Intervention.QIV = xlsDonnée(nxlsIntervention,t,68)
Intervention.QIP = xlsDonnée(nxlsIntervention,t,69)
Intervention.QIT = xlsDonnée(nxlsIntervention,t,70)
Intervention.ICV = xlsDonnée(nxlsIntervention,t,71)
Intervention.IRP = xlsDonnée(nxlsIntervention,t,72)
Intervention.IMT = xlsDonnée(nxlsIntervention,t,73)
Intervention.IVT = xlsDonnée(nxlsIntervention,t,74)
Intervention.Conclu_competence = xlsDonnée(nxlsIntervention,t,75)
Intervention.Notes = xlsDonnée(nxlsIntervention,t,76)
Intervention.Accident_fracture = xlsDonnée(nxlsIntervention,t,77)
Intervention.Operation_hospitalisation = xlsDonnée(nxlsIntervention,t,78)
Intervention.Traumatisme_cranien = xlsDonnée(nxlsIntervention,t,79)
Intervention.Malaise_PDC = xlsDonnée(nxlsIntervention,t,80)
Intervention.Trouble_equilibre = xlsDonnée(nxlsIntervention,t,81)
Intervention.Maladie_grave_chronique = xlsDonnée(nxlsIntervention,t,82)
Intervention.Asthme_allergie = xlsDonnée(nxlsIntervention,t,83)
Intervention.Suivi_pb_sante = xlsDonnée(nxlsIntervention,t,84)
Intervention.Suivi_orthophonie = xlsDonnée(nxlsIntervention,t,85)
Intervention.Dispense_sport = xlsDonnée(nxlsIntervention,t,86)
Intervention.Lunettes = xlsDonnée(nxlsIntervention,t,87)
Intervention.Medicaments = xlsDonnée(nxlsIntervention,t,88)
Intervention.Conso_tabac_alcool = xlsDonnée(nxlsIntervention,t,89)
Intervention.Exam_cardio_pulmonaire = xlsDonnée(nxlsIntervention,t,90)
Intervention.Exam_rachis = xlsDonnée(nxlsIntervention,t,91)
Intervention.Exam_equilibre = xlsDonnée(nxlsIntervention,t,92)
Intervention.Exam_autre = xlsDonnée(nxlsIntervention,t,93)
Intervention.Conclusion_visite_machine = xlsDonnée(nxlsIntervention,t,94)
Intervention.Motifs_risque_danger = xlsDonnée(nxlsIntervention,t,95)
Intervention.Deficience_principale = xlsDonnée(nxlsIntervention,t,96)
Intervention.Tps_scolarisation = xlsDonnée(nxlsIntervention,t,97)
Intervention.Heure_semaine = xlsDonnée(nxlsIntervention,t,98)
Intervention.Amenagements_handicap = xlsDonnée(nxlsIntervention,t,99)
Intervention.Milieu_vie = xlsDonnée(nxlsIntervention,t,100)
Intervention.Csp_parents = xlsDonnée(nxlsIntervention,t,101)
Intervention.Adresse = xlsDonnée(nxlsIntervention,t,102)
Intervention.Int_Maltraitance = xlsDonnée(nxlsIntervention,t,103)
Intervention.Motifs_maltraitance = xlsDonnée(nxlsIntervention,t,104)
Intervention.Origine_maltraitance = xlsDonnée(nxlsIntervention,t,105)
Intervention.Suites_maltraitance = xlsDonnée(nxlsIntervention,t,106)
Intervention.Int_risque_danger = xlsDonnée(nxlsIntervention,t,107)
Intervention.Motifs_risque_danger = xlsDonnée(nxlsIntervention,t,108)
Intervention.Origine_risquedanger = xlsDonnée(nxlsIntervention,t,109)
Intervention.Suites_risquedanger = xlsDonnée(nxlsIntervention,t,110)
Intervention.Deja_suivi = xlsDonnée(nxlsIntervention,t,111)
Intervention.Constat_coup = xlsDonnée(nxlsIntervention,t,112)
Intervention.Signalement_conseil_general = xlsDonnée(nxlsIntervention,t,113)
Intervention.Signalement_parquet = xlsDonnée(nxlsIntervention,t,114)
Intervention.Aptitude_machine_dangereuse = xlsDonnée(nxlsIntervention,t,115)
Intervention.Brev = xlsDonnée(nxlsIntervention,t,120)
Intervention.odedys = xlsDonnée(nxlsIntervention,t,121)
Intervention.bseds = xlsDonnée(nxlsIntervention,t,122)
Intervention.autre_test = xlsDonnée(nxlsIntervention,t,123)
// Puis on ajoute
SI PAS HAjoute(Intervention) ALORS
ErreurInfo(errComplet)
FIN
FIN
FIN
HDésactiveFiltre(Intervention)
HDésactiveFiltre(client)
// On ferme le fichier Xls
xlsFerme(nxlsIntervention)
// Suppression du fichier XLS "tempon"
fSupprime(sFichierIntervention_NoExtension + "xls")
// Vérification des erreurs d'intégrité
SI HErreurIntégrité() = Faux OU HErreurDoublon()=Faux ALORS
Info("L'importation s'est déroulée avec succès !")
SINON
Erreur("Une erreur s'est produite, veuillez ré-essayer.")
FIN
// On reprend la forme du curseur standart
Sablier(Faux)
// On rafraichit la table
TableAffiche(FEN_Menu.TABLELISTE,taDébut) |
Partager