Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/search endpoint #264

Merged
merged 3 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading