Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/guilhermecaz/desafio_painel_esus
https://github.com/guilhermecaz/desafio_painel_esus
Last synced: 13 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/guilhermecaz/desafio_painel_esus
- Owner: GuilhermeCAz
- Created: 2024-04-26T19:07:30.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-04-28T21:50:24.000Z (8 months ago)
- Last Synced: 2024-04-28T22:40:59.044Z (8 months ago)
- Language: Python
- Size: 176 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Desafio Painel e-SUS
## What is this repository about?
I was challenged to showcase my skills based on the problem described on [DESAFIO.md](../main/DESAFIO.md).
It involves using the Flask framework to develop a REST API. The API returns data about patients of a medical facility, as provided by a csv.
## Setup
Clone the repository
```
git clone https://github.com/GuilhermeCAz/desafio_painel_esus.git
```> Docker sets up the environment according to the Dockerfile, which means you can skip the following steps straight to [#Running via Docker](#running-via-docker).
From the folder, create and activate a virtual environment
```
python -m venv .venv
``````
.venv\scripts\activate
```Install the requirements
```
pip install -r requirements.txt
```Run the Flask application
```
flask run
```## Running tests
```
python -m unittest -v
```## Running via Docker
```
docker-compose build
``````
docker run -dp 8001:8001 desafio_painel_esus-app
```### Sample API requests (tested)
```
http://localhost:8001/api/v1/atendimentos?condicao_saude=hipertensao
``````
http://localhost:8001/api/v1/atendimentos?unidade=Unidade%20de%20saude%20Cec%C3%ADlia
``````
http://localhost:8001/api/v1/atendimentos?data_atendimento=2024-01-01
``````
http://localhost:8001/api/v1/atendimentos?data_atendimento=2024-01-01&condicao_saude=hipertensao
```