Error submitting vitals through REST

Application Name: Bahmni, OPENMRS Version Number: 1.0.0-lite Question: Hi ,Sorry for this silly question , i am new here and trying to get familiar with openmrs .comming to the question , I am trying to submit patient vitals through rest api POST /obs with the json request { “person”: “47763724-74b5-4108-8f41-2b4e1fba2b8c”, “obsDatetime”: “2016-10-08T09:39:28.000+0530”, “concept”: “163462AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA”, “location”: “833d0c66-e29a-4d31-ac13-ca9050d1bfa9”, “encounter”: “c8aeb8db-6791-4648-b9bc-fc4706a4b438”, “groupMembers”: [ { “concept”: “5089AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA”, “value”: 70 }, { “concept”: “5090AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA”, “value”: 170 }, { “concept”: “5088AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA”, “value”: 37.2 }, { “concept”: “5086AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA”, “value”: 80 }, { “concept”: “5092AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA”, “value”: 98 }, { “concept”: “5087AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA”, “value”: 75 }, { “concept”: “5085AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA”, “value”: 120 }, { “concept”: “5314AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA”, “value”: 50 }, { “concept”: “5283AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA”, “value”: 70 } ] } the main concept here with the uuid 163462AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA is Vital signs on admission with the field members Respiratory rate (15475) Weight (kg) Head circumference (15241) Karnofsky performance score (16238) Height (cm) Temperature (c) Diastolic blood pressure (16503) Arterial blood oxygen saturation (pulse oximeter) (16255) Pulse (16472) ,Systolic blood pressure (14644

the response i am getting is { “error”: { “message”: “Invalid Submission”, “code”: “webservices.rest.error.invalid.submission”, “globalErrors”: , “fieldErrors”: { “person”: [ { “code”: “error.null”, “message”: “Cannot be empty or null” }, { “code”: “error.null”, “message”: “Cannot be empty or null” }, { “code”: “error.null”, “message”: “Cannot be empty or null” }, { “code”: “error.null”, “message”: “Cannot be empty or null” }, { “code”: “error.null”, “message”: “Cannot be empty or null” }, { “code”: “error.null”, “message”: “Cannot be empty or null” }, { “code”: “error.null”, “message”: “Cannot be empty or null” }, { “code”: “error.null”, “message”: “Cannot be empty or null” }, { “code”: “error.null”, “message”: “Cannot be empty or null” } ], “obsDatetime”: [ { “code”: “error.null”, “message”: “Cannot be empty or null” }, { “code”: “error.null”, “message”: “Cannot be empty or null” }, { “code”: “error.null”, “message”: “Cannot be empty or null” }, { “code”: “error.null”, “message”: “Cannot be empty or null” }, { “code”: “error.null”, “message”: “Cannot be empty or null” }, { “code”: “error.null”, “message”: “Cannot be empty or null” }, { “code”: “error.null”, “message”: “Cannot be empty or null” }, { “code”: “error.null”, “message”: “Cannot be empty or null” }, { “code”: “error.null”, “message”: “Cannot be empty or null” } ] } } }

here is the server log 06) ~[webservices.rest-omod-common-2.39.0.jar:?]openmrs-1 | at sun.reflect - Pastebin.com **

I see this in your log: No concept found for 'c201b543-00a3-4f45-b4ee-684e7fe56782'

there is a field you have not filled which is marked as required as @dkayiwa has pointed out

please do make provide data for the concept and try it out again

i tried submitting vitals thrugh encounter and its working { “patient”: “47763724-74b5-4108-8f41-2b4e1fba2b8c”, “encounterType”: “a29ffb55-5e10-4b9a-930e-d8e8ad340f27”, “location”: “833d0c66-e29a-4d31-ac13-ca9050d1bfa9”, “encounterDatetime”: “2024-02-08T05:09:26.000Z”, “encounterProviders”: [ { “provider”: “bdeaa530-f496-11ed-b179-0242ac150003”, “encounterRole”: “016fa510-350a-49e5-8cd1-2049e93b8a64” } ], “visit”: “624bee6e-d5cb-44d8-aaa1-c078a01cea17”, “obs”: [ { “concept”: “5089AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA”, “value”: 70 }, { “concept”: “5090AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA”, “value”: 170 }, { “concept”: “5088AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA”, “value”: 37.2 }, { “concept”: “5086AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA”, “value”: 80 }, { “concept”: “5092AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA”, “value”: 98 }, { “concept”: “5087AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA”, “value”: 75 }, { “concept”: “5085AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA”, “value”: 120 }, { “concept”: “5314AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA”, “value”: 50 }, { “concept”: “5283AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA”, “value”: 70 } ] } , btw i couldnt figure out what c201b543-00a3-4f45-b4ee-684e7fe56782 is about

thanks for the ressponse joseph, yes but i couldnt figure what field that uuid is associated with. though i could enter vitals through encounter, it would be nice to know how to do it through obs

could you do a request for concept by uuid and then paste that uuid to check out what exactly it is so that you might make changes in post

1 Like

this resource could be a great way to explore and find what you want; OpenMRS Docs it show how the rest api works and the possible resquest plus all how to treat each concept

1 Like