Help using Event module

Tags: #<Tag:0x00007fddfcaa19a0> #<Tag:0x00007fddfcaa1838> #<Tag:0x00007fddfcaa16d0>

Do someone knows how to use the OpenMRS event module 2.6.0.

It is said on the documentation that to use the module, you need to call Event.subscribe(Class, String, EventListener); But i don’t know what Class is for, i just know that it must be a subclasses of OpenmrsObject. So i tried to use the second constructor :Event.subscribe(String, EventListener); but i got nothing on my EventListener instance after a patient creation. Is there any example that show how to use it? Thank you in advance

Did you some how figure this out? I see that you created another post here: Error when Event occurs

Hi @dkayiwa, I’m still searching how to achieve that. I still got that same error.

It is the class whose events you are subscribing to. Examples could be Patient.class, Obs.class, Encounter.class

Here is an example of a module subscribing to the encounter class to be notified whenever an encounter is created: