Professional Documents
Culture Documents
Ip Project 12
Ip Project 12
import os
######################################
######################################
def patRegister():
rno = len(patdf)
#print (rno)
while True:
if serPatientbyId(pid)> 0:
else:
break
weight = input("Weight:")
#print (patdf)
patdf.to_csv("csvfile\\patientnew.csv", mode='w')
######################################
######################################
def patUpdate():
if serPatientbyId(pid) > 0:
print("Patient Found")
patdf.to_csv("csyfile\\patientnew.csv", mode='w')
else:
######################################
def patRemove():
patdf.to_csv("csvfile\\patientnew.csv", mode='w')
###############################################
###############################################
print(patdf)
###############################################
###############################################
def serPatientbyId(pid):
patdf = pd.read_csv("csvfile\\patientnew.csv", index_col = 0)
if patdf.empty:
return 0
else:
###############################################
###############################################
def getPatient(pid):
if patdf.empty:
else:
###############################################
###############################################
def getPatientName(pid):
if patdf.empty:
else:
return patdf.iat[0,1]
###############################################
###############################################
def serPatientbyName():
global patdf
print(patdf.loc[patdf['name'] == pname])
def serPatientbyIDPrint():
global patdf
print(patdf.loc[patdf['pid'] == tid])
##############################
##############################
def pmenu():
os.system ("cls")
print ("\t\t\t\t\t+-------------------------+")
print("\t\t\t\t\t +-------------------------+")
print("\t\t\t\t\t +-------------------------+")
print()
def getchoice():
while True:
pmenu()
if ch == '1':
patRegister()
elif ch == '2':
patUpdate()
elif ch == '3':
patRemove()
elif ch == '4':
print("PATIENT SEARCHING")
print("1. By ID")
print("2. By Name")
if ch == '1':
serPatientbyIDPrint()
print()
print ()
elif ch == '2':
serPatientbyName()
print()
print()
elif ch == '5':
print("\t\tLIST OF PATIENTS")
print ("------------------------------")
dispPatient()
elif ch == '6':
break
else:
#main
getchoice ()