Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
rohit-innovaccer committed Nov 17, 2018
1 parent 7c10d0f commit 95bb5f5
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 10 deletions.
13 changes: 11 additions & 2 deletions doctor/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,19 @@ def post(self, request):
u = request.user
visit = Visit.objects.get(id=body['visit_id'])
if visit.type =='ALL':
visit.doctor.append(User.objects.filter(doctor__pcpId=u.doctor.pcpId))
visit.doctor.append(u.id)
visit.save()
paticipant = []
paticipant.append(u.id)
paticipant.append(visit.patient.id)
room = Rooms(
participants = paticipant,
status = 'ACTIVE'
)
room = room.save()
push_data = {
'action':1,
'roomId': ""
'roomId': room.id
}
socket_notify(push_data, channel=visit.patient.id)
socket_notify(push_data, channel=u.id)
Expand Down
1 change: 1 addition & 0 deletions hack/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,4 @@
# https://docs.djangoproject.com/en/1.11/howto/static-files/

STATIC_URL = '/static/'
WEBSOCKET_ADDR = 'http://10.10.6.54:9808'
6 changes: 3 additions & 3 deletions patient/auth_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,10 @@ def post(self, request):
type = type,
doctor = doctor
)
v = v.save()
v.save()
push_data = {
'patientDesc': body['problemDisc'],
'patientName': u.first_name + u.last_name,
'patientName': u.first_name + ' '+u.last_name,
'visit_id':v.id
}

Expand All @@ -204,7 +204,7 @@ def post(self, request):
else:
doc = User.objects.filter(_type='DOC')
for doctor in doc:
socket_notify(push_data, channel=doctor.pcpId)
socket_notify(push_data, channel=doctor.id)


return Response({})
8 changes: 3 additions & 5 deletions patient/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,19 @@ class Meta(object):
db_table = 'auth_user'


class Room(models.Model):
id = models.UUIDField(primary_key=True)
class Rooms(models.Model):
participants = ArrayField(models.CharField(max_length=25, blank=True))
status = models.CharField(max_length=20)

class Message(models.Model):
class Messages(models.Model):
"""
Will store all the messages sent for each campaign,
relations will be found in MessageRecipient model.
"""
_id = models.UUIDField(primary_key=True)
sentAt = models.DateTimeField(auto_now=True)
messageType = models.CharField(max_length=50, null=True)
messageBody = models.TextField()
room = models.ForeignKey(Room, on_delete=None)
room = models.ForeignKey(Rooms, on_delete=None)
creator = models.ForeignKey(User, on_delete=None, null=True)
url = models.URLField(null=True)
attachmentDisplayName = models.CharField(max_length=100, null=True)
Expand Down
3 changes: 3 additions & 0 deletions settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
''
]

MIDDLEWARE = [
Expand Down Expand Up @@ -118,3 +119,5 @@
# https://docs.djangoproject.com/en/1.11/howto/static-files/

STATIC_URL = '/static/'

WEBSOCKET_ADDR = 'http://10.10.6.54:9808'

0 comments on commit 95bb5f5

Please sign in to comment.