From db332725f7ac469d9edb46a459e255b98bb1ebce Mon Sep 17 00:00:00 2001 From: yashee99 <45250142+yashee99@users.noreply.github.com> Date: Thu, 22 Nov 2018 09:23:54 +0530 Subject: [PATCH] first year project assigning prescription to the patients without chaos --- cse_the_expedites.ipynb | 348 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 348 insertions(+) create mode 100644 cse_the_expedites.ipynb diff --git a/cse_the_expedites.ipynb b/cse_the_expedites.ipynb new file mode 100644 index 0000000..17706b2 --- /dev/null +++ b/cse_the_expedites.ipynb @@ -0,0 +1,348 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [], + "source": [ + "from tkinter import*\n", + "from tkinter import ttk\n", + "import random\n", + "import time\n", + "import datetime\n", + "import tkinter.messagebox\n", + "\n", + "\n", + "class Hospital:\n", + " def __init__(self,root):\n", + " self.root = root\n", + " self.root.title(\"Hospital Management System\")\n", + " self.root.geometry(\"1350x750+0+0\")\n", + " self.root.configure(background='sky blue')\n", + " \n", + " cmbNameTablets=StringVar()\n", + " Ref=StringVar()\n", + " Dose=StringVar()\n", + " NumberTablets=StringVar()\n", + " Lot=StringVar()\n", + " IssuedDate=StringVar()\n", + " ExpDate=StringVar()\n", + " DailyDose=StringVar()\n", + " PossibleSideEffects=StringVar()\n", + " FurtherInformation=StringVar()\n", + " StorageAdvice=StringVar()\n", + " DrivingUsingMachines=StringVar()\n", + " HowToUseMedication=StringVar()\n", + " PatientID=StringVar()\n", + " PatientAge=StringVar()\n", + " PatientName=StringVar()\n", + " DateOfBirth=StringVar()\n", + " PatientAddress=StringVar()\n", + " Prescription=StringVar()\n", + " \n", + " \n", + " #=============================================Function Declaration============================================#\n", + " \n", + " \n", + " def iExit():\n", + " iExit=tkinter.messagebox.askyesno(\"Hospital Management System\",\"Confirm if you want to exit\")\n", + " if iExit >0:\n", + " root.destroy()\n", + " return\n", + " \n", + " def iPrescription():\n", + " \n", + " self.txtPrescription.insert(END, \"Name of the Patient: \"+ PatientName.get() + \"\\n\")\n", + " self.txtPrescription.insert(END, \"Patient ID: \"+ PatientID.get() + \"\\n\")\n", + " self.txtPrescription.insert(END, \"Date of Birth (Age): \"+ DateOfBirth.get() + \"(\" + PatientAge.get() + \")\" + \"\\n\")\n", + " self.txtPrescription.insert(END, \"Name of the Tablet: \"+ cmbNameTablets.get() + \"\\n\")\n", + " self.txtPrescription.insert(END, \"Issued Date: \"+ IssuedDate.get() + \"\\n\")\n", + " self.txtPrescription.insert(END, \"Expired Date: \"+ ExpDate.get() + \"\\n\")\n", + " self.txtPrescription.insert(END, \"Daily Dose: \"+ DailyDose.get() + \"\\n\")\n", + " self.txtPrescription.insert(END, \"Possible Side Effects: \"+ PossibleSideEffects.get() + \"\\n\")\n", + " self.txtPrescription.insert(END, \"Storage Advice: \"+ StorageAdvice.get() + \"\\n\")\n", + " \n", + " return\n", + " \n", + " def iPrescriptionData():\n", + " \n", + " self.txtFrameDetail.insert(END, cmbNameTablets.get()+\"\\t\"+ Ref.get()+\"\\t\"+ Dose.get()+\"\\t\"+ NumberTablets.get()+ \"\\t\"\n", + " + Lot.get()+\"\\t\" + IssuedDate.get()+\"\\t\" + ExpDate.get()+\"\\t\"+ DailyDose.get()+\"\\t\"+ StorageAdvice.get()+\"\\t\\t\\t\"+ \n", + " PatientName.get()+\"\\t\"+ PatientAge.get()+ \"\\n\")\n", + " \n", + " \n", + " return\n", + " \n", + " def iDelete():\n", + " \n", + " cmbNameTablets.set(\"\")\n", + " self.cboNameTablet.current(0)\n", + " Ref.set(\"\")\n", + " Dose.set(\"\")\n", + " NumberTablets.set(\"\")\n", + " Lot.set(\"\")\n", + " IssuedDate.set(\"\")\n", + " ExpDate.set(\"\")\n", + " DailyDose.set(\"\")\n", + " PossibleSideEffects.set(\"\")\n", + " FurtherInformation.set(\"\")\n", + " StorageAdvice.set(\"\")\n", + " DrivingUsingMachines.set(\"\")\n", + " HowToUseMedication.set(\"\")\n", + " PatientID.set(\"\")\n", + " PatientAge.set(\"\")\n", + " PatientName.set(\"\")\n", + " DateOfBirth.set(\"\")\n", + " PatientAddress.set(\"\")\n", + " self.txtPrescription.delete(\"1.0\",END)\n", + " self.txtFrameDetail.delete(\"1.0\",END)\n", + "\n", + " \n", + " return\n", + " \n", + " def iReset():\n", + " \n", + " cmbNameTablets.set(\"\")\n", + " self.cboNameTablet.current(0)\n", + " Ref.set(\"\")\n", + " Dose.set(\"\")\n", + " NumberTablets.set(\"\")\n", + " Lot.set(\"\")\n", + " IssuedDate.set(\"\")\n", + " ExpDate.set(\"\")\n", + " DailyDose.set(\"\")\n", + " PossibleSideEffects.set(\"\")\n", + " FurtherInformation.set(\"\")\n", + " StorageAdvice.set(\"\")\n", + " DrivingUsingMachines.set(\"\")\n", + " HowToUseMedication.set(\"\")\n", + " PatientID.set(\"\")\n", + " PatientAge.set(\"\")\n", + " PatientName.set(\"\")\n", + " DateOfBirth.set(\"\")\n", + " PatientAddress.set(\"\")\n", + " self.txtPrescription.delete(\"1.0\",END)\n", + " self.txtFrameDetail.delete(\"1.0\",END)\n", + " \n", + " return\n", + " \n", + " \n", + " #=====================================================Frame====================================================#\n", + " \n", + " MainFrame=Frame(self.root)\n", + " MainFrame.grid()\n", + " \n", + " TitleFrame=Frame(MainFrame, bd=20, width=1350, padx=20, relief=RIDGE)\n", + " TitleFrame.pack(side=TOP)\n", + " \n", + " self.lblTitle=Label(TitleFrame, font=('calibri', 40, 'bold'), text='Hospital Management System', padx=2)\n", + " self.lblTitle.grid()\n", + " \n", + " FrameDetail = Frame(MainFrame, bd=20, width=1350, height=100, padx=20, relief=RIDGE)\n", + " FrameDetail.pack(side=BOTTOM)\n", + " \n", + " ButtonFrame = Frame(MainFrame, bd=20, width=1350, height=50, padx=20, relief=RIDGE)\n", + " ButtonFrame.pack(side=BOTTOM)\n", + " \n", + " DataFrame = Frame(MainFrame, bd=20, width=1350, height=400, padx=20, relief=RIDGE)\n", + " DataFrame.pack(side=BOTTOM)\n", + " \n", + " DataFrameLEFT = LabelFrame(DataFrame, bd=10, width=900, height=300, padx=20, relief=RIDGE, font=('calibri', 12, 'bold'), \n", + " text='Patient Information')\n", + " DataFrameLEFT.pack(side=LEFT)\n", + " \n", + " DataFrameRIGHT = LabelFrame(DataFrame, bd=10, width=450, height=300, padx=20, relief=RIDGE\n", + " , font=('calibri', 12, 'bold'), text='Prescription:')\n", + " DataFrameRIGHT.pack(side=RIGHT)\n", + " \n", + " #================================================DataFrameLEFT================================================#\n", + " \n", + " self.lblNameTablet=Label(DataFrameLEFT, font=('calibri', 12, 'bold'), text='Name of Tablets:', padx=2, pady=2)\n", + " self.lblNameTablet.grid(row=0, column=0, sticky=W)\n", + " \n", + " self.cboNameTablet=ttk.Combobox(DataFrameLEFT, textvariable=cmbNameTablets, state='readonly', \n", + " font=('calibri', 12, 'bold'), width=20)\n", + " self.cboNameTablet['value']=('', 'Ibuprofen', 'Co-codamol', 'Paracetamol', 'Amlodipine')\n", + " self.cboNameTablet.current(0)\n", + " self.cboNameTablet.grid(row=0, column=1)\n", + " \n", + " self.lblFurtherInfo=Label(DataFrameLEFT, font=('calibri', 12, 'bold'), text='Further Information:', padx=2, pady=2)\n", + " self.lblFurtherInfo.grid(row=0, column=2, sticky=W)\n", + " \n", + " self.txtFurtherInfo=Entry(DataFrameLEFT, font=('calibri', 12, 'bold'), textvariable=FurtherInformation, width=25)\n", + " self.txtFurtherInfo.grid(row=0, column=3)\n", + " \n", + " self.lblRef=Label(DataFrameLEFT, font=('calibri', 12, 'bold'), text='Reference Number:', padx=2, pady=2)\n", + " self.lblRef.grid(row=1, column=0, sticky=W)\n", + " \n", + " self.txtRef=Entry(DataFrameLEFT, font=('calibri', 12, 'bold'), textvariable=Ref, width=25)\n", + " self.txtRef.grid(row=1, column=1)\n", + " \n", + " self.lblStorage=Label(DataFrameLEFT, font=('calibri', 12, 'bold'), text='Storage Advice:', padx=2, pady=2)\n", + " self.lblStorage.grid(row=1, column=2, sticky=W)\n", + " \n", + " self.txtStorage=Entry(DataFrameLEFT, font=('calibri', 12, 'bold'), textvariable=StorageAdvice, width=25)\n", + " self.txtStorage.grid(row=1, column=3)\n", + " \n", + " self.lblDose=Label(DataFrameLEFT, font=('calibri', 12, 'bold'), text='Dose:', padx=2, pady=2)\n", + " self.lblDose.grid(row=2, column=0, sticky=W)\n", + " \n", + " self.txtDose=Entry(DataFrameLEFT, font=('calibri', 12, 'bold'), textvariable=Dose, width=25)\n", + " self.txtDose.grid(row=2, column=1)\n", + " \n", + " self.lblDUseMachines=Label(DataFrameLEFT, font=('calibri', 12, 'bold'), text='Using Machines:', padx=2, pady=2)\n", + " self.lblDUseMachines.grid(row=2, column=2, sticky=W)\n", + " \n", + " self.txtDUseMachines=Entry(DataFrameLEFT, font=('calibri', 12, 'bold'), textvariable=DrivingUsingMachines, width=25)\n", + " self.txtDUseMachines.grid(row=2, column=3)\n", + " \n", + " self.lblNoOfTablets=Label(DataFrameLEFT, font=('calibri', 12, 'bold'), text='No. of Tablets:', padx=2, pady=2)\n", + " self.lblNoOfTablets.grid(row=3, column=0, sticky=W)\n", + " \n", + " self.txtNoOfTablets=Entry(DataFrameLEFT, font=('calibri', 12, 'bold'), textvariable=NumberTablets, width=25)\n", + " self.txtNoOfTablets.grid(row=3, column=1)\n", + " \n", + " self.lblUseMedication=Label(DataFrameLEFT, font=('calibri', 12, 'bold'), text='Using Medication:', padx=2, pady=2)\n", + " self.lblUseMedication.grid(row=3, column=2, sticky=W)\n", + " \n", + " self.txtUseMedication=Entry(DataFrameLEFT, font=('calibri', 12, 'bold'), textvariable=HowToUseMedication, width=25)\n", + " self.txtUseMedication.grid(row=3, column=3)\n", + " \n", + " self.lblLot=Label(DataFrameLEFT, font=('calibri', 12, 'bold'), text='Lot:', padx=2, pady=2)\n", + " self.lblLot.grid(row=4, column=0, sticky=W)\n", + " \n", + " self.txtLot=Entry(DataFrameLEFT, font=('calibri', 12, 'bold'), textvariable=Lot, width=25)\n", + " self.txtLot.grid(row=4, column=1)\n", + " \n", + " self.lblPatientID=Label(DataFrameLEFT, font=('calibri', 12, 'bold'), text='Patient ID:', padx=2, pady=2)\n", + " self.lblPatientID.grid(row=4, column=2, sticky=W)\n", + " \n", + " self.txtPatientID=Entry(DataFrameLEFT, font=('calibri', 12, 'bold'), textvariable=PatientID, width=25)\n", + " self.txtPatientID.grid(row=4, column=3)\n", + " \n", + " self.lblIssuedDate=Label(DataFrameLEFT, font=('calibri', 12, 'bold'), text='Issued Date:', padx=2, pady=2)\n", + " self.lblIssuedDate.grid(row=5, column=0, sticky=W)\n", + " \n", + " self.txtIssuedDate=Entry(DataFrameLEFT, font=('calibri', 12, 'bold'), textvariable=IssuedDate, width=25)\n", + " self.txtIssuedDate.grid(row=5, column=1)\n", + " \n", + " self.lblExpDate=Label(DataFrameLEFT, font=('calibri', 12, 'bold'), text='Expiry Date:', padx=2, pady=2)\n", + " self.lblExpDate.grid(row=5, column=2, sticky=W)\n", + " \n", + " self.txtExpDate=Entry(DataFrameLEFT, font=('calibri', 12, 'bold'), textvariable=ExpDate, width=25)\n", + " self.txtExpDate.grid(row=5, column=3)\n", + " \n", + " self.lblPatientName=Label(DataFrameLEFT, font=('calibri', 12, 'bold'), text='Patient Name:', padx=2, pady=2)\n", + " self.lblPatientName.grid(row=6, column=0, sticky=W)\n", + " \n", + " self.txtPatientName=Entry(DataFrameLEFT, font=('calibri', 12, 'bold'), textvariable=PatientName, width=25)\n", + " self.txtPatientName.grid(row=6, column=1)\n", + " \n", + " self.lblPatientAge=Label(DataFrameLEFT, font=('calibri', 12, 'bold'), text='Patient Age:', padx=2, pady=2)\n", + " self.lblPatientAge.grid(row=6, column=2, sticky=W)\n", + " \n", + " self.txtPatientAge=Entry(DataFrameLEFT, font=('calibri', 12, 'bold'), textvariable=PatientAge, width=25)\n", + " self.txtPatientAge.grid(row=6, column=3)\n", + " \n", + " self.lblDailyDose=Label(DataFrameLEFT, font=('calibri', 12, 'bold'), text='Daily Dose:', padx=2, pady=2)\n", + " self.lblDailyDose.grid(row=7, column=0, sticky=W)\n", + " \n", + " self.txtDailyDose=Entry(DataFrameLEFT, font=('calibri', 12, 'bold'), textvariable=DailyDose, width=25)\n", + " self.txtDailyDose.grid(row=7, column=1)\n", + " \n", + " self.lblDateOfBirth=Label(DataFrameLEFT, font=('calibri', 12, 'bold'), text='Date Of Birth:', padx=2, pady=2)\n", + " self.lblDateOfBirth.grid(row=7, column=2, sticky=W)\n", + " \n", + " self.txtDateOfBirth=Entry(DataFrameLEFT, font=('calibri', 12, 'bold'), textvariable=DateOfBirth, width=25)\n", + " self.txtDateOfBirth.grid(row=7, column=3)\n", + " \n", + " self.lblSideEffects=Label(DataFrameLEFT, font=('calibri', 12, 'bold'), text='Side Effects:', padx=2, pady=2)\n", + " self.lblSideEffects.grid(row=8, column=0, sticky=W)\n", + " \n", + " self.txtSideEffects=Entry(DataFrameLEFT, font=('calibri', 12, 'bold'), textvariable=PossibleSideEffects, width=25)\n", + " self.txtSideEffects.grid(row=8, column=1)\n", + " \n", + " self.lblPatientAddress=Label(DataFrameLEFT, font=('calibri', 12, 'bold'), text='Patient Address:', padx=2, pady=2)\n", + " self.lblPatientAddress.grid(row=8, column=2, sticky=W)\n", + " \n", + " self.txtPatientAddress=Entry(DataFrameLEFT, font=('calibri', 12, 'bold'), textvariable=PatientAddress, width=25)\n", + " self.txtPatientAddress.grid(row=8, column=3)\n", + " \n", + " \n", + " #==================================================DataFrameRIGHT================================================#\n", + " \n", + " \n", + " \n", + " self.txtPrescription=Text(DataFrameRIGHT, font=('calibri', 12, 'bold'),width=40,height=10, padx=2, pady=6)\n", + " self.txtPrescription.grid(row=0, column=0)\n", + " \n", + " \n", + " #==================================================ButtonFrame================================================#\n", + " \n", + " self.btnPrescription=Button(ButtonFrame, text='Prescription',font=('calibri', 12, 'bold'), width=24, bd=4, \n", + " command=iPrescription)\n", + " self.btnPrescription.grid(row=0, column=0)\n", + " \n", + " self.btnPrescriptionData=Button(ButtonFrame, text='Prescription Data',font=('calibri', 12, 'bold'), width=24, bd=4,\n", + " command=iPrescriptionData)\n", + " self.btnPrescriptionData.grid(row=0, column=1)\n", + " \n", + " self.btnDelete=Button(ButtonFrame, text='Delete',font=('calibri', 12, 'bold'), width=24, bd=4,\n", + " command=iDelete)\n", + " self.btnDelete.grid(row=0, column=2)\n", + " \n", + " self.btnReset=Button(ButtonFrame, text='Reset',font=('calibri', 12, 'bold'), width=24, bd=4,\n", + " command=iReset)\n", + " self.btnReset.grid(row=0, column=3)\n", + " \n", + " self.btnExit=Button(ButtonFrame, text='Exit',font=('calibri', 12, 'bold'), width=24, bd=4, command=iExit)\n", + " self.btnExit.grid(row=0, column=4)\n", + " \n", + " \n", + " #==================================================FrameDetail================================================#\n", + " \n", + " \n", + " self.lblLabel=Label(FrameDetail, font=('calibri', 12, 'bold'), pady=8, \n", + " text=\"Name of Tablets\\tReference No.\\tDosage\\tNo.of tablets\\tLot\\tIssued Date\\tExp Date\\t DailyDose\\tStorage Adv.\\tPatient Name\\tAge\")\n", + " self.lblLabel.grid(row=0, column=0)\n", + " \n", + " self.txtFrameDetail=Text(FrameDetail, font=('calibri', 12, 'bold'),width=141, height=4, padx=2, pady=4)\n", + " self.txtFrameDetail.grid(row=1, column=0)\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "\n", + " \n", + "if __name__=='__main__':\n", + " root=Tk()\n", + " application=Hospital(root)\n", + " root.mainloop()" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.5" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +}