Skip to content

Commit

Permalink
Fix possible bug in update
Browse files Browse the repository at this point in the history
  • Loading branch information
vigneshhari committed Jan 6, 2025
1 parent dddc617 commit b42bfe6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions care/emr/api/viewsets/allergy_intolerance.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def authorize_create(self, instance):
"can_write_patient_obj", self.request.user, self.get_patient_obj()
):
raise PermissionDenied("You do not have permission to update encounter")
# TODO If there is an encounter, check access to the encounter

def get_queryset(self):
if not AuthorizationController.call(
Expand Down
2 changes: 1 addition & 1 deletion care/emr/api/viewsets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def perform_update(self, instance):
instance.save()
if getattr(self, "CREATE_QUESTIONNAIRE_RESPONSE", False):
QuestionnaireResponse.objects.create(
subject_id=self.fetch_patient_from_instance(instance),
subject_id=self.fetch_patient_from_instance(instance).external_id,
patient=self.fetch_patient_from_instance(instance),
encounter=self.fetch_encounter_from_instance(instance),
structured_responses={
Expand Down

0 comments on commit b42bfe6

Please sign in to comment.