Cascade Dropdown List

Dear DHIS2 Community,

I am from Cambodia, and I am quite new to DHIS2. I am going to use DHIS2 for notifiable disease surveillance. I want to make a cascade dropdown to filter address of patients in Event Capture. Example, I select a province, the next question will show only district under the selected province. When I select a district, then only communes under district show. And when I select a commune, only villages under the select commune show.

I use DHIS2 V41. I tried to pull data (province, district, commune, and village) from API and make filtering in program custom form. But it does not work.

Could you tell me the possible way to make cascade dropdown list for event capture app?

Thank you in advance for your help.

Best regards,
Dom

Hi @Dom_Peou

Welcome to the DHIS2 Community of Practice! It’s great to hear that you are working on DHIS2 and I hope that this forum will help you become more familiar with DHIS2.

It’s recommended to use the Capture app instead of the legacy apps. The Tracker and Event Capture apps are deprecated, so please make sure to use the Capture app. What version of DHIS2 are you using?

Is this for Data Analysis or Data Entry? It’s not clear what is the purpose of this dropdown you are trying to create. If this is for Data Analysis, you can use the Data Visualizer app to show the data for each OU level (province, district…etc).

However, if this is for data entry, please explain the process? When entering data, you will have the option to select the OU after program selection.

Thanks!

Dear Gassim,

Thank you so much for your quick response.

The purpose of making cascade dropdown list is to make it easy during data entry of individual patient case.

We have collected data of patient address (including province, district, commune and village). We have to enter the address of each patient in data entry form. If we can make cascade dropdown list (Example: When I select a province of province dropdown list, then next question of district only shows the district under selected province. When I selected a district of district dropdown list, the next question of commune shows only commune under selected district. For the village is the same pattern).

I use DHIS2 V41.4.2.
I am looking forward to hearing form you.

Best regards,
Dom

1 Like

Hi again @Dom_Peou!

I see your point here. The patient address is not the same as the OU (health facility).

If I understand correctly, you want the same / similar format as the OU selection process but in the capture form itself:

It is possible to have the same exact hierarchy as an Organization Unit data element or tracked entity attribute which is then added to a program stage or the enrollment attributes. See screenshot below:

If it is possible to create an OU structure in your instance (or use the existing one) then you have saved yourself from a lot of complicated program rules.

The other option would be to use multi-select optionsets and control their appearance using program rules. See here for example on how to use program rules with multi-select optionsets: Defining program rules for multiselect questions in dhis2 - #3 by Gassim

Whatever your next steps would be, I hope this helps. It’d be great if you provide an update on your next steps too.

Thank you!