Adding diagnosis for a Patient using Rest API.

I want to add diagnosis for a Patient during encounter.What will be the payload/Object in this case.I have the idea how to add observation during encounter.But I am not able to understand how to add diagnosis for a patient.Posted Image for how I want it through my rest api.

Thanks in advance

Looking at this https://github.com/openmrs/openmrs-module-emrapi/blob/master/omod/src/main/java/org/openmrs/module/emrapi/web/controller/DiagnosisController.java i do not seet this supported yet.

You are free to add a post method.

Is there any other way of doing this thing .Right now I am currently focus on how to add diagnosis for a patient with in encounter.I think there will other way,I am searching for that payload.

If there is not other option.I will definately go for adding method in emp/api.

This form is basically to create an encounter, Encounter Type is VISIT_NOTE. Each action in this encounter is an observation. For example clinical Note. Clinical Note observation has a concept of “Text of encounter note”

The other observation here is “Add presumed or confirmed diagnosis” This observation will have a collection of observations as group member of “presumed or confirmed diagnosis”. There are three members(Concepts) in each group: a. Diagnosis certainty (Confirmed in the picture) b. Diagnosis order (Primary in the picture) c. PROBLEM LIST (Malaria, HIV in picture)

So this encounter has 2 Observations

1. Visit Note
2. Visit Diagnoses. Which is a collection of observation and each observation will have three members.
	a. Diagnosis certainty (Confirmed in the picture)
	b. Diagnosis order (Primary in the picture)
	c. PROBLEM LIST (Malaria, HIV in picture)

Let me know if you need JSON output for this encounter. I am here after a while so I have to get my project srunning to do that.

Thanks for the reply.It will really helpful if you give the JSON input and output for this api.

I tried creating a visit note as he suggested,

URI : /openmrs/ws/rest/v1/encounter

Method: POST

body: https://pastebin.com/FG8R8zeY

but I get 400:Bad Request everytime. Is there any input JSON that can be useful

Share the full error log.

Are you able to reproduce it here? https://qa-refapp.openmrs.org/openmrs/module/webservices/rest/test.htm

I get this error on qa-refapp: https://pastebin.com/ZAfb1kJu

Share details of the url you are posting to, post data, and parameters, if any.

URI : https://qa-refapp.openmrs.org/openmrs/ws/rest/v1/encounter

Method: POST

body: https://pastebin.com/FG8R8zeY

Where did you get the visitDiagnosis property from?

since there was no documentation for such, i followed this instruction

Which instruction?

this one, @jaks80 asked to create a observation for visitDiagnosis having following properties.