How to achieve "Form is already filled for this treatment" to prevent a form being filled twice in a visit

I have a form and i want it to be filled once at the initial stage of the patient how do I achieve that?

One way to do this is to check if you already have an encounter of that particular type and date in a lookup tag and check if the number of encounters is zero(checking if there encounter is already saved). if it is not equal to zero, it means this form had already been filled… then you can redirect to an edit URL of the same form.NOTE This URL should be one that enables to edit the same form filled on that encounter date.