Hi all,
I am working on modifying Bahmni atomfeed module for one of our project where we need to get notified of updates into OpenMRS system (Bahmni's Atom Feed module in the OpenMRS module repo?). Our system also keeps pushing data to OpenMRS via REST which offcourse we dont want to get back again.
The module have a Spring Advice on “savePatient” method of PatientService. This method is called whenever a patient record is inserted or updated.
We want this method to skip creating atomfeed incases when patient is created from a our own system. This works fine for new data as for those we send a particular patient identifier, but for updates we are unable to find where does update request come from!
A hacky solution could be to skip atomfeeds for patient data updates done form a specific user role (daemon service user) but then patient`s ‘ChangedBy’ doesnot get updated everytime. For example incase of updating address it does not set ‘ChangedBy’ but savePatient method is called. This is also true for updates to patient_identifier.
Is there any property that would be consistent for all objects and can be used to seggregate “data entered by user”? Or w should move advice to any level (Hibernate or REST)