How to conditionally display forms

@darius Hi could you please spare a moment to look into my above post to check whether the followed approached is correct.

@dkayiwa and I were discussing about the issue on here.

@gayanw did you actually look at that constructor to see that it gets only the id and label but ignore the rest? Is this what you want to happen? :slight_smile:

Yes it is. See here in config.xml.

I guess that so far this dependency only used from JS code. So, to use it in Java code you’re going to need to add a maven dependency in pom.xml

And, you have to use the SimpleObject class from webservices.rest, with the convertToRepresentation method. (SimpleObject in uiframework is something completely different.)

@ssmusoke Did you get to implement this?

@aeze is this one of your other requirements?

@ssmusoke did you get to implement this? We currently have similar experience in Nigeria and looking to know if you or anyone have done this.

@caniekwe Please describe in more detail what you are trying to do

@ssmusoke @dkayiwa In Nigeria, we have forms we expect to be completed before documenting other forms. For example, We have an enrollment form that collects certain patients baseline information, we want to enforce these forms are completed on the initial encounter before any other encounter details or forms can be completed for the patient. we want to be able to do the following:

  1. Disable all other forms until this baseline form is completed and
  2. Ensure this form is not completed twice
  1. We have an ART Summary Encounter which is the enrollment encounter, which is only done once - so we use the code here to return the user to the dashboard if this encounter has not been completed
  1. For the ART Summary page, we check if this encounter has been entered and forward to the edit version of the page, only one version therefore can exist

These are gleamed from OpenMRS HTML Form Entry module Javascript reference

https://wiki.openmrs.org/display/docs/HTML+Form+Entry+JavaScript+Reference

Thank you @ssmusoke. we will try this and see if this works for our implementation. @nsanmi

@caniekwe remember to change the uuids to what you have and let me know if your run into any issues