Skip to content

Commit

Permalink
add intv outcome user
Browse files Browse the repository at this point in the history
  • Loading branch information
marceloarocha committed Sep 13, 2024
1 parent df9d952 commit 242c583
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions services/intervention_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,7 @@ def get_outcome_data(id_intervention, user: User, edit=False):
prescription_drug: PrescriptionDrug = record[1]
readonly = intervention.status != InterventionStatusEnum.PENDING.value and not edit
economy_type = intervention.economy_type
outcome_user: User = record[3]

# custom economy gets a simpler response
if economy_type == InterventionEconomyTypeEnum.CUSTOM.value:
Expand Down Expand Up @@ -898,6 +899,12 @@ def get_outcome_data(id_intervention, user: User, edit=False):
"readonly": readonly,
"date": intervention.date.isoformat(),
"interventionReason": record.reason,
"outcomeAt": (
intervention.outcome_at.isoformat()
if intervention.outcome_at != None
else None
),
"outcomeUser": (outcome_user.name if outcome_user != None else None),
},
}

Expand Down

0 comments on commit 242c583

Please sign in to comment.