Observation for creating diagnosis in visit note

As in the reference application, we can select diseases and mark

  1. Primary or Secondary
  2. Confirmed or not

I want to create the same in android client via rest but I am unable to figure out how to create an observation with the above entries. Right now, we only send concept value and answer in the observation for that encounter. How can we create it using REST, any information will be helpful

Current scenario of app

cc: @f4ww4z @gcliff @dkayiwa @ibacher @herbert24

Is there any test or code in core-module which I can look for help

trying to look for this may be @rishabh997 u can share were exactly in the reference application or a screenshot :slightly_smiling_face:

I want to implement this particular feature. I have figured out the way to get all the diagnoses using system properties, I just want to create diagnosis out of it.

can this be of help https://github.com/openmrs/openmrs-module-coreapps/search?q=Primary+Diagnosis&unscoped_q=Primary+Diagnosis

@rishabh997 Searching this will take you to HibernateDiagnosisDAO and DiagnosisDAO

Can you also look into DiagnosisResource2_2


@rishabh997 you can have a look at this to Adding diagnosis for a Patient using Rest API.

1 Like

I looked into all those files, I found something useful here at DiagnosisController2_2Test and this talk thread, but I still have few doubts:

  1. Is diagnosis created when we POST visit forms or it needs to be posted separately
  2. looking at the swagger, it says that I need to pass the query to get the diagnosis list, I tried passing patient UUID, patientId but it always returns empty result

Can you please confirm this @dkayiwa @herbert24 @ibacher

Which url are you posting to?


How does your post look like?

I haven’t created a POST, i am trying to find JSOn input… my doubt is that while creating visit note using REST, is diagnosis data sent in the visit note HTML Form, or first encounter is created using html form and then diagnosis is created using seperate REST

Did you try Chrome’s Developers Tools and take a look at the Network tab for the http requests made when you click that button?

1 Like