Skip to content

Instantly share code, notes, and snippets.

@joeljerushan
Last active December 19, 2020 05:38
Show Gist options
  • Save joeljerushan/c9cd01d02d19522503d689a7496b0e96 to your computer and use it in GitHub Desktop.
Save joeljerushan/c9cd01d02d19522503d689a7496b0e96 to your computer and use it in GitHub Desktop.
PCR Registration Payload
let data = {
"trackedEntityType": "SXtGAk7eCxX",
"orgUnit": set.props.org,
"attributes": [
{ "attribute": "gvP9uZqEtM5", "value": set.state.name },
{ "attribute": "DDleOZ1LGAq", "value": set.state.gender },
{ "attribute": "Js9Vbj0osNl", "value": set.state.age },
{ "attribute": "pNOTaJeFbPo", "value": set.state.address },
{ "attribute": "GO2w5l0aFjl", "value": set.props.moh },
{ "attribute": "ihz1qXLws99", "value": set.state.telephone },
],
"enrollments":[{
"orgUnit": set.props.org,
"program": "Fj4rOZSzWDn", //fixed for registration
"enrollmentDate": current_date,
"incidentDate": current_date,
"events":[
{
"program": "Fj4rOZSzWDn", //fixed for registration first event
"orgUnit": set.props.org,
"eventDate": current_date,
"status": "ACTIVE", //COMPLETED when assigned on MOH
"programStage": "kQj2iKdzmiP", //fixed!
"dataValues": [
{
//Registration date
"dataElement": "mbGLDFlEeDF",
"value": current_date
},
{
//PCR Type set
"dataElement": "qKLzcZsNFQ5", //sample type - combo box
"value": set.state.type
},
{
//Unique id for future referenece
"dataElement": "pqNsIquwP6B",
"value": UUID //we have to generate it
},
]
},
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment