Skip to content

Commit

Permalink
Merge pull request #264 from prefeitura-rio/fix/search-endpoint
Browse files Browse the repository at this point in the history
Fix/search endpoint
  • Loading branch information
TanookiVerde authored Dec 19, 2024
2 parents cc1e3a4 + 179483e commit 9c2e264
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Histórico Clínico Integrado
- Responsável de Infraestrutura: Gabriel Milan (Escritório de Dados)
- Administrador: Pedro Marques (DIT@SMS)
- Administrador: Pedro Marques (DIT @ SMS)

## O que é o HCI?
- O HCI tem como objetivo integrar os dados de saúde municipais de diferentes unidades de saúde, seja da atenção primária, hospitalar, etc.
Expand Down
6 changes: 3 additions & 3 deletions app/routers/frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,15 @@ async def search_patient(

clause = ""
if cns:
clause = f"valor_cns = {cns}"
clause = f"cns_particao = {cns}"
elif cpf:
clause = f"cpf_particao = {cpf}"
clause = f"cpf = '{cpf}'"
elif name:
clause = f"search(nome,'{name}')"

results = await read_bq(
f"""
SELECT nome, valor_cns as cns, cpf
SELECT *
FROM `{BIGQUERY_PROJECT}`.{BIGQUERY_PATIENT_SEARCH_TABLE_ID}
WHERE {clause}
""",
Expand Down

0 comments on commit 9c2e264

Please sign in to comment.