Skip to main content

BReATH - Brazilian Research of Atmosphere Towards Health

BReATH project aims to create a interface to visualize and get insights relating asthma and weather data.

It depends on our other modules:


Python Tensorflow SQLite Numpy MatPlotLib

How to execute:

  • Install breath_main:
    • Windows: python -m pip install breath_main
    • Linux: pip3 install breath_main
  • Install tensorflow:
    • Windows: python -m pip install tensorflow
    • Linux: pip3 install tensorflow
  • Run breath_main:
    • Windows: python -m breath_main
    • Linux: python3 -m breath_main
  • Select operation in the menu (enter the desired option)

Features:

We have some features implemented:

  • Search for some brazilian city in the data bank, returning its position, state and population; and making it available to perform other operations. Implements #37
  • Plot a city's history of cases of fever, cough, or sore throat. Implements #27
  • Show a city's cases in some specific date. Implements #28
  • View current weather data in the city. Implements #21, #13, #39.
  • Predicts the occurrence of current cases of fever, flu or cough in the city. Implements #33. NOTE: The model is still under development, and at the moment it does not make very correct predictions.
  • Register new user symptoms. Implements #30.

Authors

Software architecture

Our software system is architected using C4 and UML diagrams. This repository contains the main application and service management, with other services separated across multiple repositories, containing our different Python modules. It was divided in this way to help manage the different activities of the disciplines linked to this project.

Context

This project context consists of 3 stakeholders, the Patient, the Health Manager, and the Physicist/Medic, which have access to 2 different sets of features: the Map visualization and the patient portal. The first set consists of an interface with geolocalized information about climate, respiratory diseases, air quality, and history of respiratory diseases through time by city. This service also estimates the number of cases for the following days through the air quality and climate information. The second set of features show a widget that condensates the information of the climate and air quality. It also shows the consequences of those for the patient's symptoms and offers some tips on how to avoid or mitigate them. A Session Manager will link the frontend services to the background services of Data workflow, Prediction, and Data requests from exterior sources. In addition, it is responsible for writing and retrieving data from relational and graph databases.

Container and components

Container diagram

Our container level describes our service-oriented architecture. Each service performs a set of operations, and is isolated in a different Python process.

Within the containers section we also have the component and code level description. We describe only the main and the already designed components of the architecture, as some are related to features not yet started.

Session Manager:

This container orchestrates service requests, and handles the login session.

RequestSessionManager:

Handles the lifecycle of a request, from receiving it to sending its response. We used the Chain of Responsibility design pattern to create it, as can be seen on its code diagram. Because we use Python, which supports multiple inheritance, we use an abstract class, as there is no difference between it and an interface.

Code diagram

BReATH Map and Patient Portal:

These containers have a Layering Structure that intends to be an MVC. Divided into View, the top layer, Model, the middle layer, and a ServiceProxy as the bottom layer and link with the session manager. We used the Proxy Design Pattern because of the service request complexity.

In the current version, we are temporarily using ConsoleApplication, terminal version of the application

DataWorflow:

This container acts as a data formatter and validator before saving it into the database. Regarding this behavior, we used an Adapter design pattern to clean and reshape the data for the rest of the application.

DataRequester:

This container is responsible for requesting and receiving data from external APIs. Due to the possible asynchrony of the task, we used the Observer design pattern to make sure the rest of the application could continue without problems. However, we also decided to implement the abstract factory design once we could switch APIs or add new ones in the future.

It was put together as part of DataWorkflow

Prediction:

The Prediction module has an ML model, implemented in TensorFlow, used to predict in real-time the consequences of the climate and air quality over the symptoms and occurrences of respiratory diseases. As this is a central point of the application, it will receive a large number of requests. For this reason, we used a Proxy Design to help handle those.

BDAcessPoint:

The access point uses a factory Design pattern for the two possible databases to make the queries faster. The Design is divided through the GraphQuerier, RelationalQuerier, and RequestProcessor, which is the factory controller.

The graph database was not used

Databases:

  • SQL: Users, patients, symptoms and diagnosis. Also geolocated atmosphere data. It will use SQLite.
  • Graph: Geographical information (political wise), relationship between symptoms and diseases. It will use Neo4j.

Metadata

Release files for breath-main 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for breath-main 0.1.0
File Size Uploaded
breath_main-0.1.0.tar.gz 21.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for breath-main 0.1.0
File Interpreter ABI Platform
breath_main-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 47.0 kB

Release files / breath_main-0.1.0.tar.gz

Download URL breath_main-0.1.0.tar.gz
Size 21.4 kB
Tags Source
SHA-256 checksum
How to use checksums
52d368031ef7ea067bf6d2f1a9df233db7cd05eda87c79f3ee9ff15ee7fd07c6
BLAKE2b-256 checksum
How to use checksums
54fd3eb0a3cf694859c02d6f8cd45bb1eb4e6921f9f8c36a63ef39cbeef83ec8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.5

Release files / breath_main-0.1.0-py3-none-any.whl

Download URL breath_main-0.1.0-py3-none-any.whl
Size 25.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
885ba4f68d5224e2500a69898b40435722679df8f821ab6f0ec35d83ff3e5c95
BLAKE2b-256 checksum
How to use checksums
fba2d1b36950cc9fddf3ef431ade260ee4e894dacc04b0fda2b8744de58b615f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

0.0.3

1 release file

0.0.2

1 release file

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page