Skip to content

Commit

Permalink
Merge pull request #202 from prefeitura-rio/frontend/patient-using-bi…
Browse files Browse the repository at this point in the history
…g-query-data

feat: Fix professional extraction and handle empty values
  • Loading branch information
TanookiVerde committed Aug 19, 2024
2 parents 1683178 + 6d80d82 commit bbe68ed
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 bbe68ed

Please sign in to comment.