-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfonction_principale.py
139 lines (121 loc) · 6.74 KB
/
fonction_principale.py
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
#le début du programme
import os
from clear_consol import clear_consol
from patients import enregistre_patient, chercher_patient_avec_numero_dossier, afficher_patient, afficher_les_plaintes_patient, afficher_imc_patient, chercher_patient_avec_ses_identifiants
from docteur import enregistre_docteur, afficher_docteur, ajouter_horaire, afficher_horaire, enregistrer_horaire, changer_horaire
print("################################################################")
print("## ##")
print("## PROGRAMME DE GESTION D'UN HOPITAL EN PYTHON ##")
print("## ##")
print("################################################################")
#La déclaration des variables globales
def fonction_principale():
os.system('pause')
clear_consol()
print("################################################################")
print("## ##")
print("## MENU PRINCIPALE ##")
print("## ##")
print("################################################################")
print(f'Voici les actions que vous pouvez réaliser dans ce programme\n0: Pour quitter le programme\n1: Pour Enregistrer un docteur\n2: Pour Enregistrer un patient\n3: Chercher un patient par ses identités\n4: Chercher un patient par le numero de dossier\n5: Afficher tous les patients\n6: Afficher tous les docteurs\n7: Enregistrer l\'horaire de chaque medecin\n8: Afficher les plaintes d\'un patient à partir de son numero unique\n9: Afficher l\'IMC (indice de masse corporel) d\'un patient\n10: Pour Afficher l\'horaire d\'un médecin\n11: Pour ajouter à l\'horaire d\'un docteur\n12: Pour changer l\'horaire d\'un docteur')
choix = input ("\n>>>>")
if choix.lower() == "0":
exit()
elif choix.lower() == "1":
prenom = input("Entrez le prenom du nouveau docteur: ")
nom = input("Entrez le nom du nouveau docteur: ")
postnom = input("Entrez le postenom du nouveau docteur: ")
tel = input("Entrez le numéro de téléphone du nouveau docteur: ")
specialisation = input("Quel est la spécialisattion du nouveau docteur: ")
genre= input("Entrez le genre du nouveau docteur (M ou F): ")
enregistre_docteur(prenom, nom, postnom, tel, specialisation, genre)
os.system('pause')
clear_consol()
fonction_principale()
elif choix.lower() == "2":
prenom_patient = input("Entrez le prenom du patient: ")
nom_patient = input("Entrez le nom du patient: ")
postnom_patient = input("Entrez le postenom du patient: ")
tel_patient = input("Entrez le numéro de téléphone du patient: ")
poids_patient = float(input("Entrez le poids du patient"))
taille_patient = float(input("Entrez la taille du patient: "))
genre_patient = input("Entrez le genre du nouveau patient M ou F: ")
age_patient = int(input("Entrez l'âge du patient: "))
plaintes_patient = input("De quoi souffre le patient: ")
date = input("Entrez la date de l'enregistrement avec cette anneautation 22-06-2022: ")
enregistre_patient(prenom_patient, nom_patient, postnom_patient, tel_patient, poids_patient, taille_patient, genre_patient, age_patient, plaintes_patient, date)
os.system('pause')
clear_consol()
fonction_principale()
elif choix.lower() == "3":
prenom = input("Entrez le prenom du patient que vous voulez chercher: ")
nom = input("Entrez le nom du patient que vous voulez chercher: ")
postnom = input("Entrez le postnom du patient que vous voulez chercher: ")
chercher_patient_avec_ses_identifiants(prenom, nom, postnom)
os.system('pause')
clear_consol()
fonction_principale()
elif choix.lower() == "4":
numero_dossier = input("Entrez le numéro du dossier du patient: ")
print(chercher_patient_avec_numero_dossier(numero_dossier))
os.system('pause')
clear_consol()
fonction_principale()
elif choix.lower() == "5":
print(afficher_patient())
os.system('pause')
clear_consol()
fonction_principale()
elif choix.lower() == "6":
print(afficher_docteur())
os.system('pause')
clear_consol()
fonction_principale()
elif choix.lower() == "7":
prenom = input("Entrez le prenom du docteur pour leque vous voulez Enregistrer l'horaire: ")
nom = input("Entrez le nom du docteur pour leque vous voulez Enregistrer l'horaire: ")
postnom = input("Entrez le postnom du docteur pour leque vous voulez Enregistrer l'horaire: ")
print(enregistrer_horaire(prenom, nom, postnom))
os.system('pause')
clear_consol()
fonction_principale()
elif choix.lower() == "8":
numero_dossier = input("Entrez le numéro du dossier du patient: ")
afficher_les_plaintes_patient(numero_dossier)
os.system('pause')
clear_consol()
fonction_principale()
elif choix.lower() == "9":
numero_dossier = input("Entrez le numéro du dossier du patient: ")
print(afficher_imc_patient(numero_dossier))
os.system('pause')
clear_consol()
fonction_principale()
elif choix.lower() == "10":
prenom = input("Entrez le prenom du Docteur pour lequel vous voulez voir l'horaire: ")
nom = input("Entrez le nom du Docteur pour lequel vous voulez voir l'horaire: ")
postnom = input("Entrez le postnom du Docteur pour lequel vous voulez voir l'horaire: ")
print(afficher_horaire(prenom, nom, postnom))
os.system('pause')
clear_consol()
fonction_principale()
elif choix.lower() == "11":
jour = input("Pour quel jour vous voulez ajouter la tâche: ")
nomDocteur = input("Entrez le nom du docteur pour lequel vous voulez ajouter une tâche à l'horaire: ")
print(ajouter_horaire(jour, nomDocteur))
os.system('pause')
clear_consol()
fonction_principale()
elif choix.lower() == "12":
jour = input("Pour quel jour vous voulez changer la tâche: ")
nomDocteur = input("Entrez le nom du docteur pour lequel vous voulez ajouter une tâche à l'horaire: ")
print(changer_horaire(jour, nomDocteur))
os.system('pause')
clear_consol()
fonction_principale()
else :
print("Cette fonction n'est pas reconnu !\n\n")
os.system('pause')
clear_consol()
fonction_principale()
fonction_principale()