File tree 2 files changed +5
-3
lines changed
2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 10
10
BooleanField ,
11
11
ObjectIdField ,
12
12
EmbeddedDocumentField ,
13
+ EmbeddedDocumentListField ,
13
14
)
14
- from mongoengine .fields import EmbeddedDocumentListField
15
15
16
16
17
17
class PatientNotifications (EmbeddedDocument ):
@@ -47,6 +47,7 @@ class ConsultationData(EmbeddedDocument):
47
47
class ConsultationRequest (EmbeddedDocument ):
48
48
_id = ObjectIdField (default = ObjectId )
49
49
patient = ObjectIdField ()
50
+ patientName = StringField ()
50
51
healthOfficial = ObjectIdField ()
51
52
consultationData = EmbeddedDocumentField (ConsultationData )
52
53
approved = BooleanField (default = False )
@@ -75,4 +76,4 @@ class HealthOfficial(Document):
75
76
consultationRequests = EmbeddedDocumentListField (ConsultationRequest )
76
77
records = StringField ()
77
78
78
- meta = {"collection" : "healthOfficial" }
79
+ meta = {"collection" : "healthOfficial" }
Original file line number Diff line number Diff line change @@ -211,6 +211,7 @@ def addConsultationRequest(_id):
211
211
)
212
212
consultationRequest = ConsultationRequest (
213
213
patient = ObjectId (_id ),
214
+ patientName = Patient .objects .get (_id = ObjectId (_id )).name ,
214
215
healthOfficial = ObjectId (hid ),
215
216
consultationData = consultationData ,
216
217
)
@@ -225,4 +226,4 @@ def addConsultationRequest(_id):
225
226
return jsonify ({"message" : "Unexpected error occurred." }), 500
226
227
227
228
else :
228
- return jsonify ({"message" : "Bad Request" }), 400
229
+ return jsonify ({"message" : "Bad Request" }), 400
You can’t perform that action at this time.
0 commit comments