Skip to content

Commit

Permalink
use correct model to serialize
Browse files Browse the repository at this point in the history
  • Loading branch information
khavinshankar committed Dec 31, 2024
1 parent 3e20678 commit 6a7ce7e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions care/emr/resources/medication/administration/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from care.emr.resources.medication.valueset.medication import CARE_MEDICATION_VALUESET
from care.emr.resources.medication.valueset.route import CARE_ROUTE_VALUESET
from care.emr.resources.user.spec import UserSpec
from care.facility.models.patient_consultation import PatientConsultation
from care.users.models import User


Expand Down Expand Up @@ -216,7 +215,7 @@ def validate_status_reason(cls, code):

def perform_extra_deserialization(self, is_update, obj):
if not is_update:
obj.encounter = PatientConsultation.objects.get(
obj.encounter = Encounter.objects.get(
external_id=self.encounter
) # Needs more validation
obj.patient = obj.encounter.patient
Expand Down

0 comments on commit 6a7ce7e

Please sign in to comment.