Skip to content

Commit

Permalink
handle absence of "reference"
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-Costello committed Dec 20, 2024
1 parent 1f7bf89 commit ac65877
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions corehq/motech/fhir/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ def sync_all_appointments_domain(domain):
practitioner = ''
for p in appointment_resource.get('participant'):
actor = p.get('actor')
if actor and 'Practitioner' in actor.get('reference'):
if actor and actor.get('reference') is not None and 'Practitioner' in actor.get('reference'):
practitioner = actor.get('display')
break
reason_code = appointment_resource.get('reasonCode')
Expand Down Expand Up @@ -628,7 +628,7 @@ def sync_all_appointments_domain(domain):
practitioner = ''
for p in appointment_resource.get('participant'):
actor = p.get('actor')
if actor and 'Practitioner' in actor.get('reference'):
if actor and actor.get('reference') is not None and 'Practitioner' in actor.get('reference'):
practitioner = actor.get('display')
break
reason_code = appointment_resource.get('reasonCode')
Expand Down

0 comments on commit ac65877

Please sign in to comment.