-
Notifications
You must be signed in to change notification settings - Fork 517
/
Copy pathmodels.py
82 lines (67 loc) · 3.02 KB
/
models.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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