@Override
 public Encounter save(Encounter delegate) {
   // This is a hack to save encounterProviders correctly. Without this they are created without
   // encounter_id in
   // the database.
   for (EncounterProvider ep : delegate.getEncounterProviders()) {
     ep.setEncounter(delegate);
   }
   Context.getEncounterService().saveEncounter(delegate);
   return delegate;
 }
 /**
  * @return copied encounter provider
  * @should copy all EncounterProvider data
  */
 public EncounterProvider copy() {
   EncounterProvider target = new EncounterProvider();
   target.setChangedBy(getChangedBy());
   target.setCreator(getCreator());
   target.setDateChanged(getDateChanged());
   target.setDateCreated(getDateCreated());
   target.setDateVoided(getDateVoided());
   target.setVoided(getVoided());
   target.setVoidedBy(getVoidedBy());
   target.setVoidReason(getVoidReason());
   target.setEncounter(getEncounter());
   target.setEncounterRole(getEncounterRole());
   target.setProvider(getProvider());
   return target;
 }