diff --git a/hospitalmanagement b/hospitalmanagement deleted file mode 160000 index 853135d..0000000 --- a/hospitalmanagement +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 853135de381be15797a219b33b7d383ae2a5c62b diff --git a/hospitalmanagement/.gitignore b/hospitalmanagement/.gitignore new file mode 100644 index 0000000..e935dbf --- /dev/null +++ b/hospitalmanagement/.gitignore @@ -0,0 +1,116 @@ +# Django # +*.log +*.pot +*.pyc +__pycache__ +db.sqlite3 +media + +# Backup files # +*.bak + +# If you are using PyCharm # +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/dictionaries +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.xml +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/gradle.xml +.idea/**/libraries +*.iws /out/ + +# Python # +*.py[cod] +*$py.class + +# Distribution / packaging +.Python build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +.pytest_cache/ +nosetests.xml +coverage.xml +*.cover +.hypothesis/ + +# Jupyter Notebook +.ipynb_checkpoints + +# pyenv +.python-version + +# celery +celerybeat-schedule.* + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ + +# Sublime Text # +*.tmlanguage.cache +*.tmPreferences.cache +*.stTheme.cache +*.sublime-workspace +*.sublime-project + +# sftp configuration file +sftp-config.json + +# Package control specific files Package +Control.last-run +Control.ca-list +Control.ca-bundle +Control.system-ca-bundle +GitHub.sublime-settings + +# Visual Studio Code # +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +.history diff --git a/hospitalmanagement/LICENSE b/hospitalmanagement/LICENSE new file mode 100644 index 0000000..3f6be7b --- /dev/null +++ b/hospitalmanagement/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 sumit kumar + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/hospitalmanagement/README.md b/hospitalmanagement/README.md new file mode 100644 index 0000000..f5a4dbb --- /dev/null +++ b/hospitalmanagement/README.md @@ -0,0 +1,81 @@ + +# Hospital Management +![developer](https://img.shields.io/badge/Developed%20By%20%3A-Sumit%20Kumar-red) +--- +## screenshots +### Homepage +![homepage snap](https://github.com/sumitkumar1503/hospitalmanagement/blob/master/static/screenshots/homepage.png?raw=true) +### Admin Dashboard +![dashboard snap](https://github.com/sumitkumar1503/hospitalmanagement/blob/master/static/screenshots/admin_dashboard.png?raw=true) +### Invoice +![invoice snap](https://github.com/sumitkumar1503/hospitalmanagement/blob/master/static/screenshots/invoice.png?raw=true) +### Doctor list +![doctor snap](https://github.com/sumitkumar1503/hospitalmanagement/blob/master/static/screenshots/admin_doctor.png?raw=true) +--- +## Functions +### Admin +- Signup their account. Then Login (No approval Required). +- Can register/view/approve/reject/delete doctor (approve those doctor who applied for job in their hospital). +- Can admit/view/approve/reject/discharge patient (discharge patient when treatment is done). +- Can Generate/Download Invoice pdf (Generate Invoice according to medicine cost, room charge, doctor charge and other charge). +- Can view/book/approve Appointment (approve those appointments which is requested by patient). + +### Doctor +- Apply for job in hospital. Then Login (Approval required by hospital admin, Then only doctor can login). +- Can only view their patient details (symptoms, name, mobile ) assigned to that doctor by admin. +- Can view their discharged(by admin) patient list. +- Can view their Appointments, booked by admin. +- Can delete their Appointment, when doctor attended their appointment. + +### Patient +- Create account for admit in hospital. Then Login (Approval required by hospital admin, Then only patient can login). +- Can view assigned doctor's details like ( specialization, mobile, address). +- Can view their booked appointment status (pending/confirmed by admin). +- Can book appointments.(approval required by admin) +- Can view/download Invoice pdf (Only when that patient is discharged by admin). + +--- + +## HOW TO RUN THIS PROJECT +- Install Python(3.7.6) (Dont Forget to Tick Add to Path while installing Python) +- Open Terminal and Execute Following Commands : +``` +pip install django==3.0.5 +pip install django-widget-tweaks +pip install xhtml2pdf +``` +- Download This Project Zip Folder and Extract it +- Move to project folder in Terminal. Then run following Commands : +``` +py manage.py makemigrations +py manage.py migrate +py manage.py runserver +``` +- Now enter following URL in Your Browser Installed On Your Pc +``` +http://127.0.0.1:8000/ +``` + +## CHANGES REQUIRED FOR CONTACT US PAGE +- In settins.py file, You have to give your email and password +``` +EMAIL_HOST_USER = 'youremail@gmail.com' +EMAIL_HOST_PASSWORD = 'your email password' +EMAIL_RECEIVING_USER = 'youremail@gmail.com' +``` +- Login to gmail through host email id in your browser and open following link and turn it ON +``` +https://myaccount.google.com/lesssecureapps +``` +## Drawbacks/LoopHoles +- Any one can be Admin. There is no Approval required for admin account. So you can disable admin signup process and use any logic like creating superuser. +- There should be at least one doctor in hospital before admitting patient. So first add doctor. +- On update page of doctor/patient you must have to update password. + +## Disclaimer +This project is developed for demo purpose and it's not supposed to be used in real application. + +## Feedback +Any suggestion and feedback is welcome. You can message me on facebook +- [Contact on Facebook](https://fb.com/sumit.luv) +- [Subscribe my Channel LazyCoder On Youtube](https://youtube.com/lazycoders) diff --git a/hospitalmanagement/hospital/__init__.py b/hospitalmanagement/hospital/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/hospitalmanagement/hospital/admin.py b/hospitalmanagement/hospital/admin.py new file mode 100644 index 0000000..6d56e05 --- /dev/null +++ b/hospitalmanagement/hospital/admin.py @@ -0,0 +1,18 @@ +from django.contrib import admin +from .models import Doctor,Patient,Appointment,PatientDischargeDetails +# Register your models here. +class DoctorAdmin(admin.ModelAdmin): + pass +admin.site.register(Doctor, DoctorAdmin) + +class PatientAdmin(admin.ModelAdmin): + pass +admin.site.register(Patient, PatientAdmin) + +class AppointmentAdmin(admin.ModelAdmin): + pass +admin.site.register(Appointment, AppointmentAdmin) + +class PatientDischargeDetailsAdmin(admin.ModelAdmin): + pass +admin.site.register(PatientDischargeDetails, PatientDischargeDetailsAdmin) diff --git a/hospitalmanagement/hospital/apps.py b/hospitalmanagement/hospital/apps.py new file mode 100644 index 0000000..42a67a8 --- /dev/null +++ b/hospitalmanagement/hospital/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class HospitalConfig(AppConfig): + name = 'hospital' diff --git a/hospitalmanagement/hospital/forms.py b/hospitalmanagement/hospital/forms.py new file mode 100644 index 0000000..68976d0 --- /dev/null +++ b/hospitalmanagement/hospital/forms.py @@ -0,0 +1,76 @@ +from django import forms +from django.contrib.auth.models import User +from . import models + + + +#for admin signup +class AdminSigupForm(forms.ModelForm): + class Meta: + model=User + fields=['first_name','last_name','username','password'] + widgets = { + 'password': forms.PasswordInput() + } + + +#for student related form +class DoctorUserForm(forms.ModelForm): + class Meta: + model=User + fields=['first_name','last_name','username','password'] + widgets = { + 'password': forms.PasswordInput() + } +class DoctorForm(forms.ModelForm): + class Meta: + model=models.Doctor + fields=['address','mobile','department','status','profile_pic'] + + + +#for teacher related form +class PatientUserForm(forms.ModelForm): + class Meta: + model=User + fields=['first_name','last_name','username','password'] + widgets = { + 'password': forms.PasswordInput() + } +class PatientForm(forms.ModelForm): + #this is the extrafield for linking patient and their assigend doctor + #this will show dropdown __str__ method doctor model is shown on html so override it + #to_field_name this will fetch corresponding value user_id present in Doctor model and return it + assignedDoctorId=forms.ModelChoiceField(queryset=models.Doctor.objects.all().filter(status=True),empty_label="Name and Department", to_field_name="user_id") + class Meta: + model=models.Patient + fields=['address','mobile','status','symptoms','profile_pic'] + + + +class AppointmentForm(forms.ModelForm): + doctorId=forms.ModelChoiceField(queryset=models.Doctor.objects.all().filter(status=True),empty_label="Doctor Name and Department", to_field_name="user_id") + patientId=forms.ModelChoiceField(queryset=models.Patient.objects.all().filter(status=True),empty_label="Patient Name and Symptoms", to_field_name="user_id") + class Meta: + model=models.Appointment + fields=['description','status'] + + +class PatientAppointmentForm(forms.ModelForm): + doctorId=forms.ModelChoiceField(queryset=models.Doctor.objects.all().filter(status=True),empty_label="Doctor Name and Department", to_field_name="user_id") + class Meta: + model=models.Appointment + fields=['description','status'] + + +#for contact us page +class ContactusForm(forms.Form): + Name = forms.CharField(max_length=30) + Email = forms.EmailField() + Message = forms.CharField(max_length=500,widget=forms.Textarea(attrs={'rows': 3, 'cols': 30})) + + + +#Developed By : sumit kumar +#facebook : fb.com/sumit.luv +#Youtube :youtube.com/lazycoders diff --git a/hospitalmanagement/hospital/migrations/0001_initial.py b/hospitalmanagement/hospital/migrations/0001_initial.py new file mode 100644 index 0000000..da5095d --- /dev/null +++ b/hospitalmanagement/hospital/migrations/0001_initial.py @@ -0,0 +1,51 @@ +# Generated by Django 3.0.5 on 2020-05-15 04:45 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name='TeacherExtra', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('salary', models.PositiveIntegerField()), + ('joindate', models.DateField(auto_now_add=True)), + ('mobile', models.CharField(max_length=40)), + ('status', models.BooleanField(default=False)), + ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='Patient', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('address', models.CharField(max_length=40)), + ('mobile', models.CharField(max_length=40, null=True)), + ('symptoms', models.CharField(max_length=100, null=True)), + ('assignedDoctorId', models.PositiveIntegerField()), + ('status', models.BooleanField(default=False)), + ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='Doctor', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('address', models.CharField(max_length=40)), + ('mobile', models.CharField(max_length=40, null=True)), + ('department', models.CharField(choices=[('Cardiologist', 'Cardiologist'), ('Dermatologists', 'Dermatologists'), ('Emergency Medicine Specialists', 'Emergency Medicine Specialists'), ('Allergists/Immunologists', 'Allergists/Immunologists'), ('Anesthesiologists', 'Anesthesiologists'), ('Colon and Rectal Surgeons', 'Colon and Rectal Surgeons')], default='Cardiologist', max_length=50)), + ('status', models.BooleanField(default=False)), + ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + ), + ] diff --git a/hospitalmanagement/hospital/migrations/0002_delete_teacherextra.py b/hospitalmanagement/hospital/migrations/0002_delete_teacherextra.py new file mode 100644 index 0000000..2bb2979 --- /dev/null +++ b/hospitalmanagement/hospital/migrations/0002_delete_teacherextra.py @@ -0,0 +1,16 @@ +# Generated by Django 3.0.5 on 2020-05-15 04:46 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('hospital', '0001_initial'), + ] + + operations = [ + migrations.DeleteModel( + name='TeacherExtra', + ), + ] diff --git a/hospitalmanagement/hospital/migrations/0003_patient_admitdate.py b/hospitalmanagement/hospital/migrations/0003_patient_admitdate.py new file mode 100644 index 0000000..c99e86c --- /dev/null +++ b/hospitalmanagement/hospital/migrations/0003_patient_admitdate.py @@ -0,0 +1,18 @@ +# Generated by Django 3.0.5 on 2020-05-18 03:04 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('hospital', '0002_delete_teacherextra'), + ] + + operations = [ + migrations.AddField( + model_name='patient', + name='admitDate', + field=models.DateField(auto_now=True), + ), + ] diff --git a/hospitalmanagement/hospital/migrations/0004_patientdischargedetails.py b/hospitalmanagement/hospital/migrations/0004_patientdischargedetails.py new file mode 100644 index 0000000..8368caa --- /dev/null +++ b/hospitalmanagement/hospital/migrations/0004_patientdischargedetails.py @@ -0,0 +1,33 @@ +# Generated by Django 3.0.5 on 2020-05-18 08:47 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('hospital', '0003_patient_admitdate'), + ] + + operations = [ + migrations.CreateModel( + name='PatientDischargeDetails', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('patientId', models.PositiveIntegerField()), + ('patientName', models.CharField(max_length=40)), + ('assignedDoctorName', models.CharField(max_length=40)), + ('address', models.CharField(max_length=40)), + ('mobile', models.CharField(max_length=40, null=True)), + ('symptoms', models.CharField(max_length=100, null=True)), + ('admitDate', models.DateField()), + ('releaseDate', models.DateField()), + ('daySpent', models.PositiveIntegerField()), + ('roomCharge', models.PositiveIntegerField()), + ('medicineCost', models.PositiveIntegerField()), + ('doctorFee', models.PositiveIntegerField()), + ('OtherCharge', models.PositiveIntegerField()), + ('total', models.PositiveIntegerField()), + ], + ), + ] diff --git a/hospitalmanagement/hospital/migrations/0005_appointment.py b/hospitalmanagement/hospital/migrations/0005_appointment.py new file mode 100644 index 0000000..8511379 --- /dev/null +++ b/hospitalmanagement/hospital/migrations/0005_appointment.py @@ -0,0 +1,23 @@ +# Generated by Django 3.0.5 on 2020-05-20 02:15 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('hospital', '0004_patientdischargedetails'), + ] + + operations = [ + migrations.CreateModel( + name='Appointment', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('patientId', models.PositiveIntegerField()), + ('doctorId', models.PositiveIntegerField()), + ('appointmentDate', models.DateField(auto_now=True)), + ('description', models.TextField(max_length=500)), + ], + ), + ] diff --git a/hospitalmanagement/hospital/migrations/0006_appointment_status.py b/hospitalmanagement/hospital/migrations/0006_appointment_status.py new file mode 100644 index 0000000..f676776 --- /dev/null +++ b/hospitalmanagement/hospital/migrations/0006_appointment_status.py @@ -0,0 +1,18 @@ +# Generated by Django 3.0.5 on 2020-05-20 03:22 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('hospital', '0005_appointment'), + ] + + operations = [ + migrations.AddField( + model_name='appointment', + name='status', + field=models.BooleanField(default=False), + ), + ] diff --git a/hospitalmanagement/hospital/migrations/0007_auto_20200520_1023.py b/hospitalmanagement/hospital/migrations/0007_auto_20200520_1023.py new file mode 100644 index 0000000..d35b680 --- /dev/null +++ b/hospitalmanagement/hospital/migrations/0007_auto_20200520_1023.py @@ -0,0 +1,33 @@ +# Generated by Django 3.0.5 on 2020-05-20 04:53 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('hospital', '0006_appointment_status'), + ] + + operations = [ + migrations.AddField( + model_name='appointment', + name='doctorName', + field=models.CharField(max_length=40, null=True), + ), + migrations.AddField( + model_name='appointment', + name='patientName', + field=models.CharField(max_length=40, null=True), + ), + migrations.AlterField( + model_name='patient', + name='mobile', + field=models.CharField(max_length=40), + ), + migrations.AlterField( + model_name='patient', + name='symptoms', + field=models.CharField(max_length=100), + ), + ] diff --git a/hospitalmanagement/hospital/migrations/0008_doctor_profile_pic.py b/hospitalmanagement/hospital/migrations/0008_doctor_profile_pic.py new file mode 100644 index 0000000..bae59ea --- /dev/null +++ b/hospitalmanagement/hospital/migrations/0008_doctor_profile_pic.py @@ -0,0 +1,18 @@ +# Generated by Django 3.0.5 on 2020-05-20 05:21 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('hospital', '0007_auto_20200520_1023'), + ] + + operations = [ + migrations.AddField( + model_name='doctor', + name='profile_pic', + field=models.ImageField(null=True, upload_to='DoctorProfilePic/'), + ), + ] diff --git a/hospitalmanagement/hospital/migrations/0009_auto_20200523_1118.py b/hospitalmanagement/hospital/migrations/0009_auto_20200523_1118.py new file mode 100644 index 0000000..3c0af10 --- /dev/null +++ b/hospitalmanagement/hospital/migrations/0009_auto_20200523_1118.py @@ -0,0 +1,18 @@ +# Generated by Django 3.0.5 on 2020-05-23 05:48 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('hospital', '0008_doctor_profile_pic'), + ] + + operations = [ + migrations.AlterField( + model_name='doctor', + name='profile_pic', + field=models.ImageField(blank=True, null=True, upload_to=''), + ), + ] diff --git a/hospitalmanagement/hospital/migrations/0010_auto_20200523_1122.py b/hospitalmanagement/hospital/migrations/0010_auto_20200523_1122.py new file mode 100644 index 0000000..ae277b1 --- /dev/null +++ b/hospitalmanagement/hospital/migrations/0010_auto_20200523_1122.py @@ -0,0 +1,18 @@ +# Generated by Django 3.0.5 on 2020-05-23 05:52 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('hospital', '0009_auto_20200523_1118'), + ] + + operations = [ + migrations.AlterField( + model_name='doctor', + name='profile_pic', + field=models.ImageField(blank=True, null=True, upload_to='static/DoctorProfilePic/'), + ), + ] diff --git a/hospitalmanagement/hospital/migrations/0011_auto_20200523_1325.py b/hospitalmanagement/hospital/migrations/0011_auto_20200523_1325.py new file mode 100644 index 0000000..ae9e99b --- /dev/null +++ b/hospitalmanagement/hospital/migrations/0011_auto_20200523_1325.py @@ -0,0 +1,18 @@ +# Generated by Django 3.0.5 on 2020-05-23 07:55 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('hospital', '0010_auto_20200523_1122'), + ] + + operations = [ + migrations.AlterField( + model_name='doctor', + name='profile_pic', + field=models.ImageField(blank=True, null=True, upload_to='DoctorProfilePic/'), + ), + ] diff --git a/hospitalmanagement/hospital/migrations/0012_auto_20200523_1336.py b/hospitalmanagement/hospital/migrations/0012_auto_20200523_1336.py new file mode 100644 index 0000000..b037d41 --- /dev/null +++ b/hospitalmanagement/hospital/migrations/0012_auto_20200523_1336.py @@ -0,0 +1,18 @@ +# Generated by Django 3.0.5 on 2020-05-23 08:06 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('hospital', '0011_auto_20200523_1325'), + ] + + operations = [ + migrations.AlterField( + model_name='doctor', + name='profile_pic', + field=models.ImageField(blank=True, null=True, upload_to='profile_pic/DoctorProfilePic/'), + ), + ] diff --git a/hospitalmanagement/hospital/migrations/0013_patient_profile_pic.py b/hospitalmanagement/hospital/migrations/0013_patient_profile_pic.py new file mode 100644 index 0000000..10d9c8d --- /dev/null +++ b/hospitalmanagement/hospital/migrations/0013_patient_profile_pic.py @@ -0,0 +1,18 @@ +# Generated by Django 3.0.5 on 2020-05-23 09:54 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('hospital', '0012_auto_20200523_1336'), + ] + + operations = [ + migrations.AddField( + model_name='patient', + name='profile_pic', + field=models.ImageField(blank=True, null=True, upload_to='profile_pic/PatientProfilePic/'), + ), + ] diff --git a/hospitalmanagement/hospital/migrations/0014_auto_20200526_1455.py b/hospitalmanagement/hospital/migrations/0014_auto_20200526_1455.py new file mode 100644 index 0000000..0a17786 --- /dev/null +++ b/hospitalmanagement/hospital/migrations/0014_auto_20200526_1455.py @@ -0,0 +1,18 @@ +# Generated by Django 3.0.5 on 2020-05-26 09:25 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('hospital', '0013_patient_profile_pic'), + ] + + operations = [ + migrations.AlterField( + model_name='patientdischargedetails', + name='mobile', + field=models.CharField(max_length=10, null=True), + ), + ] diff --git a/hospitalmanagement/hospital/migrations/0015_auto_20200526_1501.py b/hospitalmanagement/hospital/migrations/0015_auto_20200526_1501.py new file mode 100644 index 0000000..96c3872 --- /dev/null +++ b/hospitalmanagement/hospital/migrations/0015_auto_20200526_1501.py @@ -0,0 +1,23 @@ +# Generated by Django 3.0.5 on 2020-05-26 09:31 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('hospital', '0014_auto_20200526_1455'), + ] + + operations = [ + migrations.AlterField( + model_name='doctor', + name='mobile', + field=models.CharField(max_length=10, null=True), + ), + migrations.AlterField( + model_name='patient', + name='mobile', + field=models.CharField(max_length=10), + ), + ] diff --git a/hospitalmanagement/hospital/migrations/0016_auto_20200622_1830.py b/hospitalmanagement/hospital/migrations/0016_auto_20200622_1830.py new file mode 100644 index 0000000..d3054de --- /dev/null +++ b/hospitalmanagement/hospital/migrations/0016_auto_20200622_1830.py @@ -0,0 +1,28 @@ +# Generated by Django 3.0.5 on 2020-06-22 18:30 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('hospital', '0015_auto_20200526_1501'), + ] + + operations = [ + migrations.AlterField( + model_name='doctor', + name='mobile', + field=models.CharField(max_length=20, null=True), + ), + migrations.AlterField( + model_name='patient', + name='mobile', + field=models.CharField(max_length=20), + ), + migrations.AlterField( + model_name='patientdischargedetails', + name='mobile', + field=models.CharField(max_length=20, null=True), + ), + ] diff --git a/hospitalmanagement/hospital/migrations/0017_auto_20200622_1835.py b/hospitalmanagement/hospital/migrations/0017_auto_20200622_1835.py new file mode 100644 index 0000000..e54249a --- /dev/null +++ b/hospitalmanagement/hospital/migrations/0017_auto_20200622_1835.py @@ -0,0 +1,34 @@ +# Generated by Django 3.0.5 on 2020-06-22 18:35 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('hospital', '0016_auto_20200622_1830'), + ] + + operations = [ + migrations.AlterField( + model_name='appointment', + name='doctorId', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='hospital.Doctor'), + ), + migrations.AlterField( + model_name='appointment', + name='patientId', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='hospital.Patient'), + ), + migrations.AlterField( + model_name='patient', + name='assignedDoctorId', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='hospital.Doctor'), + ), + migrations.AlterField( + model_name='patientdischargedetails', + name='patientId', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='hospital.Patient'), + ), + ] diff --git a/hospitalmanagement/hospital/migrations/0018_auto_20201015_2036.py b/hospitalmanagement/hospital/migrations/0018_auto_20201015_2036.py new file mode 100644 index 0000000..e3144f5 --- /dev/null +++ b/hospitalmanagement/hospital/migrations/0018_auto_20201015_2036.py @@ -0,0 +1,33 @@ +# Generated by Django 3.0.5 on 2020-10-15 15:06 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('hospital', '0017_auto_20200622_1835'), + ] + + operations = [ + migrations.AlterField( + model_name='appointment', + name='doctorId', + field=models.PositiveIntegerField(null=True), + ), + migrations.AlterField( + model_name='appointment', + name='patientId', + field=models.PositiveIntegerField(null=True), + ), + migrations.AlterField( + model_name='patient', + name='assignedDoctorId', + field=models.PositiveIntegerField(null=True), + ), + migrations.AlterField( + model_name='patientdischargedetails', + name='patientId', + field=models.PositiveIntegerField(null=True), + ), + ] diff --git a/hospitalmanagement/hospital/migrations/__init__.py b/hospitalmanagement/hospital/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/hospitalmanagement/hospital/models.py b/hospitalmanagement/hospital/models.py new file mode 100644 index 0000000..3fc27ac --- /dev/null +++ b/hospitalmanagement/hospital/models.py @@ -0,0 +1,82 @@ +from django.db import models +from django.contrib.auth.models import User + + + +departments=[('Cardiologist','Cardiologist'), +('Dermatologists','Dermatologists'), +('Emergency Medicine Specialists','Emergency Medicine Specialists'), +('Allergists/Immunologists','Allergists/Immunologists'), +('Anesthesiologists','Anesthesiologists'), +('Colon and Rectal Surgeons','Colon and Rectal Surgeons') +] +class Doctor(models.Model): + user=models.OneToOneField(User,on_delete=models.CASCADE) + profile_pic= models.ImageField(upload_to='profile_pic/DoctorProfilePic/',null=True,blank=True) + address = models.CharField(max_length=40) + mobile = models.CharField(max_length=20,null=True) + department= models.CharField(max_length=50,choices=departments,default='Cardiologist') + status=models.BooleanField(default=False) + @property + def get_name(self): + return self.user.first_name+" "+self.user.last_name + @property + def get_id(self): + return self.user.id + def __str__(self): + return "{} ({})".format(self.user.first_name,self.department) + + + +class Patient(models.Model): + user=models.OneToOneField(User,on_delete=models.CASCADE) + profile_pic= models.ImageField(upload_to='profile_pic/PatientProfilePic/',null=True,blank=True) + address = models.CharField(max_length=40) + mobile = models.CharField(max_length=20,null=False) + symptoms = models.CharField(max_length=100,null=False) + assignedDoctorId = models.PositiveIntegerField(null=True) + admitDate=models.DateField(auto_now=True) + status=models.BooleanField(default=False) + @property + def get_name(self): + return self.user.first_name+" "+self.user.last_name + @property + def get_id(self): + return self.user.id + def __str__(self): + return self.user.first_name+" ("+self.symptoms+")" + + +class Appointment(models.Model): + patientId=models.PositiveIntegerField(null=True) + doctorId=models.PositiveIntegerField(null=True) + patientName=models.CharField(max_length=40,null=True) + doctorName=models.CharField(max_length=40,null=True) + appointmentDate=models.DateField(auto_now=True) + description=models.TextField(max_length=500) + status=models.BooleanField(default=False) + + + +class PatientDischargeDetails(models.Model): + patientId=models.PositiveIntegerField(null=True) + patientName=models.CharField(max_length=40) + assignedDoctorName=models.CharField(max_length=40) + address = models.CharField(max_length=40) + mobile = models.CharField(max_length=20,null=True) + symptoms = models.CharField(max_length=100,null=True) + + admitDate=models.DateField(null=False) + releaseDate=models.DateField(null=False) + daySpent=models.PositiveIntegerField(null=False) + + roomCharge=models.PositiveIntegerField(null=False) + medicineCost=models.PositiveIntegerField(null=False) + doctorFee=models.PositiveIntegerField(null=False) + OtherCharge=models.PositiveIntegerField(null=False) + total=models.PositiveIntegerField(null=False) + + +#Developed By : sumit kumar +#facebook : fb.com/sumit.luv +#Youtube :youtube.com/lazycoders diff --git a/hospitalmanagement/hospital/views.py b/hospitalmanagement/hospital/views.py new file mode 100644 index 0000000..f536725 --- /dev/null +++ b/hospitalmanagement/hospital/views.py @@ -0,0 +1,833 @@ +from django.shortcuts import render,redirect,reverse +from . import forms,models +from django.db.models import Sum +from django.contrib.auth.models import Group +from django.http import HttpResponseRedirect +from django.core.mail import send_mail +from django.contrib.auth.decorators import login_required,user_passes_test +from datetime import datetime,timedelta,date +from django.conf import settings +from django.db.models import Q + +# Create your views here. +def home_view(request): + if request.user.is_authenticated: + return HttpResponseRedirect('afterlogin') + return render(request,'hospital/index.html') + + +#for showing signup/login button for admin(by sumit) +def adminclick_view(request): + if request.user.is_authenticated: + return HttpResponseRedirect('afterlogin') + return render(request,'hospital/adminclick.html') + + +#for showing signup/login button for doctor(by sumit) +def doctorclick_view(request): + if request.user.is_authenticated: + return HttpResponseRedirect('afterlogin') + return render(request,'hospital/doctorclick.html') + + +#for showing signup/login button for patient(by sumit) +def patientclick_view(request): + if request.user.is_authenticated: + return HttpResponseRedirect('afterlogin') + return render(request,'hospital/patientclick.html') + + + + +def admin_signup_view(request): + form=forms.AdminSigupForm() + if request.method=='POST': + form=forms.AdminSigupForm(request.POST) + if form.is_valid(): + user=form.save() + user.set_password(user.password) + user.save() + my_admin_group = Group.objects.get_or_create(name='ADMIN') + my_admin_group[0].user_set.add(user) + return HttpResponseRedirect('adminlogin') + return render(request,'hospital/adminsignup.html',{'form':form}) + + + + +def doctor_signup_view(request): + userForm=forms.DoctorUserForm() + doctorForm=forms.DoctorForm() + mydict={'userForm':userForm,'doctorForm':doctorForm} + if request.method=='POST': + userForm=forms.DoctorUserForm(request.POST) + doctorForm=forms.DoctorForm(request.POST,request.FILES) + if userForm.is_valid() and doctorForm.is_valid(): + user=userForm.save() + user.set_password(user.password) + user.save() + doctor=doctorForm.save(commit=False) + doctor.user=user + doctor=doctor.save() + my_doctor_group = Group.objects.get_or_create(name='DOCTOR') + my_doctor_group[0].user_set.add(user) + return HttpResponseRedirect('doctorlogin') + return render(request,'hospital/doctorsignup.html',context=mydict) + + +def patient_signup_view(request): + userForm=forms.PatientUserForm() + patientForm=forms.PatientForm() + mydict={'userForm':userForm,'patientForm':patientForm} + if request.method=='POST': + userForm=forms.PatientUserForm(request.POST) + patientForm=forms.PatientForm(request.POST,request.FILES) + if userForm.is_valid() and patientForm.is_valid(): + user=userForm.save() + user.set_password(user.password) + user.save() + patient=patientForm.save(commit=False) + patient.user=user + patient.assignedDoctorId=request.POST.get('assignedDoctorId') + patient=patient.save() + my_patient_group = Group.objects.get_or_create(name='PATIENT') + my_patient_group[0].user_set.add(user) + return HttpResponseRedirect('patientlogin') + return render(request,'hospital/patientsignup.html',context=mydict) + + + + + + +#-----------for checking user is doctor , patient or admin(by sumit) +def is_admin(user): + return user.groups.filter(name='ADMIN').exists() +def is_doctor(user): + return user.groups.filter(name='DOCTOR').exists() +def is_patient(user): + return user.groups.filter(name='PATIENT').exists() + + +#---------AFTER ENTERING CREDENTIALS WE CHECK WHETHER USERNAME AND PASSWORD IS OF ADMIN,DOCTOR OR PATIENT +def afterlogin_view(request): + if is_admin(request.user): + return redirect('admin-dashboard') + elif is_doctor(request.user): + accountapproval=models.Doctor.objects.all().filter(user_id=request.user.id,status=True) + if accountapproval: + return redirect('doctor-dashboard') + else: + return render(request,'hospital/doctor_wait_for_approval.html') + elif is_patient(request.user): + accountapproval=models.Patient.objects.all().filter(user_id=request.user.id,status=True) + if accountapproval: + return redirect('patient-dashboard') + else: + return render(request,'hospital/patient_wait_for_approval.html') + + + + + + + + +#--------------------------------------------------------------------------------- +#------------------------ ADMIN RELATED VIEWS START ------------------------------ +#--------------------------------------------------------------------------------- +@login_required(login_url='adminlogin') +@user_passes_test(is_admin) +def admin_dashboard_view(request): + #for both table in admin dashboard + doctors=models.Doctor.objects.all().order_by('-id') + patients=models.Patient.objects.all().order_by('-id') + #for three cards + doctorcount=models.Doctor.objects.all().filter(status=True).count() + pendingdoctorcount=models.Doctor.objects.all().filter(status=False).count() + + patientcount=models.Patient.objects.all().filter(status=True).count() + pendingpatientcount=models.Patient.objects.all().filter(status=False).count() + + appointmentcount=models.Appointment.objects.all().filter(status=True).count() + pendingappointmentcount=models.Appointment.objects.all().filter(status=False).count() + mydict={ + 'doctors':doctors, + 'patients':patients, + 'doctorcount':doctorcount, + 'pendingdoctorcount':pendingdoctorcount, + 'patientcount':patientcount, + 'pendingpatientcount':pendingpatientcount, + 'appointmentcount':appointmentcount, + 'pendingappointmentcount':pendingappointmentcount, + } + return render(request,'hospital/admin_dashboard.html',context=mydict) + + +# this view for sidebar click on admin page +@login_required(login_url='adminlogin') +@user_passes_test(is_admin) +def admin_doctor_view(request): + return render(request,'hospital/admin_doctor.html') + + + +@login_required(login_url='adminlogin') +@user_passes_test(is_admin) +def admin_view_doctor_view(request): + doctors=models.Doctor.objects.all().filter(status=True) + return render(request,'hospital/admin_view_doctor.html',{'doctors':doctors}) + + + +@login_required(login_url='adminlogin') +@user_passes_test(is_admin) +def delete_doctor_from_hospital_view(request,pk): + doctor=models.Doctor.objects.get(id=pk) + user=models.User.objects.get(id=doctor.user_id) + user.delete() + doctor.delete() + return redirect('admin-view-doctor') + + + +@login_required(login_url='adminlogin') +@user_passes_test(is_admin) +def update_doctor_view(request,pk): + doctor=models.Doctor.objects.get(id=pk) + user=models.User.objects.get(id=doctor.user_id) + + userForm=forms.DoctorUserForm(instance=user) + doctorForm=forms.DoctorForm(request.FILES,instance=doctor) + mydict={'userForm':userForm,'doctorForm':doctorForm} + if request.method=='POST': + userForm=forms.DoctorUserForm(request.POST,instance=user) + doctorForm=forms.DoctorForm(request.POST,request.FILES,instance=doctor) + if userForm.is_valid() and doctorForm.is_valid(): + user=userForm.save() + user.set_password(user.password) + user.save() + doctor=doctorForm.save(commit=False) + doctor.status=True + doctor.save() + return redirect('admin-view-doctor') + return render(request,'hospital/admin_update_doctor.html',context=mydict) + + + + +@login_required(login_url='adminlogin') +@user_passes_test(is_admin) +def admin_add_doctor_view(request): + userForm=forms.DoctorUserForm() + doctorForm=forms.DoctorForm() + mydict={'userForm':userForm,'doctorForm':doctorForm} + if request.method=='POST': + userForm=forms.DoctorUserForm(request.POST) + doctorForm=forms.DoctorForm(request.POST, request.FILES) + if userForm.is_valid() and doctorForm.is_valid(): + user=userForm.save() + user.set_password(user.password) + user.save() + + doctor=doctorForm.save(commit=False) + doctor.user=user + doctor.status=True + doctor.save() + + my_doctor_group = Group.objects.get_or_create(name='DOCTOR') + my_doctor_group[0].user_set.add(user) + + return HttpResponseRedirect('admin-view-doctor') + return render(request,'hospital/admin_add_doctor.html',context=mydict) + + + + +@login_required(login_url='adminlogin') +@user_passes_test(is_admin) +def admin_approve_doctor_view(request): + #those whose approval are needed + doctors=models.Doctor.objects.all().filter(status=False) + return render(request,'hospital/admin_approve_doctor.html',{'doctors':doctors}) + + +@login_required(login_url='adminlogin') +@user_passes_test(is_admin) +def approve_doctor_view(request,pk): + doctor=models.Doctor.objects.get(id=pk) + doctor.status=True + doctor.save() + return redirect(reverse('admin-approve-doctor')) + + +@login_required(login_url='adminlogin') +@user_passes_test(is_admin) +def reject_doctor_view(request,pk): + doctor=models.Doctor.objects.get(id=pk) + user=models.User.objects.get(id=doctor.user_id) + user.delete() + doctor.delete() + return redirect('admin-approve-doctor') + + + +@login_required(login_url='adminlogin') +@user_passes_test(is_admin) +def admin_view_doctor_specialisation_view(request): + doctors=models.Doctor.objects.all().filter(status=True) + return render(request,'hospital/admin_view_doctor_specialisation.html',{'doctors':doctors}) + + + +@login_required(login_url='adminlogin') +@user_passes_test(is_admin) +def admin_patient_view(request): + return render(request,'hospital/admin_patient.html') + + + +@login_required(login_url='adminlogin') +@user_passes_test(is_admin) +def admin_view_patient_view(request): + patients=models.Patient.objects.all().filter(status=True) + return render(request,'hospital/admin_view_patient.html',{'patients':patients}) + + + +@login_required(login_url='adminlogin') +@user_passes_test(is_admin) +def delete_patient_from_hospital_view(request,pk): + patient=models.Patient.objects.get(id=pk) + user=models.User.objects.get(id=patient.user_id) + user.delete() + patient.delete() + return redirect('admin-view-patient') + + + +@login_required(login_url='adminlogin') +@user_passes_test(is_admin) +def update_patient_view(request,pk): + patient=models.Patient.objects.get(id=pk) + user=models.User.objects.get(id=patient.user_id) + + userForm=forms.PatientUserForm(instance=user) + patientForm=forms.PatientForm(request.FILES,instance=patient) + mydict={'userForm':userForm,'patientForm':patientForm} + if request.method=='POST': + userForm=forms.PatientUserForm(request.POST,instance=user) + patientForm=forms.PatientForm(request.POST,request.FILES,instance=patient) + if userForm.is_valid() and patientForm.is_valid(): + user=userForm.save() + user.set_password(user.password) + user.save() + patient=patientForm.save(commit=False) + patient.status=True + patient.assignedDoctorId=request.POST.get('assignedDoctorId') + patient.save() + return redirect('admin-view-patient') + return render(request,'hospital/admin_update_patient.html',context=mydict) + + + + + +@login_required(login_url='adminlogin') +@user_passes_test(is_admin) +def admin_add_patient_view(request): + userForm=forms.PatientUserForm() + patientForm=forms.PatientForm() + mydict={'userForm':userForm,'patientForm':patientForm} + if request.method=='POST': + userForm=forms.PatientUserForm(request.POST) + patientForm=forms.PatientForm(request.POST,request.FILES) + if userForm.is_valid() and patientForm.is_valid(): + user=userForm.save() + user.set_password(user.password) + user.save() + + patient=patientForm.save(commit=False) + patient.user=user + patient.status=True + patient.assignedDoctorId=request.POST.get('assignedDoctorId') + patient.save() + + my_patient_group = Group.objects.get_or_create(name='PATIENT') + my_patient_group[0].user_set.add(user) + + return HttpResponseRedirect('admin-view-patient') + return render(request,'hospital/admin_add_patient.html',context=mydict) + + + +#------------------FOR APPROVING PATIENT BY ADMIN---------------------- +@login_required(login_url='adminlogin') +@user_passes_test(is_admin) +def admin_approve_patient_view(request): + #those whose approval are needed + patients=models.Patient.objects.all().filter(status=False) + return render(request,'hospital/admin_approve_patient.html',{'patients':patients}) + + + +@login_required(login_url='adminlogin') +@user_passes_test(is_admin) +def approve_patient_view(request,pk): + patient=models.Patient.objects.get(id=pk) + patient.status=True + patient.save() + return redirect(reverse('admin-approve-patient')) + + + +@login_required(login_url='adminlogin') +@user_passes_test(is_admin) +def reject_patient_view(request,pk): + patient=models.Patient.objects.get(id=pk) + user=models.User.objects.get(id=patient.user_id) + user.delete() + patient.delete() + return redirect('admin-approve-patient') + + + +#--------------------- FOR DISCHARGING PATIENT BY ADMIN START------------------------- +@login_required(login_url='adminlogin') +@user_passes_test(is_admin) +def admin_discharge_patient_view(request): + patients=models.Patient.objects.all().filter(status=True) + return render(request,'hospital/admin_discharge_patient.html',{'patients':patients}) + + + +@login_required(login_url='adminlogin') +@user_passes_test(is_admin) +def discharge_patient_view(request,pk): + patient=models.Patient.objects.get(id=pk) + days=(date.today()-patient.admitDate) #2 days, 0:00:00 + assignedDoctor=models.User.objects.all().filter(id=patient.assignedDoctorId) + d=days.days # only how many day that is 2 + patientDict={ + 'patientId':pk, + 'name':patient.get_name, + 'mobile':patient.mobile, + 'address':patient.address, + 'symptoms':patient.symptoms, + 'admitDate':patient.admitDate, + 'todayDate':date.today(), + 'day':d, + 'assignedDoctorName':assignedDoctor[0].first_name, + } + if request.method == 'POST': + feeDict ={ + 'roomCharge':int(request.POST['roomCharge'])*int(d), + 'doctorFee':request.POST['doctorFee'], + 'medicineCost' : request.POST['medicineCost'], + 'OtherCharge' : request.POST['OtherCharge'], + 'total':(int(request.POST['roomCharge'])*int(d))+int(request.POST['doctorFee'])+int(request.POST['medicineCost'])+int(request.POST['OtherCharge']) + } + patientDict.update(feeDict) + #for updating to database patientDischargeDetails (pDD) + pDD=models.PatientDischargeDetails() + pDD.patientId=pk + pDD.patientName=patient.get_name + pDD.assignedDoctorName=assignedDoctor[0].first_name + pDD.address=patient.address + pDD.mobile=patient.mobile + pDD.symptoms=patient.symptoms + pDD.admitDate=patient.admitDate + pDD.releaseDate=date.today() + pDD.daySpent=int(d) + pDD.medicineCost=int(request.POST['medicineCost']) + pDD.roomCharge=int(request.POST['roomCharge'])*int(d) + pDD.doctorFee=int(request.POST['doctorFee']) + pDD.OtherCharge=int(request.POST['OtherCharge']) + pDD.total=(int(request.POST['roomCharge'])*int(d))+int(request.POST['doctorFee'])+int(request.POST['medicineCost'])+int(request.POST['OtherCharge']) + pDD.save() + return render(request,'hospital/patient_final_bill.html',context=patientDict) + return render(request,'hospital/patient_generate_bill.html',context=patientDict) + + + +# PDF generation via xhtml2pdf has been disabled to avoid freetype/reportlab runtime errors. +# Fallback: render the bill template as regular HTML so users can view/print it from the browser. +def download_pdf_view(request, pk): + dischargeDetails = models.PatientDischargeDetails.objects.all().filter(patientId=pk).order_by('-id')[:1] + if not dischargeDetails: + return render(request, 'hospital/download_bill.html', {}) + context = { + 'patientName': dischargeDetails[0].patientName, + 'assignedDoctorName': dischargeDetails[0].assignedDoctorName, + 'address': dischargeDetails[0].address, + 'mobile': dischargeDetails[0].mobile, + 'symptoms': dischargeDetails[0].symptoms, + 'admitDate': dischargeDetails[0].admitDate, + 'releaseDate': dischargeDetails[0].releaseDate, + 'daySpent': dischargeDetails[0].daySpent, + 'medicineCost': dischargeDetails[0].medicineCost, + 'roomCharge': dischargeDetails[0].roomCharge, + 'doctorFee': dischargeDetails[0].doctorFee, + 'OtherCharge': dischargeDetails[0].OtherCharge, + 'total': dischargeDetails[0].total, + } + return render(request, 'hospital/download_bill.html', context) + + + +#-----------------APPOINTMENT START-------------------------------------------------------------------- +@login_required(login_url='adminlogin') +@user_passes_test(is_admin) +def admin_appointment_view(request): + return render(request,'hospital/admin_appointment.html') + + + +@login_required(login_url='adminlogin') +@user_passes_test(is_admin) +def admin_view_appointment_view(request): + appointments=models.Appointment.objects.all().filter(status=True) + return render(request,'hospital/admin_view_appointment.html',{'appointments':appointments}) + + + +@login_required(login_url='adminlogin') +@user_passes_test(is_admin) +def admin_add_appointment_view(request): + appointmentForm=forms.AppointmentForm() + mydict={'appointmentForm':appointmentForm,} + if request.method=='POST': + appointmentForm=forms.AppointmentForm(request.POST) + if appointmentForm.is_valid(): + appointment=appointmentForm.save(commit=False) + appointment.doctorId=request.POST.get('doctorId') + appointment.patientId=request.POST.get('patientId') + appointment.doctorName=models.User.objects.get(id=request.POST.get('doctorId')).first_name + appointment.patientName=models.User.objects.get(id=request.POST.get('patientId')).first_name + appointment.status=True + appointment.save() + return HttpResponseRedirect('admin-view-appointment') + return render(request,'hospital/admin_add_appointment.html',context=mydict) + + + +@login_required(login_url='adminlogin') +@user_passes_test(is_admin) +def admin_approve_appointment_view(request): + #those whose approval are needed + appointments=models.Appointment.objects.all().filter(status=False) + return render(request,'hospital/admin_approve_appointment.html',{'appointments':appointments}) + + + +@login_required(login_url='adminlogin') +@user_passes_test(is_admin) +def approve_appointment_view(request,pk): + appointment=models.Appointment.objects.get(id=pk) + appointment.status=True + appointment.save() + return redirect(reverse('admin-approve-appointment')) + + + +@login_required(login_url='adminlogin') +@user_passes_test(is_admin) +def reject_appointment_view(request,pk): + appointment=models.Appointment.objects.get(id=pk) + appointment.delete() + return redirect('admin-approve-appointment') +#--------------------------------------------------------------------------------- +#------------------------ ADMIN RELATED VIEWS END ------------------------------ +#--------------------------------------------------------------------------------- + + + + + + +#--------------------------------------------------------------------------------- +#------------------------ DOCTOR RELATED VIEWS START ------------------------------ +#--------------------------------------------------------------------------------- +@login_required(login_url='doctorlogin') +@user_passes_test(is_doctor) +def doctor_dashboard_view(request): + #for three cards + patientcount=models.Patient.objects.all().filter(status=True,assignedDoctorId=request.user.id).count() + appointmentcount=models.Appointment.objects.all().filter(status=True,doctorId=request.user.id).count() + patientdischarged=models.PatientDischargeDetails.objects.all().distinct().filter(assignedDoctorName=request.user.first_name).count() + + #for table in doctor dashboard + appointments=models.Appointment.objects.all().filter(status=True,doctorId=request.user.id).order_by('-id') + patientid=[] + for a in appointments: + patientid.append(a.patientId) + patients=models.Patient.objects.all().filter(status=True,user_id__in=patientid).order_by('-id') + appointments=zip(appointments,patients) + mydict={ + 'patientcount':patientcount, + 'appointmentcount':appointmentcount, + 'patientdischarged':patientdischarged, + 'appointments':appointments, + 'doctor':models.Doctor.objects.get(user_id=request.user.id), #for profile picture of doctor in sidebar + } + return render(request,'hospital/doctor_dashboard.html',context=mydict) + + + +@login_required(login_url='doctorlogin') +@user_passes_test(is_doctor) +def doctor_patient_view(request): + mydict={ + 'doctor':models.Doctor.objects.get(user_id=request.user.id), #for profile picture of doctor in sidebar + } + return render(request,'hospital/doctor_patient.html',context=mydict) + + + + + +@login_required(login_url='doctorlogin') +@user_passes_test(is_doctor) +def doctor_view_patient_view(request): + patients=models.Patient.objects.all().filter(status=True,assignedDoctorId=request.user.id) + doctor=models.Doctor.objects.get(user_id=request.user.id) #for profile picture of doctor in sidebar + return render(request,'hospital/doctor_view_patient.html',{'patients':patients,'doctor':doctor}) + + +@login_required(login_url='doctorlogin') +@user_passes_test(is_doctor) +def search_view(request): + doctor=models.Doctor.objects.get(user_id=request.user.id) #for profile picture of doctor in sidebar + # whatever user write in search box we get in query + query = request.GET['query'] + patients=models.Patient.objects.all().filter(status=True,assignedDoctorId=request.user.id).filter(Q(symptoms__icontains=query)|Q(user__first_name__icontains=query)) + return render(request,'hospital/doctor_view_patient.html',{'patients':patients,'doctor':doctor}) + + + +@login_required(login_url='doctorlogin') +@user_passes_test(is_doctor) +def doctor_view_discharge_patient_view(request): + dischargedpatients=models.PatientDischargeDetails.objects.all().distinct().filter(assignedDoctorName=request.user.first_name) + doctor=models.Doctor.objects.get(user_id=request.user.id) #for profile picture of doctor in sidebar + return render(request,'hospital/doctor_view_discharge_patient.html',{'dischargedpatients':dischargedpatients,'doctor':doctor}) + + + +@login_required(login_url='doctorlogin') +@user_passes_test(is_doctor) +def doctor_appointment_view(request): + doctor=models.Doctor.objects.get(user_id=request.user.id) #for profile picture of doctor in sidebar + return render(request,'hospital/doctor_appointment.html',{'doctor':doctor}) + + + +@login_required(login_url='doctorlogin') +@user_passes_test(is_doctor) +def doctor_view_appointment_view(request): + doctor=models.Doctor.objects.get(user_id=request.user.id) #for profile picture of doctor in sidebar + appointments=models.Appointment.objects.all().filter(status=True,doctorId=request.user.id) + patientid=[] + for a in appointments: + patientid.append(a.patientId) + patients=models.Patient.objects.all().filter(status=True,user_id__in=patientid) + appointments=zip(appointments,patients) + return render(request,'hospital/doctor_view_appointment.html',{'appointments':appointments,'doctor':doctor}) + + + +@login_required(login_url='doctorlogin') +@user_passes_test(is_doctor) +def doctor_delete_appointment_view(request): + doctor=models.Doctor.objects.get(user_id=request.user.id) #for profile picture of doctor in sidebar + appointments=models.Appointment.objects.all().filter(status=True,doctorId=request.user.id) + patientid=[] + for a in appointments: + patientid.append(a.patientId) + patients=models.Patient.objects.all().filter(status=True,user_id__in=patientid) + appointments=zip(appointments,patients) + return render(request,'hospital/doctor_delete_appointment.html',{'appointments':appointments,'doctor':doctor}) + + + +@login_required(login_url='doctorlogin') +@user_passes_test(is_doctor) +def delete_appointment_view(request,pk): + appointment=models.Appointment.objects.get(id=pk) + appointment.delete() + doctor=models.Doctor.objects.get(user_id=request.user.id) #for profile picture of doctor in sidebar + appointments=models.Appointment.objects.all().filter(status=True,doctorId=request.user.id) + patientid=[] + for a in appointments: + patientid.append(a.patientId) + patients=models.Patient.objects.all().filter(status=True,user_id__in=patientid) + appointments=zip(appointments,patients) + return render(request,'hospital/doctor_delete_appointment.html',{'appointments':appointments,'doctor':doctor}) + + + +#--------------------------------------------------------------------------------- +#------------------------ DOCTOR RELATED VIEWS END ------------------------------ +#--------------------------------------------------------------------------------- + + + + + + +#--------------------------------------------------------------------------------- +#------------------------ PATIENT RELATED VIEWS START ------------------------------ +#--------------------------------------------------------------------------------- +@login_required(login_url='patientlogin') +@user_passes_test(is_patient) +def patient_dashboard_view(request): + patient=models.Patient.objects.get(user_id=request.user.id) + doctor=models.Doctor.objects.get(user_id=patient.assignedDoctorId) + mydict={ + 'patient':patient, + 'doctorName':doctor.get_name, + 'doctorMobile':doctor.mobile, + 'doctorAddress':doctor.address, + 'symptoms':patient.symptoms, + 'doctorDepartment':doctor.department, + 'admitDate':patient.admitDate, + } + return render(request,'hospital/patient_dashboard.html',context=mydict) + + + +@login_required(login_url='patientlogin') +@user_passes_test(is_patient) +def patient_appointment_view(request): + patient=models.Patient.objects.get(user_id=request.user.id) #for profile picture of patient in sidebar + return render(request,'hospital/patient_appointment.html',{'patient':patient}) + + + +@login_required(login_url='patientlogin') +@user_passes_test(is_patient) +def patient_book_appointment_view(request): + appointmentForm=forms.PatientAppointmentForm() + patient=models.Patient.objects.get(user_id=request.user.id) #for profile picture of patient in sidebar + message=None + mydict={'appointmentForm':appointmentForm,'patient':patient,'message':message} + if request.method=='POST': + appointmentForm=forms.PatientAppointmentForm(request.POST) + if appointmentForm.is_valid(): + print(request.POST.get('doctorId')) + desc=request.POST.get('description') + + doctor=models.Doctor.objects.get(user_id=request.POST.get('doctorId')) + + appointment=appointmentForm.save(commit=False) + appointment.doctorId=request.POST.get('doctorId') + appointment.patientId=request.user.id #----user can choose any patient but only their info will be stored + appointment.doctorName=models.User.objects.get(id=request.POST.get('doctorId')).first_name + appointment.patientName=request.user.first_name #----user can choose any patient but only their info will be stored + appointment.status=False + appointment.save() + return HttpResponseRedirect('patient-view-appointment') + return render(request,'hospital/patient_book_appointment.html',context=mydict) + + + +def patient_view_doctor_view(request): + doctors=models.Doctor.objects.all().filter(status=True) + patient=models.Patient.objects.get(user_id=request.user.id) #for profile picture of patient in sidebar + return render(request,'hospital/patient_view_doctor.html',{'patient':patient,'doctors':doctors}) + + + +def search_doctor_view(request): + patient=models.Patient.objects.get(user_id=request.user.id) #for profile picture of patient in sidebar + + # whatever user write in search box we get in query + query = request.GET['query'] + doctors=models.Doctor.objects.all().filter(status=True).filter(Q(department__icontains=query)| Q(user__first_name__icontains=query)) + return render(request,'hospital/patient_view_doctor.html',{'patient':patient,'doctors':doctors}) + + + + +@login_required(login_url='patientlogin') +@user_passes_test(is_patient) +def patient_view_appointment_view(request): + patient=models.Patient.objects.get(user_id=request.user.id) #for profile picture of patient in sidebar + appointments=models.Appointment.objects.all().filter(patientId=request.user.id) + return render(request,'hospital/patient_view_appointment.html',{'appointments':appointments,'patient':patient}) + + + +@login_required(login_url='patientlogin') +@user_passes_test(is_patient) +def patient_discharge_view(request): + patient=models.Patient.objects.get(user_id=request.user.id) #for profile picture of patient in sidebar + dischargeDetails=models.PatientDischargeDetails.objects.all().filter(patientId=patient.id).order_by('-id')[:1] + patientDict=None + if dischargeDetails: + patientDict ={ + 'is_discharged':True, + 'patient':patient, + 'patientId':patient.id, + 'patientName':patient.get_name, + 'assignedDoctorName':dischargeDetails[0].assignedDoctorName, + 'address':patient.address, + 'mobile':patient.mobile, + 'symptoms':patient.symptoms, + 'admitDate':patient.admitDate, + 'releaseDate':dischargeDetails[0].releaseDate, + 'daySpent':dischargeDetails[0].daySpent, + 'medicineCost':dischargeDetails[0].medicineCost, + 'roomCharge':dischargeDetails[0].roomCharge, + 'doctorFee':dischargeDetails[0].doctorFee, + 'OtherCharge':dischargeDetails[0].OtherCharge, + 'total':dischargeDetails[0].total, + } + print(patientDict) + else: + patientDict={ + 'is_discharged':False, + 'patient':patient, + 'patientId':request.user.id, + } + return render(request,'hospital/patient_discharge.html',context=patientDict) + + +#------------------------ PATIENT RELATED VIEWS END ------------------------------ +#--------------------------------------------------------------------------------- + + + + + + + + +#--------------------------------------------------------------------------------- +#------------------------ ABOUT US AND CONTACT US VIEWS START ------------------------------ +#--------------------------------------------------------------------------------- +def aboutus_view(request): + return render(request,'hospital/aboutus.html') + +def contactus_view(request): + sub = forms.ContactusForm() + if request.method == 'POST': + sub = forms.ContactusForm(request.POST) + if sub.is_valid(): + email = sub.cleaned_data['Email'] + name=sub.cleaned_data['Name'] + message = sub.cleaned_data['Message'] + send_mail(str(name)+' || '+str(email),message,settings.EMAIL_HOST_USER, settings.EMAIL_RECEIVING_USER, fail_silently = False) + return render(request, 'hospital/contactussuccess.html') + return render(request, 'hospital/contactus.html', {'form':sub}) + + +#--------------------------------------------------------------------------------- +#------------------------ ADMIN RELATED VIEWS END ------------------------------ +#--------------------------------------------------------------------------------- + + + +#Developed By : sumit kumar +#facebook : fb.com/sumit.luv +#Youtube :youtube.com/lazycoders diff --git a/hospitalmanagement/hospitalmanagement/__init__.py b/hospitalmanagement/hospitalmanagement/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/hospitalmanagement/hospitalmanagement/asgi.py b/hospitalmanagement/hospitalmanagement/asgi.py new file mode 100644 index 0000000..0b9fa03 --- /dev/null +++ b/hospitalmanagement/hospitalmanagement/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for hospitalmanagement project. + +It exposes the ASGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'hospitalmanagement.settings') + +application = get_asgi_application() diff --git a/hospitalmanagement/hospitalmanagement/settings.py b/hospitalmanagement/hospitalmanagement/settings.py new file mode 100644 index 0000000..2d1df0c --- /dev/null +++ b/hospitalmanagement/hospitalmanagement/settings.py @@ -0,0 +1,146 @@ +""" +Django settings for hospitalmanagement project. + +Generated by 'django-admin startproject' using Django 3.0.5. + +For more information on this file, see +https://docs.djangoproject.com/en/3.0/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/3.0/ref/settings/ +""" + +import os + +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +TEMPLATE_DIR = os.path.join(BASE_DIR,'templates') +STATIC_DIR=os.path.join(BASE_DIR,'static') + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'hpbv()ep00boce&o0w7z1h)st148(*m@6@-rk$nn)(n9ojj4c0' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'hospital', + 'widget_tweaks', +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'hospitalmanagement.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [TEMPLATE_DIR,], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'hospitalmanagement.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/3.0/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + } +} + + +# Password validation +# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/3.0/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/3.0/howto/static-files/ + +STATIC_URL = '/static/' + +STATICFILES_DIRS=[STATIC_DIR,] + +MEDIA_ROOT=os.path.join(BASE_DIR,'static') + + + +LOGIN_REDIRECT_URL='/afterlogin' + +#for contact us give your gmail id and password +EMAIL_BACKEND ='django.core.mail.backends.smtp.EmailBackend' +EMAIL_HOST = 'smtp.gmail.com' +EMAIL_USE_TLS = True +EMAIL_PORT = 587 +EMAIL_HOST_USER = 'from@gmail.com' # this email will be used to send emails +EMAIL_HOST_PASSWORD = 'xyz' # host email password required +# now sign in with your host gmail account in your browser +# open following link and turn it ON +# https://myaccount.google.com/lesssecureapps +# otherwise you will get SMTPAuthenticationError at /contactus +# this process is required because google blocks apps authentication by default +EMAIL_RECEIVING_USER = ['to@gmail.com'] # email on which you will receive messages sent from website diff --git a/hospitalmanagement/hospitalmanagement/urls.py b/hospitalmanagement/hospitalmanagement/urls.py new file mode 100644 index 0000000..d72f3c8 --- /dev/null +++ b/hospitalmanagement/hospitalmanagement/urls.py @@ -0,0 +1,114 @@ +""" + +Developed By : sumit kumar +facebook : fb.com/sumit.luv +Youtube :youtube.com/lazycoders + + +""" + + + + +from django.contrib import admin +from django.urls import path +from hospital import views +from django.contrib.auth.views import LoginView,LogoutView + + +#-------------FOR ADMIN RELATED URLS +urlpatterns = [ + path('admin/', admin.site.urls), + path('',views.home_view,name=''), + + + path('aboutus', views.aboutus_view), + path('contactus', views.contactus_view), + + + path('adminclick', views.adminclick_view), + path('doctorclick', views.doctorclick_view), + path('patientclick', views.patientclick_view), + + path('adminsignup', views.admin_signup_view), + path('doctorsignup', views.doctor_signup_view,name='doctorsignup'), + path('patientsignup', views.patient_signup_view), + + path('adminlogin', LoginView.as_view(template_name='hospital/adminlogin.html')), + path('doctorlogin', LoginView.as_view(template_name='hospital/doctorlogin.html')), + path('patientlogin', LoginView.as_view(template_name='hospital/patientlogin.html')), + + + path('afterlogin', views.afterlogin_view,name='afterlogin'), + path('logout', LogoutView.as_view(template_name='hospital/index.html'),name='logout'), + + + path('admin-dashboard', views.admin_dashboard_view,name='admin-dashboard'), + + path('admin-doctor', views.admin_doctor_view,name='admin-doctor'), + path('admin-view-doctor', views.admin_view_doctor_view,name='admin-view-doctor'), + path('delete-doctor-from-hospital/', views.delete_doctor_from_hospital_view,name='delete-doctor-from-hospital'), + path('update-doctor/', views.update_doctor_view,name='update-doctor'), + path('admin-add-doctor', views.admin_add_doctor_view,name='admin-add-doctor'), + path('admin-approve-doctor', views.admin_approve_doctor_view,name='admin-approve-doctor'), + path('approve-doctor/', views.approve_doctor_view,name='approve-doctor'), + path('reject-doctor/', views.reject_doctor_view,name='reject-doctor'), + path('admin-view-doctor-specialisation',views.admin_view_doctor_specialisation_view,name='admin-view-doctor-specialisation'), + + + path('admin-patient', views.admin_patient_view,name='admin-patient'), + path('admin-view-patient', views.admin_view_patient_view,name='admin-view-patient'), + path('delete-patient-from-hospital/', views.delete_patient_from_hospital_view,name='delete-patient-from-hospital'), + path('update-patient/', views.update_patient_view,name='update-patient'), + path('admin-add-patient', views.admin_add_patient_view,name='admin-add-patient'), + path('admin-approve-patient', views.admin_approve_patient_view,name='admin-approve-patient'), + path('approve-patient/', views.approve_patient_view,name='approve-patient'), + path('reject-patient/', views.reject_patient_view,name='reject-patient'), + path('admin-discharge-patient', views.admin_discharge_patient_view,name='admin-discharge-patient'), + path('discharge-patient/', views.discharge_patient_view,name='discharge-patient'), + path('download-pdf/', views.download_pdf_view,name='download-pdf'), + + + path('admin-appointment', views.admin_appointment_view,name='admin-appointment'), + path('admin-view-appointment', views.admin_view_appointment_view,name='admin-view-appointment'), + path('admin-add-appointment', views.admin_add_appointment_view,name='admin-add-appointment'), + path('admin-approve-appointment', views.admin_approve_appointment_view,name='admin-approve-appointment'), + path('approve-appointment/', views.approve_appointment_view,name='approve-appointment'), + path('reject-appointment/', views.reject_appointment_view,name='reject-appointment'), +] + + +#---------FOR DOCTOR RELATED URLS------------------------------------- +urlpatterns +=[ + path('doctor-dashboard', views.doctor_dashboard_view,name='doctor-dashboard'), + path('search', views.search_view,name='search'), + + path('doctor-patient', views.doctor_patient_view,name='doctor-patient'), + path('doctor-view-patient', views.doctor_view_patient_view,name='doctor-view-patient'), + path('doctor-view-discharge-patient',views.doctor_view_discharge_patient_view,name='doctor-view-discharge-patient'), + + path('doctor-appointment', views.doctor_appointment_view,name='doctor-appointment'), + path('doctor-view-appointment', views.doctor_view_appointment_view,name='doctor-view-appointment'), + path('doctor-delete-appointment',views.doctor_delete_appointment_view,name='doctor-delete-appointment'), + path('delete-appointment/', views.delete_appointment_view,name='delete-appointment'), +] + + + + +#---------FOR PATIENT RELATED URLS------------------------------------- +urlpatterns +=[ + + path('patient-dashboard', views.patient_dashboard_view,name='patient-dashboard'), + path('patient-appointment', views.patient_appointment_view,name='patient-appointment'), + path('patient-book-appointment', views.patient_book_appointment_view,name='patient-book-appointment'), + path('patient-view-appointment', views.patient_view_appointment_view,name='patient-view-appointment'), + path('patient-view-doctor', views.patient_view_doctor_view,name='patient-view-doctor'), + path('searchdoctor', views.search_doctor_view,name='searchdoctor'), + path('patient-discharge', views.patient_discharge_view,name='patient-discharge'), + +] + +#Developed By : sumit kumar +#facebook : fb.com/sumit.luv +#Youtube :youtube.com/lazycoders diff --git a/hospitalmanagement/hospitalmanagement/wsgi.py b/hospitalmanagement/hospitalmanagement/wsgi.py new file mode 100644 index 0000000..0f3526d --- /dev/null +++ b/hospitalmanagement/hospitalmanagement/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for hospitalmanagement project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'hospitalmanagement.settings') + +application = get_wsgi_application() diff --git a/hospitalmanagement/manage.py b/hospitalmanagement/manage.py new file mode 100644 index 0000000..cfabb5f --- /dev/null +++ b/hospitalmanagement/manage.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'hospitalmanagement.settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main() diff --git a/hospitalmanagement/requirement.txt b/hospitalmanagement/requirement.txt new file mode 100644 index 0000000..8337a87 --- /dev/null +++ b/hospitalmanagement/requirement.txt @@ -0,0 +1,4 @@ +xhtml2pdf +Django==3.0.5 +django-widget-tweaks==1.4.8 +sqlparse==0.3.1 diff --git a/hospitalmanagement/static/images/admin.png b/hospitalmanagement/static/images/admin.png new file mode 100644 index 0000000..2b83185 Binary files /dev/null and b/hospitalmanagement/static/images/admin.png differ diff --git a/hospitalmanagement/static/images/adminpropic.png b/hospitalmanagement/static/images/adminpropic.png new file mode 100644 index 0000000..774a1e9 Binary files /dev/null and b/hospitalmanagement/static/images/adminpropic.png differ diff --git a/hospitalmanagement/static/images/bg.jpg b/hospitalmanagement/static/images/bg.jpg new file mode 100644 index 0000000..8872081 Binary files /dev/null and b/hospitalmanagement/static/images/bg.jpg differ diff --git a/hospitalmanagement/static/images/doctor.png b/hospitalmanagement/static/images/doctor.png new file mode 100644 index 0000000..e3e9ef0 Binary files /dev/null and b/hospitalmanagement/static/images/doctor.png differ diff --git a/hospitalmanagement/static/images/patient.jpg b/hospitalmanagement/static/images/patient.jpg new file mode 100644 index 0000000..a1c0b49 Binary files /dev/null and b/hospitalmanagement/static/images/patient.jpg differ diff --git a/hospitalmanagement/static/screenshots/admin_dashboard.png b/hospitalmanagement/static/screenshots/admin_dashboard.png new file mode 100644 index 0000000..3d092e6 Binary files /dev/null and b/hospitalmanagement/static/screenshots/admin_dashboard.png differ diff --git a/hospitalmanagement/static/screenshots/admin_doctor.png b/hospitalmanagement/static/screenshots/admin_doctor.png new file mode 100644 index 0000000..568083a Binary files /dev/null and b/hospitalmanagement/static/screenshots/admin_doctor.png differ diff --git a/hospitalmanagement/static/screenshots/homepage.png b/hospitalmanagement/static/screenshots/homepage.png new file mode 100644 index 0000000..89d801a Binary files /dev/null and b/hospitalmanagement/static/screenshots/homepage.png differ diff --git a/hospitalmanagement/static/screenshots/invoice.png b/hospitalmanagement/static/screenshots/invoice.png new file mode 100644 index 0000000..5263629 Binary files /dev/null and b/hospitalmanagement/static/screenshots/invoice.png differ diff --git a/hospitalmanagement/static/style.css b/hospitalmanagement/static/style.css new file mode 100644 index 0000000..787e6f2 --- /dev/null +++ b/hospitalmanagement/static/style.css @@ -0,0 +1,178 @@ +body { + + padding-left: 240px; +} +main { + position: relative; + height: 100vh; +} + +.menu { + background: #5bc995; + height: 100vh; + width: 240px; + position: fixed; + top: 0px; + left: 0; + z-index: 5; + outline: none; +} +.menu .avatar { + background: rgba(0, 0, 0, 0.1); + padding: 2em 0.5em; + text-align: center; +} +.menu .avatar img { + width: 100px; + border-radius: 50%; + overflow: hidden; + border: 4px solid #ffea92; + box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2); +} +.menu .avatar h2 { + font-weight: normal; + margin-bottom: 0; +} +.menu ul { + list-style: none; + padding: 0.5em 0; + margin: 0; +} +.menu ul li { + padding: 0.5em 1em 0.5em 3em; + font-size: 0.95em; + font-weight: regular; + background-repeat: no-repeat; + background-position: left 15px center; + background-size: auto 20px; + transition: all 0.15s linear; + cursor: pointer; +} +.menu ul li.icon-dashboard { + background-image: url("http://www.entypo.com/images//gauge.svg"); +} +.menu ul li.icon-customers { + background-image: url("http://www.entypo.com/images//briefcase.svg"); +} +.menu ul li.icon-users { + background-image: url("http://www.entypo.com/images//users.svg"); +} +.menu ul li.icon-calendar { + background-image: url("http://www.entypo.com/images//calendar.svg"); +} + +.menu ul li:hover { + background-color: rgba(0, 0, 0, 0.1); +} +.menu ul li:focus { + outline: none; +} +@media screen and (max-width: 900px) and (min-width: 400px) { + body { + padding-left: 90px; + } + .menu { + width: 90px; + } + .menu .avatar { + padding: 0.5em; + position: relative; + } + .menu .avatar img { + width: 60px; + } + .menu .avatar h2 { + opacity: 0; + position: absolute; + top: 50%; + left: 100px; + margin: 0; + min-width: 200px; + border-radius: 4px; + background: rgba(0, 0, 0, 0.4); + transform: translate3d(-20px, -50%, 0); + transition: all 0.15s ease-in-out; + } + .menu .avatar:hover h2 { + opacity: 1; + transform: translate3d(0px, -50%, 0); + } + .menu ul li { + height: 60px; + background-position: center center; + background-size: 30px auto; + position: relative; + } + .menu ul li span { + opacity: 0; + position: absolute; + background: rgba(0, 0, 0, 0.5); + padding: 0.2em 0.5em; + border-radius: 4px; + top: 50%; + left: 80px; + transform: translate3d(-15px, -50%, 0); + transition: all 0.15s ease-in-out; + } + .menu ul li span:before { + content: ''; + width: 0; + height: 0; + position: absolute; + top: 50%; + left: -5px; + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; + border-right: 5px solid rgba(0, 0, 0, 0.5); + transform: translateY(-50%); + } + .menu ul li:hover span { + opacity: 1; + transform: translate3d(0px, -50%, 0); + } +} +@media screen and (max-width: 400px) { + body { + padding-left: 0; + } + .menu { + width: 230px; + box-shadow: 0 0 0 100em rgba(0, 0, 0, 0); + transform: translate3d(-230px, 0, 0); + transition: all 0.3s ease-in-out; + } + .menu .smartphone-menu-trigger { + width: 40px; + height: 40px; + position: absolute; + left: 100%; + background: #5bc995; + } + .menu .smartphone-menu-trigger:before, + .menu .smartphone-menu-trigger:after { + content: ''; + width: 50%; + height: 2px; + background: #fff; + border-radius: 10px; + position: absolute; + top: 45%; + left: 50%; + transform: translate3d(-50%, -50%, 0); + } + .menu .smartphone-menu-trigger:after { + top: 55%; + transform: translate3d(-50%, -50%, 0); + } + .menu ul li { + padding: 1em 1em 1em 3em; + font-size: 1.2em; + } + .menu:focus { + transform: translate3d(0, 0, 0); + box-shadow: 0 0 0 100em rgba(0, 0, 0, 0.6); + } + .menu:focus .smartphone-menu-trigger { + pointer-events: none; + } +} diff --git a/hospitalmanagement/templates/hospital/aboutus.html b/hospitalmanagement/templates/hospital/aboutus.html new file mode 100644 index 0000000..686a31e --- /dev/null +++ b/hospitalmanagement/templates/hospital/aboutus.html @@ -0,0 +1,49 @@ + +{% load static %} + + + + + + LazyCoder || sumit + + sumit + + + + {% include "hospital/navbar.html" %} +

+
+

About Us !

+
+
+

Hello

+

A service dedicated to Hospital Admin, Doctor and Patient.

+
+

Explore our Website.

+

+ HOME +

+
+ {% include "hospital/footer.html" %} + + + + diff --git a/hospitalmanagement/templates/hospital/admin_add_appointment.html b/hospitalmanagement/templates/hospital/admin_add_appointment.html new file mode 100644 index 0000000..fe01fb3 --- /dev/null +++ b/hospitalmanagement/templates/hospital/admin_add_appointment.html @@ -0,0 +1,86 @@ +{% extends 'hospital/admin_base.html' %} +{% load widget_tweaks %} +{% block content %} + + + + + + + + +

+ +
+ {% csrf_token %} +
+
+
+

Book Appointment Details

+
+
+
+
+
+ {% render_field appointmentForm.description class="form-control" placeholder="Description" %} +
+
+ {% render_field appointmentForm.doctorId class="form-control" placeholder="doctor" %} +
+
+ {% render_field appointmentForm.patientId class="form-control" placeholder="patient" %} +
+ +
+ +
+ +
+
+
+
+ + + +{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/admin_add_doctor.html b/hospitalmanagement/templates/hospital/admin_add_doctor.html new file mode 100644 index 0000000..8872b0d --- /dev/null +++ b/hospitalmanagement/templates/hospital/admin_add_doctor.html @@ -0,0 +1,102 @@ +{% extends 'hospital/admin_base.html' %} +{% load widget_tweaks %} +{% block content %} + + + + + + + + + +


+ +
+ {% csrf_token %} +
+
+
+

Add New Doctor To Hospital

+
+
+
+
+
+ {% render_field userForm.first_name class="form-control" placeholder="First Name" %} +
+
+ {% render_field userForm.username class="form-control" placeholder="Username" %} +
+
+ {% render_field doctorForm.department class="form-control" placeholder="Department" %} +
+
+ {% render_field doctorForm.address class="form-control" placeholder="Address" %} +
+ +
+
+
+ {% render_field userForm.last_name class="form-control" placeholder="Last Name" %} +
+
+ {% render_field userForm.password class="form-control" placeholder="Password" %} +
+
+ {% render_field doctorForm.mobile class="form-control" placeholder="Mobile" %} +
+
+ {% render_field doctorForm.profile_pic required="required" class="form-control" placeholder="Profile Picture" %} +
+
+
+ +
+
+
+ +
+ +{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/admin_add_patient.html b/hospitalmanagement/templates/hospital/admin_add_patient.html new file mode 100644 index 0000000..1e249c8 --- /dev/null +++ b/hospitalmanagement/templates/hospital/admin_add_patient.html @@ -0,0 +1,104 @@ +{% extends 'hospital/admin_base.html' %} +{% load widget_tweaks %} +{% block content %} + + + + + + + + + +


+ +
+ {% csrf_token %} +
+
+
+

Admit Patient To Hospital

+
+
+
+
+
+ {% render_field userForm.first_name class="form-control" placeholder="First Name" %} +
+
+ {% render_field userForm.username class="form-control" placeholder="Username" %} +
+
+ {% render_field patientForm.address class="form-control" placeholder="Address" %} +
+
+ {% render_field patientForm.symptoms class="form-control" placeholder="Symptoms" %} +
+
+ {% render_field patientForm.profile_pic required="required" class="form-control" placeholder="Profile Picture" %} +
+
+
+
+ {% render_field userForm.last_name class="form-control" placeholder="Last Name" %} +
+
+ {% render_field userForm.password class="form-control" placeholder="Password" %} +
+
+ {% render_field patientForm.mobile class="form-control" placeholder="Mobile" %} +
+
+ {% render_field patientForm.assignedDoctorId class="form-control" placeholder="Doctor" %} +
+
+
+ +
+
+
+ +
+ +{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/admin_appointment.html b/hospitalmanagement/templates/hospital/admin_appointment.html new file mode 100644 index 0000000..6da4d71 --- /dev/null +++ b/hospitalmanagement/templates/hospital/admin_appointment.html @@ -0,0 +1,123 @@ +{% extends 'hospital/admin_base.html' %} +{% load static %} +{% block content %} +

+ + + + + + + + + + + +
+
+
+ +
+ +
+ +
+ + + + +
+
+ +






+{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/admin_approve_appointment.html b/hospitalmanagement/templates/hospital/admin_approve_appointment.html new file mode 100644 index 0000000..9fec4c2 --- /dev/null +++ b/hospitalmanagement/templates/hospital/admin_approve_appointment.html @@ -0,0 +1,63 @@ +{% extends 'hospital/admin_base.html' %} +{% block content %} + + + + + + + + +
+
+
+
Appointment Approvals Required
+
+ + + + + + + + + + + + {% for a in appointments %} + + + + + + + + + {% endfor %} +
Doctor NamePatient NameDescriptionDateApproveReject
{{a.doctorName}}{{a.patientName}}{{a.description}}{{a.appointmentDate}}
+
+ + +
+ + +{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/admin_approve_doctor.html b/hospitalmanagement/templates/hospital/admin_approve_doctor.html new file mode 100644 index 0000000..d6b8ffb --- /dev/null +++ b/hospitalmanagement/templates/hospital/admin_approve_doctor.html @@ -0,0 +1,66 @@ +{% extends 'hospital/admin_base.html' %} +{% block content %} +{%load static%} + + + + + + + + +
+
+
+
Doctors   Applied For Registration
+
+ + + + + + + + + + + + + {% for d in doctors %} + + + + + + + + + + {% endfor %} +
NameProfile PictureMobileAddressDepartmentApproveReject
{{d.get_name}} Profile Pic{{d.mobile}}{{d.address}}{{d.department}}
+
+ + +
+ + +{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/admin_approve_patient.html b/hospitalmanagement/templates/hospital/admin_approve_patient.html new file mode 100644 index 0000000..b437d07 --- /dev/null +++ b/hospitalmanagement/templates/hospital/admin_approve_patient.html @@ -0,0 +1,66 @@ +{% extends 'hospital/admin_base.html' %} +{% block content %} +{%load static%} + + + + + + + + +
+
+
+
Patient Wants To Admit
+
+ + + + + + + + + + + + + {% for p in patients %} + + + + + + + + + + {% endfor %} +
NameProfile PictureSymptomsMobileAddressApproveReject
{{p.get_name}} Profile Pic{{p.symptoms}}{{p.mobile}}{{p.address}}
+
+ + +
+ + +{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/admin_base.html b/hospitalmanagement/templates/hospital/admin_base.html new file mode 100644 index 0000000..ae04f09 --- /dev/null +++ b/hospitalmanagement/templates/hospital/admin_base.html @@ -0,0 +1,357 @@ + +{% load static %} + + + + + LazyCoder || sumit + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + +

+ + + {% block content %} + + {% endblock content %} + + +



+
+

+ + + + +

+ +
+
+
+
+ +
+
+
+
+ +
+ + + + + diff --git a/hospitalmanagement/templates/hospital/admin_dashboard.html b/hospitalmanagement/templates/hospital/admin_dashboard.html new file mode 100644 index 0000000..e4c4b5d --- /dev/null +++ b/hospitalmanagement/templates/hospital/admin_dashboard.html @@ -0,0 +1,78 @@ +{% extends 'hospital/admin_base.html' %} +{% load static %} +{% block content %} +{%include 'hospital/admin_dashboard_cards.html'%} +



+
+
+
+
+
Recent Doctors
+
+ + + + + + + + + + + {% for d in doctors %} + + + + + {%if d.status%} + + {% else %} + + {% endif %} + + + {% endfor %} +
NameDepartmentMobileStatus
{{d.get_name}}{{d.department}}{{d.mobile}} Permanent On Hold
+
+ +
+
+
Recent Patient
+
+ + + + + + + + + + + + {% for p in patients %} + + + + + + {%if p.status%} + + {% else %} + + {% endif %} + + + {% endfor %} +
NameSymptomsMobileAddressStatus
{{p.get_name}}{{p.symptoms}}{{p.mobile}}{{p.address}} Admitted On Hold
+
+
+
+ + + +{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/admin_dashboard_cards.html b/hospitalmanagement/templates/hospital/admin_dashboard_cards.html new file mode 100644 index 0000000..e1888b0 --- /dev/null +++ b/hospitalmanagement/templates/hospital/admin_dashboard_cards.html @@ -0,0 +1,188 @@ + + + + + + + + + + + + + + + +
+
+
+
+

{{doctorcount}}

+

Total Doctor

+

Approval Required : {{pendingdoctorcount}}

+
+
+ +
+
+
+
+
+
+
+

{{patientcount}}

+

Total Patient

+

Wants to Admit : {{pendingpatientcount}}

+
+
+ +
+
+
+
+
+
+
+

{{appointmentcount}}

+

Total Appointment

+

Approve Appointments :{{pendingappointmentcount}}

+
+
+ +
+
+
+
+
+
+ + + + diff --git a/hospitalmanagement/templates/hospital/admin_discharge_patient.html b/hospitalmanagement/templates/hospital/admin_discharge_patient.html new file mode 100644 index 0000000..b018969 --- /dev/null +++ b/hospitalmanagement/templates/hospital/admin_discharge_patient.html @@ -0,0 +1,59 @@ +{% extends 'hospital/admin_base.html' %} +{% block content %} + + + + + + + + +
+
+
+
Discharge Patient
+
+ + + + + + + + + + {% for p in patients %} + + + + + + + {% endfor %} +
NameSymptomsMobileDischarge
{{p.get_name}}{{p.symptoms}}{{p.mobile}}
+
+ + +
+ + +{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/admin_doctor.html b/hospitalmanagement/templates/hospital/admin_doctor.html new file mode 100644 index 0000000..9af9aac --- /dev/null +++ b/hospitalmanagement/templates/hospital/admin_doctor.html @@ -0,0 +1,135 @@ +{% extends 'hospital/admin_base.html' %} +{% load static %} +{% block content %} +

+ + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ +
+ +
+ +
+ + +
+
+ +






+{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/admin_doctor_patient_card.html b/hospitalmanagement/templates/hospital/admin_doctor_patient_card.html new file mode 100644 index 0000000..c543533 --- /dev/null +++ b/hospitalmanagement/templates/hospital/admin_doctor_patient_card.html @@ -0,0 +1,94 @@ + +{% load static %} + + + + + + + + + + + +
+
+
+ John +

ADMIN

+

+
+ +
+ +
+
+ John +

DOCTOR

+

+
+
+ +
+
+ John +

PATIENT

+

+
+
+ +
+ + + + + diff --git a/hospitalmanagement/templates/hospital/admin_patient.html b/hospitalmanagement/templates/hospital/admin_patient.html new file mode 100644 index 0000000..613b304 --- /dev/null +++ b/hospitalmanagement/templates/hospital/admin_patient.html @@ -0,0 +1,137 @@ +{% extends 'hospital/admin_base.html' %} +{% load static %} +{% block content %} +

+ + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ +
+ +
+ +
+ +
+ +
+ +
+
+
+ +






+{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/admin_update_doctor.html b/hospitalmanagement/templates/hospital/admin_update_doctor.html new file mode 100644 index 0000000..7c184b4 --- /dev/null +++ b/hospitalmanagement/templates/hospital/admin_update_doctor.html @@ -0,0 +1,100 @@ +{% extends 'hospital/admin_base.html' %} +{% load widget_tweaks %} +{% block content %} + + + + + + + + +

+ +
+ {% csrf_token %} +
+
+
+

Update Doctor Details

+
+
+
+
+
+ {% render_field userForm.first_name class="form-control" placeholder="First Name" %} +
+
+ {% render_field userForm.username class="form-control" placeholder="Username" %} +
+
+ {% render_field doctorForm.mobile class="form-control" placeholder="Mobile" %} +
+
+ {% render_field doctorForm.department class="form-control" placeholder="Department" %} +
+
+
+
+ {% render_field userForm.last_name class="form-control" placeholder="Last Name" %} +
+
+ {% render_field userForm.password class="form-control" placeholder="Password" %} +
+
+ {% render_field doctorForm.address class="form-control" placeholder="Address" %} +
+
+ {% render_field doctorForm.profile_pic class="form-control" placeholder="Profile Picture" %} +
+
+
+ +
+
+
+
+ + +{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/admin_update_patient.html b/hospitalmanagement/templates/hospital/admin_update_patient.html new file mode 100644 index 0000000..8f55e79 --- /dev/null +++ b/hospitalmanagement/templates/hospital/admin_update_patient.html @@ -0,0 +1,103 @@ +{% extends 'hospital/admin_base.html' %} +{% load widget_tweaks %} +{% block content %} + + + + + + + + +

+ +
+ {% csrf_token %} +
+
+
+

Update Doctor Details

+
+
+
+
+
+ {% render_field userForm.first_name class="form-control" placeholder="First Name" %} +
+
+ {% render_field userForm.username class="form-control" placeholder="Username" %} +
+
+ {% render_field patientForm.address class="form-control" placeholder="Address" %} +
+
+ {% render_field patientForm.symptoms class="form-control" placeholder="Symptoms" %} +
+
+ {% render_field patientForm.profile_pic class="form-control" placeholder="Profile Picture" %} +
+
+
+
+ {% render_field userForm.last_name class="form-control" placeholder="Last Name" %} +
+
+ {% render_field userForm.password class="form-control" placeholder="Password" %} +
+
+ {% render_field patientForm.mobile class="form-control" placeholder="Mobile" %} +
+
+ {% render_field patientForm.assignedDoctorId class="form-control" placeholder="Doctor" %} +
+
+
+ +
+
+
+
+ + +{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/admin_view_appointment.html b/hospitalmanagement/templates/hospital/admin_view_appointment.html new file mode 100644 index 0000000..d93475c --- /dev/null +++ b/hospitalmanagement/templates/hospital/admin_view_appointment.html @@ -0,0 +1,58 @@ +{% extends 'hospital/admin_base.html' %} +{% block content %} + + + + + + + + + +
+
+
+
Appointments
+
+ + + + + + + + + + {% for a in appointments %} + + + + + + + {% endfor %} +
Doctor NamePatient NameDescriptionDate
{{a.doctorName}}{{a.patientName}}{{a.description}}{{a.appointmentDate}}
+
+
+ + +{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/admin_view_doctor.html b/hospitalmanagement/templates/hospital/admin_view_doctor.html new file mode 100644 index 0000000..d96c26a --- /dev/null +++ b/hospitalmanagement/templates/hospital/admin_view_doctor.html @@ -0,0 +1,67 @@ +{% extends 'hospital/admin_base.html' %} +{% block content %} +{%load static%} + + + + + + + + + +
+
+
+
Doctors
+
+ + + + + + + + + + + + + + {% for d in doctors %} + + + + + + + + + + + {% endfor %} +
NameProfile PictureMobileAddressDepartmentUpdateDelete
{{d.get_name}} Profile Pic{{d.mobile}}{{d.address}}{{d.department}}
+
+
+ + +{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/admin_view_doctor_Specialisation.html b/hospitalmanagement/templates/hospital/admin_view_doctor_Specialisation.html new file mode 100644 index 0000000..5eec44a --- /dev/null +++ b/hospitalmanagement/templates/hospital/admin_view_doctor_Specialisation.html @@ -0,0 +1,56 @@ +{% extends 'hospital/admin_base.html' %} +{% block content %} + + + + + + + + + +
+
+
+
Department & Doctors
+
+ + + + + + + + + {% for d in doctors %} + + + + + + {% endfor %} +
DepartmentDoctor NameMobile
{{d.department}} {{d.get_name}}{{d.mobile}}
+
+
+ + +{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/admin_view_patient.html b/hospitalmanagement/templates/hospital/admin_view_patient.html new file mode 100644 index 0000000..ce6477e --- /dev/null +++ b/hospitalmanagement/templates/hospital/admin_view_patient.html @@ -0,0 +1,65 @@ +{% extends 'hospital/admin_base.html' %} +{% block content %} +{%load static%} + + + + + + + + + +
+
+
+
Patient
+
+ + + + + + + + + + + + + {% for p in patients %} + + + + + + + + + + {% endfor %} +
NameProfile PictureSymptomsMobileAddressUpdateDelete
{{p.get_name}} Profile Pic{{p.symptoms}}{{p.mobile}}{{p.address}}
+
+
+ + +{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/adminclick.html b/hospitalmanagement/templates/hospital/adminclick.html new file mode 100644 index 0000000..f132e20 --- /dev/null +++ b/hospitalmanagement/templates/hospital/adminclick.html @@ -0,0 +1,23 @@ +{% extends 'hospital/homebase.html' %} + +{% block content %} + +
+
+ +
+

Hello, Admin

+

Welcome to Hospital Management System.

+
+

You can access various features after Login/SignUp.

+

+ SignUp + Login +

+
+ +{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/adminlogin.html b/hospitalmanagement/templates/hospital/adminlogin.html new file mode 100644 index 0000000..510fda6 --- /dev/null +++ b/hospitalmanagement/templates/hospital/adminlogin.html @@ -0,0 +1,103 @@ + +{% load widget_tweaks %} + + + + + + LazyCoder || sumit + + + + + + + {% include "hospital/navbar.html" %} +
+
+

+ + +
+ {% csrf_token %} +
+
+
+

Admin Login Page

+
+ +
+
+
+ +
+ {% render_field form.username class="form-control" placeholder="Username" %} +
+ +
+
+ +
+ {% render_field form.password class="form-control" placeholder="Password" %} +
+ +
+
+ +
Do not have account? Signup here
+
+
+
+ +
+ +


+ + + {% include "hospital/footer.html" %} + + + diff --git a/hospitalmanagement/templates/hospital/adminsignup.html b/hospitalmanagement/templates/hospital/adminsignup.html new file mode 100644 index 0000000..2359574 --- /dev/null +++ b/hospitalmanagement/templates/hospital/adminsignup.html @@ -0,0 +1,110 @@ + + +{% load widget_tweaks %} + + + + + + LazyCoder || sumit + + + + + + + {% include "hospital/navbar.html" %} +
+
+
+
+ + + + + +
+ {% csrf_token %} +
+
+
+

Add New Admin To Hospital

+
+ +
+
+
+
+ {% render_field form.first_name class="form-control" placeholder="First Name" %} +
+
+ {% render_field form.username class="form-control" placeholder="Username" %} +
+ +
+
+
+ {% render_field form.last_name class="form-control" placeholder="Last Name" %} +
+
+ {% render_field form.password class="form-control" placeholder="Password" %} +
+ +
+
+ +
Already have an account? Login here
+
+
+
+ +
+ + + {% include "hospital/footer.html" %} + + + diff --git a/hospitalmanagement/templates/hospital/contactus.html b/hospitalmanagement/templates/hospital/contactus.html new file mode 100644 index 0000000..301b27f --- /dev/null +++ b/hospitalmanagement/templates/hospital/contactus.html @@ -0,0 +1,41 @@ + +{% load static %} + + + + + + LazyCoder || sumit + + + + + + + {% include "hospital/navbar.html" %} +

+ +
+

Send Us Your Valuable Feedback !

+ +
+ + {% csrf_token %} +
+

+

{{ form.as_p }}

+

+
+ +
+
+
+ {% include "hospital/footer.html" %} + + + + diff --git a/hospitalmanagement/templates/hospital/contactussuccess.html b/hospitalmanagement/templates/hospital/contactussuccess.html new file mode 100644 index 0000000..771cdc8 --- /dev/null +++ b/hospitalmanagement/templates/hospital/contactussuccess.html @@ -0,0 +1,45 @@ + +{% load static %} + + + + + + + + LazyCoder || sumit + + + + + + + {% include "hospital/navbar.html" %} +

+
+

Your message sent successfully !

+

We will respond to your feedback soon

+
+

Check other features of website !

+

+ HOME +

+
+ + {% include "hospital/footer.html" %} + + + + diff --git a/hospitalmanagement/templates/hospital/doctor_appointment.html b/hospitalmanagement/templates/hospital/doctor_appointment.html new file mode 100644 index 0000000..15bff41 --- /dev/null +++ b/hospitalmanagement/templates/hospital/doctor_appointment.html @@ -0,0 +1,101 @@ +{% extends 'hospital/doctor_base.html' %} +{% load static %} +{% block content %} +

+ + + + + + + + + + + + +
+
+
+ +
+ +
+ +
+ + +
+
+ +






+{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/doctor_base.html b/hospitalmanagement/templates/hospital/doctor_base.html new file mode 100644 index 0000000..308ab7a --- /dev/null +++ b/hospitalmanagement/templates/hospital/doctor_base.html @@ -0,0 +1,342 @@ + +{% load static %} + + + + + LazyCoder || sumit + + + + + + + + + + + + + + + +
+ +
+ +
+ +

+ + {% block content %} + {% endblock content %} + +






+
+

+ + + + +

+
+
+
+
+ +
+
+
+
+
+ + + + + diff --git a/hospitalmanagement/templates/hospital/doctor_dashboard.html b/hospitalmanagement/templates/hospital/doctor_dashboard.html new file mode 100644 index 0000000..223d17a --- /dev/null +++ b/hospitalmanagement/templates/hospital/doctor_dashboard.html @@ -0,0 +1,43 @@ +{% extends 'hospital/doctor_base.html' %} +{% load static %} +{% block content %} +{%include 'hospital/doctor_dashboard_cards.html'%} +



+
+
+
+
+
Recent Appointments For You
+
+ + + + + + + + + + + + {% for a,p in appointments %} + + + + + + + + + {% endfor %} +
Patient NamePictureDescriptionMobileAddressDate
{{a.patientName}} Profile Pic{{a.description}}{{p.mobile}}{{p.address}}{{a.appointmentDate}}
+
+
+
+ + +{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/doctor_dashboard_cards.html b/hospitalmanagement/templates/hospital/doctor_dashboard_cards.html new file mode 100644 index 0000000..2b23906 --- /dev/null +++ b/hospitalmanagement/templates/hospital/doctor_dashboard_cards.html @@ -0,0 +1,186 @@ + + + + + + + + + + + + + + + +
+
+
+
+

{{appointmentcount}}

+

Appointments For You

+
+
+ +
+
+
+
+
+
+
+

{{patientcount}}

+

Patient Under You

+ +
+
+ +
+
+
+
+
+
+
+

{{patientdischarged}}

+

Your Patient Discharged

+
+
+ +
+
+
+
+
+
+ + + + diff --git a/hospitalmanagement/templates/hospital/doctor_delete_appointment.html b/hospitalmanagement/templates/hospital/doctor_delete_appointment.html new file mode 100644 index 0000000..1e36ca4 --- /dev/null +++ b/hospitalmanagement/templates/hospital/doctor_delete_appointment.html @@ -0,0 +1,59 @@ +{% extends 'hospital/doctor_base.html' %} +{% block content %} +{%load static%} + + + + + + + + + +
+
+
+
Delete Your Appointments
+
+ + + + + + + + + + {% for a,p in appointments %} + + + + + + + {% endfor %} +
Patient NamePictureDescriptionDelete
{{a.patientName}} Profile Pic{{a.description}}
+
+
+ + +{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/doctor_patient.html b/hospitalmanagement/templates/hospital/doctor_patient.html new file mode 100644 index 0000000..18bc8e0 --- /dev/null +++ b/hospitalmanagement/templates/hospital/doctor_patient.html @@ -0,0 +1,115 @@ +{% extends 'hospital/doctor_base.html' %} +{% load static %} +{% block content %} +

+ + + + + + + + + + + + + + + + +
+
+
+ +
+ + + +
+
+ +






+{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/doctor_view_appointment.html b/hospitalmanagement/templates/hospital/doctor_view_appointment.html new file mode 100644 index 0000000..6acb22b --- /dev/null +++ b/hospitalmanagement/templates/hospital/doctor_view_appointment.html @@ -0,0 +1,63 @@ +{% extends 'hospital/doctor_base.html' %} +{% block content %} +{%load static%} + + + + + + + + + +
+
+
+
Your Appointments
+
+ + + + + + + + + + + + {% for a,p in appointments %} + + + + + + + + + {% endfor %} +
Patient NamePictureDescriptionMobileAddressAppointment Date
{{a.patientName}} Profile Pic{{a.description}}{{p.mobile}}{{p.address}}{{a.appointmentDate}}
+
+
+ + +{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/doctor_view_discharge_patient.html b/hospitalmanagement/templates/hospital/doctor_view_discharge_patient.html new file mode 100644 index 0000000..046fb1d --- /dev/null +++ b/hospitalmanagement/templates/hospital/doctor_view_discharge_patient.html @@ -0,0 +1,65 @@ +{% extends 'hospital/doctor_base.html' %} +{% block content %} +{%load static%} + + + + + + + + + +
+
+
+
Your Discharged Patient List
+
+ + + + + + + + + + + + + + {% for p in dischargedpatients %} + + + + + + + + + {% endfor %} +
NameAdmit DateRelease DateSymptomsMobileAddress
{{p.patientName}}{{p.admitDate}}{{p.releaseDate}}{{p.symptoms}}{{p.mobile}}{{p.address}}
+
+
+ + +{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/doctor_view_patient.html b/hospitalmanagement/templates/hospital/doctor_view_patient.html new file mode 100644 index 0000000..d7a2879 --- /dev/null +++ b/hospitalmanagement/templates/hospital/doctor_view_patient.html @@ -0,0 +1,78 @@ +{% extends 'hospital/doctor_base.html' %} +{% block content %} +{%load static%} + + + + + + + + + + + +
+ +
+ + +
+ + + {% if patients %} +
+
+
Your Total Patient List
+
+ + + + + + + + + + + + {% for p in patients %} + + + + + + + + {% endfor %} +
NameProfile PictureSymptomsMobileAddress
{{p.get_name}} Profile Pic{{p.symptoms}}{{p.mobile}}{{p.address}}
+
+ {%else%} +


+

No Patient Found !!!

+ {% endif %} + + +
+ + +{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/doctor_wait_for_approval.html b/hospitalmanagement/templates/hospital/doctor_wait_for_approval.html new file mode 100644 index 0000000..4df3b1e --- /dev/null +++ b/hospitalmanagement/templates/hospital/doctor_wait_for_approval.html @@ -0,0 +1,52 @@ + + + + + + + + LazyCoder || sumit + + + + + + + + {% include "hospital/navbar.html" %} +
+
+ +
+

Hello {{request.user.first_name}}

+

Your Account is not approved till now

Our Team is checking your profile

Soon your Account will be confirmed !!!

+
+

Check Later

+

+ Logout For Now +

+
+ + {% include "hospital/footer.html" %} + + + + diff --git a/hospitalmanagement/templates/hospital/doctorclick.html b/hospitalmanagement/templates/hospital/doctorclick.html new file mode 100644 index 0000000..3ae3461 --- /dev/null +++ b/hospitalmanagement/templates/hospital/doctorclick.html @@ -0,0 +1,24 @@ +{% extends 'hospital/homebase.html' %} + + +{% block content %} + +
+
+ +
+

Hello, Doctor

+

Welcome to Hospital Management System.

+
+

You can access various features after Login/SignUp.

+

+ Apply + Login +

+
+ +{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/doctorlogin.html b/hospitalmanagement/templates/hospital/doctorlogin.html new file mode 100644 index 0000000..2754f36 --- /dev/null +++ b/hospitalmanagement/templates/hospital/doctorlogin.html @@ -0,0 +1,104 @@ + +{% load widget_tweaks %} + + + + + + LazyCoder || sumit + + + + + + + + {% include "hospital/navbar.html" %} +
+
+

+ + +
+ {% csrf_token %} +
+
+
+

Doctor Login Page

+
+ +
+
+
+ +
+ {% render_field form.username class="form-control" placeholder="Username" %} +
+ +
+
+ +
+ {% render_field form.password class="form-control" placeholder="Password" %} +
+ +
+
+ +
Do not have account? Signup here
+
+
+
+ +
+ +


+ + + {% include "hospital/footer.html" %} + + + diff --git a/hospitalmanagement/templates/hospital/doctorsignup.html b/hospitalmanagement/templates/hospital/doctorsignup.html new file mode 100644 index 0000000..9877ecb --- /dev/null +++ b/hospitalmanagement/templates/hospital/doctorsignup.html @@ -0,0 +1,122 @@ + + +{% load widget_tweaks %} + + + + + + LazyCoder || sumit + + + + + + + {% include "hospital/navbar.html" %} +
+
+
+
+ + + + + +
+ {% csrf_token %} +
+
+
+

Register In Hospital

+
+ +
+
+
+
+ {% render_field userForm.first_name class="form-control" placeholder="First Name" %} +
+
+ {% render_field userForm.username class="form-control" placeholder="Username" %} +
+
+ {% render_field doctorForm.department class="form-control" placeholder="Department" %} +
+
+ {% render_field doctorForm.address class="form-control" placeholder="Address" %} +
+ +
+
+
+ {% render_field userForm.last_name class="form-control" placeholder="Last Name" %} +
+
+ {% render_field userForm.password class="form-control" placeholder="Password" %} +
+
+ {% render_field doctorForm.mobile class="form-control" placeholder="Mobile" %} +
+
+ {% render_field doctorForm.profile_pic required="required" class="form-control" placeholder="Profile Picture" %} +
+ +
+
+ +
Already have an account? Login here
+
+
+
+ +
+ + {% include "hospital/footer.html" %} + + + + diff --git a/hospitalmanagement/templates/hospital/download_bill.html b/hospitalmanagement/templates/hospital/download_bill.html new file mode 100644 index 0000000..9c734da --- /dev/null +++ b/hospitalmanagement/templates/hospital/download_bill.html @@ -0,0 +1,203 @@ + + + + + + + + + + + +


+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+
Hospital Management
+
+ + Admit Date: {{admitDate}}
+ Release Date: {{releaseDate}}
+ Days Spent: {{daySpent}} +
+
+ + + + + + +
+ Patient Name : {{patientName}}
+ Patient Mobile : {{mobile}}
+ Patient Addres : {{address}}
+
+ Doctor Name :
+ {{assignedDoctorName}}
+ +
+
+ + + + + +
+ Disease and Symptoms :
+           {{symptoms}} +
+
+ + + + +
+ Charges :

+ Room Charge of {{daySpent}} Days : {{roomCharge}}
+ Doctor Fee : {{doctorFee}}
+ Medicine Cost : {{medicineCost}}
+ Other Charge : {{OtherCharge}}

+           Total Rupees : {{total}} +
+
+
+ + + + diff --git a/hospitalmanagement/templates/hospital/footer.html b/hospitalmanagement/templates/hospital/footer.html new file mode 100644 index 0000000..15eba51 --- /dev/null +++ b/hospitalmanagement/templates/hospital/footer.html @@ -0,0 +1,90 @@ + + + + + + + + + + + + +
+ +

+ + + + +

+ +
+
+
+
+ +
+
+
+
+ + + diff --git a/hospitalmanagement/templates/hospital/homebase.html b/hospitalmanagement/templates/hospital/homebase.html new file mode 100644 index 0000000..75a5c5c --- /dev/null +++ b/hospitalmanagement/templates/hospital/homebase.html @@ -0,0 +1,23 @@ + + + + + + LazyCoder || sumit + + + + + {% include "hospital/navbar.html" %} + {%block content%} + + {%endblock content%} + {% include "hospital/footer.html" %} + + + + diff --git a/hospitalmanagement/templates/hospital/index.html b/hospitalmanagement/templates/hospital/index.html new file mode 100644 index 0000000..e42a8a8 --- /dev/null +++ b/hospitalmanagement/templates/hospital/index.html @@ -0,0 +1,80 @@ +{% extends 'hospital/homebase.html' %} +{% load static %} + + + +{% block content %} + + + + + +
+
+ +
+
+
You’ll Love the Way We Care for You
+




+

+

Emergency ?

+ +

+ Take Appointment +

+

+
+ +



+ +{% include "hospital/admin_doctor_patient_card.html" %} +


+ + +{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/navbar.html b/hospitalmanagement/templates/hospital/navbar.html new file mode 100644 index 0000000..4ebf0f0 --- /dev/null +++ b/hospitalmanagement/templates/hospital/navbar.html @@ -0,0 +1,65 @@ + +{% load static %} + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + diff --git a/hospitalmanagement/templates/hospital/patient_appointment.html b/hospitalmanagement/templates/hospital/patient_appointment.html new file mode 100644 index 0000000..891fe70 --- /dev/null +++ b/hospitalmanagement/templates/hospital/patient_appointment.html @@ -0,0 +1,109 @@ +{% extends 'hospital/patient_base.html' %} +{% load static %} +{% block content %} +

+ + + + + + + + + + + +
+
+
+ +
+ +
+ +
+
+
+ +







+{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/patient_base.html b/hospitalmanagement/templates/hospital/patient_base.html new file mode 100644 index 0000000..8557a88 --- /dev/null +++ b/hospitalmanagement/templates/hospital/patient_base.html @@ -0,0 +1,343 @@ + +{% load static %} + + + + + LazyCoder || sumit + + + + + + + + + + + + + + + + +
+ +
+ +
+ +

+ + {% block content %} + {% endblock content %} + +






+
+

+ + + + +

+
+
+
+
+ +
+
+
+
+
+ + + + + diff --git a/hospitalmanagement/templates/hospital/patient_book_appointment.html b/hospitalmanagement/templates/hospital/patient_book_appointment.html new file mode 100644 index 0000000..adb8e82 --- /dev/null +++ b/hospitalmanagement/templates/hospital/patient_book_appointment.html @@ -0,0 +1,95 @@ +{% extends 'hospital/patient_base.html' %} +{% load widget_tweaks %} +{% block content %} + + + + + + + + +

+{% if message %} + + +{% endif %} + + + +
+ {% csrf_token %} +
+
+
+

Book Appointment Details

+
+
+
+
+
+ {% render_field appointmentForm.description class="form-control" placeholder="Description" %} +
+
+ {% render_field appointmentForm.doctorId class="form-control" placeholder="doctor" %} +
+ + + + +
+ +
+ +
+
+
+
+ + + +{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/patient_dashboard.html b/hospitalmanagement/templates/hospital/patient_dashboard.html new file mode 100644 index 0000000..7c508b2 --- /dev/null +++ b/hospitalmanagement/templates/hospital/patient_dashboard.html @@ -0,0 +1,13 @@ +{% extends 'hospital/patient_base.html' %} +{% load static %} +{% block content %} +{%include 'hospital/patient_dashboard_cards.html'%} +



+ + + +{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/patient_dashboard_cards.html b/hospitalmanagement/templates/hospital/patient_dashboard_cards.html new file mode 100644 index 0000000..3338d1e --- /dev/null +++ b/hospitalmanagement/templates/hospital/patient_dashboard_cards.html @@ -0,0 +1,239 @@ + + + + + + + + + + + + + + + +
+
+
+
+

{{doctorName}}

+

Doctor Name

+
+
+ +
+
+
+
+
+
+
+

{{symptoms}}

+

Symptoms

+
+
+ +
+
+
+
+
+
+
+

{{doctorMobile}}

+

Doctor Mobile

+
+
+ +
+
+
+
+
+
+ + + +


+ + + +
+
+
+
+

{{doctorAddress}}

+

Doctor Address

+
+
+ +
+
+
+
+
+
+
+

{{doctorDepartment}}

+

Doctor Department

+
+
+ +
+
+
+
+
+
+
+

{{admitDate}}

+

Admit Date

+
+
+ +
+
+
+
+
+
+ + + + + + + diff --git a/hospitalmanagement/templates/hospital/patient_discharge.html b/hospitalmanagement/templates/hospital/patient_discharge.html new file mode 100644 index 0000000..8f2814e --- /dev/null +++ b/hospitalmanagement/templates/hospital/patient_discharge.html @@ -0,0 +1,250 @@ +{% extends 'hospital/patient_base.html' %} +{% load static %} +{% block content %} + + + + A simple, clean, and responsive HTML invoice template + + + + +


+ +{%if is_discharged%} +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+

Hospital Management

+
+ + Admit Date: {{admitDate}}
+ Release Date: {{releaseDate}}
+ Days Spent: {{daySpent}} +
+
+ + + + + + +
+ Patient Name : {{patientName}}
+ Patient Mobile : {{mobile}}
+ Patient Addres : {{address}}
+
+ Doctor Name :
+ {{assignedDoctorName}}
+ +
+
+ Disease and Symptoms + + +
+ {{symptoms}} +
+ Item + + Price +
+ Room Charge of {{daySpent}} Days + + {{roomCharge}} +
+ Doctor Fee + + {{doctorFee}} +
+ Medicine Cost + + {{medicineCost}} +
+ Other Charge + + {{OtherCharge}} +
+ Total Rupees : {{total}} +
+
+

+ + + + +{%else%} +
You Are Not Discharged By Hospital !
+
Your Treatment Is Going On !


+
When You Will Be Discahrged. You Can Download Invoice.
+{%endif%} + +







+{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/patient_final_bill.html b/hospitalmanagement/templates/hospital/patient_final_bill.html new file mode 100644 index 0000000..fa70b30 --- /dev/null +++ b/hospitalmanagement/templates/hospital/patient_final_bill.html @@ -0,0 +1,240 @@ +{% extends 'hospital/admin_base.html' %} +{% load static %} +{% block content %} + + + + A simple, clean, and responsive HTML invoice template + + + + +


+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+

Hospital Management

+
+ + Admit Date: {{admitDate}}
+ Release Date: {{todayDate}}
+ Days Spent: {{day}} +
+
+ + + + + + +
+ Patient Name : {{name}}
+ Patient Mobile : {{mobile}}
+ Patient Addres : {{address}}
+
+ Doctor Name :
+ {{assignedDoctorName}}
+ +
+
+ Disease and Symptoms + + +
+ {{symptoms}} +
+ Item + + Price +
+ Room Charge of {{day}} Days + + {{roomCharge}} +
+ Doctor Fee + + {{doctorFee}} +
+ Medicine Cost + + {{medicineCost}} +
+ Other Charge + + {{OtherCharge}} +
+ Total Rupees : {{total}} +
+
+

+ + + +{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/patient_generate_bill.html b/hospitalmanagement/templates/hospital/patient_generate_bill.html new file mode 100644 index 0000000..01dcc02 --- /dev/null +++ b/hospitalmanagement/templates/hospital/patient_generate_bill.html @@ -0,0 +1,235 @@ +{% extends 'hospital/admin_base.html' %} +{% load static %} +{% block content %} + + + + A simple, clean, and responsive HTML invoice template + + + + +


+
+ + + + + + + + + + + + + + + + + + + + + + + + + {% csrf_token %} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+

Hospital Management

+
+ + Admit Date: {{admitDate}}
+ Release Date: {{todayDate}}
+ Days Spent: {{day}} +
+
+ + + + + + +
+ Patient Name : {{name}}
+ Patient Mobile : {{mobile}}
+ Patient Addres : {{address}}
+
+ Doctor Name :
+ {{assignedDoctorName}}
+ +
+
+ Disease and Symptoms + + +
+ {{symptoms}} +
+ Item + + Price +
+ Room Charge (Per Day) + + +
+ Doctor Fee + + +
+ Medicine Cost + + +
+ Other Charge + + +
+ +
+
+ + + +{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/patient_view_appointment.html b/hospitalmanagement/templates/hospital/patient_view_appointment.html new file mode 100644 index 0000000..d9f3166 --- /dev/null +++ b/hospitalmanagement/templates/hospital/patient_view_appointment.html @@ -0,0 +1,62 @@ +{% extends 'hospital/patient_base.html' %} +{% block content %} + + + + + + + + + +
+
+
+
Your Appointments
+
+ + + + + + + + + + {% for a in appointments %} + + + + + {%if a.status%} + + {% else %} + + {% endif %} + + {% endfor %} +
Doctor NameDescriptionDateStatus
{{a.doctorName}}{{a.description}}{{a.appointmentDate}} Confirmed Pending
+
+
+ + +{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/patient_view_doctor.html b/hospitalmanagement/templates/hospital/patient_view_doctor.html new file mode 100644 index 0000000..f8a7ad1 --- /dev/null +++ b/hospitalmanagement/templates/hospital/patient_view_doctor.html @@ -0,0 +1,80 @@ +{% extends 'hospital/patient_base.html' %} +{% block content %} +{%load static%} + + + + + + + + + + + +
+ +
+ + +
+ + + {% if doctors %} +
+
+
Total Doctor List
+
+ + + + + + + + + + + + + {% for d in doctors %} + + + + + + + + + {% endfor %} +
NameProfile PictureMobileAddressDepartment
{{d.get_name}} Profile Pic{{d.mobile}}{{d.address}}{{d.department}}
+
+ {%else%} +


+

No Doctor Found !!!

+ {% endif %} + + +
+ + +{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/patient_wait_for_approval.html b/hospitalmanagement/templates/hospital/patient_wait_for_approval.html new file mode 100644 index 0000000..fb6fdd1 --- /dev/null +++ b/hospitalmanagement/templates/hospital/patient_wait_for_approval.html @@ -0,0 +1,51 @@ + + + + + + + + LazyCoder || sumit + + + + + + + {% include "hospital/navbar.html" %} +
+
+ +
+

Hello {{request.user.first_name}}

+

Your Account is not approved till now

Our Team is checking your profile

Soon your account will be confirmed !!!

+
+

Check Later

+

+ Logout For Now +

+
+ + {% include "hospital/footer.html" %} + + + + diff --git a/hospitalmanagement/templates/hospital/patientclick.html b/hospitalmanagement/templates/hospital/patientclick.html new file mode 100644 index 0000000..487f7cf --- /dev/null +++ b/hospitalmanagement/templates/hospital/patientclick.html @@ -0,0 +1,24 @@ +{% extends 'hospital/homebase.html' %} + + +{% block content %} + +
+
+ +
+

Hello, Patient

+

Welcome to Hospital Management System.

+
+

You can access various features after Login/SignUp.

+

+ Register Your Account + Login +

+
+ +{% endblock content %} diff --git a/hospitalmanagement/templates/hospital/patientlogin.html b/hospitalmanagement/templates/hospital/patientlogin.html new file mode 100644 index 0000000..9b9d2f7 --- /dev/null +++ b/hospitalmanagement/templates/hospital/patientlogin.html @@ -0,0 +1,104 @@ + +{% load widget_tweaks %} + + + + + + LazyCoder || sumit + + + + + + + + {% include "hospital/navbar.html" %} +
+
+

+ + +
+ {% csrf_token %} +
+
+
+

Patient Login Page

+
+ +
+
+
+ +
+ {% render_field form.username class="form-control" placeholder="Username" %} +
+ +
+
+ +
+ {% render_field form.password class="form-control" placeholder="Password" %} +
+ +
+
+ +
Do not have account? Signup here
+
+
+
+ +
+ +


+ + + {% include "hospital/footer.html" %} + + + diff --git a/hospitalmanagement/templates/hospital/patientsignup.html b/hospitalmanagement/templates/hospital/patientsignup.html new file mode 100644 index 0000000..bf1a16c --- /dev/null +++ b/hospitalmanagement/templates/hospital/patientsignup.html @@ -0,0 +1,124 @@ + + +{% load widget_tweaks %} + + + + + + LazyCoder || sumit + + + + + + + {% include "hospital/navbar.html" %} +
+
+
+
+ + + + + +
+ {% csrf_token %} +
+
+
+

Register to Hospital

+
+ +
+
+
+
+ {% render_field userForm.first_name class="form-control" placeholder="First Name" %} +
+
+ {% render_field userForm.username class="form-control" placeholder="Username" %} +
+
+ {% render_field patientForm.address class="form-control" placeholder="Address" %} +
+
+ {% render_field patientForm.symptoms class="form-control" placeholder="Symptoms" %} +
+
+ {% render_field patientForm.profile_pic required="required" class="form-control" placeholder="Profile Picture" %} +
+
+
+
+ {% render_field userForm.last_name class="form-control" placeholder="Last Name" %} +
+
+ {% render_field userForm.password class="form-control" placeholder="Password" %} +
+
+ {% render_field patientForm.mobile class="form-control" pattern="[6789][0-9]{9}" placeholder="Mobile Number" %} +
+
+ {% render_field patientForm.assignedDoctorId class="form-control" placeholder="Doctor" %} +
+ +
+
+ +
Already have an account? Login here
+
+
+
+ +
+ + {% include "hospital/footer.html" %} + + + +