Limit Creation of Encounters when using HTMLFORMs

This just a solution to a situation where someone would want to fill only one encounter for the patient in his/her life time and only be able to edit if one already exists other than creating new. I have tested that and it works! But another question is related to this Single encounter per visit, have you attempted accomplishing that in refApp?