Restricting consultation forms based on patient status or provider?

Under the Clinical - Consultation area a list of all available forms can be pulled out with the little green button at the end. However some/many of these forms only make sense for particular types of patients. E.g. a male patient doesn’t need any maternal services or HIV followup forms should only be available once there was a HIV intake form.

I’m hoping that there is a way to filter this list of forms?

Thanks for your questions :slight_smile:

Currently there is only one way to filter the forms which is by Program. We maintain mapping between Program and Form in entity_mapping table. We do not have a UI for this yet. You can find some more details about similar things here -

We do intend to extend this approach to do this based on patient’s gender and perhaps age in future.

>> We do intend to extend this approach to do this based on patient’s gender and perhaps age in future. I should have said based on other contextual and key patient information. That could be based on gender, age, location, provider, etc.

Would this simplify that work in any way?

The documentation on creating Observation forms is here. Maybe it will help you:

Any form that is defined under the All Observations Template currently shows up as an available form. You can “PIN” the form to a provider, and from then on that form will always show up for that provider. That way, you can say – whenever I open the Observation Form page, I should always see this form. So, if I am a gynaecologist, I can choose to PIN the gynaecology form so I see it every time I consult a patient.

OK. This is already a good start. So I simply add the UUID of the program and the UUID of a form to this table?

And as a followup question to verify: This is only tied to the existence of a program enrolment and not tied to program workflow states or enrolment dates of the program enrolment. Is this correct?

I’m asking because ideally a form is not available when the program is in a particular state or the enrolment has already ended.

Hi Daniel, This module looks very good and appropriate for something like what I had in my mind. But I have couple of questions:

  • As I understand this supposed to be used for filtering forms. Does it have to be used only for filtering forms, can it be used for other things too, like display controls on patient/visit dashboard? Or to filter out available programs for a patient based on this? In other words can this be used as “Patient and Context Based Filter” for anything?
  • How widely is this module used? If we choose to use this, how freely we would be able to enhance this module?
  • Is this part of “extended core” of OpenMRS? As in, has this been maintained to work with latest versions of OpenMRS?

Thanks for pointing to this module.

Hi Vivek,

It was initially developed for only filtering forms. Adapting it for something else would require some development efforts. As to how widely used it is, am not sure. But if am to guess, i think not much. :slight_smile: You are completely free to take over the development of this module and extend it to whatever ways you see useful. I have not seen anyone develop it further from where the GSOC student left it.