Skip to content

Commit a088b86

Browse files
committed
Merge branch 'feat/outliers-table-DHIS2-13858' into feat/bundle-26.4.0
Prepare analytics bundle
2 parents 6d1ceb4 + b5a7d09 commit a088b86

33 files changed

Lines changed: 1283 additions & 674 deletions

i18n/en.pot

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ msgstr ""
55
"Content-Type: text/plain; charset=utf-8\n"
66
"Content-Transfer-Encoding: 8bit\n"
77
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
8-
"POT-Creation-Date: 2023-09-27T14:15:13.876Z\n"
9-
"PO-Revision-Date: 2023-09-27T14:15:13.876Z\n"
8+
"POT-Creation-Date: 2024-01-25T12:05:03.360Z\n"
9+
"PO-Revision-Date: 2024-01-25T12:05:03.360Z\n"
1010

1111
msgid "view only"
1212
msgstr "view only"
@@ -150,6 +150,9 @@ msgstr "Math operators"
150150
msgid "Data Type"
151151
msgstr "Data Type"
152152

153+
msgid "Only {{dataType}} can be used in {{visType}}"
154+
msgstr "Only {{dataType}} can be used in {{visType}}"
155+
153156
msgid "All types"
154157
msgstr "All types"
155158

@@ -180,6 +183,9 @@ msgstr "No event data items found"
180183
msgid "No program indicators found"
181184
msgstr "No program indicators found"
182185

186+
msgid "No calculations found"
187+
msgstr "No calculations found"
188+
183189
msgid "No indicators found for \"{{- searchTerm}}\""
184190
msgstr "No indicators found for \"{{- searchTerm}}\""
185191

@@ -192,6 +198,9 @@ msgstr "No event data items found for \"{{- searchTerm}}\""
192198
msgid "No program indicators found for \"{{- searchTerm}}\""
193199
msgstr "No program indicators found for \"{{- searchTerm}}\""
194200

201+
msgid "No calculations found for \"{{- searchTerm}}\""
202+
msgstr "No calculations found for \"{{- searchTerm}}\""
203+
195204
msgid "Nothing found for \"{{- searchTerm}}\""
196205
msgstr "Nothing found for \"{{- searchTerm}}\""
197206

@@ -654,15 +663,15 @@ msgstr "Select year"
654663
msgid "Period"
655664
msgstr "Period"
656665

666+
msgid "Selected Periods"
667+
msgstr "Selected Periods"
668+
657669
msgid "Relative periods"
658670
msgstr "Relative periods"
659671

660672
msgid "Fixed periods"
661673
msgstr "Fixed periods"
662674

663-
msgid "Selected Periods"
664-
msgstr "Selected Periods"
665-
666675
msgid "No periods selected"
667676
msgstr "No periods selected"
668677

@@ -1164,6 +1173,9 @@ msgstr "Scatter"
11641173
msgid "Single value"
11651174
msgstr "Single value"
11661175

1176+
msgid "Outlier table"
1177+
msgstr "Outlier table"
1178+
11671179
msgid "All charts"
11681180
msgstr "All charts"
11691181

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"@dhis2/cli-app-scripts": "^9.0.1",
3636
"@dhis2/cli-style": "^10.4.1",
3737
"@dhis2/d2-i18n": "^1.1.0",
38-
"@dhis2/ui": "^8.13.13",
38+
"@dhis2/ui": "^9.2.0",
3939
"@sambego/storybook-state": "^2.0.1",
4040
"@storybook/addons": "^6.5.16",
4141
"@storybook/preset-create-react-app": "^3.1.7",
@@ -52,7 +52,7 @@
5252
"peerDependencies": {
5353
"@dhis2/app-runtime": "^3",
5454
"@dhis2/d2-i18n": "^1.1",
55-
"@dhis2/ui": "^8.2.5",
55+
"@dhis2/ui": "^9.2.0",
5656
"prop-types": "^15",
5757
"react": "^16.3",
5858
"react-dom": "^16.3",
@@ -75,6 +75,9 @@
7575
"react-beautiful-dnd": "^10.1.1",
7676
"resize-observer-polyfill": "^1.5.1"
7777
},
78+
"resolutions": {
79+
"@dhis2/ui": "^9.2.0"
80+
},
7881
"files": [
7982
"build"
8083
]

src/__fixtures__/fixtures.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ export default (function x() {
114114
require('./json/api/analytics/enrollments.json')
115115
)
116116

117+
addFixture(
118+
'/api/analytics/outlierDetection',
119+
require('./json/api/analytics/outlierDetection.json')
120+
)
117121
return {
118122
get: getFixture,
119123
add: addFixture,
Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
{
2+
"headers": [
3+
{
4+
"name": "dxname",
5+
"column": "Data name",
6+
"valueType": "TEXT",
7+
"type": "java.lang.String",
8+
"hidden": false,
9+
"meta": false
10+
},
11+
{
12+
"name": "ouname",
13+
"column": "Organisation unit name",
14+
"valueType": "TEXT",
15+
"type": "java.lang.String",
16+
"hidden": false,
17+
"meta": false
18+
},
19+
{
20+
"name": "value",
21+
"column": "Value",
22+
"valueType": "NUMBER",
23+
"type": "java.lang.Double",
24+
"hidden": false,
25+
"meta": false
26+
},
27+
{
28+
"name": "absdev",
29+
"column": "Absolute deviation",
30+
"valueType": "NUMBER",
31+
"type": "java.lang.Double",
32+
"hidden": false,
33+
"meta": false
34+
},
35+
{
36+
"name": "modifiedzscore",
37+
"column": "Modified zScore",
38+
"valueType": "NUMBER",
39+
"type": "java.lang.Double",
40+
"hidden": false,
41+
"meta": false
42+
},
43+
{
44+
"name": "median",
45+
"column": "Median",
46+
"valueType": "NUMBER",
47+
"type": "java.lang.Double",
48+
"hidden": false,
49+
"meta": false
50+
},
51+
{
52+
"name": "lowerbound",
53+
"column": "Lower boundary",
54+
"valueType": "NUMBER",
55+
"type": "java.lang.Double",
56+
"hidden": false,
57+
"meta": false
58+
},
59+
{
60+
"name": "upperbound",
61+
"column": "Upper boundary",
62+
"valueType": "NUMBER",
63+
"type": "java.lang.Double",
64+
"hidden": false,
65+
"meta": false
66+
}
67+
],
68+
"metaData": {
69+
"maxResults": 100,
70+
"count": 13,
71+
"orderBy": "mean_abs_dev",
72+
"threshold": 3.0,
73+
"algorithm": "MOD_Z_SCORE"
74+
},
75+
"rowContext": {
76+
77+
},
78+
"rows": [
79+
[
80+
"ANC 2nd visit",
81+
"UMC (Urban Centre) Hospital",
82+
"1669.0",
83+
"920.0",
84+
"3.902767295597484",
85+
"749.0",
86+
"-290.93013894085743",
87+
"1788.9301389408574"
88+
],
89+
[
90+
"ANC 1st visit",
91+
"Charlotte CHP",
92+
"49.0",
93+
"39.0",
94+
"7.515857142857143",
95+
"10.0",
96+
"-23.948490393535913",
97+
"43.94849039353591"
98+
],
99+
[
100+
"ANC 2nd visit",
101+
"Charlotte CHP",
102+
"40.0",
103+
"33.0",
104+
"22.258499999999998",
105+
"7.0",
106+
"-30.86489139031037",
107+
"44.86489139031037"
108+
],
109+
[
110+
"ANC 2nd visit",
111+
"Wilberforce CHC",
112+
"56.0",
113+
"24.5",
114+
"3.004590909090909",
115+
"31.5",
116+
"-1.3890179239210454",
117+
"64.38901792392105"
118+
],
119+
[
120+
"ANC 1st visit",
121+
"Deep Eye water MCHP",
122+
"40.0",
123+
"16.0",
124+
"3.5973333333333333",
125+
"24.0",
126+
"4.850913859925324",
127+
"43.14908614007467"
128+
],
129+
[
130+
"ANC 2nd visit",
131+
"Lion for Lion Clinic",
132+
"30.0",
133+
"16.0",
134+
"3.5973333333333333",
135+
"14.0",
136+
"-5.620896815302167",
137+
"33.62089681530217"
138+
],
139+
[
140+
"ANC 2nd visit",
141+
"Deep Eye water MCHP",
142+
"33.0",
143+
"14.5",
144+
"3.9121",
145+
"18.5",
146+
"-3.4245866551686603",
147+
"40.42458665516866"
148+
],
149+
[
150+
"ANC 2nd visit",
151+
"Blessed Mokaka East Clinic",
152+
"2.0",
153+
"13.0",
154+
"4.38425",
155+
"15.0",
156+
"-3.417043736713012",
157+
"33.41704373671301"
158+
],
159+
[
160+
"ANC 2nd visit",
161+
"Malambay CHP",
162+
"15.0",
163+
"12.0",
164+
"5.396",
165+
"3.0",
166+
"-13.770509831248425",
167+
"19.770509831248425"
168+
],
169+
[
170+
"ANC 2nd visit",
171+
"Wellbody MCHP",
172+
"20.0",
173+
"10.0",
174+
"3.3725",
175+
"10.0",
176+
"-10.999999999999996",
177+
"30.999999999999996"
178+
],
179+
[
180+
"ANC 1st visit",
181+
"Blessed Mokaka East Clinic",
182+
"26.0",
183+
"10.0",
184+
"4.496666666666667",
185+
"16.0",
186+
"1.6734512181055958",
187+
"30.326548781894402"
188+
],
189+
[
190+
"ANC 1st visit",
191+
"Murray Town CHC",
192+
"18.0",
193+
"9.0",
194+
"6.0705",
195+
"9.0",
196+
"-2.43571205496543",
197+
"20.43571205496543"
198+
],
199+
[
200+
"ANC 2nd visit",
201+
"Thompson Bay MCHP",
202+
"11.0",
203+
"6.0",
204+
"4.047",
205+
"5.0",
206+
"-2.038266127580332",
207+
"12.038266127580332"
208+
]
209+
],
210+
"headerWidth": 8,
211+
"width": 8,
212+
"height": 13
213+
}

src/api/analytics/AnalyticsAggregate.js

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,38 @@ class AnalyticsAggregate extends AnalyticsBase {
6868
* .withStartDate('2017-10-01')
6969
* .withEndDate('2017-10-31');
7070
*
71-
* analytics.aggregate.getDebugSql(req);
71+
* analytics.aggregate.getDebugSql(req)
7272
* .then(console.log);
7373
*/
7474
getDebugSql(req) {
7575
return this.fetch(req.withPath('debug/sql'))
7676
}
77+
78+
/**
79+
* @param {!AnalyticsRequest} req Request object
80+
*
81+
* @returns {Promise} Promise that resolves with the SQL statement used to query the database.
82+
*
83+
* @example
84+
* const req = new analytics.request()
85+
* .withParameters({
86+
* dx: 'fbfJHSPpUQD,cYeuwXTCPkU',
87+
* pe: 'THIS_YEAR',
88+
* ou: 'USER_ORGUNIT,USER_ORGUNIT_CHILDREN',
89+
* headers: 'dxname,pename,ouname,value,absdev,modifiedzscore,median,lowerbound,upperbound',
90+
* algorithm: 'MODIFIED_Z_SCORE',
91+
* maxResults: 100,
92+
* threshold: 3,
93+
orderBy: 'value',
94+
sortOrder: 'desc',
95+
* });
96+
*
97+
* analytics.aggregate.getOutliersData(req)
98+
* .then(console.log);
99+
*/
100+
getOutliersData(req) {
101+
return this.fetch(req.withPath('outlierDetection'))
102+
}
77103
}
78104

79105
export default AnalyticsAggregate

0 commit comments

Comments
 (0)