Skip to content

Commit

Permalink
fix string representation of prescription and mar (#2412)
Browse files Browse the repository at this point in the history
fix string representation of prescription and mar (#2412)
  • Loading branch information
sainak authored Sep 19, 2024
1 parent 0683faa commit 28e2ac0
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions care/facility/models/prescription.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def has_object_write_permission(self, request):
return ConsultationRelatedPermissionMixin.has_write_permission(request)

def __str__(self):
return self.medicine + " - " + self.consultation.patient.name
return f"Prescription({self.id}) {self.consultation_id} - {self.medicine_id}"


class MedicineAdministration(BaseModel, ConsultationRelatedPermissionMixin):
Expand Down Expand Up @@ -204,11 +204,7 @@ class MedicineAdministration(BaseModel, ConsultationRelatedPermissionMixin):
)

def __str__(self):
return (
self.prescription.medicine
+ " - "
+ self.prescription.consultation.patient.name
)
return f"MedicineAdministration({self.id}) {self.prescription_id} - {self.administered_date}"

def get_related_consultation(self):
return self.prescription.consultation
Expand Down

0 comments on commit 28e2ac0

Please sign in to comment.