Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ticket: https://broadinstitute.atlassian.net/browse/DDP-5819
Draft version of dynamic dashboard statistics feature:
Statistic
interface which helps to make high level abstraction for the feature, to make easier to add different kind of statistic representation later, this type interface will be parent of all type of statistic(Counter, Graph, etc).StatisticFactory
interface andStatisticCreator
class which will help to generate different kind of Statistic type, to hideswitch
statement which manages to which type of object return depending on statistic type(Counter-Participant, Graph-Participant etc).StatisticResult
abstract class which will be parent class of result of any type of statistic, currently empty but it can be useful to provide common data for all kind of statisticStatisticPayload
first intention of this class was to deserialize json from frontend of what kind of statistic user wanted to create, but currently is used to create Java object filled with data fromdashboard_settings
table, I think it can be good helper class to communicate with code from outer world(Database, Frontend, etc).StatisticFor
idea of this enum class is to make difference for what we make statistics, statistics for participant related things or statistics for medical record related things and etc.FilterType
nearly the same idea asStatisticFor
has, will help in filtering data, for exampleStatisticFor
can bePARTICIPANT
andFilterType
will beENROLLED
,REGISTERED
, etc it should be useful for filtering to have small methods which will haveSingle Responsibility
.DisplayType
enum class, the same idea asFilterType
andStatisticFor
have, to make difference on code level what kind of representation is required.Counter
,ParticipantCounter
andCounterResult
classes are related to COUNTER representation of statistic, I think each representation will have such classes, for exampleBarGraph
,ParticipantBarGraph
,BarGraphResult
, all of these classes will have typeStatistic