if (ii.getCommunicationId() != null) {
Communication existingLog = em.find(Communication.class, ii.getCommunicationId());
if (existingLog.getHealthRecordId().compareTo(healthRecordId) == 0) {
ii.setDataSourceId(healthRecordId);
em.merge(ii);
persistenceSvc.commitTx();
} else {
logger.error("Non-matching HRID on merge attempt");
res = false;
}
} else {