Health-GPS 3.0.0.0
Global Health Policy Simulation model (Health-GPS)
Loading...
Searching...
No Matches
disease_table.h
Go to the documentation of this file.
1#pragma once
2#include <map>
3#include <string>
4
7
8namespace hgps {
9
11struct MeasureKey final {
12 static inline const std::string prevalence{"prevalence"};
13 static inline const std::string mortality{"mortality"};
14 static inline const std::string remission{"remission"};
15 static inline const std::string incidence{"incidence"};
16};
17
21 public:
23 DiseaseMeasure() = default;
24
27 DiseaseMeasure(std::map<int, double> measures);
28
31 std::size_t size() const noexcept;
32
37 double at(int measure_id) const;
38
43 double operator[](int measure_id) const;
44
45 private:
46 std::map<int, double> measures_;
47};
48
52 public:
53 DiseaseTable() = delete;
54
59 DiseaseTable(const core::DiseaseInfo &info, std::map<std::string, int> &&measures,
60 std::map<int, std::map<core::Gender, DiseaseMeasure>> &&data);
61
64 const core::DiseaseInfo &info() const noexcept;
65
68 std::size_t size() const noexcept;
69
72 std::size_t rows() const noexcept;
73
76 std::size_t cols() const noexcept;
77
81 bool contains(const int age) const noexcept;
82
84 bool contains(int age, core::Gender gender) const noexcept;
85
90
93 const std::map<std::string, int> &measures() const noexcept;
94
99 int at(const std::string &measure) const;
100
105 int operator[](const std::string &measure) const;
106
112 DiseaseMeasure &operator()(const int age, const core::Gender gender);
113
119 const DiseaseMeasure &operator()(const int age, const core::Gender gender) const;
120
121 private:
122 core::DiseaseInfo info_;
123 std::map<std::string, int> measures_;
124 std::map<int, std::map<core::Gender, DiseaseMeasure>> data_;
125};
126} // namespace hgps
Defines the disease measures collection data type.
Definition disease_table.h:20
std::size_t size() const noexcept
Gets the size of the measure collection.
Definition disease_table.cpp:44
double at(int measure_id) const
Gets the measure value by identifier.
Definition disease_table.cpp:46
DiseaseMeasure()=default
Initialises a new instance of the DiseaseMeasure class.
const core::DiseaseInfo & info() const noexcept
Gets the disease information.
Definition disease_table.cpp:80
std::size_t cols() const noexcept
Gets the number of columns, gender.
Definition disease_table.cpp:86
bool contains(const int age) const noexcept
Defines whether the table contains a given age.
Definition disease_table.cpp:94
std::size_t size() const noexcept
Gets the total size of the table, number of measure cells.
Definition disease_table.cpp:82
const std::map< std::string, int > & measures() const noexcept
Gets the measures to identifier mapping.
Definition disease_table.cpp:155
std::size_t rows() const noexcept
Gets the number of rows, age.
Definition disease_table.cpp:84
std::string describe_prevalence_skip_coverage() const
Definition disease_table.cpp:101
int at(const std::string &measure) const
Gets a measure identifier by name.
Definition disease_table.cpp:157
Top-level namespace for Health-GPS Core C++ API.
Definition analysis.h:7
Top-level namespace for Health-GPS Data C++ API.
Definition api.h:7
Top-level namespace for Health-GPS Console host application.
Definition command_options.cpp:9
@ info
General notification and progress message.
Definition event_message.h:15
Global namespace.
Definition column_iterator.h:123
Disease measures key mapping.
Definition disease_table.h:11
static const std::string prevalence
Definition disease_table.h:12
static const std::string mortality
Definition disease_table.h:13
static const std::string remission
Definition disease_table.h:14
static const std::string incidence
Definition disease_table.h:15
Disease information structure.
Definition disease.h:14