/** Default constructor, sets up the listener name and the list of events to subscribe to. */ public PatientEventListener() { super("phenotips-patient-indexer", new PatientChangedEvent(), new PatientDeletedEvent()); }
/** Default constructor, sets up the listener name and the list of events to subscribe to. */ public LimsSynchronizationEventListener() { super("lims247sync", new PatientChangedEvent(), new PatientDeletedEvent()); }
@Override public void onEvent(Event event, Object source, Object data) { XWikiDocument doc = (XWikiDocument) source; BaseObject patientRecordObj = doc.getXObject(Patient.CLASS_REFERENCE); if (patientRecordObj == null || "PatientTemplate".equals(doc.getDocumentReference().getName())) { return; } Patient patient = this.repo.load(doc); User user = this.userManager.getCurrentUser(); this.observationManager.notify(new PatientChangedEvent(patient, user), source); // FIXME Send a diff as the notification data } }
@Override public void onEvent(Event event, Object source, Object data) { XWikiDocument doc = (XWikiDocument) source; BaseObject patientRecordObj = doc.getXObject(Patient.CLASS_REFERENCE); if (patientRecordObj == null || "PatientTemplate".equals(doc.getDocumentReference().getName())) { return; } Patient patient = this.repo.load(doc); User user = this.userManager.getCurrentUser(); this.observationManager.notify(new PatientChangedEvent(patient, user), source); // FIXME Send a diff as the notification data } }
@Override public void onEvent(Event event, Object source, Object data) { XWikiDocument doc = (XWikiDocument) source; BaseObject patientRecordObj = doc.getXObject(Patient.CLASS_REFERENCE); if (patientRecordObj == null || "PatientTemplate".equals(doc.getDocumentReference().getName())) { return; } Patient patient = this.repo.load(doc); User user = this.userManager.getCurrentUser(); this.observationManager.notify(new PatientCreatedEvent(patient, user), source); this.observationManager.notify(new PatientChangedEvent(patient, user), source); } }
@Override public void onEvent(Event event, Object source, Object data) { XWikiDocument doc = (XWikiDocument) source; BaseObject patientRecordObj = doc.getXObject(Patient.CLASS_REFERENCE); if (patientRecordObj == null || "PatientTemplate".equals(doc.getDocumentReference().getName())) { return; } Patient patient = this.repo.load(doc); User user = this.userManager.getCurrentUser(); this.observationManager.notify(new PatientCreatedEvent(patient, user), source); this.observationManager.notify(new PatientChangedEvent(patient, user), source); } }