Skip to content

Commit

Permalink
feat: Fix professional extraction and handle empty values
Browse files Browse the repository at this point in the history
  • Loading branch information
TanookiVerde committed Aug 19, 2024
1 parent 2194110 commit 6d80d82
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions app/routers/frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,14 @@ async def get_patient_encounters(
if professional:
if isinstance(professional, list):
professional = professional[0] if len(professional) > 0 else {}
professional = {
"name": professional.get('nome'),
"role": professional.get('especialidade')
}

if not professional['nome'] and not professional['especialidade']:
professional = None
else:
professional = {
"name": professional.get('nome'),
"role": professional.get('especialidade')
}

# Filter Tags
unit_type = result['estabelecimento']['estabelecimento_tipo']
Expand Down

0 comments on commit 6d80d82

Please sign in to comment.