Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions addressBook/addressBook.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

def createUser():
# Read Json File -> Record.Json file
data = serialzeJson()
data = deSerialzeJson()

# User Input Details
firstName = input("Enter the first name : ")
Expand Down Expand Up @@ -46,22 +46,22 @@ def createUser():

def showUserInJson():
# Read Json File -> Record.Json file
data = serialzeJson()
data = deSerialzeJson()
pprint.pprint(data)


def showUser():

# Read Json File -> Record.Json file
data = serialzeJson()
data = deSerialzeJson()

for user in data['person']:
print("\nFirstName: " + user['firstName'] + "\n" + "Last Name : " + user['lastName'] + "\n" + "Address : " + user['address'] + "\n" +
"City : " + user['city'] + "\n" + "State : " + user['state'] + "\n" + "Zipcode : " + user['zip'] + "\n" + "Phone Number : " + user['phoneNumber'] + "\n")

def delUser():
# Read Json File -> Record.Json file
data = serialzeJson()
data = deSerialzeJson()

# index to display for delete option
index = 1
Expand All @@ -79,7 +79,7 @@ def delUser():

def editUser():
# Read Json File -> Record.Json file
data = serialzeJson()
data = deSerialzeJson()

index = 1
for user in data['person']:
Expand All @@ -98,7 +98,12 @@ def editUser():
with open("record.json", "w") as f:
f.write(json_obj)

def serialzeJson():
def sortUser():
pass
# Sort using last name of the person (Ties broken by first name)
# Sort using zip code of the person (Ties broken by second name)

def deSerialzeJson():
with open('record.json') as f:
data = json.loads(f.read())
return(data)
Expand All @@ -107,7 +112,7 @@ def serialzeJson():
while True:
print(" ")
print("User Management Panel")
print(" 1.Create User \n 2.Show Users In Json Format \n 3. Show Users \n 4. Delete User \n 5. edit User")
print(" 1.Create User \n 2.Show Users In Json Format \n 3. Show Users \n 4. Delete User \n 5. Edit User")

val = input("Enter your choice : \t")

Expand Down
Binary file not shown.
Binary file modified clinicManagement/__pycache__/doctor.cpython-38.pyc
Binary file not shown.
Binary file modified clinicManagement/__pycache__/patient.cpython-38.pyc
Binary file not shown.
Binary file modified clinicManagement/__pycache__/searchDoctor.cpython-38.pyc
Binary file not shown.
27 changes: 18 additions & 9 deletions clinicManagement/appointment.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
from os import path
from doctor import deSerialzeJson
import patient as p

'''
Function:
Expand All @@ -16,12 +17,15 @@
'''

def checkDoctor():
queryName = input("Enter the name of the doctor you want you appointment with : ").upper()
data = deSerialzeJson()
for doctors in data['doctorsData']:
if(doctors['name'] == queryName):
doctorMatch = doctors['name']
return(doctorMatch)
try:
queryName = input("Enter the name of the doctor you want you appointment with : ").upper()
except Exception as e:
print("Exception handles", e)
data = deSerialzeJson()
for doctors in data['doctorsData']:
if(doctors['name'] == queryName):
doctorMatch = doctors['name']
return(doctorMatch)
# Able to search doctors;

'''
Expand All @@ -38,7 +42,10 @@ def checkDoctor():
def appointDoctor():

match = checkDoctor()
client = input("Enter the your name : ")
try:
client = input("Enter the your name : ").upper()
except Exception as e:
print("Sorry an error happend : ")
appointment = []
appointment.append(client)
data = deSerialzeJson()
Expand All @@ -52,11 +59,13 @@ def appointDoctor():

if len(doctors['appointment'])<5:
doctors['appointment'].append(client)
p.addPatient()

else:
print('Sorry appointment list is full : ')
else:
doctors['appointment'] = appointment
p.addPatient()
if flag is not True:
print("Doctor unavailable : ")

Expand All @@ -65,6 +74,6 @@ def appointDoctor():
f.write(json_obj)


if __name__ == "__main__":
appointDoctor()
# if __name__ == "__main__":


20 changes: 18 additions & 2 deletions clinicManagement/doctor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
import json
import os
from os import path
import logging

LOG_FORMAT = "%(LeveLname)s %(asctime)s - %(message)s"

logging.basicConfig(filename= "D:\\vs studio\\bridgeLabz\\codes\\programmingProblems\\clinic_log\\clinic.log",
level=logging.DEBUG, format= LOG_FORMAT)

logger = logging.getLogger()



doctorsData = [] # Global array to create new json array

'''
Expand Down Expand Up @@ -70,8 +81,7 @@ def doctorID():
with open('clinicData.json') as f:
if f.read() == '':
return(id)
else:

else:
data = deSerialzeJson()
id = len(data['doctorsData'])
return(id+1)
Expand All @@ -87,6 +97,8 @@ def doctorID():
'''
def shiftInput():
checkShift = input("Enter shift AM/PM/BOTH : ").upper()
logging.debug("Collecting the shift input", checkShift)
logger.info
if (checkShift == 'AM') or (checkShift == 'PM') or (checkShift == 'BOTH'):
return(checkShift)
else:
Expand All @@ -104,9 +116,13 @@ def shiftInput():
'''
def createData():
name = input("Enter the name : ").upper()
logging.debug("Collecting the name input", name)
id = str(doctorID())
logging.debug("Collecting the id input", id)
specialization = input("Enter the doctors specialization : ").upper()
logging.debug("Collecting the specialization input", specialization)
shift = shiftInput()
logging.debug("Collecting the shift input", shift)

x = {
'name': 'DR '+name,
Expand Down
10 changes: 9 additions & 1 deletion clinicManagement/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,25 @@
import doctor as d
import patient as p
import searchDoctor as sd
import appointment as ap
import logging


def main():
print("Clinique Management System")
ch = input("1. Enter 1 to add a doctor \n2. Enter 2 to see all avaiable doctors \n3. Search Doctors: \nEnter your choice : ")
ch = input("1. Enter 1 to add a doctor \n2. Enter 2 to see all avaiable doctors \n3. Search Doctors \n4. Get an appointment \nEnter your choice : ")

if (ch =='1'):
d.addDoctor()
elif (ch == '2'):
d.showDoctor()
elif(ch == '3'):
sd.keySearch()
elif(ch == '4'):
ap.appointDoctor()
else:
print("enter a proper choice : \n")
main()


if __name__ == "__main__":
Expand Down
File renamed without changes.
Binary file removed cliniqueManagement/__pycache__/doctor.cpython-38.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
78 changes: 0 additions & 78 deletions cliniqueManagement/doctor.py

This file was deleted.

26 changes: 0 additions & 26 deletions cliniqueManagement/main.py

This file was deleted.

80 changes: 0 additions & 80 deletions cliniqueManagement/patient.py

This file was deleted.

Loading