We are working on creating a simple tool to automate how we setup data elements on a dhis2 instance.
We are using a rest client to post json to the endpoint /api/dataElements to create an element.
We are using the demo instance to test and it gives us an interesting error about a failed not null constraint on the column valuetype. This also happens when we provided values e.g valuetype:string or valueType:string , has anyone else experienced the same ? Or could you guide us on how we can get around this problem.
We have a schema-generator at /api/schemas/type (/api/schemas/dataElement), sadly this is not done yet, as possible options for enums etc are not listed.
The only real solution to this today, is to create a few data-elements that has the options you want to import, then go to /api/dataElement/ID and export it… and look at the payload.
···
–
Morten
On Mon, Aug 25, 2014 at 6:38 PM, James Muranga jmured@gmail.com wrote:
Hello,
Hope everyone is okay.
We are working on creating a simple tool to automate how we setup data elements on a dhis2 instance.
We are using a rest client to post json to the endpoint /api/dataElements to create an element.
We are using the demo instance to test and it gives us an interesting error about a failed not null constraint on the column valuetype. This also happens when we provided values e.g valuetype:string or valueType:string , has anyone else experienced the same ? Or could you guide us on how we can get around this problem.
Thanks Morten , the schemas endpoint is what we were looking for .
We can view the options for enum from the dhis2 web interface for now .
Thanks
···
On Mon, Aug 25, 2014 at 2:48 PM, Morten Olav Hansen mortenoh@gmail.com wrote:
Hi James
We have a schema-generator at /api/schemas/type (/api/schemas/dataElement), sadly this is not done yet, as possible options for enums etc are not listed.
The only real solution to this today, is to create a few data-elements that has the options you want to import, then go to /api/dataElement/ID and export it… and look at the payload.
–
Muranga James
–
Morten
On Mon, Aug 25, 2014 at 6:38 PM, James Muranga jmured@gmail.com wrote:
Hello,
Hope everyone is okay.
We are working on creating a simple tool to automate how we setup data elements on a dhis2 instance.
We are using a rest client to post json to the endpoint /api/dataElements to create an element.
We are using the demo instance to test and it gives us an interesting error about a failed not null constraint on the column valuetype. This also happens when we provided values e.g valuetype:string or valueType:string , has anyone else experienced the same ? Or could you guide us on how we can get around this problem.
On Mon, Aug 25, 2014 at 2:48 PM, Morten Olav Hansen mortenoh@gmail.com wrote:
Hi James
We have a schema-generator at /api/schemas/type (/api/schemas/dataElement), sadly this is not done yet, as possible options for enums etc are not listed.
The only real solution to this today, is to create a few data-elements that has the options you want to import, then go to /api/dataElement/ID and export it… and look at the payload.
–
Muranga James
–
Morten
On Mon, Aug 25, 2014 at 6:38 PM, James Muranga jmured@gmail.com wrote:
Hello,
Hope everyone is okay.
We are working on creating a simple tool to automate how we setup data elements on a dhis2 instance.
We are using a rest client to post json to the endpoint /api/dataElements to create an element.
We are using the demo instance to test and it gives us an interesting error about a failed not null constraint on the column valuetype. This also happens when we provided values e.g valuetype:string or valueType:string , has anyone else experienced the same ? Or could you guide us on how we can get around this problem.
On Mon, Aug 25, 2014 at 2:48 PM, Morten Olav Hansen mortenoh@gmail.com wrote:
Hi James
We have a schema-generator at /api/schemas/type (/api/schemas/dataElement), sadly this is not done yet, as possible options for enums etc are not listed.
The only real solution to this today, is to create a few data-elements that has the options you want to import, then go to /api/dataElement/ID and export it… and look at the payload.
–
Muranga James
–
Morten
On Mon, Aug 25, 2014 at 6:38 PM, James Muranga jmured@gmail.com wrote:
Hello,
Hope everyone is okay.
We are working on creating a simple tool to automate how we setup data elements on a dhis2 instance.
We are using a rest client to post json to the endpoint /api/dataElements to create an element.
We are using the demo instance to test and it gives us an interesting error about a failed not null constraint on the column valuetype. This also happens when we provided values e.g valuetype:string or valueType:string , has anyone else experienced the same ? Or could you guide us on how we can get around this problem.