Skip to content

Commit

Permalink
Add specimen serialization to diagnostic report list spec
Browse files Browse the repository at this point in the history
  • Loading branch information
yash-learner committed Jan 17, 2025
1 parent 48f88e6 commit e56be6c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions care/emr/resources/diagnostic_report/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@ def perform_extra_serialization(cls, mapping, obj):
).to_json()
if obj.subject:
mapping["subject"] = PatientRetrieveSpec.serialize(obj.subject).to_json()
if obj.specimen.exists():
mapping["specimen"] = [
SpecimenRetrieveSpec.serialize(specimen).to_json()
for specimen in obj.specimen.all()
]


class DiagnosticReportRetrieveSpec(DiagnosticReportListSpec):
Expand Down

0 comments on commit e56be6c

Please sign in to comment.