Hide form of patient based on first and second visit

FLHW user creates the patient .
FLHW fills 2 form for one patient i.e( Enrollment form & Follow up form)
In the first visit of patient , only Enrollment form should be shown & follow-up form should be hidden.

Only after Enrollment form is filled ,follow-up form should appear . (1st visit of patient )

When Follow-up form appears , Enrollment form should be hidden. (2nd visit of patient )

It would be better if you provide some github link(code ) ,if some-one has already done it previously

Hi @Sanjit7,

We can make use of the context in contact-summary to achieve this behavior. As you can find here:

To show an App Form on a contact’s profile, the form’s expression field in its properties file must evaluate to true for that contact. The context information from the profile is accessible as the variable summary.

Since you are looking for specific examples, here are some:

In contact-summary.templates.js, you define the context:

In the app form’s properties.json, you set the expression:

In the above examples, you can see how the pregnancy and delivery forms are shown/hidden from the available actions.

In your case, the functions can be much simpler. Here is an example:

I hope the above examples are helpful.

1 Like