Ensure each patient only has one form entered

Is there a way to ensure that a patient only has one type of form entered eg a study consent form (One should be able to track the changes to a form , but each patient should only have one of these entered)

+1 if you can limit editing of this form in future once a criteria has been met eg a patient has been enrolled in a study and now cannot have their consent changed ?

cc @darius @ball @dkayiwa @burke

Dear @judy, If you’re using HTML forms, you could use some JavaScript to prevent a given type of form from being entered multiple times or edited. I did something like this to make my Vaccination form automatically go to edit when opened, you could re-direct to the view version of the form instead so the average user wouldn’t be able to make changes to the form if it already exists.

See my comment on the page https://wiki.openmrs.org/display/docs/HTML+Form+Entry+JavaScript+Reference from October 2014 for a starting point on the JavaScript code.

Good luck!

Thanks @arbaughj – @dkayiwa is there anything similar to this for xforms

My forms are already in xforms and am not very motivated to rewrite them in html

@Judy,

I could add this do the xforms module via a global property/setting. Do you want to do it for just a certain form? Or all forms?

You should specify the form you want to be only one form entered — so when a user select that form it should open the saved form and allow you to edit the saved form

Maybe an additional should be do not edit for locked form

I am not sure of how best to tackle this

Judy,

I have just sent an updated module to your gmail account. There is a setting/global property named “xforms.singleEntryForms” Set it to a comma separated list of the ids of the forms you want to behave like this. e.g 7,6,8 Then test it out and tell if it works. If it happens to work, show your appreciation by updating the documentation with this functionality. :slight_smile:

1 Like