Health management system in python

technical talkiess
0

 def getdate():

    import datetime

    return datetime.datetime.now()


def getPatientDailyDetails(name):

    patient_list = ['vishal','harry','carry']

    if(name in patient_list):

        print("Which task you lock to the patient")

        p_task = input()

        print("Write a task details")

        p_details = input()


        content = str([getdate()]) +p_details

        fileNmae = name +'_' + p_task +'.txt'

        f = open(fileNmae,'a')

        f.write(content+'\n')

    return "Details saved successfully"


def retrievePatientDetails(name,task):

    f = open(name +'_'+task+'.txt')

    return f.read()

    

print("which task you perform :- loct diet or excecise or retrieve data")

task_p_details = input()

if(task_p_details == 'retrieve'):

    print("Enter the patient name Which diet you retrieve:")

    r_p_name = input()

    print("Enter the Which information you retrieve ex:- diet , execise:")

    r_task_details = input()

    # retrieve patient details 

    print(retrievePatientDetails(r_p_name,r_task_details))

else:

    print("Enter the patient name : [vishal,harry,carry]")

    pname = input()

    # add patient details

    print(getPatientDailyDetails(pname))

Post a Comment

0Comments

Thanks you for commenting your questions. I will see question and respond you.

Post a Comment (0)