Opermrs Error in creating new Encounter through rest API

Application Name: Bahmni, Version Number: 1.0.0-lite

Question: Hi, i am fairly new to openmrs and was trying to encounter through rest api /openmrs/ws/rest/v1/encounter

payload: { “encounterDatetime”: “2015-02-24T06:08:25.000+0000”, “patient”: “47763724-74b5-4108-8f41-2b4e1fba2b8c”, “encounterType”: “ba045c0c-f496-11ed-b02c-0242ac150003”, “location”: “833d0c66-e29a-4d31-ac13-ca9050d1bfa9”, “encounterProviders”: [ { “provider”: “bb1a7781-7896-40be-aaca-7d1b41d843a6”, “encounterRole”: “240b26f9-dd88-4172-823d-4a8bfeb7841f” } ], “visit”: { “patient”: “47763724-74b5-4108-8f41-2b4e1fba2b8c”, “visitType”: “13a5ea15-82bc-45ee-b07d-763c346e1cf5”, “startDatetime”: “2015-02-24T06:08:25.000+0000”, “stopDatetime” : “2015-02-24T06:09:25.000+0000” } } response:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log. Any hint or help would be greatly appreciated


Can you share the server side log via pastebin.com?

thanks for the reply, here it is openmrs-1 | Running Bahmnni EMR Startup Script...openmrs-1 | Substituting En - Pastebin.com

Does your database have a provider with this uuid? bb1a7781-7896-40be-aaca-7d1b41d843a6

thank you for the hint, i see “provider”: “bdeaa530-f496-11ed-b179-0242ac150003”, and “encounterRole”: “016fa510-350a-49e5-8cd1-2049e93b8a64” were the one missing from the database. i created them and its working. thanks

1 Like