Skip to content
This repository was archived by the owner on Aug 14, 2020. It is now read-only.

Dividir Endpoint Datasus e alterar respectivo Model #126

Open
4 of 5 tasks
jeduardo824 opened this issue May 18, 2020 · 3 comments
Open
4 of 5 tasks

Dividir Endpoint Datasus e alterar respectivo Model #126

jeduardo824 opened this issue May 18, 2020 · 3 comments

Comments

@jeduardo824
Copy link
Collaborator

jeduardo824 commented May 18, 2020

Precisamos dividir o endpoint do Datasus em alguns outros endpoints e fazer algumas alterações no Model:

Por favor, submetam 1 PR POR ISSUE!!

  • Alterações no model: Precisamos adicionar os seguintes campos no model:
    - city varchar(100)
    - codUf integer
    - codMun integer
    - codHealthRegion integer
    - nameHealthRegion varchar(150)
    - epiWeek integer
    - population integer
    - recoveredNew integer
    - accompanyingNew integer

  • Endpoint 1: /datasus/graphs/last30days (SQL Query: SELECT date, totalcases, totaldeaths FROM DataSus WHERE region = 'Brasil' ORDER BY date DESC LIMIT 30)

  • Endpoint 2: /datasus/graphs/regions (SQL Query: SELECT date, region, SUM(totalcases) FROM DataSus WHERE date = (SELECT MAX(date) FROM DataSus) AND city = '' AND codmun IS NULL GROUP BY date, region)

  • Endpoint 3: /datasus/graphs/total_cases (SQL Query: SELECT date, region, totalcases, totaldeaths from DataSus WHERE date = (SELECT MAX(date) FROM DataSus) AND coduf = 76)

  • Endpoint 4: /datasus/regions (SQL Query: SELECT id, region, state, city, coduf, codmun, population, totalcases, totaldeaths, date FROM DataSus WHERE date = (SELECT MAX(date) FROM Datasus))

@jeduardo824
Copy link
Collaborator Author

Checkpoint 1 e 2 - @nizbel

@nizbel
Copy link
Collaborator

nizbel commented May 20, 2020

No Endpoint 3, o que é esse coduf 76? Pelo que tinha entendido a query deveria retornar os totais por região?

@jeduardo824
Copy link
Collaborator Author

@nizbel É o codigo para "Brasil"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants