CodeValue statistics
Add a FAB button "Statistics" when displaying the list of code values of the selected group (e.g. https://demo.ggce.genebanks.org/admin/codes/ANNOTATION_TYPE).
Clicking the button calls ..../ANNOTATION_TYPE/stats endpoint that returns a Map<string, Map<Map<string, number>>>
statisticswhere the first key is the "value" found in the database for this
groupName, the second key is the Java classname of the entity, the third key is the property name, and the number is the
countof
valuein
entity[property]:
{
"XX": {
"Inventory": {
"field1": 10,
"field2": 1,
},
"Accession": {
"something1": 500,
"other": 142
},
"YY": {
"Inventory": {
"another1": 34
},
"InventoryAction": ...
API implements this by scanning entity properties for the selected groupName
and executing a query select property, count(id) from entity group by property where property.notNull()
and merging the results.
The UI should render a dialog with a <Table
that shows:
Value | Status | Entity | Property | Count |
---|---|---|---|---|
XX | OK | Inventory | field1 | 10 |
XX | OK | Inventory | field2 | 1 |
XX | OK | Accession | something1 | 500 |
XX | OK | Accession | something1 | 500 |
YY | Not declared | Inventory | another1 | 34 |
YY | Not declared | InventoryAction | ... | ... |
The Status column shows if the value
in the database exists as a CodeValue
in the groupName
.