@openfn/language-dhis2 3.0.0-0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -166
- package/ast.json +142 -184
- package/lib/Adaptor.js +189 -203
- package/lib/Client.js +18 -2
- package/lib/Utils.js +37 -99
- package/package.json +2 -2
package/ast.json
CHANGED
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
"title": "param",
|
|
44
|
-
"description": "Optional `options` to
|
|
44
|
+
"description": "Optional `options` to define URL parameters via params (E.g. `filter`, `dimension` and other import parameters), request config (E.g. `auth`) and the DHIS2 apiVersion.",
|
|
45
45
|
"type": {
|
|
46
46
|
"type": "OptionalType",
|
|
47
47
|
"expression": {
|
|
@@ -74,57 +74,57 @@
|
|
|
74
74
|
{
|
|
75
75
|
"title": "example",
|
|
76
76
|
"description": "create('programs', {\n name: 'name 20',\n shortName: 'n20',\n programType: 'WITHOUT_REGISTRATION',\n});",
|
|
77
|
-
"caption": "
|
|
77
|
+
"caption": "a program"
|
|
78
78
|
},
|
|
79
79
|
{
|
|
80
80
|
"title": "example",
|
|
81
81
|
"description": "create('events', {\n program: 'eBAyeGv0exc',\n orgUnit: 'DiszpKrYNg8',\n status: 'COMPLETED',\n});",
|
|
82
|
-
"caption": "
|
|
82
|
+
"caption": "an event"
|
|
83
83
|
},
|
|
84
84
|
{
|
|
85
85
|
"title": "example",
|
|
86
86
|
"description": "create('trackedEntityInstances', {\n orgUnit: 'TSyzvBiovKh',\n trackedEntityType: 'nEenWmSyUEp',\n attributes: [\n {\n attribute: 'w75KJ2mc4zz',\n value: 'Gigiwe',\n },\n ]\n});",
|
|
87
|
-
"caption": "
|
|
87
|
+
"caption": "a trackedEntityInstance"
|
|
88
88
|
},
|
|
89
89
|
{
|
|
90
90
|
"title": "example",
|
|
91
91
|
"description": "create('dataSets', { name: 'OpenFn Data Set', periodType: 'Monthly' });",
|
|
92
|
-
"caption": "
|
|
92
|
+
"caption": "a dataSet"
|
|
93
93
|
},
|
|
94
94
|
{
|
|
95
95
|
"title": "example",
|
|
96
96
|
"description": "create('dataSetNotificationTemplates', {\n dataSetNotificationTrigger: 'DATA_SET_COMPLETION',\n notificationRecipient: 'ORGANISATION_UNIT_CONTACT',\n name: 'Notification',\n messageTemplate: 'Hello',\n deliveryChannels: ['SMS'],\n dataSets: [],\n});",
|
|
97
|
-
"caption": "
|
|
97
|
+
"caption": "a dataSetNotification"
|
|
98
98
|
},
|
|
99
99
|
{
|
|
100
100
|
"title": "example",
|
|
101
101
|
"description": "create('dataElements', {\n aggregationType: 'SUM',\n domainType: 'AGGREGATE',\n valueType: 'NUMBER',\n name: 'Paracetamol',\n shortName: 'Para',\n});",
|
|
102
|
-
"caption": "
|
|
102
|
+
"caption": "a dataElement"
|
|
103
103
|
},
|
|
104
104
|
{
|
|
105
105
|
"title": "example",
|
|
106
106
|
"description": "create('dataElementGroups', {\n name: 'Data Element Group 1',\n dataElements: [],\n});",
|
|
107
|
-
"caption": "
|
|
107
|
+
"caption": "a dataElementGroup"
|
|
108
108
|
},
|
|
109
109
|
{
|
|
110
110
|
"title": "example",
|
|
111
111
|
"description": "create('dataElementGroupSets', {\n name: 'Data Element Group Set 4',\n dataDimension: true,\n shortName: 'DEGS4',\n dataElementGroups: [],\n});",
|
|
112
|
-
"caption": "
|
|
112
|
+
"caption": "a dataElementGroupSet"
|
|
113
113
|
},
|
|
114
114
|
{
|
|
115
115
|
"title": "example",
|
|
116
116
|
"description": "create('dataValueSets', {\n dataElement: 'f7n9E0hX8qk',\n period: '201401',\n orgUnit: 'DiszpKrYNg8',\n value: '12',\n});",
|
|
117
|
-
"caption": "
|
|
117
|
+
"caption": "a dataValueSet"
|
|
118
118
|
},
|
|
119
119
|
{
|
|
120
120
|
"title": "example",
|
|
121
121
|
"description": "create('dataValueSets', {\n dataSet: 'pBOMPrpg1QX',\n completeDate: '2014-02-03',\n period: '201401',\n orgUnit: 'DiszpKrYNg8',\n dataValues: [\n {\n dataElement: 'f7n9E0hX8qk',\n value: '1',\n },\n {\n dataElement: 'Ix2HsbDMLea',\n value: '2',\n },\n {\n dataElement: 'eY5ehpbEsB7',\n value: '3',\n },\n ],\n});",
|
|
122
|
-
"caption": "
|
|
122
|
+
"caption": "a dataValueSet with related dataValues"
|
|
123
123
|
},
|
|
124
124
|
{
|
|
125
125
|
"title": "example",
|
|
126
126
|
"description": "create('enrollments', {\n trackedEntityInstance: 'bmshzEacgxa',\n orgUnit: 'TSyzvBiovKh',\n program: 'gZBxv9Ujxg0',\n enrollmentDate: '2013-09-17',\n incidentDate: '2013-09-17',\n});",
|
|
127
|
-
"caption": "
|
|
127
|
+
"caption": "an enrollment"
|
|
128
128
|
}
|
|
129
129
|
]
|
|
130
130
|
},
|
|
@@ -181,37 +181,12 @@
|
|
|
181
181
|
},
|
|
182
182
|
{
|
|
183
183
|
"title": "param",
|
|
184
|
-
"description": "Optional options
|
|
184
|
+
"description": "Optional `options` to define URL parameters via params (E.g. `filter`, `dimension` and other import parameters), request config (E.g. `auth`) and the DHIS2 apiVersion.",
|
|
185
185
|
"type": {
|
|
186
186
|
"type": "OptionalType",
|
|
187
187
|
"expression": {
|
|
188
|
-
"type": "
|
|
189
|
-
"
|
|
190
|
-
{
|
|
191
|
-
"type": "FieldType",
|
|
192
|
-
"key": "apiVersion",
|
|
193
|
-
"value": {
|
|
194
|
-
"type": "NameExpression",
|
|
195
|
-
"name": "number"
|
|
196
|
-
}
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
"type": "FieldType",
|
|
200
|
-
"key": "operationName",
|
|
201
|
-
"value": {
|
|
202
|
-
"type": "NameExpression",
|
|
203
|
-
"name": "string"
|
|
204
|
-
}
|
|
205
|
-
},
|
|
206
|
-
{
|
|
207
|
-
"type": "FieldType",
|
|
208
|
-
"key": "resourceType",
|
|
209
|
-
"value": {
|
|
210
|
-
"type": "NameExpression",
|
|
211
|
-
"name": "string"
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
]
|
|
188
|
+
"type": "NameExpression",
|
|
189
|
+
"name": "Object"
|
|
215
190
|
}
|
|
216
191
|
},
|
|
217
192
|
"name": "options"
|
|
@@ -239,52 +214,52 @@
|
|
|
239
214
|
{
|
|
240
215
|
"title": "example",
|
|
241
216
|
"description": "update('programs', 'qAZJCrNJK8H', {\n name: '14e1aa02c3f0a31618e096f2c6d03bed',\n shortName: '14e1aa02',\n programType: 'WITHOUT_REGISTRATION',\n});",
|
|
242
|
-
"caption": "
|
|
217
|
+
"caption": "a program"
|
|
243
218
|
},
|
|
244
219
|
{
|
|
245
220
|
"title": "example",
|
|
246
221
|
"description": "update('events', 'PVqUD2hvU4E', {\n program: 'eBAyeGv0exc',\n orgUnit: 'Ngelehun CHC',\n status: 'COMPLETED',\n storedBy: 'admin',\n dataValues: [],\n});",
|
|
247
|
-
"caption": "an
|
|
222
|
+
"caption": "an event"
|
|
248
223
|
},
|
|
249
224
|
{
|
|
250
225
|
"title": "example",
|
|
251
226
|
"description": "update('trackedEntityInstances', 'IeQfgUtGPq2', {\n created: '2015-08-06T21:12:37.256',\n orgUnit: 'TSyzvBiovKh',\n createdAtClient: '2015-08-06T21:12:37.256',\n trackedEntityInstance: 'IeQfgUtGPq2',\n lastUpdated: '2015-08-06T21:12:37.257',\n trackedEntityType: 'nEenWmSyUEp',\n inactive: false,\n deleted: false,\n featureType: 'NONE',\n programOwners: [\n {\n ownerOrgUnit: 'TSyzvBiovKh',\n program: 'IpHINAT79UW',\n trackedEntityInstance: 'IeQfgUtGPq2',\n },\n ],\n enrollments: [],\n relationships: [],\n attributes: [\n {\n lastUpdated: '2016-01-12T00:00:00.000',\n displayName: 'Last name',\n created: '2016-01-12T00:00:00.000',\n valueType: 'TEXT',\n attribute: 'zDhUuAYrxNC',\n value: 'Russell',\n },\n {\n lastUpdated: '2016-01-12T00:00:00.000',\n code: 'MMD_PER_NAM',\n displayName: 'First name',\n created: '2016-01-12T00:00:00.000',\n valueType: 'TEXT',\n attribute: 'w75KJ2mc4zz',\n value: 'Catherine',\n },\n ],\n});",
|
|
252
|
-
"caption": "a
|
|
227
|
+
"caption": "a trackedEntityInstance"
|
|
253
228
|
},
|
|
254
229
|
{
|
|
255
230
|
"title": "example",
|
|
256
231
|
"description": "update('dataSets', 'lyLU2wR22tC', { name: 'OpenFN Data Set', periodType: 'Weekly' });",
|
|
257
|
-
"caption": "
|
|
232
|
+
"caption": "a dataSet"
|
|
258
233
|
},
|
|
259
234
|
{
|
|
260
235
|
"title": "example",
|
|
261
236
|
"description": "update('dataSetNotificationTemplates', 'VbQBwdm1wVP', {\n dataSetNotificationTrigger: 'DATA_SET_COMPLETION',\n notificationRecipient: 'ORGANISATION_UNIT_CONTACT',\n name: 'Notification',\n messageTemplate: 'Hello Updated,\n deliveryChannels: ['SMS'],\n dataSets: [],\n});",
|
|
262
|
-
"caption": "
|
|
237
|
+
"caption": "a dataSetNotification"
|
|
263
238
|
},
|
|
264
239
|
{
|
|
265
240
|
"title": "example",
|
|
266
241
|
"description": "update('dataElements', 'FTRrcoaog83', {\n aggregationType: 'SUM',\n domainType: 'AGGREGATE',\n valueType: 'NUMBER',\n name: 'Paracetamol',\n shortName: 'Para',\n});",
|
|
267
|
-
"caption": "
|
|
242
|
+
"caption": "a dataElement"
|
|
268
243
|
},
|
|
269
244
|
{
|
|
270
245
|
"title": "example",
|
|
271
246
|
"description": "update('dataElementGroups', 'QrprHT61XFk', {\n name: 'Data Element Group 1',\n dataElements: [],\n});",
|
|
272
|
-
"caption": "
|
|
247
|
+
"caption": "a dataElementGroup"
|
|
273
248
|
},
|
|
274
249
|
{
|
|
275
250
|
"title": "example",
|
|
276
251
|
"description": "update('dataElementGroupSets', 'VxWloRvAze8', {\n name: 'Data Element Group Set 4',\n dataDimension: true,\n shortName: 'DEGS4',\n dataElementGroups: [],\n});",
|
|
277
|
-
"caption": "
|
|
252
|
+
"caption": "a dataElementGroupSet"
|
|
278
253
|
},
|
|
279
254
|
{
|
|
280
255
|
"title": "example",
|
|
281
256
|
"description": "update('dataValueSets', 'AsQj6cDsUq4', {\n dataElement: 'f7n9E0hX8qk',\n period: '201401',\n orgUnit: 'DiszpKrYNg8',\n value: '12',\n});",
|
|
282
|
-
"caption": "
|
|
257
|
+
"caption": "a dataValueSet"
|
|
283
258
|
},
|
|
284
259
|
{
|
|
285
260
|
"title": "example",
|
|
286
261
|
"description": "update('dataValueSets', 'Ix2HsbDMLea', {\n dataSet: 'pBOMPrpg1QX',\n completeDate: '2014-02-03',\n period: '201401',\n orgUnit: 'DiszpKrYNg8',\n dataValues: [\n {\n dataElement: 'f7n9E0hX8qk',\n value: '1',\n },\n {\n dataElement: 'Ix2HsbDMLea',\n value: '2',\n },\n {\n dataElement: 'eY5ehpbEsB7',\n value: '3',\n },\n ],\n});",
|
|
287
|
-
"caption": "
|
|
262
|
+
"caption": "a dataValueSet with related dataValues"
|
|
288
263
|
},
|
|
289
264
|
{
|
|
290
265
|
"title": "example",
|
|
@@ -299,6 +274,7 @@
|
|
|
299
274
|
"name": "get",
|
|
300
275
|
"params": [
|
|
301
276
|
"resourceType",
|
|
277
|
+
"query",
|
|
302
278
|
"options",
|
|
303
279
|
"callback"
|
|
304
280
|
],
|
|
@@ -326,37 +302,21 @@
|
|
|
326
302
|
},
|
|
327
303
|
{
|
|
328
304
|
"title": "param",
|
|
329
|
-
"description": "
|
|
305
|
+
"description": "A query object that will limit what resources are retrieved when converted into request params.",
|
|
306
|
+
"type": {
|
|
307
|
+
"type": "NameExpression",
|
|
308
|
+
"name": "Object"
|
|
309
|
+
},
|
|
310
|
+
"name": "query"
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"title": "param",
|
|
314
|
+
"description": "Optional `options` to define URL parameters via params beyond filters, request configuration (e.g. `auth`) and DHIS2 api version to use.",
|
|
330
315
|
"type": {
|
|
331
316
|
"type": "OptionalType",
|
|
332
317
|
"expression": {
|
|
333
|
-
"type": "
|
|
334
|
-
"
|
|
335
|
-
{
|
|
336
|
-
"type": "FieldType",
|
|
337
|
-
"key": "apiVersion",
|
|
338
|
-
"value": {
|
|
339
|
-
"type": "NameExpression",
|
|
340
|
-
"name": "number"
|
|
341
|
-
}
|
|
342
|
-
},
|
|
343
|
-
{
|
|
344
|
-
"type": "FieldType",
|
|
345
|
-
"key": "operationName",
|
|
346
|
-
"value": {
|
|
347
|
-
"type": "NameExpression",
|
|
348
|
-
"name": "string"
|
|
349
|
-
}
|
|
350
|
-
},
|
|
351
|
-
{
|
|
352
|
-
"type": "FieldType",
|
|
353
|
-
"key": "responseType",
|
|
354
|
-
"value": {
|
|
355
|
-
"type": "NameExpression",
|
|
356
|
-
"name": "string"
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
]
|
|
318
|
+
"type": "NameExpression",
|
|
319
|
+
"name": "Object"
|
|
360
320
|
}
|
|
361
321
|
},
|
|
362
322
|
"name": "options"
|
|
@@ -383,8 +343,18 @@
|
|
|
383
343
|
},
|
|
384
344
|
{
|
|
385
345
|
"title": "example",
|
|
386
|
-
"description": "
|
|
387
|
-
"caption": "
|
|
346
|
+
"description": "get('dataValueSets', {\n dataSet: 'pBOMPrpg1QX',\n orgUnit: 'DiszpKrYNg8',\n period: '201401',\n fields: '*',\n});",
|
|
347
|
+
"caption": "all data values for the 'pBOMPrpg1QX' dataset"
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
"title": "example",
|
|
351
|
+
"description": "get('programs', { orgUnit: 'TSyzvBiovKh', fields: '*' });",
|
|
352
|
+
"caption": "all programs for an organization unit"
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
"title": "example",
|
|
356
|
+
"description": "get('trackedEntityInstances', {\n ou: 'DiszpKrYNg8',\n filter: ['flGbXLXCrEo:Eq:124', 'w75KJ2mc4zz:Eq:John'],\n});",
|
|
357
|
+
"caption": "a single tracked entity instance by a unique external ID"
|
|
388
358
|
}
|
|
389
359
|
]
|
|
390
360
|
},
|
|
@@ -394,6 +364,7 @@
|
|
|
394
364
|
"name": "upsert",
|
|
395
365
|
"params": [
|
|
396
366
|
"resourceType",
|
|
367
|
+
"query",
|
|
397
368
|
"data",
|
|
398
369
|
"options",
|
|
399
370
|
"callback"
|
|
@@ -413,7 +384,7 @@
|
|
|
413
384
|
},
|
|
414
385
|
{
|
|
415
386
|
"title": "param",
|
|
416
|
-
"description": "The type of a resource to `
|
|
387
|
+
"description": "The type of a resource to `upsert`. E.g. `trackedEntityInstances`",
|
|
417
388
|
"type": {
|
|
418
389
|
"type": "NameExpression",
|
|
419
390
|
"name": "string"
|
|
@@ -422,7 +393,16 @@
|
|
|
422
393
|
},
|
|
423
394
|
{
|
|
424
395
|
"title": "param",
|
|
425
|
-
"description": "
|
|
396
|
+
"description": "A query object that allows to uniquely identify the resource to update. If no matches found, then the resource will be created.",
|
|
397
|
+
"type": {
|
|
398
|
+
"type": "NameExpression",
|
|
399
|
+
"name": "Object"
|
|
400
|
+
},
|
|
401
|
+
"name": "query"
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
"title": "param",
|
|
405
|
+
"description": "The data to use for update or create depending on the result of the query.",
|
|
426
406
|
"type": {
|
|
427
407
|
"type": "NameExpression",
|
|
428
408
|
"name": "Object"
|
|
@@ -431,42 +411,34 @@
|
|
|
431
411
|
},
|
|
432
412
|
{
|
|
433
413
|
"title": "param",
|
|
434
|
-
"description": "
|
|
414
|
+
"description": "Optional configuration that will be applied to both the `get` and the `create` or `update` operations.",
|
|
435
415
|
"type": {
|
|
436
416
|
"type": "OptionalType",
|
|
437
417
|
"expression": {
|
|
438
418
|
"type": "RecordType",
|
|
439
419
|
"fields": [
|
|
440
|
-
{
|
|
441
|
-
"type": "FieldType",
|
|
442
|
-
"key": "replace",
|
|
443
|
-
"value": {
|
|
444
|
-
"type": "NameExpression",
|
|
445
|
-
"name": "boolean"
|
|
446
|
-
}
|
|
447
|
-
},
|
|
448
420
|
{
|
|
449
421
|
"type": "FieldType",
|
|
450
422
|
"key": "apiVersion",
|
|
451
423
|
"value": {
|
|
452
424
|
"type": "NameExpression",
|
|
453
|
-
"name": "
|
|
425
|
+
"name": "object"
|
|
454
426
|
}
|
|
455
427
|
},
|
|
456
428
|
{
|
|
457
429
|
"type": "FieldType",
|
|
458
|
-
"key": "
|
|
430
|
+
"key": "requestConfig",
|
|
459
431
|
"value": {
|
|
460
432
|
"type": "NameExpression",
|
|
461
|
-
"name": "
|
|
433
|
+
"name": "object"
|
|
462
434
|
}
|
|
463
435
|
},
|
|
464
436
|
{
|
|
465
437
|
"type": "FieldType",
|
|
466
|
-
"key": "
|
|
438
|
+
"key": "params",
|
|
467
439
|
"value": {
|
|
468
440
|
"type": "NameExpression",
|
|
469
|
-
"name": "
|
|
441
|
+
"name": "object"
|
|
470
442
|
}
|
|
471
443
|
}
|
|
472
444
|
]
|
|
@@ -504,24 +476,8 @@
|
|
|
504
476
|
},
|
|
505
477
|
{
|
|
506
478
|
"title": "example",
|
|
507
|
-
"description": "upsert(\n
|
|
479
|
+
"description": "upsert('trackedEntityInstances', {\n ou: 'TSyzvBiovKh',\n filter: ['w75KJ2mc4zz:Eq:Qassim'],\n}, {\n orgUnit: 'TSyzvBiovKh',\n trackedEntityType: 'nEenWmSyUEp',\n attributes: [\n {\n attribute: 'w75KJ2mc4zz',\n value: 'Qassim',\n },\n ],\n});",
|
|
508
480
|
"caption": "Example `expression.js` of upsert"
|
|
509
|
-
},
|
|
510
|
-
{
|
|
511
|
-
"title": "todo",
|
|
512
|
-
"description": "Tweak/refine to mimic implementation based on the following inspiration: {@link https://sqlite.org/lang_upsert.html sqlite upsert} and {@link https://wiki.postgresql.org/wiki/UPSERT postgresql upsert}"
|
|
513
|
-
},
|
|
514
|
-
{
|
|
515
|
-
"title": "todo",
|
|
516
|
-
"description": "Test implementation for upserting metadata"
|
|
517
|
-
},
|
|
518
|
-
{
|
|
519
|
-
"title": "todo",
|
|
520
|
-
"description": "Test implementation for upserting data values"
|
|
521
|
-
},
|
|
522
|
-
{
|
|
523
|
-
"title": "todo",
|
|
524
|
-
"description": "Implement the updateCondition"
|
|
525
481
|
}
|
|
526
482
|
]
|
|
527
483
|
},
|
|
@@ -575,7 +531,7 @@
|
|
|
575
531
|
{
|
|
576
532
|
"title": "example",
|
|
577
533
|
"description": "discover('post', '/trackedEntityInstances')",
|
|
578
|
-
"caption": "
|
|
534
|
+
"caption": "a list of parameters allowed on a given endpoint for specific http method"
|
|
579
535
|
}
|
|
580
536
|
]
|
|
581
537
|
},
|
|
@@ -587,7 +543,6 @@
|
|
|
587
543
|
"resourceType",
|
|
588
544
|
"path",
|
|
589
545
|
"data",
|
|
590
|
-
"params",
|
|
591
546
|
"options",
|
|
592
547
|
"callback"
|
|
593
548
|
],
|
|
@@ -633,7 +588,7 @@
|
|
|
633
588
|
},
|
|
634
589
|
{
|
|
635
590
|
"title": "param",
|
|
636
|
-
"description": "Optional
|
|
591
|
+
"description": "Optional configuration, including params for the update ({preheatCache: true, strategy: 'UPDATE', mergeMode: 'REPLACE'}). Defaults to `{operationName: 'patch', apiVersion: state.configuration.apiVersion, responseType: 'json'}`",
|
|
637
592
|
"type": {
|
|
638
593
|
"type": "OptionalType",
|
|
639
594
|
"expression": {
|
|
@@ -641,43 +596,6 @@
|
|
|
641
596
|
"name": "Object"
|
|
642
597
|
}
|
|
643
598
|
},
|
|
644
|
-
"name": "params"
|
|
645
|
-
},
|
|
646
|
-
{
|
|
647
|
-
"title": "param",
|
|
648
|
-
"description": "Optional options for update method. Defaults to `{operationName: 'patch', apiVersion: state.configuration.apiVersion, responseType: 'json'}`",
|
|
649
|
-
"type": {
|
|
650
|
-
"type": "OptionalType",
|
|
651
|
-
"expression": {
|
|
652
|
-
"type": "RecordType",
|
|
653
|
-
"fields": [
|
|
654
|
-
{
|
|
655
|
-
"type": "FieldType",
|
|
656
|
-
"key": "apiVersion",
|
|
657
|
-
"value": {
|
|
658
|
-
"type": "NameExpression",
|
|
659
|
-
"name": "number"
|
|
660
|
-
}
|
|
661
|
-
},
|
|
662
|
-
{
|
|
663
|
-
"type": "FieldType",
|
|
664
|
-
"key": "operationName",
|
|
665
|
-
"value": {
|
|
666
|
-
"type": "NameExpression",
|
|
667
|
-
"name": "string"
|
|
668
|
-
}
|
|
669
|
-
},
|
|
670
|
-
{
|
|
671
|
-
"type": "FieldType",
|
|
672
|
-
"key": "responseType",
|
|
673
|
-
"value": {
|
|
674
|
-
"type": "NameExpression",
|
|
675
|
-
"name": "string"
|
|
676
|
-
}
|
|
677
|
-
}
|
|
678
|
-
]
|
|
679
|
-
}
|
|
680
|
-
},
|
|
681
599
|
"name": "options"
|
|
682
600
|
},
|
|
683
601
|
{
|
|
@@ -702,20 +620,19 @@
|
|
|
702
620
|
},
|
|
703
621
|
{
|
|
704
622
|
"title": "example",
|
|
705
|
-
"description": "patch('dataElements', 'FTRrcoaog83'
|
|
706
|
-
"caption": "
|
|
623
|
+
"description": "patch('dataElements', 'FTRrcoaog83', { name: 'New Name' });",
|
|
624
|
+
"caption": "a dataElement"
|
|
707
625
|
}
|
|
708
626
|
]
|
|
709
627
|
},
|
|
710
628
|
"valid": true
|
|
711
629
|
},
|
|
712
630
|
{
|
|
713
|
-
"name": "
|
|
631
|
+
"name": "destroy",
|
|
714
632
|
"params": [
|
|
715
633
|
"resourceType",
|
|
716
634
|
"path",
|
|
717
635
|
"data",
|
|
718
|
-
"params",
|
|
719
636
|
"options",
|
|
720
637
|
"callback"
|
|
721
638
|
],
|
|
@@ -764,19 +681,7 @@
|
|
|
764
681
|
},
|
|
765
682
|
{
|
|
766
683
|
"title": "param",
|
|
767
|
-
"description": "Optional `
|
|
768
|
-
"type": {
|
|
769
|
-
"type": "OptionalType",
|
|
770
|
-
"expression": {
|
|
771
|
-
"type": "NameExpression",
|
|
772
|
-
"name": "Object"
|
|
773
|
-
}
|
|
774
|
-
},
|
|
775
|
-
"name": "params"
|
|
776
|
-
},
|
|
777
|
-
{
|
|
778
|
-
"title": "param",
|
|
779
|
-
"description": "Optional `options` for `del` operation. Defaults to `{operationName: 'delete', apiVersion: state.configuration.apiVersion, responseType: 'json'}`",
|
|
684
|
+
"description": "Optional `options` for `del` operation including params e.g. `{preheatCache: true, strategy: 'UPDATE', mergeMode: 'REPLACE'}`. Run `discover` or see {@link https://docs.dhis2.org/2.34/en/dhis2_developer_manual/web-api.html#create-update-parameters DHIS2 documentation}. Defaults to `{operationName: 'delete', apiVersion: state.configuration.apiVersion, responseType: 'json'}`",
|
|
780
685
|
"type": {
|
|
781
686
|
"type": "OptionalType",
|
|
782
687
|
"expression": {
|
|
@@ -833,18 +738,18 @@
|
|
|
833
738
|
},
|
|
834
739
|
{
|
|
835
740
|
"title": "example",
|
|
836
|
-
"description": "
|
|
837
|
-
"caption": "
|
|
741
|
+
"description": "destroy('trackedEntityInstances', 'LcRd6Nyaq7T');",
|
|
742
|
+
"caption": "a tracked entity instance"
|
|
838
743
|
}
|
|
839
744
|
]
|
|
840
745
|
},
|
|
841
746
|
"valid": true
|
|
842
747
|
},
|
|
843
748
|
{
|
|
844
|
-
"name": "
|
|
749
|
+
"name": "findAttributeValue",
|
|
845
750
|
"params": [
|
|
846
|
-
"
|
|
847
|
-
"
|
|
751
|
+
"trackedEntityInstance",
|
|
752
|
+
"attributeDisplayName"
|
|
848
753
|
],
|
|
849
754
|
"docs": {
|
|
850
755
|
"description": "Gets an attribute value by its case-insensitive display name",
|
|
@@ -856,7 +761,7 @@
|
|
|
856
761
|
},
|
|
857
762
|
{
|
|
858
763
|
"title": "example",
|
|
859
|
-
"description": "
|
|
764
|
+
"description": "findAttributeValue(state.data.trackedEntityInstances[0], 'first name')"
|
|
860
765
|
},
|
|
861
766
|
{
|
|
862
767
|
"title": "function",
|
|
@@ -870,7 +775,7 @@
|
|
|
870
775
|
"type": "NameExpression",
|
|
871
776
|
"name": "Object"
|
|
872
777
|
},
|
|
873
|
-
"name": "
|
|
778
|
+
"name": "trackedEntityInstance"
|
|
874
779
|
},
|
|
875
780
|
{
|
|
876
781
|
"title": "param",
|
|
@@ -879,7 +784,7 @@
|
|
|
879
784
|
"type": "NameExpression",
|
|
880
785
|
"name": "string"
|
|
881
786
|
},
|
|
882
|
-
"name": "
|
|
787
|
+
"name": "attributeDisplayName"
|
|
883
788
|
},
|
|
884
789
|
{
|
|
885
790
|
"title": "returns",
|
|
@@ -894,10 +799,10 @@
|
|
|
894
799
|
"valid": true
|
|
895
800
|
},
|
|
896
801
|
{
|
|
897
|
-
"name": "
|
|
802
|
+
"name": "attr",
|
|
898
803
|
"params": [
|
|
899
|
-
"
|
|
900
|
-
"
|
|
804
|
+
"attribute",
|
|
805
|
+
"value"
|
|
901
806
|
],
|
|
902
807
|
"docs": {
|
|
903
808
|
"description": "Converts an attribute ID and value into a DSHI2 attribute object",
|
|
@@ -909,7 +814,7 @@
|
|
|
909
814
|
},
|
|
910
815
|
{
|
|
911
816
|
"title": "example",
|
|
912
|
-
"description": "
|
|
817
|
+
"description": "attr('w75KJ2mc4zz', 'Elias')"
|
|
913
818
|
},
|
|
914
819
|
{
|
|
915
820
|
"title": "function",
|
|
@@ -923,7 +828,7 @@
|
|
|
923
828
|
"type": "NameExpression",
|
|
924
829
|
"name": "string"
|
|
925
830
|
},
|
|
926
|
-
"name": "
|
|
831
|
+
"name": "attribute"
|
|
927
832
|
},
|
|
928
833
|
{
|
|
929
834
|
"title": "param",
|
|
@@ -932,7 +837,60 @@
|
|
|
932
837
|
"type": "NameExpression",
|
|
933
838
|
"name": "string"
|
|
934
839
|
},
|
|
935
|
-
"name": "
|
|
840
|
+
"name": "value"
|
|
841
|
+
},
|
|
842
|
+
{
|
|
843
|
+
"title": "returns",
|
|
844
|
+
"description": null,
|
|
845
|
+
"type": {
|
|
846
|
+
"type": "NameExpression",
|
|
847
|
+
"name": "object"
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
]
|
|
851
|
+
},
|
|
852
|
+
"valid": true
|
|
853
|
+
},
|
|
854
|
+
{
|
|
855
|
+
"name": "dv",
|
|
856
|
+
"params": [
|
|
857
|
+
"dataElement",
|
|
858
|
+
"value"
|
|
859
|
+
],
|
|
860
|
+
"docs": {
|
|
861
|
+
"description": "Converts a dataElement and value into a DSHI2 dataValue object",
|
|
862
|
+
"tags": [
|
|
863
|
+
{
|
|
864
|
+
"title": "public",
|
|
865
|
+
"description": null,
|
|
866
|
+
"type": null
|
|
867
|
+
},
|
|
868
|
+
{
|
|
869
|
+
"title": "example",
|
|
870
|
+
"description": "dv('f7n9E0hX8qk', 12)"
|
|
871
|
+
},
|
|
872
|
+
{
|
|
873
|
+
"title": "function",
|
|
874
|
+
"description": null,
|
|
875
|
+
"name": null
|
|
876
|
+
},
|
|
877
|
+
{
|
|
878
|
+
"title": "param",
|
|
879
|
+
"description": "A data element ID.",
|
|
880
|
+
"type": {
|
|
881
|
+
"type": "NameExpression",
|
|
882
|
+
"name": "string"
|
|
883
|
+
},
|
|
884
|
+
"name": "dataElement"
|
|
885
|
+
},
|
|
886
|
+
{
|
|
887
|
+
"title": "param",
|
|
888
|
+
"description": "The value for that data element.",
|
|
889
|
+
"type": {
|
|
890
|
+
"type": "NameExpression",
|
|
891
|
+
"name": "string"
|
|
892
|
+
},
|
|
893
|
+
"name": "value"
|
|
936
894
|
},
|
|
937
895
|
{
|
|
938
896
|
"title": "returns",
|