Skip to main content

Create TEI (dhis2)

This job was provided by an OpenFn.org user via the job library API.

Metadataโ€‹

Key Functionsโ€‹

createTEI, dataValue

Expressionโ€‹

createTEI({
orgUnit: 'DiszpKrYNg8',
trackedEntityType: 'nEenWmSyUEp',
program: 'uy2gU8kT1jF',
attributes: [
{ attribute: 'zDhUuAYrxNC', value: dataValue('body.Patient_name') },
{ attribute: 'w75KJ2mc4zz', value: dataValue('body.Last_Name_of_Patient') },
],
enrollments: [
{
orgUnit: 'DiszpKrYNg8',
program: 'uy2gU8kT1jF',
programState: 'oRySG82BKE6', // active
enrollmentDate: dataValue('body.Date'),
incidentDate: dataValue('body.Date'),
},
],
});