-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #617 from OpenFn/dhis2-docs
`dhis2` update examples
- Loading branch information
Showing
4 changed files
with
51 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,25 @@ | ||
// ---- | ||
// Add data to data value sets in DHIS2 using a generic JSON message, submitted | ||
// by Taylor Downs @ OpenFn. | ||
// by Taylor Downs @ OpenFn. Co-authored by @mtuchi | ||
// --- | ||
|
||
dataValueSet( | ||
fields( | ||
field('dataSet', 'pBOMPrpg1QX'), | ||
field('orgUnit', 'DiszpKrYNg8'), | ||
field('period', '201401'), | ||
field('completeData', dataValue('form.date')), | ||
field('dataValues', function (state) { | ||
return [ | ||
dataElement('qrur9Dvnyt5', dataValue('form.prop_a')(state)), | ||
dataElement('oZg33kd9taw', dataValue('form.prop_b')(state)), | ||
dataElement('msodh3rEMJa', dataValue('form.prop_c')(state)), | ||
]; | ||
}) | ||
) | ||
); | ||
create('dataValueSets', { | ||
dataSet: 'pBOMPrpg1QX', | ||
completeDate: $.form.date, | ||
period: '201401', | ||
orgUnit: 'DiszpKrYNg8', | ||
dataValues: [ | ||
{ | ||
dataElement: 'f7n9E0hX8qk', | ||
value: $.form.prop_a, | ||
}, | ||
{ | ||
dataElement: 'Ix2HsbDMLea', | ||
value: $.form.prop_b, | ||
}, | ||
{ | ||
dataElement: 'eY5ehpbEsB7', | ||
value: $.form.prop_c, | ||
}, | ||
], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,30 @@ | ||
// ---- | ||
// Create new events in DHIS2 using a generic JSON message, submitted by | ||
// Taylor Downs @ OpenFn for demonstration porpoises. | ||
// Taylor Downs @ OpenFn, Co-authored by @mtuchi | ||
// --- | ||
|
||
event( | ||
fields( | ||
field('program', 'eBAyeGv0exc'), | ||
field('orgUnit', 'DiszpKrYNg8'), | ||
field('eventDate', dataValue('meta.date')), | ||
field('status', 'COMPLETED'), | ||
field('storedBy', 'admin'), | ||
field('coordinate', { | ||
latitude: '59.8', | ||
longitude: '10.9', | ||
}), | ||
field('dataValues', function (state) { | ||
return [ | ||
dataElement('qrur9Dvnyt5', dataValue('form.prop_a')(state)), | ||
dataElement('oZg33kd9taw', dataValue('form.prop_b')(state)), | ||
dataElement('msodh3rEMJa', dataValue('form.prop_c')(state)), | ||
]; | ||
}) | ||
) | ||
); | ||
create('events', { | ||
program: 'eBAyeGv0exc', | ||
orgUnit: 'DiszpKrYNg8', | ||
occurredAt: $.meta.date, | ||
status: 'COMPLETED', | ||
storedBy: 'admin', | ||
geometry: { | ||
type: 'POINT', | ||
coordinates: [59.8, 10.9], | ||
}, | ||
dataValues: [ | ||
{ | ||
dataElement: 'qrur9Dvnyt5', | ||
value: $.form.prop_a, | ||
}, | ||
{ | ||
dataElement: 'oZg33kd9taw', | ||
value: $.form.prop_b, | ||
}, | ||
{ | ||
dataElement: 'msodh3rEMJa', | ||
value: $.form.prop_c, | ||
}, | ||
], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
"generate-library": "docusaurus generate-library", | ||
"generate-adaptors": "docusaurus generate-adaptors", | ||
"start": "docusaurus generate-adaptors & docusaurus start", | ||
"start:dev": "docusaurus generate-adaptors -m && docusaurus start", | ||
"start:dev": "docusaurus generate-adaptors -m && docusaurus generate-library && docusaurus start", | ||
"start-offline": "docusaurus start", | ||
"build": "docusaurus build", | ||
"swizzle": "docusaurus swizzle", | ||
|
@@ -62,4 +62,4 @@ | |
"cytoscape": "3.28.1" | ||
}, | ||
"packageManager": "[email protected]" | ||
} | ||
} |