Skip to content

Commit

Permalink
using cpf_particao to query
Browse files Browse the repository at this point in the history
  • Loading branch information
TanookiVerde committed Sep 2, 2024
1 parent e301a35 commit a3f9111
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
6 changes: 3 additions & 3 deletions app/routers/frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ async def get_patient_header(
f"""
SELECT *
FROM `{BIGQUERY_PROJECT}`.{BIGQUERY_PATIENT_HEADER_TABLE_ID}
WHERE cpf = '{cpf}'
WHERE cpf_particao = {cpf}
""",
from_file="/tmp/credentials.json",
)
Expand Down Expand Up @@ -88,7 +88,7 @@ async def get_patient_summary(
f"""
SELECT *
FROM `{BIGQUERY_PROJECT}`.{BIGQUERY_PATIENT_SUMMARY_TABLE_ID}
WHERE cpf = '{cpf}'
WHERE cpf_particao = {cpf}
""",
from_file="/tmp/credentials.json",
)
Expand Down Expand Up @@ -123,7 +123,7 @@ async def get_patient_encounters(
f"""
SELECT *
FROM `{BIGQUERY_PROJECT}`.{BIGQUERY_PATIENT_ENCOUNTERS_TABLE_ID}
WHERE cpf = '{cpf}' and exibicao.indicador = true
WHERE cpf_particao = {cpf} and exibicao.indicador = true
""",
from_file="/tmp/credentials.json",
)
Expand Down
22 changes: 19 additions & 3 deletions app/types/frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@
from typing import Optional, List
from pydantic import BaseModel

from fastapi.security import OAuth2PasswordRequestForm


class LoginFormWith2FA(OAuth2PasswordRequestForm):
def __init__(
self,
username: str,
password: str,
totp: str,
):
super().__init__(username=username, password=password)
self.totp = totp


# Clinic Family model
class FamilyClinic(BaseModel):
Expand All @@ -16,11 +29,13 @@ class FamilyHealthTeam(BaseModel):
name: Optional[str]
phone: Optional[str]


# Clinical Exam Model
class ClinicalExam(BaseModel):
type: str
description: Optional[str]


# Medical Conditions model
class PatientSummary(BaseModel):
allergies: List[str]
Expand All @@ -29,7 +44,7 @@ class PatientSummary(BaseModel):

# Responsible model
class Responsible(BaseModel):
name: str
name: Optional[str] # Temporary
role: str


Expand All @@ -40,7 +55,7 @@ class Encounter(BaseModel):
location: str
type: str
subtype: Optional[str]
exhibition_type: str = 'default'
exhibition_type: str = "default"
active_cids: List[str]
responsible: Optional[Responsible]
clinical_motivation: Optional[str]
Expand All @@ -56,8 +71,9 @@ class UserInfo(BaseModel):
email: Optional[str]
role: Optional[str]


class Professional(BaseModel):
name: str
name: Optional[str]
registry: Optional[str]


Expand Down

0 comments on commit a3f9111

Please sign in to comment.