nus-yam/ex-repair huggingface dataset:
Program: 23619
Project: 23619
Buggy source:
public org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemUniqueIdComponent convertNamingSystemUniqueIdComponent(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemUniqueIdComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemUniqueIdComponent tgt=new org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemUniqueIdComponent();
  copyElement(src,tgt);
  tgt.setType(convertNamingSystemIdentifierType(src.getType()));
  tgt.setValue(src.getValue());
  tgt.setPreferred(src.getPreferred());
  tgt.setPeriod(convertPeriod(src.getPeriod()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemUniqueIdComponent convertNamingSystemUniqueIdComponent(org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemUniqueIdComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemUniqueIdComponent tgt=new org.hl7.fhir.dstu2.model.NamingSystem.NamingSystemUniqueIdComponent();
  copyElement(src,tgt);
  tgt.setType(convertNamingSystemIdentifierType(src.getType()));
  tgt.setValue(src.getValue());
  tgt.setPreferred(src.getPreferred());
  tgt.setPeriod(convertPeriod(src.getPeriod()));
  return tgt;
}
Program: 23620
Project: 23620
Buggy source:
public org.hl7.fhir.dstu2.model.Schedule convertSchedule(org.hl7.fhir.dstu3.model.Schedule src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Schedule tgt=new org.hl7.fhir.dstu2.model.Schedule();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getServiceType())   tgt.addType(convertCodeableConcept(t));
  tgt.setActor(convertReference(src.getActor()));
  tgt.setPlanningHorizon(convertPeriod(src.getPlanningHorizon()));
  tgt.setComment(src.getComment());
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Schedule convertSchedule(org.hl7.fhir.dstu3.model.Schedule src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Schedule tgt=new org.hl7.fhir.dstu2.model.Schedule();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getServiceType())   tgt.addType(convertCodeableConcept(t));
  tgt.setActor(convertReference(src.getActor()));
  tgt.setPlanningHorizon(convertPeriod(src.getPlanningHorizon()));
  tgt.setComment(src.getComment());
  return tgt;
}
Program: 23621
Project: 23621
Buggy source:
public org.hl7.fhir.dstu2.model.ConceptMap.ConceptMapContactComponent convertConceptMapContactComponent(org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapContactComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.ConceptMap.ConceptMapContactComponent tgt=new org.hl7.fhir.dstu2.model.ConceptMap.ConceptMapContactComponent();
  copyElement(src,tgt);
  tgt.setName(src.getName());
  for (  org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom())   tgt.addTelecom(convertContactPoint(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.ConceptMap.ConceptMapContactComponent convertConceptMapContactComponent(org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapContactComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.ConceptMap.ConceptMapContactComponent tgt=new org.hl7.fhir.dstu2.model.ConceptMap.ConceptMapContactComponent();
  copyElement(src,tgt);
  tgt.setName(src.getName());
  for (  org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom())   tgt.addTelecom(convertContactPoint(t));
  return tgt;
}
Program: 23622
Project: 23622
Buggy source:
public org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseSubstitutionComponent convertMedicationDispenseSubstitutionComponent(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseSubstitutionComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseSubstitutionComponent tgt=new org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseSubstitutionComponent();
  copyElement(src,tgt);
  tgt.setType(convertCodeableConcept(src.getType()));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReason())   tgt.addReason(convertCodeableConcept(t));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getResponsibleParty())   tgt.addResponsibleParty(convertReference(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseSubstitutionComponent convertMedicationDispenseSubstitutionComponent(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseSubstitutionComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseSubstitutionComponent tgt=new org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseSubstitutionComponent();
  copyElement(src,tgt);
  tgt.setType(convertCodeableConcept(src.getType()));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReason())   tgt.addReason(convertCodeableConcept(t));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getResponsibleParty())   tgt.addResponsibleParty(convertReference(t));
  return tgt;
}
Program: 23623
Project: 23623
Buggy source:
public org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityDetailComponent convertCarePlanActivityDetailComponent(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityDetailComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityDetailComponent tgt=new org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityDetailComponent();
  copyElement(src,tgt);
  tgt.setCategory(convertCodeableConcept(src.getCategory()));
  tgt.setCode(convertCodeableConcept(src.getCode()));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode())   tgt.addReasonCode(convertCodeableConcept(t));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getReasonReference())   tgt.addReasonReference(convertReference(t));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getGoal())   tgt.addGoal(convertReference(t));
  tgt.setStatus(convertCarePlanActivityStatus(src.getStatus()));
  tgt.setStatusReason(convertCodeableConcept(src.getStatusReason()));
  tgt.setProhibited(src.getProhibited());
  tgt.setScheduled(convertType(src.getScheduled()));
  tgt.setLocation(convertReference(src.getLocation()));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getPerformer())   tgt.addPerformer(convertReference(t));
  tgt.setProduct(convertType(src.getProduct()));
  tgt.setDailyAmount(convertSimpleQuantity(src.getDailyAmount()));
  tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
  tgt.setDescription(src.getDescription());
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityDetailComponent convertCarePlanActivityDetailComponent(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityDetailComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityDetailComponent tgt=new org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityDetailComponent();
  copyElement(src,tgt);
  tgt.setCategory(convertCodeableConcept(src.getCategory()));
  tgt.setCode(convertCodeableConcept(src.getCode()));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode())   tgt.addReasonCode(convertCodeableConcept(t));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getReasonReference())   tgt.addReasonReference(convertReference(t));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getGoal())   tgt.addGoal(convertReference(t));
  tgt.setStatus(convertCarePlanActivityStatus(src.getStatus()));
  tgt.setStatusReason(convertCodeableConcept(src.getStatusReason()));
  tgt.setProhibited(src.getProhibited());
  tgt.setScheduled(convertType(src.getScheduled()));
  tgt.setLocation(convertReference(src.getLocation()));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getPerformer())   tgt.addPerformer(convertReference(t));
  tgt.setProduct(convertType(src.getProduct()));
  tgt.setDailyAmount(convertSimpleQuantity(src.getDailyAmount()));
  tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
  tgt.setDescription(src.getDescription());
  return tgt;
}
Program: 23624
Project: 23624
Buggy source:
public org.hl7.fhir.dstu2.model.Duration convertDuration(org.hl7.fhir.dstu3.model.Duration src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Duration tgt=new org.hl7.fhir.dstu2.model.Duration();
  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.Duration convertDuration(org.hl7.fhir.dstu3.model.Duration src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Duration tgt=new org.hl7.fhir.dstu2.model.Duration();
  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: 23625
Project: 23625
Buggy source:
public org.hl7.fhir.dstu2.model.Basic convertBasic(org.hl7.fhir.dstu3.model.Basic src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Basic tgt=new org.hl7.fhir.dstu2.model.Basic();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setCode(convertCodeableConcept(src.getCode()));
  tgt.setSubject(convertReference(src.getSubject()));
  tgt.setCreated(src.getCreated());
  tgt.setAuthor(convertReference(src.getAuthor()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Basic convertBasic(org.hl7.fhir.dstu3.model.Basic src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Basic tgt=new org.hl7.fhir.dstu2.model.Basic();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setCode(convertCodeableConcept(src.getCode()));
  tgt.setSubject(convertReference(src.getSubject()));
  tgt.setCreated(src.getCreated());
  tgt.setAuthor(convertReference(src.getAuthor()));
  return tgt;
}
Program: 23626
Project: 23626
Buggy source:
public org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent convertOtherElementComponent(org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent tgt=new org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent();
  copyElement(src,tgt);
  tgt.setElement(src.getProperty());
  tgt.setCodeSystem(src.getSystem());
  tgt.setCode(src.getCode());
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent convertOtherElementComponent(org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent tgt=new org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent();
  copyElement(src,tgt);
  tgt.setElement(src.getProperty());
  tgt.setCodeSystem(src.getSystem());
  tgt.setCode(src.getCode());
  return tgt;
}
Program: 23627
Project: 23627
Buggy source:
public org.hl7.fhir.dstu2.model.ImmunizationRecommendation convertImmunizationRecommendation(org.hl7.fhir.dstu3.model.ImmunizationRecommendation src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.ImmunizationRecommendation tgt=new org.hl7.fhir.dstu2.model.ImmunizationRecommendation();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setPatient(convertReference(src.getPatient()));
  for (  org.hl7.fhir.dstu3.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent t : src.getRecommendation())   tgt.addRecommendation(convertImmunizationRecommendationRecommendationComponent(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.ImmunizationRecommendation convertImmunizationRecommendation(org.hl7.fhir.dstu3.model.ImmunizationRecommendation src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.ImmunizationRecommendation tgt=new org.hl7.fhir.dstu2.model.ImmunizationRecommendation();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setPatient(convertReference(src.getPatient()));
  for (  org.hl7.fhir.dstu3.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent t : src.getRecommendation())   tgt.addRecommendation(convertImmunizationRecommendationRecommendationComponent(t));
  return tgt;
}
Program: 23628
Project: 23628
Buggy source:
public org.hl7.fhir.dstu2.model.NamingSystem convertNamingSystem(org.hl7.fhir.dstu3.model.NamingSystem src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.NamingSystem tgt=new org.hl7.fhir.dstu2.model.NamingSystem();
  copyDomainResource(src,tgt);
  tgt.setName(src.getName());
  tgt.setStatus(convertConformanceResourceStatus(src.getStatus()));
  tgt.setKind(convertNamingSystemType(src.getKind()));
  tgt.setDate(src.getDate());
  tgt.setPublisher(src.getPublisher());
  for (  org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemContactComponent t : src.getContact())   tgt.addContact(convertNamingSystemContactComponent(t));
  tgt.setResponsible(src.getResponsible());
  tgt.setType(convertCodeableConcept(src.getType()));
  tgt.setDescription(src.getDescription());
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getUseContext())   tgt.addUseContext(convertCodeableConcept(t));
  tgt.setUsage(src.getUsage());
  for (  org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId())   tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t));
  tgt.setReplacedBy(convertReference(src.getReplacedBy()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.NamingSystem convertNamingSystem(org.hl7.fhir.dstu3.model.NamingSystem src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.NamingSystem tgt=new org.hl7.fhir.dstu2.model.NamingSystem();
  copyDomainResource(src,tgt);
  tgt.setName(src.getName());
  tgt.setStatus(convertConformanceResourceStatus(src.getStatus()));
  tgt.setKind(convertNamingSystemType(src.getKind()));
  tgt.setDate(src.getDate());
  tgt.setPublisher(src.getPublisher());
  for (  org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemContactComponent t : src.getContact())   tgt.addContact(convertNamingSystemContactComponent(t));
  tgt.setResponsible(src.getResponsible());
  tgt.setType(convertCodeableConcept(src.getType()));
  tgt.setDescription(src.getDescription());
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getUseContext())   tgt.addUseContext(convertCodeableConcept(t));
  tgt.setUsage(src.getUsage());
  for (  org.hl7.fhir.dstu3.model.NamingSystem.NamingSystemUniqueIdComponent t : src.getUniqueId())   tgt.addUniqueId(convertNamingSystemUniqueIdComponent(t));
  tgt.setReplacedBy(convertReference(src.getReplacedBy()));
  return tgt;
}
Program: 23629
Project: 23629
Buggy source:
public org.hl7.fhir.dstu2.model.Practitioner.PractitionerPractitionerRoleComponent convertPractitionerPractitionerRoleComponent(org.hl7.fhir.dstu3.model.Practitioner.PractitionerRoleComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Practitioner.PractitionerPractitionerRoleComponent tgt=new org.hl7.fhir.dstu2.model.Practitioner.PractitionerPractitionerRoleComponent();
  copyElement(src,tgt);
  tgt.setManagingOrganization(convertReference(src.getOrganization()));
  tgt.setRole(convertCodeableConcept(src.getCode()));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialty())   tgt.addSpecialty(convertCodeableConcept(t));
  tgt.setPeriod(convertPeriod(src.getPeriod()));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getLocation())   tgt.addLocation(convertReference(t));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getHealthcareService())   tgt.addHealthcareService(convertReference(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Practitioner.PractitionerPractitionerRoleComponent convertPractitionerPractitionerRoleComponent(org.hl7.fhir.dstu3.model.Practitioner.PractitionerRoleComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Practitioner.PractitionerPractitionerRoleComponent tgt=new org.hl7.fhir.dstu2.model.Practitioner.PractitionerPractitionerRoleComponent();
  copyElement(src,tgt);
  tgt.setManagingOrganization(convertReference(src.getOrganization()));
  tgt.setRole(convertCodeableConcept(src.getCode()));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialty())   tgt.addSpecialty(convertCodeableConcept(t));
  tgt.setPeriod(convertPeriod(src.getPeriod()));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getLocation())   tgt.addLocation(convertReference(t));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getHealthcareService())   tgt.addHealthcareService(convertReference(t));
  return tgt;
}
Program: 23630
Project: 23630
Buggy source:
public org.hl7.fhir.dstu2.model.Subscription convertSubscription(org.hl7.fhir.dstu3.model.Subscription src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Subscription tgt=new org.hl7.fhir.dstu2.model.Subscription();
  copyDomainResource(src,tgt);
  tgt.setCriteria(src.getCriteria());
  for (  org.hl7.fhir.dstu3.model.ContactPoint t : src.getContact())   tgt.addContact(convertContactPoint(t));
  tgt.setReason(src.getReason());
  tgt.setStatus(convertSubscriptionStatus(src.getStatus()));
  tgt.setError(src.getError());
  tgt.setChannel(convertSubscriptionChannelComponent(src.getChannel()));
  tgt.setEnd(src.getEnd());
  for (  org.hl7.fhir.dstu3.model.Coding t : src.getTag())   tgt.addTag(convertCoding(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Subscription convertSubscription(org.hl7.fhir.dstu3.model.Subscription src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Subscription tgt=new org.hl7.fhir.dstu2.model.Subscription();
  copyDomainResource(src,tgt);
  tgt.setCriteria(src.getCriteria());
  for (  org.hl7.fhir.dstu3.model.ContactPoint t : src.getContact())   tgt.addContact(convertContactPoint(t));
  tgt.setReason(src.getReason());
  tgt.setStatus(convertSubscriptionStatus(src.getStatus()));
  tgt.setError(src.getError());
  tgt.setChannel(convertSubscriptionChannelComponent(src.getChannel()));
  tgt.setEnd(src.getEnd());
  for (  org.hl7.fhir.dstu3.model.Coding t : src.getTag())   tgt.addTag(convertCoding(t));
  return tgt;
}
Program: 23632
Project: 23632
Buggy source:
public org.hl7.fhir.dstu2.model.DetectedIssue convertDetectedIssue(org.hl7.fhir.dstu3.model.DetectedIssue src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.DetectedIssue tgt=new org.hl7.fhir.dstu2.model.DetectedIssue();
  copyDomainResource(src,tgt);
  tgt.setPatient(convertReference(src.getPatient()));
  tgt.setCategory(convertCodeableConcept(src.getCategory()));
  tgt.setSeverity(convertDetectedIssueSeverity(src.getSeverity()));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getImplicated())   tgt.addImplicated(convertReference(t));
  tgt.setDetail(src.getDetail());
  tgt.setDate(src.getDate());
  tgt.setAuthor(convertReference(src.getAuthor()));
  tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
  tgt.setReference(src.getReference());
  for (  org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation())   tgt.addMitigation(convertDetectedIssueMitigationComponent(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.DetectedIssue convertDetectedIssue(org.hl7.fhir.dstu3.model.DetectedIssue src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.DetectedIssue tgt=new org.hl7.fhir.dstu2.model.DetectedIssue();
  copyDomainResource(src,tgt);
  tgt.setPatient(convertReference(src.getPatient()));
  tgt.setCategory(convertCodeableConcept(src.getCategory()));
  tgt.setSeverity(convertDetectedIssueSeverity(src.getSeverity()));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getImplicated())   tgt.addImplicated(convertReference(t));
  tgt.setDetail(src.getDetail());
  tgt.setDate(src.getDate());
  tgt.setAuthor(convertReference(src.getAuthor()));
  tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
  tgt.setReference(src.getReference());
  for (  org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation())   tgt.addMitigation(convertDetectedIssueMitigationComponent(t));
  return tgt;
}
Program: 23633
Project: 23633
Buggy source:
public org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionBaseComponent convertElementDefinitionBaseComponent(org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionBaseComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionBaseComponent tgt=new org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionBaseComponent();
  copyElement(src,tgt);
  tgt.setPath(src.getPath());
  tgt.setMin(src.getMin());
  tgt.setMax(src.getMax());
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionBaseComponent convertElementDefinitionBaseComponent(org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionBaseComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionBaseComponent tgt=new org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionBaseComponent();
  copyElement(src,tgt);
  tgt.setPath(src.getPath());
  tgt.setMin(src.getMin());
  tgt.setMax(src.getMax());
  return tgt;
}
Program: 23634
Project: 23634
Buggy source:
public org.hl7.fhir.dstu2.model.Timing convertTiming(org.hl7.fhir.dstu3.model.Timing src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Timing tgt=new org.hl7.fhir.dstu2.model.Timing();
  copyElement(src,tgt);
  for (  org.hl7.fhir.dstu3.model.DateTimeType t : src.getEvent())   tgt.addEvent(t.getValue());
  tgt.setRepeat(convertTimingRepeatComponent(src.getRepeat()));
  tgt.setCode(convertCodeableConcept(src.getCode()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Timing convertTiming(org.hl7.fhir.dstu3.model.Timing src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Timing tgt=new org.hl7.fhir.dstu2.model.Timing();
  copyElement(src,tgt);
  for (  org.hl7.fhir.dstu3.model.DateTimeType t : src.getEvent())   tgt.addEvent(t.getValue());
  tgt.setRepeat(convertTimingRepeatComponent(src.getRepeat()));
  tgt.setCode(convertCodeableConcept(src.getCode()));
  return tgt;
}
Program: 23635
Project: 23635
Buggy source:
public org.hl7.fhir.dstu2.model.Practitioner convertPractitioner(org.hl7.fhir.dstu3.model.Practitioner src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Practitioner tgt=new org.hl7.fhir.dstu2.model.Practitioner();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setActive(src.getActive());
  for (  org.hl7.fhir.dstu3.model.HumanName t : src.getName())   tgt.setName(convertHumanName(t));
  for (  org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom())   tgt.addTelecom(convertContactPoint(t));
  for (  org.hl7.fhir.dstu3.model.Address t : src.getAddress())   tgt.addAddress(convertAddress(t));
  tgt.setGender(convertAdministrativeGender(src.getGender()));
  tgt.setBirthDate(src.getBirthDate());
  for (  org.hl7.fhir.dstu3.model.Attachment t : src.getPhoto())   tgt.addPhoto(convertAttachment(t));
  for (  org.hl7.fhir.dstu3.model.Practitioner.PractitionerRoleComponent t : src.getRole())   tgt.addPractitionerRole(convertPractitionerPractitionerRoleComponent(t));
  for (  org.hl7.fhir.dstu3.model.Practitioner.PractitionerQualificationComponent t : src.getQualification())   tgt.addQualification(convertPractitionerQualificationComponent(t));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCommunication())   tgt.addCommunication(convertCodeableConcept(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Practitioner convertPractitioner(org.hl7.fhir.dstu3.model.Practitioner src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Practitioner tgt=new org.hl7.fhir.dstu2.model.Practitioner();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setActive(src.getActive());
  for (  org.hl7.fhir.dstu3.model.HumanName t : src.getName())   tgt.setName(convertHumanName(t));
  for (  org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom())   tgt.addTelecom(convertContactPoint(t));
  for (  org.hl7.fhir.dstu3.model.Address t : src.getAddress())   tgt.addAddress(convertAddress(t));
  tgt.setGender(convertAdministrativeGender(src.getGender()));
  tgt.setBirthDate(src.getBirthDate());
  for (  org.hl7.fhir.dstu3.model.Attachment t : src.getPhoto())   tgt.addPhoto(convertAttachment(t));
  for (  org.hl7.fhir.dstu3.model.Practitioner.PractitionerRoleComponent t : src.getRole())   tgt.addPractitionerRole(convertPractitionerPractitionerRoleComponent(t));
  for (  org.hl7.fhir.dstu3.model.Practitioner.PractitionerQualificationComponent t : src.getQualification())   tgt.addQualification(convertPractitionerQualificationComponent(t));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCommunication())   tgt.addCommunication(convertCodeableConcept(t));
  return tgt;
}
Program: 23636
Project: 23636
Buggy source:
public org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideDependencyComponent convertImplementationGuideDependencyComponent(org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideDependencyComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideDependencyComponent tgt=new org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideDependencyComponent();
  copyElement(src,tgt);
  tgt.setType(convertGuideDependencyType(src.getType()));
  tgt.setUri(src.getUri());
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideDependencyComponent convertImplementationGuideDependencyComponent(org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuideDependencyComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideDependencyComponent tgt=new org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuideDependencyComponent();
  copyElement(src,tgt);
  tgt.setType(convertGuideDependencyType(src.getType()));
  tgt.setUri(src.getUri());
  return tgt;
}
Program: 23637
Project: 23637
Buggy source:
public org.hl7.fhir.dstu2.model.Specimen.SpecimenTreatmentComponent convertSpecimenTreatmentComponent(org.hl7.fhir.dstu3.model.Specimen.SpecimenTreatmentComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Specimen.SpecimenTreatmentComponent tgt=new org.hl7.fhir.dstu2.model.Specimen.SpecimenTreatmentComponent();
  copyElement(src,tgt);
  tgt.setDescription(src.getDescription());
  tgt.setProcedure(convertCodeableConcept(src.getProcedure()));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getAdditive())   tgt.addAdditive(convertReference(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Specimen.SpecimenTreatmentComponent convertSpecimenTreatmentComponent(org.hl7.fhir.dstu3.model.Specimen.SpecimenTreatmentComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Specimen.SpecimenTreatmentComponent tgt=new org.hl7.fhir.dstu2.model.Specimen.SpecimenTreatmentComponent();
  copyElement(src,tgt);
  tgt.setDescription(src.getDescription());
  tgt.setProcedure(convertCodeableConcept(src.getProcedure()));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getAdditive())   tgt.addAdditive(convertReference(t));
  return tgt;
}
Program: 23638
Project: 23638
Buggy source:
public org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent convertBundleEntryComponent(org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent src) throws FHIRException {
  if (src == null)   return null;
  if (advisor.ignoreEntry(src))   return null;
  org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent tgt=new org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent();
  copyElement(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent t : src.getLink())   tgt.addLink(convertBundleLinkComponent(t));
  tgt.setFullUrl(src.getFullUrl());
  org.hl7.fhir.dstu2.model.Resource res=advisor.convert(src.getResource());
  if (res == null)   res=convertResource(src.getResource());
  tgt.setResource(res);
  tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch()));
  tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest()));
  tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent convertBundleEntryComponent(org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  if (advisor.ignoreEntry(src))   return null;
  org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent tgt=new org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent();
  copyElement(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent t : src.getLink())   tgt.addLink(convertBundleLinkComponent(t));
  tgt.setFullUrl(src.getFullUrl());
  org.hl7.fhir.dstu2.model.Resource res=advisor.convert(src.getResource());
  if (res == null)   res=convertResource(src.getResource());
  tgt.setResource(res);
  tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch()));
  tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest()));
  tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse()));
  return tgt;
}
Program: 23639
Project: 23639
Buggy source:
public org.hl7.fhir.dstu2.model.Money convertMoney(org.hl7.fhir.dstu3.model.Money src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Money tgt=new org.hl7.fhir.dstu2.model.Money();
  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.Money convertMoney(org.hl7.fhir.dstu3.model.Money src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Money tgt=new org.hl7.fhir.dstu2.model.Money();
  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: 23640
Project: 23640
Buggy source:
public org.hl7.fhir.dstu2.model.Provenance.ProvenanceEntityComponent convertProvenanceEntityComponent(org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Provenance.ProvenanceEntityComponent tgt=new org.hl7.fhir.dstu2.model.Provenance.ProvenanceEntityComponent();
  copyElement(src,tgt);
  tgt.setRole(convertProvenanceEntityRole(src.getRole()));
  tgt.setType(convertCoding(src.getType()));
  tgt.setReference(src.getReference());
  tgt.setDisplay(src.getDisplay());
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Provenance.ProvenanceEntityComponent convertProvenanceEntityComponent(org.hl7.fhir.dstu3.model.Provenance.ProvenanceEntityComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Provenance.ProvenanceEntityComponent tgt=new org.hl7.fhir.dstu2.model.Provenance.ProvenanceEntityComponent();
  copyElement(src,tgt);
  tgt.setRole(convertProvenanceEntityRole(src.getRole()));
  tgt.setType(convertCoding(src.getType()));
  tgt.setReference(src.getReference());
  tgt.setDisplay(src.getDisplay());
  return tgt;
}
Program: 23641
Project: 23641
Buggy source:
public org.hl7.fhir.dstu2.model.List_.ListEntryComponent convertListEntry(org.hl7.fhir.dstu3.model.ListResource.ListEntryComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.List_.ListEntryComponent tgt=new org.hl7.fhir.dstu2.model.List_.ListEntryComponent();
  copyBackboneElement(src,tgt);
  tgt.setFlag(convertCodeableConcept(src.getFlag()));
  tgt.setDeleted(src.getDeleted());
  tgt.setDate(src.getDate());
  tgt.setItem(convertReference(src.getItem()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.List_.ListEntryComponent convertListEntry(org.hl7.fhir.dstu3.model.ListResource.ListEntryComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.List_.ListEntryComponent tgt=new org.hl7.fhir.dstu2.model.List_.ListEntryComponent();
  copyBackboneElement(src,tgt);
  tgt.setFlag(convertCodeableConcept(src.getFlag()));
  tgt.setDeleted(src.getDeleted());
  tgt.setDate(src.getDate());
  tgt.setItem(convertReference(src.getItem()));
  return tgt;
}
Program: 23643
Project: 23643
Buggy source:
public org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelComponent convertSubscriptionChannelComponent(org.hl7.fhir.dstu3.model.Subscription.SubscriptionChannelComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelComponent tgt=new org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelComponent();
  copyElement(src,tgt);
  tgt.setType(convertSubscriptionChannelType(src.getType()));
  tgt.setEndpoint(src.getEndpoint());
  tgt.setPayload(src.getPayload());
  tgt.setHeader(src.getHeader());
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelComponent convertSubscriptionChannelComponent(org.hl7.fhir.dstu3.model.Subscription.SubscriptionChannelComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelComponent tgt=new org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelComponent();
  copyElement(src,tgt);
  tgt.setType(convertSubscriptionChannelType(src.getType()));
  tgt.setEndpoint(src.getEndpoint());
  tgt.setPayload(src.getPayload());
  tgt.setHeader(src.getHeader());
  return tgt;
}
Program: 23644
Project: 23644
Buggy source:
public org.hl7.fhir.dstu2.model.Substance convertSubstance(org.hl7.fhir.dstu3.model.Substance src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Substance tgt=new org.hl7.fhir.dstu2.model.Substance();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory())   tgt.addCategory(convertCodeableConcept(t));
  tgt.setCode(convertCodeableConcept(src.getCode()));
  tgt.setDescription(src.getDescription());
  for (  org.hl7.fhir.dstu3.model.Substance.SubstanceInstanceComponent t : src.getInstance())   tgt.addInstance(convertSubstanceInstanceComponent(t));
  for (  org.hl7.fhir.dstu3.model.Substance.SubstanceIngredientComponent t : src.getIngredient())   tgt.addIngredient(convertSubstanceIngredientComponent(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Substance convertSubstance(org.hl7.fhir.dstu3.model.Substance src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Substance tgt=new org.hl7.fhir.dstu2.model.Substance();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory())   tgt.addCategory(convertCodeableConcept(t));
  tgt.setCode(convertCodeableConcept(src.getCode()));
  tgt.setDescription(src.getDescription());
  for (  org.hl7.fhir.dstu3.model.Substance.SubstanceInstanceComponent t : src.getInstance())   tgt.addInstance(convertSubstanceInstanceComponent(t));
  for (  org.hl7.fhir.dstu3.model.Substance.SubstanceIngredientComponent t : src.getIngredient())   tgt.addIngredient(convertSubstanceIngredientComponent(t));
  return tgt;
}
Program: 23645
Project: 23645
Buggy source:
public org.hl7.fhir.dstu2.model.ElementDefinition.TypeRefComponent convertTypeRefComponent(org.hl7.fhir.dstu3.model.ElementDefinition.TypeRefComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.ElementDefinition.TypeRefComponent tgt=new org.hl7.fhir.dstu2.model.ElementDefinition.TypeRefComponent();
  copyElement(src,tgt);
  tgt.setCode(src.getCode());
  if (src.hasProfile())   tgt.addProfile(src.getProfile());
  for (  org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ElementDefinition.AggregationMode> t : src.getAggregation())   tgt.addAggregation(convertAggregationMode(t.getValue()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.ElementDefinition.TypeRefComponent convertTypeRefComponent(org.hl7.fhir.dstu3.model.ElementDefinition.TypeRefComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.ElementDefinition.TypeRefComponent tgt=new org.hl7.fhir.dstu2.model.ElementDefinition.TypeRefComponent();
  copyElement(src,tgt);
  tgt.setCode(src.getCode());
  if (src.hasProfile())   tgt.addProfile(src.getProfile());
  for (  org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ElementDefinition.AggregationMode> t : src.getAggregation())   tgt.addAggregation(convertAggregationMode(t.getValue()));
  return tgt;
}
Program: 23646
Project: 23646
Buggy source:
public org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionConstraintComponent convertElementDefinitionConstraintComponent(org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionConstraintComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionConstraintComponent tgt=new org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionConstraintComponent();
  copyElement(src,tgt);
  tgt.setKey(src.getKey());
  tgt.setRequirements(src.getRequirements());
  tgt.setSeverity(convertConstraintSeverity(src.getSeverity()));
  tgt.setHuman(src.getHuman());
  if (src.hasExpression())   ToolingExtensions.addStringExtension(tgt,ToolingExtensions.EXT_EXPRESSION,src.getExpression());
  tgt.setXpath(src.getXpath());
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionConstraintComponent convertElementDefinitionConstraintComponent(org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionConstraintComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionConstraintComponent tgt=new org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionConstraintComponent();
  copyElement(src,tgt);
  tgt.setKey(src.getKey());
  tgt.setRequirements(src.getRequirements());
  tgt.setSeverity(convertConstraintSeverity(src.getSeverity()));
  tgt.setHuman(src.getHuman());
  if (src.hasExpression())   ToolingExtensions.addStringExtension(tgt,ToolingExtensions.EXT_EXPRESSION,src.getExpression());
  tgt.setXpath(src.getXpath());
  return tgt;
}
Program: 23647
Project: 23647
Buggy source:
public org.hl7.fhir.dstu2.model.DeviceUseRequest convertDeviceUseRequest(org.hl7.fhir.dstu3.model.DeviceUseRequest src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.DeviceUseRequest tgt=new org.hl7.fhir.dstu2.model.DeviceUseRequest();
  copyDomainResource(src,tgt);
  tgt.setStatus(convertDeviceUseRequestStatus(src.getStatus()));
  tgt.setEncounter(convertReference(src.getContext()));
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode())   tgt.addIndication(convertCodeableConcept(t));
  for (  Annotation t : src.getNote())   tgt.addNotes(t.getText());
  tgt.setOrderedOn(src.getAuthored());
  tgt.setSubject(convertReference(src.getSubject()));
  tgt.setTiming(convertType(src.getOccurrence()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.DeviceUseRequest convertDeviceUseRequest(org.hl7.fhir.dstu3.model.DeviceUseRequest src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.DeviceUseRequest tgt=new org.hl7.fhir.dstu2.model.DeviceUseRequest();
  copyDomainResource(src,tgt);
  tgt.setStatus(convertDeviceUseRequestStatus(src.getStatus()));
  tgt.setEncounter(convertReference(src.getContext()));
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode())   tgt.addIndication(convertCodeableConcept(t));
  for (  Annotation t : src.getNote())   tgt.addNotes(t.getText());
  tgt.setOrderedOn(src.getAuthored());
  tgt.setSubject(convertReference(src.getSubject()));
  tgt.setTiming(convertType(src.getOccurrence()));
  return tgt;
}
Program: 23648
Project: 23648
Buggy source:
public org.hl7.fhir.dstu2.model.Medication.MedicationProductComponent convertMedicationProductComponent(org.hl7.fhir.dstu3.model.Medication.MedicationProductComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Medication.MedicationProductComponent tgt=new org.hl7.fhir.dstu2.model.Medication.MedicationProductComponent();
  copyElement(src,tgt);
  tgt.setForm(convertCodeableConcept(src.getForm()));
  for (  org.hl7.fhir.dstu3.model.Medication.MedicationProductIngredientComponent t : src.getIngredient())   tgt.addIngredient(convertMedicationProductIngredientComponent(t));
  for (  org.hl7.fhir.dstu3.model.Medication.MedicationProductBatchComponent t : src.getBatch())   tgt.addBatch(convertMedicationProductBatchComponent(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Medication.MedicationProductComponent convertMedicationProductComponent(org.hl7.fhir.dstu3.model.Medication.MedicationProductComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Medication.MedicationProductComponent tgt=new org.hl7.fhir.dstu2.model.Medication.MedicationProductComponent();
  copyElement(src,tgt);
  tgt.setForm(convertCodeableConcept(src.getForm()));
  for (  org.hl7.fhir.dstu3.model.Medication.MedicationProductIngredientComponent t : src.getIngredient())   tgt.addIngredient(convertMedicationProductIngredientComponent(t));
  for (  org.hl7.fhir.dstu3.model.Medication.MedicationProductBatchComponent t : src.getBatch())   tgt.addBatch(convertMedicationProductBatchComponent(t));
  return tgt;
}
Program: 23649
Project: 23649
Buggy source:
private org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus convertParticipantStatus(org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus src){
switch (src) {
case ACCEPTED:
    return org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.ACCEPTED;
case DECLINED:
  return org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.DECLINED;
case TENTATIVE:
return org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.TENTATIVE;
case NEEDSACTION:
return org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.NEEDSACTION;
default :
return org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.NULL;
}
}

Fixed version (ground truth):
private org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus convertParticipantStatus(org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus src){
  if (src == null)   return null;
switch (src) {
case ACCEPTED:
    return org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.ACCEPTED;
case DECLINED:
  return org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.DECLINED;
case TENTATIVE:
return org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.TENTATIVE;
case NEEDSACTION:
return org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.NEEDSACTION;
default :
return org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.NULL;
}
}
Program: 23650
Project: 23650
Buggy source:
public org.hl7.fhir.dstu2.model.Contract.TermValuedItemComponent convertTermValuedItemComponent(org.hl7.fhir.dstu3.model.Contract.TermValuedItemComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Contract.TermValuedItemComponent tgt=new org.hl7.fhir.dstu2.model.Contract.TermValuedItemComponent();
  copyElement(src,tgt);
  tgt.setEntity(convertType(src.getEntity()));
  tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
  tgt.setEffectiveTime(src.getEffectiveTime());
  tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
  tgt.setUnitPrice(convertMoney(src.getUnitPrice()));
  tgt.setFactor(src.getFactor());
  tgt.setPoints(src.getPoints());
  tgt.setNet(convertMoney(src.getNet()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Contract.TermValuedItemComponent convertTermValuedItemComponent(org.hl7.fhir.dstu3.model.Contract.TermValuedItemComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Contract.TermValuedItemComponent tgt=new org.hl7.fhir.dstu2.model.Contract.TermValuedItemComponent();
  copyElement(src,tgt);
  tgt.setEntity(convertType(src.getEntity()));
  tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
  tgt.setEffectiveTime(src.getEffectiveTime());
  tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
  tgt.setUnitPrice(convertMoney(src.getUnitPrice()));
  tgt.setFactor(src.getFactor());
  tgt.setPoints(src.getPoints());
  tgt.setNet(convertMoney(src.getNet()));
  return tgt;
}