nus-yam/ex-repair huggingface dataset:
Program: 23714
Project: 23714
Buggy source:
public org.hl7.fhir.dstu2.model.Composition convertComposition(org.hl7.fhir.dstu3.model.Composition src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Composition tgt=new org.hl7.fhir.dstu2.model.Composition();
  copyDomainResource(src,tgt);
  tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
  tgt.setDate(src.getDate());
  tgt.setType(convertCodeableConcept(src.getType()));
  tgt.setClass_(convertCodeableConcept(src.getClass_()));
  tgt.setTitle(src.getTitle());
  tgt.setStatus(convertCompositionStatus(src.getStatus()));
  tgt.setConfidentiality(src.getConfidentiality().toCode());
  tgt.setSubject(convertReference(src.getSubject()));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getAuthor())   tgt.addAuthor(convertReference(t));
  for (  org.hl7.fhir.dstu3.model.Composition.CompositionAttesterComponent t : src.getAttester())   tgt.addAttester(convertCompositionAttesterComponent(t));
  tgt.setCustodian(convertReference(src.getCustodian()));
  for (  org.hl7.fhir.dstu3.model.Composition.CompositionEventComponent t : src.getEvent())   tgt.addEvent(convertCompositionEventComponent(t));
  tgt.setEncounter(convertReference(src.getEncounter()));
  for (  org.hl7.fhir.dstu3.model.Composition.SectionComponent t : src.getSection())   tgt.addSection(convertSectionComponent(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Composition convertComposition(org.hl7.fhir.dstu3.model.Composition src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Composition tgt=new org.hl7.fhir.dstu2.model.Composition();
  copyDomainResource(src,tgt);
  tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
  tgt.setDate(src.getDate());
  tgt.setType(convertCodeableConcept(src.getType()));
  tgt.setClass_(convertCodeableConcept(src.getClass_()));
  tgt.setTitle(src.getTitle());
  tgt.setStatus(convertCompositionStatus(src.getStatus()));
  tgt.setConfidentiality(src.getConfidentiality().toCode());
  tgt.setSubject(convertReference(src.getSubject()));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getAuthor())   tgt.addAuthor(convertReference(t));
  for (  org.hl7.fhir.dstu3.model.Composition.CompositionAttesterComponent t : src.getAttester())   tgt.addAttester(convertCompositionAttesterComponent(t));
  tgt.setCustodian(convertReference(src.getCustodian()));
  for (  org.hl7.fhir.dstu3.model.Composition.CompositionEventComponent t : src.getEvent())   tgt.addEvent(convertCompositionEventComponent(t));
  tgt.setEncounter(convertReference(src.getEncounter()));
  for (  org.hl7.fhir.dstu3.model.Composition.SectionComponent t : src.getSection())   tgt.addSection(convertSectionComponent(t));
  return tgt;
}
Program: 23715
Project: 23715
Buggy source:
public org.hl7.fhir.dstu2.model.Appointment convertAppointment(org.hl7.fhir.dstu3.model.Appointment src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Appointment tgt=new org.hl7.fhir.dstu2.model.Appointment();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setStatus(convertAppointmentStatus(src.getStatus()));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getServiceType())   tgt.setType(convertCodeableConcept(t));
  tgt.setReason(convertCodeableConcept(src.getReason()));
  tgt.setPriority(src.getPriority());
  tgt.setDescription(src.getDescription());
  tgt.setStart(src.getStart());
  tgt.setEnd(src.getEnd());
  tgt.setMinutesDuration(src.getMinutesDuration());
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getSlot())   tgt.addSlot(convertReference(t));
  tgt.setComment(src.getComment());
  for (  org.hl7.fhir.dstu3.model.Appointment.AppointmentParticipantComponent t : src.getParticipant())   tgt.addParticipant(convertAppointmentParticipantComponent(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Appointment convertAppointment(org.hl7.fhir.dstu3.model.Appointment src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Appointment tgt=new org.hl7.fhir.dstu2.model.Appointment();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setStatus(convertAppointmentStatus(src.getStatus()));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getServiceType())   tgt.setType(convertCodeableConcept(t));
  tgt.setReason(convertCodeableConcept(src.getReason()));
  tgt.setPriority(src.getPriority());
  tgt.setDescription(src.getDescription());
  tgt.setStart(src.getStart());
  tgt.setEnd(src.getEnd());
  tgt.setMinutesDuration(src.getMinutesDuration());
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getSlot())   tgt.addSlot(convertReference(t));
  tgt.setComment(src.getComment());
  for (  org.hl7.fhir.dstu3.model.Appointment.AppointmentParticipantComponent t : src.getParticipant())   tgt.addParticipant(convertAppointmentParticipantComponent(t));
  return tgt;
}
Program: 23716
Project: 23716
Buggy source:
public org.hl7.fhir.dstu2.model.Bundle.BundleEntryRequestComponent convertBundleEntryRequestComponent(org.hl7.fhir.dstu3.model.Bundle.BundleEntryRequestComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Bundle.BundleEntryRequestComponent tgt=new org.hl7.fhir.dstu2.model.Bundle.BundleEntryRequestComponent();
  copyElement(src,tgt);
  tgt.setMethod(convertHTTPVerb(src.getMethod()));
  tgt.setUrl(src.getUrl());
  tgt.setIfNoneMatch(src.getIfNoneMatch());
  tgt.setIfModifiedSince(src.getIfModifiedSince());
  tgt.setIfMatch(src.getIfMatch());
  tgt.setIfNoneExist(src.getIfNoneExist());
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Bundle.BundleEntryRequestComponent convertBundleEntryRequestComponent(org.hl7.fhir.dstu3.model.Bundle.BundleEntryRequestComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Bundle.BundleEntryRequestComponent tgt=new org.hl7.fhir.dstu2.model.Bundle.BundleEntryRequestComponent();
  copyElement(src,tgt);
  tgt.setMethod(convertHTTPVerb(src.getMethod()));
  tgt.setUrl(src.getUrl());
  tgt.setIfNoneMatch(src.getIfNoneMatch());
  tgt.setIfModifiedSince(src.getIfModifiedSince());
  tgt.setIfMatch(src.getIfMatch());
  tgt.setIfNoneExist(src.getIfNoneExist());
  return tgt;
}
Program: 23717
Project: 23717
Buggy source:
public org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationComponent convertDeviceMetricCalibrationComponent(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationComponent tgt=new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationComponent();
  copyElement(src,tgt);
  tgt.setType(convertDeviceMetricCalibrationType(src.getType()));
  tgt.setState(convertDeviceMetricCalibrationState(src.getState()));
  tgt.setTime(src.getTime());
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationComponent convertDeviceMetricCalibrationComponent(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationComponent tgt=new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationComponent();
  copyElement(src,tgt);
  tgt.setType(convertDeviceMetricCalibrationType(src.getType()));
  tgt.setState(convertDeviceMetricCalibrationState(src.getState()));
  tgt.setTime(src.getTime());
  return tgt;
}
Program: 23718
Project: 23718
Buggy source:
public org.hl7.fhir.dstu2.model.ProcessResponse convertProcessResponse(org.hl7.fhir.dstu3.model.ProcessResponse src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.ProcessResponse tgt=new org.hl7.fhir.dstu2.model.ProcessResponse();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  if (src.hasRequestReference())   tgt.setRequest((org.hl7.fhir.dstu2.model.Reference)convertType(src.getRequest()));
  tgt.setOutcome(convertCoding(src.getOutcome()));
  tgt.setDisposition(src.getDisposition());
  tgt.setRuleset(convertCoding(src.getRuleset()));
  tgt.setOriginalRuleset(convertCoding(src.getOriginalRuleset()));
  tgt.setCreated(src.getCreated());
  if (src.hasOrganizationReference())   tgt.setOrganization((org.hl7.fhir.dstu2.model.Reference)convertType(src.getOrganization()));
  if (src.hasRequestProviderReference())   tgt.setRequestProvider((org.hl7.fhir.dstu2.model.Reference)convertType(src.getRequestProvider()));
  if (src.hasRequestOrganizationReference())   tgt.setRequestOrganization((org.hl7.fhir.dstu2.model.Reference)convertType(src.getRequestOrganization()));
  tgt.setForm(convertCoding(src.getForm()));
  for (  org.hl7.fhir.dstu3.model.ProcessResponse.ProcessResponseNotesComponent t : src.getNotes())   tgt.addNotes(convertProcessResponseNotesComponent(t));
  for (  org.hl7.fhir.dstu3.model.Coding t : src.getError())   tgt.addError(convertCoding(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.ProcessResponse convertProcessResponse(org.hl7.fhir.dstu3.model.ProcessResponse src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.ProcessResponse tgt=new org.hl7.fhir.dstu2.model.ProcessResponse();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  if (src.hasRequestReference())   tgt.setRequest((org.hl7.fhir.dstu2.model.Reference)convertType(src.getRequest()));
  tgt.setOutcome(convertCoding(src.getOutcome()));
  tgt.setDisposition(src.getDisposition());
  tgt.setRuleset(convertCoding(src.getRuleset()));
  tgt.setOriginalRuleset(convertCoding(src.getOriginalRuleset()));
  tgt.setCreated(src.getCreated());
  if (src.hasOrganizationReference())   tgt.setOrganization((org.hl7.fhir.dstu2.model.Reference)convertType(src.getOrganization()));
  if (src.hasRequestProviderReference())   tgt.setRequestProvider((org.hl7.fhir.dstu2.model.Reference)convertType(src.getRequestProvider()));
  if (src.hasRequestOrganizationReference())   tgt.setRequestOrganization((org.hl7.fhir.dstu2.model.Reference)convertType(src.getRequestOrganization()));
  tgt.setForm(convertCoding(src.getForm()));
  for (  org.hl7.fhir.dstu3.model.ProcessResponse.ProcessResponseNotesComponent t : src.getNotes())   tgt.addNotes(convertProcessResponseNotesComponent(t));
  for (  org.hl7.fhir.dstu3.model.Coding t : src.getError())   tgt.addError(convertCoding(t));
  return tgt;
}
Program: 23719
Project: 23719
Buggy source:
public org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContextComponent convertDocumentReferenceContextComponent(org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContextComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContextComponent tgt=new org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContextComponent();
  copyElement(src,tgt);
  tgt.setEncounter(convertReference(src.getEncounter()));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getEvent())   tgt.addEvent(convertCodeableConcept(t));
  tgt.setPeriod(convertPeriod(src.getPeriod()));
  tgt.setFacilityType(convertCodeableConcept(src.getFacilityType()));
  tgt.setPracticeSetting(convertCodeableConcept(src.getPracticeSetting()));
  tgt.setSourcePatientInfo(convertReference(src.getSourcePatientInfo()));
  for (  org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContextRelatedComponent t : src.getRelated())   tgt.addRelated(convertDocumentReferenceContextRelatedComponent(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContextComponent convertDocumentReferenceContextComponent(org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContextComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContextComponent tgt=new org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceContextComponent();
  copyElement(src,tgt);
  tgt.setEncounter(convertReference(src.getEncounter()));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getEvent())   tgt.addEvent(convertCodeableConcept(t));
  tgt.setPeriod(convertPeriod(src.getPeriod()));
  tgt.setFacilityType(convertCodeableConcept(src.getFacilityType()));
  tgt.setPracticeSetting(convertCodeableConcept(src.getPracticeSetting()));
  tgt.setSourcePatientInfo(convertReference(src.getSourcePatientInfo()));
  for (  org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceContextRelatedComponent t : src.getRelated())   tgt.addRelated(convertDocumentReferenceContextRelatedComponent(t));
  return tgt;
}
Program: 23720
Project: 23720
Buggy source:
public org.hl7.fhir.dstu2.model.Condition.ConditionStageComponent convertConditionStageComponent(org.hl7.fhir.dstu3.model.Condition.ConditionStageComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Condition.ConditionStageComponent tgt=new org.hl7.fhir.dstu2.model.Condition.ConditionStageComponent();
  copyElement(src,tgt);
  tgt.setSummary(convertCodeableConcept(src.getSummary()));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getAssessment())   tgt.addAssessment(convertReference(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Condition.ConditionStageComponent convertConditionStageComponent(org.hl7.fhir.dstu3.model.Condition.ConditionStageComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Condition.ConditionStageComponent tgt=new org.hl7.fhir.dstu2.model.Condition.ConditionStageComponent();
  copyElement(src,tgt);
  tgt.setSummary(convertCodeableConcept(src.getSummary()));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getAssessment())   tgt.addAssessment(convertReference(t));
  return tgt;
}
Program: 23721
Project: 23721
Buggy source:
public org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataComponent convertTestScriptMetadataComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataComponent tgt=new org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataComponent();
  copyElement(src,tgt);
  for (  org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink())   tgt.addLink(convertTestScriptMetadataLinkComponent(t));
  for (  org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability())   tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataComponent convertTestScriptMetadataComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataComponent tgt=new org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataComponent();
  copyElement(src,tgt);
  for (  org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataLinkComponent t : src.getLink())   tgt.addLink(convertTestScriptMetadataLinkComponent(t));
  for (  org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent t : src.getCapability())   tgt.addCapability(convertTestScriptMetadataCapabilityComponent(t));
  return tgt;
}
Program: 23722
Project: 23722
Buggy source:
public org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceNotAvailableComponent convertHealthcareServiceNotAvailableComponent(org.hl7.fhir.dstu3.model.HealthcareService.HealthcareServiceNotAvailableComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceNotAvailableComponent tgt=new org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceNotAvailableComponent();
  copyElement(src,tgt);
  tgt.setDescription(src.getDescription());
  tgt.setDuring(convertPeriod(src.getDuring()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceNotAvailableComponent convertHealthcareServiceNotAvailableComponent(org.hl7.fhir.dstu3.model.HealthcareService.HealthcareServiceNotAvailableComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceNotAvailableComponent tgt=new org.hl7.fhir.dstu2.model.HealthcareService.HealthcareServiceNotAvailableComponent();
  copyElement(src,tgt);
  tgt.setDescription(src.getDescription());
  tgt.setDuring(convertPeriod(src.getDuring()));
  return tgt;
}
Program: 23723
Project: 23723
Buggy source:
public org.hl7.fhir.dstu2.model.Procedure.ProcedureFocalDeviceComponent convertProcedureFocalDeviceComponent(org.hl7.fhir.dstu3.model.Procedure.ProcedureFocalDeviceComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Procedure.ProcedureFocalDeviceComponent tgt=new org.hl7.fhir.dstu2.model.Procedure.ProcedureFocalDeviceComponent();
  copyElement(src,tgt);
  tgt.setAction(convertCodeableConcept(src.getAction()));
  tgt.setManipulated(convertReference(src.getManipulated()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Procedure.ProcedureFocalDeviceComponent convertProcedureFocalDeviceComponent(org.hl7.fhir.dstu3.model.Procedure.ProcedureFocalDeviceComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Procedure.ProcedureFocalDeviceComponent tgt=new org.hl7.fhir.dstu2.model.Procedure.ProcedureFocalDeviceComponent();
  copyElement(src,tgt);
  tgt.setAction(convertCodeableConcept(src.getAction()));
  tgt.setManipulated(convertReference(src.getManipulated()));
  return tgt;
}
Program: 23724
Project: 23724
Buggy source:
public org.hl7.fhir.dstu2.model.Encounter.EncounterLocationComponent convertEncounterLocationComponent(org.hl7.fhir.dstu3.model.Encounter.EncounterLocationComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Encounter.EncounterLocationComponent tgt=new org.hl7.fhir.dstu2.model.Encounter.EncounterLocationComponent();
  copyElement(src,tgt);
  tgt.setLocation(convertReference(src.getLocation()));
  tgt.setStatus(convertEncounterLocationStatus(src.getStatus()));
  tgt.setPeriod(convertPeriod(src.getPeriod()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Encounter.EncounterLocationComponent convertEncounterLocationComponent(org.hl7.fhir.dstu3.model.Encounter.EncounterLocationComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Encounter.EncounterLocationComponent tgt=new org.hl7.fhir.dstu2.model.Encounter.EncounterLocationComponent();
  copyElement(src,tgt);
  tgt.setLocation(convertReference(src.getLocation()));
  tgt.setStatus(convertEncounterLocationStatus(src.getStatus()));
  tgt.setPeriod(convertPeriod(src.getPeriod()));
  return tgt;
}
Program: 23725
Project: 23725
Buggy source:
public org.hl7.fhir.dstu2.model.TestScript.TestScriptFixtureComponent convertTestScriptFixtureComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.TestScript.TestScriptFixtureComponent tgt=new org.hl7.fhir.dstu2.model.TestScript.TestScriptFixtureComponent();
  copyElement(src,tgt);
  tgt.setAutocreate(src.getAutocreate());
  tgt.setAutodelete(src.getAutodelete());
  tgt.setResource(convertReference(src.getResource()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.TestScript.TestScriptFixtureComponent convertTestScriptFixtureComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptFixtureComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.TestScript.TestScriptFixtureComponent tgt=new org.hl7.fhir.dstu2.model.TestScript.TestScriptFixtureComponent();
  copyElement(src,tgt);
  tgt.setAutocreate(src.getAutocreate());
  tgt.setAutodelete(src.getAutodelete());
  tgt.setResource(convertReference(src.getResource()));
  return tgt;
}
Program: 23726
Project: 23726
Buggy source:
public org.hl7.fhir.dstu2.model.EpisodeOfCare convertEpisodeOfCare(org.hl7.fhir.dstu3.model.EpisodeOfCare src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.EpisodeOfCare tgt=new org.hl7.fhir.dstu2.model.EpisodeOfCare();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus()));
  for (  org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent t : src.getStatusHistory())   tgt.addStatusHistory(convertEpisodeOfCareStatusHistoryComponent(t));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType())   tgt.addType(convertCodeableConcept(t));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getCondition())   tgt.addCondition(convertReference(t));
  tgt.setPatient(convertReference(src.getPatient()));
  tgt.setManagingOrganization(convertReference(src.getManagingOrganization()));
  tgt.setPeriod(convertPeriod(src.getPeriod()));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getReferralRequest())   tgt.addReferralRequest(convertReference(t));
  tgt.setCareManager(convertReference(src.getCareManager()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.EpisodeOfCare convertEpisodeOfCare(org.hl7.fhir.dstu3.model.EpisodeOfCare src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.EpisodeOfCare tgt=new org.hl7.fhir.dstu2.model.EpisodeOfCare();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus()));
  for (  org.hl7.fhir.dstu3.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent t : src.getStatusHistory())   tgt.addStatusHistory(convertEpisodeOfCareStatusHistoryComponent(t));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType())   tgt.addType(convertCodeableConcept(t));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getCondition())   tgt.addCondition(convertReference(t));
  tgt.setPatient(convertReference(src.getPatient()));
  tgt.setManagingOrganization(convertReference(src.getManagingOrganization()));
  tgt.setPeriod(convertPeriod(src.getPeriod()));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getReferralRequest())   tgt.addReferralRequest(convertReference(t));
  tgt.setCareManager(convertReference(src.getCareManager()));
  return tgt;
}
Program: 23727
Project: 23727
Buggy source:
public org.hl7.fhir.dstu2.model.Group.GroupMemberComponent convertGroupMemberComponent(org.hl7.fhir.dstu3.model.Group.GroupMemberComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Group.GroupMemberComponent tgt=new org.hl7.fhir.dstu2.model.Group.GroupMemberComponent();
  copyElement(src,tgt);
  tgt.setEntity(convertReference(src.getEntity()));
  tgt.setPeriod(convertPeriod(src.getPeriod()));
  tgt.setInactive(src.getInactive());
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Group.GroupMemberComponent convertGroupMemberComponent(org.hl7.fhir.dstu3.model.Group.GroupMemberComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Group.GroupMemberComponent tgt=new org.hl7.fhir.dstu2.model.Group.GroupMemberComponent();
  copyElement(src,tgt);
  tgt.setEntity(convertReference(src.getEntity()));
  tgt.setPeriod(convertPeriod(src.getPeriod()));
  tgt.setInactive(src.getInactive());
  return tgt;
}
Program: 23728
Project: 23728
Buggy source:
public org.hl7.fhir.dstu2.model.AllergyIntolerance convertAllergyIntolerance(org.hl7.fhir.dstu3.model.AllergyIntolerance src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.AllergyIntolerance tgt=new org.hl7.fhir.dstu2.model.AllergyIntolerance();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setStatus(convertAllergyIntoleranceStatus(src.getStatus()));
  tgt.setType(convertAllergyIntoleranceType(src.getType()));
  tgt.setCategory(convertAllergyIntoleranceCategory(src.getCategory()));
  tgt.setCriticality(convertAllergyIntoleranceCriticality(src.getCriticality()));
  tgt.setSubstance(convertCodeableConcept(src.getCode()));
  tgt.setPatient(convertReference(src.getPatient()));
  tgt.setRecordedDate(src.getAttestedDate());
  tgt.setRecorder(convertReference(src.getRecorder()));
  tgt.setReporter(convertReference(src.getReporter()));
  tgt.setOnset(src.getOnset());
  tgt.setLastOccurence(src.getLastOccurrence());
  for (  org.hl7.fhir.dstu3.model.Annotation t : src.getNote())   tgt.setNote(convertAnnotation(t));
  for (  org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceReactionComponent t : src.getReaction())   tgt.addReaction(convertAllergyIntoleranceReactionComponent(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.AllergyIntolerance convertAllergyIntolerance(org.hl7.fhir.dstu3.model.AllergyIntolerance src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.AllergyIntolerance tgt=new org.hl7.fhir.dstu2.model.AllergyIntolerance();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setStatus(convertAllergyIntoleranceStatus(src.getStatus()));
  tgt.setType(convertAllergyIntoleranceType(src.getType()));
  tgt.setCategory(convertAllergyIntoleranceCategory(src.getCategory()));
  tgt.setCriticality(convertAllergyIntoleranceCriticality(src.getCriticality()));
  tgt.setSubstance(convertCodeableConcept(src.getCode()));
  tgt.setPatient(convertReference(src.getPatient()));
  tgt.setRecordedDate(src.getAttestedDate());
  tgt.setRecorder(convertReference(src.getRecorder()));
  tgt.setReporter(convertReference(src.getReporter()));
  tgt.setOnset(src.getOnset());
  tgt.setLastOccurence(src.getLastOccurrence());
  for (  org.hl7.fhir.dstu3.model.Annotation t : src.getNote())   tgt.setNote(convertAnnotation(t));
  for (  org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceReactionComponent t : src.getReaction())   tgt.addReaction(convertAllergyIntoleranceReactionComponent(t));
  return tgt;
}
Program: 23729
Project: 23729
Buggy source:
public org.hl7.fhir.dstu2.model.Age convertAge(org.hl7.fhir.dstu3.model.Age src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Age tgt=new org.hl7.fhir.dstu2.model.Age();
  copyElement(src,tgt);
  tgt.setValue(src.getValue());
  tgt.setComparator(convertQuantityComparator(src.getComparator()));
  tgt.setUnit(src.getUnit());
  tgt.setSystem(src.getSystem());
  tgt.setCode(src.getCode());
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Age convertAge(org.hl7.fhir.dstu3.model.Age src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Age tgt=new org.hl7.fhir.dstu2.model.Age();
  copyElement(src,tgt);
  tgt.setValue(src.getValue());
  tgt.setComparator(convertQuantityComparator(src.getComparator()));
  tgt.setUnit(src.getUnit());
  tgt.setSystem(src.getSystem());
  tgt.setCode(src.getCode());
  return tgt;
}
Program: 23730
Project: 23730
Buggy source:
public org.hl7.fhir.dstu2.model.Identifier convertIdentifier(org.hl7.fhir.dstu3.model.Identifier src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Identifier tgt=new org.hl7.fhir.dstu2.model.Identifier();
  copyElement(src,tgt);
  tgt.setUse(convertIdentifierUse(src.getUse()));
  tgt.setType(convertCodeableConcept(src.getType()));
  tgt.setSystem(src.getSystem());
  tgt.setValue(src.getValue());
  tgt.setPeriod(convertPeriod(src.getPeriod()));
  tgt.setAssigner(convertReference(src.getAssigner()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Identifier convertIdentifier(org.hl7.fhir.dstu3.model.Identifier src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Identifier tgt=new org.hl7.fhir.dstu2.model.Identifier();
  copyElement(src,tgt);
  tgt.setUse(convertIdentifierUse(src.getUse()));
  tgt.setType(convertCodeableConcept(src.getType()));
  tgt.setSystem(src.getSystem());
  tgt.setValue(src.getValue());
  tgt.setPeriod(convertPeriod(src.getPeriod()));
  tgt.setAssigner(convertReference(src.getAssigner()));
  return tgt;
}
Program: 23731
Project: 23731
Buggy source:
public org.hl7.fhir.dstu2.model.Encounter.EncounterParticipantComponent convertEncounterParticipantComponent(org.hl7.fhir.dstu3.model.Encounter.EncounterParticipantComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Encounter.EncounterParticipantComponent tgt=new org.hl7.fhir.dstu2.model.Encounter.EncounterParticipantComponent();
  copyElement(src,tgt);
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType())   tgt.addType(convertCodeableConcept(t));
  tgt.setPeriod(convertPeriod(src.getPeriod()));
  tgt.setIndividual(convertReference(src.getIndividual()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Encounter.EncounterParticipantComponent convertEncounterParticipantComponent(org.hl7.fhir.dstu3.model.Encounter.EncounterParticipantComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Encounter.EncounterParticipantComponent tgt=new org.hl7.fhir.dstu2.model.Encounter.EncounterParticipantComponent();
  copyElement(src,tgt);
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType())   tgt.addType(convertCodeableConcept(t));
  tgt.setPeriod(convertPeriod(src.getPeriod()));
  tgt.setIndividual(convertReference(src.getIndividual()));
  return tgt;
}
Program: 23732
Project: 23732
Buggy source:
public org.hl7.fhir.dstu2.model.NutritionOrder.NutritionOrderOralDietNutrientComponent convertNutritionOrderOralDietNutrientComponent(org.hl7.fhir.dstu3.model.NutritionRequest.NutritionRequestOralDietNutrientComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.NutritionOrder.NutritionOrderOralDietNutrientComponent tgt=new org.hl7.fhir.dstu2.model.NutritionOrder.NutritionOrderOralDietNutrientComponent();
  copyElement(src,tgt);
  tgt.setModifier(convertCodeableConcept(src.getModifier()));
  tgt.setAmount(convertSimpleQuantity(src.getAmount()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.NutritionOrder.NutritionOrderOralDietNutrientComponent convertNutritionOrderOralDietNutrientComponent(org.hl7.fhir.dstu3.model.NutritionRequest.NutritionRequestOralDietNutrientComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.NutritionOrder.NutritionOrderOralDietNutrientComponent tgt=new org.hl7.fhir.dstu2.model.NutritionOrder.NutritionOrderOralDietNutrientComponent();
  copyElement(src,tgt);
  tgt.setModifier(convertCodeableConcept(src.getModifier()));
  tgt.setAmount(convertSimpleQuantity(src.getAmount()));
  return tgt;
}
Program: 23733
Project: 23733
Buggy source:
public org.hl7.fhir.dstu2.model.Conformance.ConformanceSoftwareComponent convertConformanceSoftwareComponent(org.hl7.fhir.dstu3.model.Conformance.ConformanceSoftwareComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Conformance.ConformanceSoftwareComponent tgt=new org.hl7.fhir.dstu2.model.Conformance.ConformanceSoftwareComponent();
  copyElement(src,tgt);
  tgt.setName(src.getName());
  tgt.setVersion(src.getVersion());
  tgt.setReleaseDate(src.getReleaseDate());
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Conformance.ConformanceSoftwareComponent convertConformanceSoftwareComponent(org.hl7.fhir.dstu3.model.Conformance.ConformanceSoftwareComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Conformance.ConformanceSoftwareComponent tgt=new org.hl7.fhir.dstu2.model.Conformance.ConformanceSoftwareComponent();
  copyElement(src,tgt);
  tgt.setName(src.getName());
  tgt.setVersion(src.getVersion());
  tgt.setReleaseDate(src.getReleaseDate());
  return tgt;
}
Program: 23734
Project: 23734
Buggy source:
public org.hl7.fhir.dstu2.model.Provenance convertProvenance(org.hl7.fhir.dstu3.model.Provenance src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Provenance tgt=new org.hl7.fhir.dstu2.model.Provenance();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getTarget())   tgt.addTarget(convertReference(t));
  tgt.setPeriod(convertPeriod(src.getPeriod()));
  tgt.setRecorded(src.getRecorded());
  for (  org.hl7.fhir.dstu3.model.Coding t : src.getReason())   tgt.addReason().addCoding(convertCoding(t));
  tgt.setActivity(new org.hl7.fhir.dstu2.model.CodeableConcept().addCoding(convertCoding(src.getActivity())));
  tgt.setLocation(convertReference(src.getLocation()));
  for (  org.hl7.fhir.dstu3.model.UriType t : src.getPolicy())   tgt.addPolicy(t.getValue());
  for (  org.hl7.fhir.dstu3.model.Provenance.ProvenanceAgentComponent t : src.getAgent())   tgt.addAgent(convertProvenanceAgentComponent(t));
  for (  org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityComponent t : src.getEntity())   tgt.addEntity(convertProvenanceEntityComponent(t));
  for (  org.hl7.fhir.dstu3.model.Signature t : src.getSignature())   tgt.addSignature(convertSignature(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Provenance convertProvenance(org.hl7.fhir.dstu3.model.Provenance src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Provenance tgt=new org.hl7.fhir.dstu2.model.Provenance();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getTarget())   tgt.addTarget(convertReference(t));
  tgt.setPeriod(convertPeriod(src.getPeriod()));
  tgt.setRecorded(src.getRecorded());
  for (  org.hl7.fhir.dstu3.model.Coding t : src.getReason())   tgt.addReason().addCoding(convertCoding(t));
  tgt.setActivity(new org.hl7.fhir.dstu2.model.CodeableConcept().addCoding(convertCoding(src.getActivity())));
  tgt.setLocation(convertReference(src.getLocation()));
  for (  org.hl7.fhir.dstu3.model.UriType t : src.getPolicy())   tgt.addPolicy(t.getValue());
  for (  org.hl7.fhir.dstu3.model.Provenance.ProvenanceAgentComponent t : src.getAgent())   tgt.addAgent(convertProvenanceAgentComponent(t));
  for (  org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityComponent t : src.getEntity())   tgt.addEntity(convertProvenanceEntityComponent(t));
  for (  org.hl7.fhir.dstu3.model.Signature t : src.getSignature())   tgt.addSignature(convertSignature(t));
  return tgt;
}
Program: 23735
Project: 23735
Buggy source:
public org.hl7.fhir.dstu2.model.List_ convertList(org.hl7.fhir.dstu3.model.ListResource src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.List_ tgt=new org.hl7.fhir.dstu2.model.List_();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setTitle(src.getTitle());
  tgt.setCode(convertCodeableConcept(src.getCode()));
  tgt.setSubject(convertReference(src.getSubject()));
  tgt.setSource(convertReference(src.getSource()));
  tgt.setEncounter(convertReference(src.getEncounter()));
  tgt.setStatus(convertListStatus(src.getStatus()));
  tgt.setDate(src.getDate());
  tgt.setOrderedBy(convertCodeableConcept(src.getOrderedBy()));
  tgt.setMode(convertListMode(src.getMode()));
  for (  org.hl7.fhir.dstu3.model.Annotation t : src.getNote())   tgt.setNote(t.getText());
  for (  org.hl7.fhir.dstu3.model.ListResource.ListEntryComponent t : src.getEntry())   tgt.addEntry(convertListEntry(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.List_ convertList(org.hl7.fhir.dstu3.model.ListResource src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.List_ tgt=new org.hl7.fhir.dstu2.model.List_();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setTitle(src.getTitle());
  tgt.setCode(convertCodeableConcept(src.getCode()));
  tgt.setSubject(convertReference(src.getSubject()));
  tgt.setSource(convertReference(src.getSource()));
  tgt.setEncounter(convertReference(src.getEncounter()));
  tgt.setStatus(convertListStatus(src.getStatus()));
  tgt.setDate(src.getDate());
  tgt.setOrderedBy(convertCodeableConcept(src.getOrderedBy()));
  tgt.setMode(convertListMode(src.getMode()));
  for (  org.hl7.fhir.dstu3.model.Annotation t : src.getNote())   tgt.setNote(t.getText());
  for (  org.hl7.fhir.dstu3.model.ListResource.ListEntryComponent t : src.getEntry())   tgt.addEntry(convertListEntry(t));
  return tgt;
}
Program: 23737
Project: 23737
Buggy source:
public org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionMappingComponent convertStructureDefinitionMappingComponent(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionMappingComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionMappingComponent tgt=new org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionMappingComponent();
  copyElement(src,tgt);
  tgt.setIdentity(src.getIdentity());
  tgt.setUri(src.getUri());
  tgt.setName(src.getName());
  tgt.setComments(src.getComments());
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionMappingComponent convertStructureDefinitionMappingComponent(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionMappingComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionMappingComponent tgt=new org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionMappingComponent();
  copyElement(src,tgt);
  tgt.setIdentity(src.getIdentity());
  tgt.setUri(src.getUri());
  tgt.setName(src.getName());
  tgt.setComments(src.getComments());
  return tgt;
}
Program: 23738
Project: 23738
Buggy source:
public org.hl7.fhir.dstu2.model.SupplyDelivery convertSupplyDelivery(org.hl7.fhir.dstu3.model.SupplyDelivery src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.SupplyDelivery tgt=new org.hl7.fhir.dstu2.model.SupplyDelivery();
  copyDomainResource(src,tgt);
  tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
  tgt.setStatus(convertSupplyDeliveryStatus(src.getStatus()));
  tgt.setPatient(convertReference(src.getPatient()));
  tgt.setType(convertCodeableConcept(src.getType()));
  tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
  tgt.setSupplier(convertReference(src.getSupplier()));
  tgt.setWhenPrepared(convertPeriod(src.getWhenPrepared()));
  tgt.setTime(src.getTime());
  tgt.setDestination(convertReference(src.getDestination()));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getReceiver())   tgt.addReceiver(convertReference(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.SupplyDelivery convertSupplyDelivery(org.hl7.fhir.dstu3.model.SupplyDelivery src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.SupplyDelivery tgt=new org.hl7.fhir.dstu2.model.SupplyDelivery();
  copyDomainResource(src,tgt);
  tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
  tgt.setStatus(convertSupplyDeliveryStatus(src.getStatus()));
  tgt.setPatient(convertReference(src.getPatient()));
  tgt.setType(convertCodeableConcept(src.getType()));
  tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
  tgt.setSupplier(convertReference(src.getSupplier()));
  tgt.setWhenPrepared(convertPeriod(src.getWhenPrepared()));
  tgt.setTime(src.getTime());
  tgt.setDestination(convertReference(src.getDestination()));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getReceiver())   tgt.addReceiver(convertReference(t));
  return tgt;
}
Program: 23739
Project: 23739
Buggy source:
public org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataCapabilityComponent convertTestScriptMetadataCapabilityComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataCapabilityComponent tgt=new org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataCapabilityComponent();
  copyElement(src,tgt);
  tgt.setRequired(src.getRequired());
  tgt.setValidated(src.getValidated());
  tgt.setDescription(src.getDescription());
  tgt.setDestination(src.getDestination());
  for (  org.hl7.fhir.dstu3.model.UriType t : src.getLink())   tgt.addLink(t.getValue());
  tgt.setConformance(convertReference(src.getConformance()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataCapabilityComponent convertTestScriptMetadataCapabilityComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptMetadataCapabilityComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataCapabilityComponent tgt=new org.hl7.fhir.dstu2.model.TestScript.TestScriptMetadataCapabilityComponent();
  copyElement(src,tgt);
  tgt.setRequired(src.getRequired());
  tgt.setValidated(src.getValidated());
  tgt.setDescription(src.getDescription());
  tgt.setDestination(src.getDestination());
  for (  org.hl7.fhir.dstu3.model.UriType t : src.getLink())   tgt.addLink(t.getValue());
  tgt.setConformance(convertReference(src.getConformance()));
  return tgt;
}
Program: 23740
Project: 23740
Buggy source:
public org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupComponent convertTestScriptSetupComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptSetupComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupComponent tgt=new org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupComponent();
  copyElement(src,tgt);
  for (  org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent t : src.getAction())   tgt.addAction(convertSetupActionComponent(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupComponent convertTestScriptSetupComponent(org.hl7.fhir.dstu3.model.TestScript.TestScriptSetupComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupComponent tgt=new org.hl7.fhir.dstu2.model.TestScript.TestScriptSetupComponent();
  copyElement(src,tgt);
  for (  org.hl7.fhir.dstu3.model.TestScript.SetupActionComponent t : src.getAction())   tgt.addAction(convertSetupActionComponent(t));
  return tgt;
}
Program: 23741
Project: 23741
Buggy source:
public org.hl7.fhir.dstu2.model.Contract.TermComponent convertTermComponent(org.hl7.fhir.dstu3.model.Contract.TermComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Contract.TermComponent tgt=new org.hl7.fhir.dstu2.model.Contract.TermComponent();
  copyElement(src,tgt);
  tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
  tgt.setIssued(src.getIssued());
  tgt.setApplies(convertPeriod(src.getApplies()));
  tgt.setType(convertCodeableConcept(src.getType()));
  tgt.setSubType(convertCodeableConcept(src.getSubType()));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getAction())   tgt.addAction(convertCodeableConcept(t));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getActionReason())   tgt.addActionReason(convertCodeableConcept(t));
  for (  org.hl7.fhir.dstu3.model.Contract.TermAgentComponent t : src.getAgent())   tgt.addActor(convertTermAgentComponent(t));
  tgt.setText(src.getText());
  for (  org.hl7.fhir.dstu3.model.Contract.TermValuedItemComponent t : src.getValuedItem())   tgt.addValuedItem(convertTermValuedItemComponent(t));
  for (  org.hl7.fhir.dstu3.model.Contract.TermComponent t : src.getGroup())   tgt.addGroup(convertTermComponent(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Contract.TermComponent convertTermComponent(org.hl7.fhir.dstu3.model.Contract.TermComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Contract.TermComponent tgt=new org.hl7.fhir.dstu2.model.Contract.TermComponent();
  copyElement(src,tgt);
  tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
  tgt.setIssued(src.getIssued());
  tgt.setApplies(convertPeriod(src.getApplies()));
  tgt.setType(convertCodeableConcept(src.getType()));
  tgt.setSubType(convertCodeableConcept(src.getSubType()));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getAction())   tgt.addAction(convertCodeableConcept(t));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getActionReason())   tgt.addActionReason(convertCodeableConcept(t));
  for (  org.hl7.fhir.dstu3.model.Contract.TermAgentComponent t : src.getAgent())   tgt.addActor(convertTermAgentComponent(t));
  tgt.setText(src.getText());
  for (  org.hl7.fhir.dstu3.model.Contract.TermValuedItemComponent t : src.getValuedItem())   tgt.addValuedItem(convertTermValuedItemComponent(t));
  for (  org.hl7.fhir.dstu3.model.Contract.TermComponent t : src.getGroup())   tgt.addGroup(convertTermComponent(t));
  return tgt;
}
Program: 23742
Project: 23742
Buggy source:
public org.hl7.fhir.dstu2.model.Attachment convertAttachment(org.hl7.fhir.dstu3.model.Attachment src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Attachment tgt=new org.hl7.fhir.dstu2.model.Attachment();
  copyElement(src,tgt);
  tgt.setContentType(src.getContentType());
  tgt.setLanguage(src.getLanguage());
  tgt.setData(src.getData());
  tgt.setUrl(src.getUrl());
  tgt.setSize(src.getSize());
  tgt.setHash(src.getHash());
  tgt.setTitle(src.getTitle());
  tgt.setCreation(src.getCreation());
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Attachment convertAttachment(org.hl7.fhir.dstu3.model.Attachment src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Attachment tgt=new org.hl7.fhir.dstu2.model.Attachment();
  copyElement(src,tgt);
  tgt.setContentType(src.getContentType());
  tgt.setLanguage(src.getLanguage());
  tgt.setData(src.getData());
  tgt.setUrl(src.getUrl());
  tgt.setSize(src.getSize());
  tgt.setHash(src.getHash());
  tgt.setTitle(src.getTitle());
  tgt.setCreation(src.getCreation());
  return tgt;
}