We have created a mobile client for our implementation,i.e, UgandaEMR . Ideally, the mobile client must be able to sync data to and from the facility EMR provided there is a network connection.
We have already worked on the synching of data from the EMR to the Mobile device, however, the challenge is sending data back to the EMR from the mobile device.
We are using the endpoint https://demo.openmrs.org/openmrs/ws/rest/v1/encountertype/67a71486-1a54-468f-ac3e-7091a9a79584 for encounters as explained here https://demo.openmrs.org/openmrs/module/webservices/rest/apiDocs.htm.
The Post Body i.e, content to send to the EMR is here https://gist.github.com/solemabrothers/d993c2f73b81fb50786bd451d48e4526
The error message is [obs on class org.openmrs.EncounterType as shown here https://gist.github.com/solemabrothers/695df51a2aa7ff1a758558104bcd5867
I need advice on how to solve this error. Thank you. @dkayiwa @ssmusoke @wyclif @mozzy
sorry about the error
i see the url end point you are using is for an encountertype, if you are aiming at creating an encounter then the url should be something like this http://localhost:8087/openmrs/ws/rest/v1/encounter and the post payload probably like this
"encounterDatetime": "2019-10-16 12:08:43",
thats why the obs attribute is not being understood on the
class org.openmrs.EncounterType because the EncounterType only takes in name and description attributes …
Feel free to correct me if i have gooten your question wrongly
@gcliff I need to send obs along with the encounter, running the above json body gives this error message
"message": "Invalid Submission",
"message": "Patient is Required"