I’m trying to create a new observation with REST services but I keep getting errors. When I post the data below
{
"concept": "67a71486-1a54-468f-ac3e-7091a9a79584",
"person": "24d85b48-ef69-4de0-91a4-e751bda85332",
"obsDatetime": "2017-05-17T11:00:03.783",
"encounter": "94d1e029-fc45-4601-b937-12a9c092c71a"
}
I get the error below,
{
"error": {
"message": "Invalid Submission",
"code": "webservices.rest.error.invalid.submission",
"globalErrors": [
{
"code": "error.noValue",
"message": "error.noValue"
}
],
"fieldErrors": {
"concept": [
{
"code": "error.null",
"message": "Cannot be empty or null"
}
]
}
}
}
When I post the following data,
{
"concept": "67a71486-1a54-468f-ac3e-7091a9a79584",
"person": "24d85b48-ef69-4de0-91a4-e751bda85332",
"obsDatetime": "2017-05-17T11:00:03.783",
"encounter": "94d1e029-fc45-4601-b937-12a9c092c71a",
"value": "Something text here or concept uuid"
}
I get the following error.
{
"error": {
"message": "[value on class org.openmrs.Obs]",
"code": "org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource:748",
"detail": "org.openmrs.module.webservices.rest.web.response.ConversionException: value on class org.openmrs.Obs\n\tat
}
}
It’s the same code I use when updating an observation, only that I change the url that I make the request to. I don’t seem to find the problem. Please advise.