nus-yam/ex-repair huggingface dataset:
Program: 23651
Project: 23651
Buggy source:
public org.hl7.fhir.dstu2.model.ValueSet.ValueSetContactComponent convertValueSetContactComponent(org.hl7.fhir.dstu3.model.ValueSet.ValueSetContactComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.ValueSet.ValueSetContactComponent tgt=new org.hl7.fhir.dstu2.model.ValueSet.ValueSetContactComponent();
  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.ValueSet.ValueSetContactComponent convertValueSetContactComponent(org.hl7.fhir.dstu3.model.ValueSet.ValueSetContactComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.ValueSet.ValueSetContactComponent tgt=new org.hl7.fhir.dstu2.model.ValueSet.ValueSetContactComponent();
  copyElement(src,tgt);
  tgt.setName(src.getName());
  for (  org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom())   tgt.addTelecom(convertContactPoint(t));
  return tgt;
}
Program: 23652
Project: 23652
Buggy source:
public org.hl7.fhir.dstu2.model.NutritionOrder.NutritionOrderEnteralFormulaComponent convertNutritionOrderEnteralFormulaComponent(org.hl7.fhir.dstu3.model.NutritionRequest.NutritionRequestEnteralFormulaComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.NutritionOrder.NutritionOrderEnteralFormulaComponent tgt=new org.hl7.fhir.dstu2.model.NutritionOrder.NutritionOrderEnteralFormulaComponent();
  copyElement(src,tgt);
  tgt.setBaseFormulaType(convertCodeableConcept(src.getBaseFormulaType()));
  tgt.setBaseFormulaProductName(src.getBaseFormulaProductName());
  tgt.setAdditiveType(convertCodeableConcept(src.getAdditiveType()));
  tgt.setAdditiveProductName(src.getAdditiveProductName());
  tgt.setCaloricDensity(convertSimpleQuantity(src.getCaloricDensity()));
  tgt.setRouteofAdministration(convertCodeableConcept(src.getRouteofAdministration()));
  for (  org.hl7.fhir.dstu3.model.NutritionRequest.NutritionRequestEnteralFormulaAdministrationComponent t : src.getAdministration())   tgt.addAdministration(convertNutritionOrderEnteralFormulaAdministrationComponent(t));
  tgt.setMaxVolumeToDeliver(convertSimpleQuantity(src.getMaxVolumeToDeliver()));
  tgt.setAdministrationInstruction(src.getAdministrationInstruction());
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.NutritionOrder.NutritionOrderEnteralFormulaComponent convertNutritionOrderEnteralFormulaComponent(org.hl7.fhir.dstu3.model.NutritionRequest.NutritionRequestEnteralFormulaComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.NutritionOrder.NutritionOrderEnteralFormulaComponent tgt=new org.hl7.fhir.dstu2.model.NutritionOrder.NutritionOrderEnteralFormulaComponent();
  copyElement(src,tgt);
  tgt.setBaseFormulaType(convertCodeableConcept(src.getBaseFormulaType()));
  tgt.setBaseFormulaProductName(src.getBaseFormulaProductName());
  tgt.setAdditiveType(convertCodeableConcept(src.getAdditiveType()));
  tgt.setAdditiveProductName(src.getAdditiveProductName());
  tgt.setCaloricDensity(convertSimpleQuantity(src.getCaloricDensity()));
  tgt.setRouteofAdministration(convertCodeableConcept(src.getRouteofAdministration()));
  for (  org.hl7.fhir.dstu3.model.NutritionRequest.NutritionRequestEnteralFormulaAdministrationComponent t : src.getAdministration())   tgt.addAdministration(convertNutritionOrderEnteralFormulaAdministrationComponent(t));
  tgt.setMaxVolumeToDeliver(convertSimpleQuantity(src.getMaxVolumeToDeliver()));
  tgt.setAdministrationInstruction(src.getAdministrationInstruction());
  return tgt;
}
Program: 23653
Project: 23653
Buggy source:
public org.hl7.fhir.dstu2.model.Medication.MedicationProductBatchComponent convertMedicationProductBatchComponent(org.hl7.fhir.dstu3.model.Medication.MedicationProductBatchComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Medication.MedicationProductBatchComponent tgt=new org.hl7.fhir.dstu2.model.Medication.MedicationProductBatchComponent();
  copyElement(src,tgt);
  tgt.setLotNumber(src.getLotNumber());
  tgt.setExpirationDate(src.getExpirationDate());
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Medication.MedicationProductBatchComponent convertMedicationProductBatchComponent(org.hl7.fhir.dstu3.model.Medication.MedicationProductBatchComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Medication.MedicationProductBatchComponent tgt=new org.hl7.fhir.dstu2.model.Medication.MedicationProductBatchComponent();
  copyElement(src,tgt);
  tgt.setLotNumber(src.getLotNumber());
  tgt.setExpirationDate(src.getExpirationDate());
  return tgt;
}
Program: 23654
Project: 23654
Buggy source:
public org.hl7.fhir.dstu2.model.Questionnaire.QuestionComponent convertQuestionnaireQuestionComponent(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Questionnaire.QuestionComponent tgt=new org.hl7.fhir.dstu2.model.Questionnaire.QuestionComponent();
  copyElement(src,tgt);
  tgt.setLinkId(src.getLinkId());
  for (  org.hl7.fhir.dstu3.model.Coding t : src.getConcept())   tgt.addConcept(convertCoding(t));
  tgt.setText(src.getText());
  tgt.setType(convertQuestionnaireItemType(src.getType()));
  tgt.setRequired(src.getRequired());
  tgt.setRepeats(src.getRepeats());
  tgt.setOptions(convertReference(src.getOptions()));
  for (  org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemOptionComponent t : src.getOption())   if (t.hasValueCoding())   try {
    tgt.addOption(convertCoding(t.getValueCoding()));
  }
 catch (  org.hl7.fhir.dstu3.exceptions.FHIRException e) {
    throw new FHIRException(e);
  }
  for (  org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent t : src.getItem())   tgt.addGroup(convertQuestionnaireGroupComponent(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Questionnaire.QuestionComponent convertQuestionnaireQuestionComponent(org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Questionnaire.QuestionComponent tgt=new org.hl7.fhir.dstu2.model.Questionnaire.QuestionComponent();
  copyElement(src,tgt);
  tgt.setLinkId(src.getLinkId());
  for (  org.hl7.fhir.dstu3.model.Coding t : src.getConcept())   tgt.addConcept(convertCoding(t));
  tgt.setText(src.getText());
  tgt.setType(convertQuestionnaireItemType(src.getType()));
  tgt.setRequired(src.getRequired());
  tgt.setRepeats(src.getRepeats());
  tgt.setOptions(convertReference(src.getOptions()));
  for (  org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemOptionComponent t : src.getOption())   if (t.hasValueCoding())   try {
    tgt.addOption(convertCoding(t.getValueCoding()));
  }
 catch (  org.hl7.fhir.dstu3.exceptions.FHIRException e) {
    throw new FHIRException(e);
  }
  for (  org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemComponent t : src.getItem())   tgt.addGroup(convertQuestionnaireGroupComponent(t));
  return tgt;
}
Program: 23655
Project: 23655
Buggy source:
public org.hl7.fhir.dstu2.model.Signature convertSignature(org.hl7.fhir.dstu3.model.Signature src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Signature tgt=new org.hl7.fhir.dstu2.model.Signature();
  copyElement(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Coding t : src.getType())   tgt.addType(convertCoding(t));
  tgt.setWhen(src.getWhen());
  tgt.setWho(convertType(src.getWho()));
  tgt.setContentType(src.getContentType());
  tgt.setBlob(src.getBlob());
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Signature convertSignature(org.hl7.fhir.dstu3.model.Signature src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Signature tgt=new org.hl7.fhir.dstu2.model.Signature();
  copyElement(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Coding t : src.getType())   tgt.addType(convertCoding(t));
  tgt.setWhen(src.getWhen());
  tgt.setWho(convertType(src.getWho()));
  tgt.setContentType(src.getContentType());
  tgt.setBlob(src.getBlob());
  return tgt;
}
Program: 23656
Project: 23656
Buggy source:
public org.hl7.fhir.dstu2.model.MedicationAdministration.MedicationAdministrationDosageComponent convertMedicationAdministrationDosageComponent(org.hl7.fhir.dstu3.model.MedicationAdministration.MedicationAdministrationDosageComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.MedicationAdministration.MedicationAdministrationDosageComponent tgt=new org.hl7.fhir.dstu2.model.MedicationAdministration.MedicationAdministrationDosageComponent();
  copyElement(src,tgt);
  tgt.setText(src.getText());
  tgt.setSite(convertType(src.getSite()));
  tgt.setRoute(convertCodeableConcept(src.getRoute()));
  tgt.setMethod(convertCodeableConcept(src.getMethod()));
  tgt.setRate(convertType(src.getRate()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.MedicationAdministration.MedicationAdministrationDosageComponent convertMedicationAdministrationDosageComponent(org.hl7.fhir.dstu3.model.MedicationAdministration.MedicationAdministrationDosageComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.MedicationAdministration.MedicationAdministrationDosageComponent tgt=new org.hl7.fhir.dstu2.model.MedicationAdministration.MedicationAdministrationDosageComponent();
  copyElement(src,tgt);
  tgt.setText(src.getText());
  tgt.setSite(convertType(src.getSite()));
  tgt.setRoute(convertCodeableConcept(src.getRoute()));
  tgt.setMethod(convertCodeableConcept(src.getMethod()));
  tgt.setRate(convertType(src.getRate()));
  return tgt;
}
Program: 23657
Project: 23657
Buggy source:
public org.hl7.fhir.dstu2.model.Timing.TimingRepeatComponent convertTimingRepeatComponent(org.hl7.fhir.dstu3.model.Timing.TimingRepeatComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Timing.TimingRepeatComponent tgt=new org.hl7.fhir.dstu2.model.Timing.TimingRepeatComponent();
  copyElement(src,tgt);
  tgt.setBounds(convertType(src.getBounds()));
  tgt.setCount(src.getCount());
  tgt.setDuration(src.getDuration());
  tgt.setDurationMax(src.getDurationMax());
  tgt.setDurationUnits(convertUnitsOfTime(src.getDurationUnit()));
  tgt.setFrequency(src.getFrequency());
  tgt.setFrequencyMax(src.getFrequencyMax());
  tgt.setPeriod(src.getPeriod());
  tgt.setPeriodMax(src.getPeriodMax());
  tgt.setPeriodUnits(convertUnitsOfTime(src.getPeriodUnit()));
  tgt.setWhen(convertEventTiming(src.getWhen()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Timing.TimingRepeatComponent convertTimingRepeatComponent(org.hl7.fhir.dstu3.model.Timing.TimingRepeatComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Timing.TimingRepeatComponent tgt=new org.hl7.fhir.dstu2.model.Timing.TimingRepeatComponent();
  copyElement(src,tgt);
  tgt.setBounds(convertType(src.getBounds()));
  tgt.setCount(src.getCount());
  tgt.setDuration(src.getDuration());
  tgt.setDurationMax(src.getDurationMax());
  tgt.setDurationUnits(convertUnitsOfTime(src.getDurationUnit()));
  tgt.setFrequency(src.getFrequency());
  tgt.setFrequencyMax(src.getFrequencyMax());
  tgt.setPeriod(src.getPeriod());
  tgt.setPeriodMax(src.getPeriodMax());
  tgt.setPeriodUnits(convertUnitsOfTime(src.getPeriodUnit()));
  tgt.setWhen(convertEventTiming(src.getWhen()));
  return tgt;
}
Program: 23658
Project: 23658
Buggy source:
public org.hl7.fhir.dstu2.model.ConceptMap.SourceElementComponent convertSourceElementComponent(org.hl7.fhir.dstu3.model.ConceptMap.SourceElementComponent src,org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupComponent g) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.ConceptMap.SourceElementComponent tgt=new org.hl7.fhir.dstu2.model.ConceptMap.SourceElementComponent();
  copyElement(src,tgt);
  tgt.setCodeSystem(g.getSource());
  tgt.setCode(src.getCode());
  for (  org.hl7.fhir.dstu3.model.ConceptMap.TargetElementComponent t : src.getTarget())   tgt.addTarget(convertTargetElementComponent(t,g));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.ConceptMap.SourceElementComponent convertSourceElementComponent(org.hl7.fhir.dstu3.model.ConceptMap.SourceElementComponent src,org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupComponent g) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.ConceptMap.SourceElementComponent tgt=new org.hl7.fhir.dstu2.model.ConceptMap.SourceElementComponent();
  copyElement(src,tgt);
  tgt.setCodeSystem(g.getSource());
  tgt.setCode(src.getCode());
  for (  org.hl7.fhir.dstu3.model.ConceptMap.TargetElementComponent t : src.getTarget())   tgt.addTarget(convertTargetElementComponent(t,g));
  return tgt;
}
Program: 23659
Project: 23659
Buggy source:
public org.hl7.fhir.dstu2.model.Encounter.EncounterHospitalizationComponent convertEncounterHospitalizationComponent(org.hl7.fhir.dstu3.model.Encounter.EncounterHospitalizationComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Encounter.EncounterHospitalizationComponent tgt=new org.hl7.fhir.dstu2.model.Encounter.EncounterHospitalizationComponent();
  copyElement(src,tgt);
  tgt.setPreAdmissionIdentifier(convertIdentifier(src.getPreAdmissionIdentifier()));
  tgt.setOrigin(convertReference(src.getOrigin()));
  tgt.setAdmitSource(convertCodeableConcept(src.getAdmitSource()));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getAdmittingDiagnosis())   tgt.addAdmittingDiagnosis(convertReference(t));
  tgt.setReAdmission(convertCodeableConcept(src.getReAdmission()));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getDietPreference())   tgt.addDietPreference(convertCodeableConcept(t));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialCourtesy())   tgt.addSpecialCourtesy(convertCodeableConcept(t));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialArrangement())   tgt.addSpecialArrangement(convertCodeableConcept(t));
  tgt.setDestination(convertReference(src.getDestination()));
  tgt.setDischargeDisposition(convertCodeableConcept(src.getDischargeDisposition()));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getDischargeDiagnosis())   tgt.addDischargeDiagnosis(convertReference(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Encounter.EncounterHospitalizationComponent convertEncounterHospitalizationComponent(org.hl7.fhir.dstu3.model.Encounter.EncounterHospitalizationComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Encounter.EncounterHospitalizationComponent tgt=new org.hl7.fhir.dstu2.model.Encounter.EncounterHospitalizationComponent();
  copyElement(src,tgt);
  tgt.setPreAdmissionIdentifier(convertIdentifier(src.getPreAdmissionIdentifier()));
  tgt.setOrigin(convertReference(src.getOrigin()));
  tgt.setAdmitSource(convertCodeableConcept(src.getAdmitSource()));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getAdmittingDiagnosis())   tgt.addAdmittingDiagnosis(convertReference(t));
  tgt.setReAdmission(convertCodeableConcept(src.getReAdmission()));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getDietPreference())   tgt.addDietPreference(convertCodeableConcept(t));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialCourtesy())   tgt.addSpecialCourtesy(convertCodeableConcept(t));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialArrangement())   tgt.addSpecialArrangement(convertCodeableConcept(t));
  tgt.setDestination(convertReference(src.getDestination()));
  tgt.setDischargeDisposition(convertCodeableConcept(src.getDischargeDisposition()));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getDischargeDiagnosis())   tgt.addDischargeDiagnosis(convertReference(t));
  return tgt;
}
Program: 23660
Project: 23660
Buggy source:
public org.hl7.fhir.dstu2.model.HumanName convertHumanName(org.hl7.fhir.dstu3.model.HumanName src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.HumanName tgt=new org.hl7.fhir.dstu2.model.HumanName();
  copyElement(src,tgt);
  tgt.setUse(convertNameUse(src.getUse()));
  tgt.setText(src.getText());
  for (  org.hl7.fhir.dstu3.model.StringType t : src.getFamily())   tgt.addFamily(t.getValue());
  for (  org.hl7.fhir.dstu3.model.StringType t : src.getGiven())   tgt.addGiven(t.getValue());
  for (  org.hl7.fhir.dstu3.model.StringType t : src.getPrefix())   tgt.addPrefix(t.getValue());
  for (  org.hl7.fhir.dstu3.model.StringType t : src.getSuffix())   tgt.addSuffix(t.getValue());
  tgt.setPeriod(convertPeriod(src.getPeriod()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.HumanName convertHumanName(org.hl7.fhir.dstu3.model.HumanName src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.HumanName tgt=new org.hl7.fhir.dstu2.model.HumanName();
  copyElement(src,tgt);
  tgt.setUse(convertNameUse(src.getUse()));
  tgt.setText(src.getText());
  for (  org.hl7.fhir.dstu3.model.StringType t : src.getFamily())   tgt.addFamily(t.getValue());
  for (  org.hl7.fhir.dstu3.model.StringType t : src.getGiven())   tgt.addGiven(t.getValue());
  for (  org.hl7.fhir.dstu3.model.StringType t : src.getPrefix())   tgt.addPrefix(t.getValue());
  for (  org.hl7.fhir.dstu3.model.StringType t : src.getSuffix())   tgt.addSuffix(t.getValue());
  tgt.setPeriod(convertPeriod(src.getPeriod()));
  return tgt;
}
Program: 23661
Project: 23661
Buggy source:
public org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionDesignationComponent convertConceptReferenceDesignationComponent(org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceDesignationComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionDesignationComponent tgt=new org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionDesignationComponent();
  copyElement(src,tgt);
  tgt.setLanguage(src.getLanguage());
  tgt.setUse(convertCoding(src.getUse()));
  tgt.setValue(src.getValue());
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionDesignationComponent convertConceptReferenceDesignationComponent(org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceDesignationComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionDesignationComponent tgt=new org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionDesignationComponent();
  copyElement(src,tgt);
  tgt.setLanguage(src.getLanguage());
  tgt.setUse(convertCoding(src.getUse()));
  tgt.setValue(src.getValue());
  return tgt;
}
Program: 23662
Project: 23662
Buggy source:
public org.hl7.fhir.dstu2.model.Encounter.EncounterClass convertEncounterClass(org.hl7.fhir.dstu3.model.Coding src) throws FHIRException {
  if (src == null)   return null;
  if (src.getSystem().equals("String_Node_Str")) {
    if (src.getCode().equals("String_Node_Str"))     return org.hl7.fhir.dstu2.model.Encounter.EncounterClass.INPATIENT;
    if (src.getCode().equals("String_Node_Str"))     return org.hl7.fhir.dstu2.model.Encounter.EncounterClass.AMBULATORY;
    if (src.getCode().equals("String_Node_Str"))     return org.hl7.fhir.dstu2.model.Encounter.EncounterClass.EMERGENCY;
    if (src.getCode().equals("String_Node_Str"))     return org.hl7.fhir.dstu2.model.Encounter.EncounterClass.HOME;
    if (src.getCode().equals("String_Node_Str"))     return org.hl7.fhir.dstu2.model.Encounter.EncounterClass.FIELD;
    if (src.getCode().equals("String_Node_Str"))     return org.hl7.fhir.dstu2.model.Encounter.EncounterClass.DAYTIME;
    if (src.getCode().equals("String_Node_Str"))     return org.hl7.fhir.dstu2.model.Encounter.EncounterClass.VIRTUAL;
  }
  return org.hl7.fhir.dstu2.model.Encounter.EncounterClass.NULL;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Encounter.EncounterClass convertEncounterClass(org.hl7.fhir.dstu3.model.Coding src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  if (src.getSystem().equals("String_Node_Str")) {
    if (src.getCode().equals("String_Node_Str"))     return org.hl7.fhir.dstu2.model.Encounter.EncounterClass.INPATIENT;
    if (src.getCode().equals("String_Node_Str"))     return org.hl7.fhir.dstu2.model.Encounter.EncounterClass.AMBULATORY;
    if (src.getCode().equals("String_Node_Str"))     return org.hl7.fhir.dstu2.model.Encounter.EncounterClass.EMERGENCY;
    if (src.getCode().equals("String_Node_Str"))     return org.hl7.fhir.dstu2.model.Encounter.EncounterClass.HOME;
    if (src.getCode().equals("String_Node_Str"))     return org.hl7.fhir.dstu2.model.Encounter.EncounterClass.FIELD;
    if (src.getCode().equals("String_Node_Str"))     return org.hl7.fhir.dstu2.model.Encounter.EncounterClass.DAYTIME;
    if (src.getCode().equals("String_Node_Str"))     return org.hl7.fhir.dstu2.model.Encounter.EncounterClass.VIRTUAL;
  }
  return org.hl7.fhir.dstu2.model.Encounter.EncounterClass.NULL;
}
Program: 23663
Project: 23663
Buggy source:
public org.hl7.fhir.dstu2.model.Parameters.ParametersParameterComponent convertParametersParameterComponent(org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Parameters.ParametersParameterComponent tgt=new org.hl7.fhir.dstu2.model.Parameters.ParametersParameterComponent();
  copyElement(src,tgt);
  tgt.setName(src.getName());
  tgt.setValue(convertType(src.getValue()));
  tgt.setResource(convertResource(src.getResource()));
  for (  org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent t : src.getPart())   tgt.addPart(convertParametersParameterComponent(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Parameters.ParametersParameterComponent convertParametersParameterComponent(org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Parameters.ParametersParameterComponent tgt=new org.hl7.fhir.dstu2.model.Parameters.ParametersParameterComponent();
  copyElement(src,tgt);
  tgt.setName(src.getName());
  tgt.setValue(convertType(src.getValue()));
  tgt.setResource(convertResource(src.getResource()));
  for (  org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent t : src.getPart())   tgt.addPart(convertParametersParameterComponent(t));
  return tgt;
}
Program: 23664
Project: 23664
Buggy source:
public org.hl7.fhir.dstu2.model.DeviceComponent convertDeviceComponent(org.hl7.fhir.dstu3.model.DeviceComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.DeviceComponent tgt=new org.hl7.fhir.dstu2.model.DeviceComponent();
  copyDomainResource(src,tgt);
  tgt.setType(convertCodeableConcept(src.getType()));
  tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
  tgt.setLastSystemChange(src.getLastSystemChange());
  tgt.setSource(convertReference(src.getSource()));
  tgt.setParent(convertReference(src.getParent()));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getOperationalStatus())   tgt.addOperationalStatus(convertCodeableConcept(t));
  tgt.setParameterGroup(convertCodeableConcept(src.getParameterGroup()));
  tgt.setMeasurementPrinciple(convertMeasmntPrinciple(src.getMeasurementPrinciple()));
  for (  org.hl7.fhir.dstu3.model.DeviceComponent.DeviceComponentProductionSpecificationComponent t : src.getProductionSpecification())   tgt.addProductionSpecification(convertDeviceComponentProductionSpecificationComponent(t));
  tgt.setLanguageCode(convertCodeableConcept(src.getLanguageCode()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.DeviceComponent convertDeviceComponent(org.hl7.fhir.dstu3.model.DeviceComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.DeviceComponent tgt=new org.hl7.fhir.dstu2.model.DeviceComponent();
  copyDomainResource(src,tgt);
  tgt.setType(convertCodeableConcept(src.getType()));
  tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
  tgt.setLastSystemChange(src.getLastSystemChange());
  tgt.setSource(convertReference(src.getSource()));
  tgt.setParent(convertReference(src.getParent()));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getOperationalStatus())   tgt.addOperationalStatus(convertCodeableConcept(t));
  tgt.setParameterGroup(convertCodeableConcept(src.getParameterGroup()));
  tgt.setMeasurementPrinciple(convertMeasmntPrinciple(src.getMeasurementPrinciple()));
  for (  org.hl7.fhir.dstu3.model.DeviceComponent.DeviceComponentProductionSpecificationComponent t : src.getProductionSpecification())   tgt.addProductionSpecification(convertDeviceComponentProductionSpecificationComponent(t));
  tgt.setLanguageCode(convertCodeableConcept(src.getLanguageCode()));
  return tgt;
}
Program: 23665
Project: 23665
Buggy source:
public org.hl7.fhir.dstu2.model.RelatedPerson convertRelatedPerson(org.hl7.fhir.dstu3.model.RelatedPerson src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.RelatedPerson tgt=new org.hl7.fhir.dstu2.model.RelatedPerson();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setPatient(convertReference(src.getPatient()));
  tgt.setRelationship(convertCodeableConcept(src.getRelationship()));
  if (!src.getName().isEmpty())   tgt.setName(convertHumanName(src.getName().get(0)));
  for (  org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom())   tgt.addTelecom(convertContactPoint(t));
  tgt.setGender(convertAdministrativeGender(src.getGender()));
  tgt.setBirthDate(src.getBirthDate());
  for (  org.hl7.fhir.dstu3.model.Address t : src.getAddress())   tgt.addAddress(convertAddress(t));
  for (  org.hl7.fhir.dstu3.model.Attachment t : src.getPhoto())   tgt.addPhoto(convertAttachment(t));
  tgt.setPeriod(convertPeriod(src.getPeriod()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.RelatedPerson convertRelatedPerson(org.hl7.fhir.dstu3.model.RelatedPerson src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.RelatedPerson tgt=new org.hl7.fhir.dstu2.model.RelatedPerson();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setPatient(convertReference(src.getPatient()));
  tgt.setRelationship(convertCodeableConcept(src.getRelationship()));
  if (!src.getName().isEmpty())   tgt.setName(convertHumanName(src.getName().get(0)));
  for (  org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom())   tgt.addTelecom(convertContactPoint(t));
  tgt.setGender(convertAdministrativeGender(src.getGender()));
  tgt.setBirthDate(src.getBirthDate());
  for (  org.hl7.fhir.dstu3.model.Address t : src.getAddress())   tgt.addAddress(convertAddress(t));
  for (  org.hl7.fhir.dstu3.model.Attachment t : src.getPhoto())   tgt.addPhoto(convertAttachment(t));
  tgt.setPeriod(convertPeriod(src.getPeriod()));
  return tgt;
}
Program: 23666
Project: 23666
Buggy source:
public org.hl7.fhir.dstu2.model.Conformance.ConformanceImplementationComponent convertConformanceImplementationComponent(org.hl7.fhir.dstu3.model.Conformance.ConformanceImplementationComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Conformance.ConformanceImplementationComponent tgt=new org.hl7.fhir.dstu2.model.Conformance.ConformanceImplementationComponent();
  copyElement(src,tgt);
  tgt.setDescription(src.getDescription());
  tgt.setUrl(src.getUrl());
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Conformance.ConformanceImplementationComponent convertConformanceImplementationComponent(org.hl7.fhir.dstu3.model.Conformance.ConformanceImplementationComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Conformance.ConformanceImplementationComponent tgt=new org.hl7.fhir.dstu2.model.Conformance.ConformanceImplementationComponent();
  copyElement(src,tgt);
  tgt.setDescription(src.getDescription());
  tgt.setUrl(src.getUrl());
  return tgt;
}
Program: 23667
Project: 23667
Buggy source:
public org.hl7.fhir.dstu2.model.Contract.ActorComponent convertAgentComponent(org.hl7.fhir.dstu3.model.Contract.AgentComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Contract.ActorComponent tgt=new org.hl7.fhir.dstu2.model.Contract.ActorComponent();
  copyElement(src,tgt);
  tgt.setEntity(convertReference(src.getActor()));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getRole())   tgt.addRole(convertCodeableConcept(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Contract.ActorComponent convertAgentComponent(org.hl7.fhir.dstu3.model.Contract.AgentComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Contract.ActorComponent tgt=new org.hl7.fhir.dstu2.model.Contract.ActorComponent();
  copyElement(src,tgt);
  tgt.setEntity(convertReference(src.getActor()));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getRole())   tgt.addRole(convertCodeableConcept(t));
  return tgt;
}
Program: 23668
Project: 23668
Buggy source:
public org.hl7.fhir.dstu2.model.OperationOutcome.OperationOutcomeIssueComponent convertOperationOutcomeIssueComponent(org.hl7.fhir.dstu3.model.OperationOutcome.OperationOutcomeIssueComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.OperationOutcome.OperationOutcomeIssueComponent tgt=new org.hl7.fhir.dstu2.model.OperationOutcome.OperationOutcomeIssueComponent();
  copyElement(src,tgt);
  tgt.setSeverity(convertIssueSeverity(src.getSeverity()));
  tgt.setCode(convertIssueType(src.getCode()));
  tgt.setDetails(convertCodeableConcept(src.getDetails()));
  tgt.setDiagnostics(src.getDiagnostics());
  for (  org.hl7.fhir.dstu3.model.StringType t : src.getLocation())   tgt.addLocation(t.getValue());
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.OperationOutcome.OperationOutcomeIssueComponent convertOperationOutcomeIssueComponent(org.hl7.fhir.dstu3.model.OperationOutcome.OperationOutcomeIssueComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.OperationOutcome.OperationOutcomeIssueComponent tgt=new org.hl7.fhir.dstu2.model.OperationOutcome.OperationOutcomeIssueComponent();
  copyElement(src,tgt);
  tgt.setSeverity(convertIssueSeverity(src.getSeverity()));
  tgt.setCode(convertIssueType(src.getCode()));
  tgt.setDetails(convertCodeableConcept(src.getDetails()));
  tgt.setDiagnostics(src.getDiagnostics());
  for (  org.hl7.fhir.dstu3.model.StringType t : src.getLocation())   tgt.addLocation(t.getValue());
  return tgt;
}
Program: 23669
Project: 23669
Buggy source:
public org.hl7.fhir.dstu2.model.ClinicalImpression convertClinicalImpression(org.hl7.fhir.dstu3.model.ClinicalImpression src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.ClinicalImpression tgt=new org.hl7.fhir.dstu2.model.ClinicalImpression();
  copyDomainResource(src,tgt);
  tgt.setPatient(convertReference(src.getSubject()));
  tgt.setAssessor(convertReference(src.getAssessor()));
  tgt.setStatus(convertClinicalImpressionStatus(src.getStatus()));
  tgt.setDate(src.getDate());
  tgt.setDescription(src.getDescription());
  tgt.setPrevious(convertReference(src.getPrevious()));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getProblem())   tgt.addProblem(convertReference(t));
  for (  org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionInvestigationsComponent t : src.getInvestigations())   tgt.addInvestigations(convertClinicalImpressionInvestigationsComponent(t));
  for (  UriType t : src.getProtocol())   tgt.setProtocol(t.asStringValue());
  tgt.setSummary(src.getSummary());
  for (  org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionFindingComponent t : src.getFinding())   tgt.addFinding(convertClinicalImpressionFindingComponent(t));
  tgt.setPrognosis(src.getPrognosisCodeableConceptFirstRep().getText());
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getPlan())   tgt.addPlan(convertReference(t));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getAction())   tgt.addAction(convertReference(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.ClinicalImpression convertClinicalImpression(org.hl7.fhir.dstu3.model.ClinicalImpression src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.ClinicalImpression tgt=new org.hl7.fhir.dstu2.model.ClinicalImpression();
  copyDomainResource(src,tgt);
  tgt.setPatient(convertReference(src.getSubject()));
  tgt.setAssessor(convertReference(src.getAssessor()));
  tgt.setStatus(convertClinicalImpressionStatus(src.getStatus()));
  tgt.setDate(src.getDate());
  tgt.setDescription(src.getDescription());
  tgt.setPrevious(convertReference(src.getPrevious()));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getProblem())   tgt.addProblem(convertReference(t));
  for (  org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionInvestigationsComponent t : src.getInvestigations())   tgt.addInvestigations(convertClinicalImpressionInvestigationsComponent(t));
  for (  UriType t : src.getProtocol())   tgt.setProtocol(t.asStringValue());
  tgt.setSummary(src.getSummary());
  for (  org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionFindingComponent t : src.getFinding())   tgt.addFinding(convertClinicalImpressionFindingComponent(t));
  tgt.setPrognosis(src.getPrognosisCodeableConceptFirstRep().getText());
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getPlan())   tgt.addPlan(convertReference(t));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getAction())   tgt.addAction(convertReference(t));
  return tgt;
}
Program: 23670
Project: 23670
Buggy source:
public org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceSearchParamComponent convertConformanceRestResourceSearchParamComponent(org.hl7.fhir.dstu3.model.Conformance.ConformanceRestResourceSearchParamComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceSearchParamComponent tgt=new org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceSearchParamComponent();
  copyElement(src,tgt);
  tgt.setName(src.getName());
  tgt.setDefinition(src.getDefinition());
  tgt.setType(convertSearchParamType(src.getType()));
  tgt.setDocumentation(src.getDocumentation());
  for (  org.hl7.fhir.dstu3.model.CodeType t : src.getTarget())   tgt.addTarget(t.getValue());
  for (  org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Conformance.SearchModifierCode> t : src.getModifier())   tgt.addModifier(convertSearchModifierCode(t.getValue()));
  for (  org.hl7.fhir.dstu3.model.StringType t : src.getChain())   tgt.addChain(t.getValue());
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceSearchParamComponent convertConformanceRestResourceSearchParamComponent(org.hl7.fhir.dstu3.model.Conformance.ConformanceRestResourceSearchParamComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceSearchParamComponent tgt=new org.hl7.fhir.dstu2.model.Conformance.ConformanceRestResourceSearchParamComponent();
  copyElement(src,tgt);
  tgt.setName(src.getName());
  tgt.setDefinition(src.getDefinition());
  tgt.setType(convertSearchParamType(src.getType()));
  tgt.setDocumentation(src.getDocumentation());
  for (  org.hl7.fhir.dstu3.model.CodeType t : src.getTarget())   tgt.addTarget(t.getValue());
  for (  org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Conformance.SearchModifierCode> t : src.getModifier())   tgt.addModifier(convertSearchModifierCode(t.getValue()));
  for (  org.hl7.fhir.dstu3.model.StringType t : src.getChain())   tgt.addChain(t.getValue());
  return tgt;
}
Program: 23671
Project: 23671
Buggy source:
public org.hl7.fhir.dstu2.model.Conformance.ConformanceRestSecurityCertificateComponent convertConformanceRestSecurityCertificateComponent(org.hl7.fhir.dstu3.model.Conformance.ConformanceRestSecurityCertificateComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Conformance.ConformanceRestSecurityCertificateComponent tgt=new org.hl7.fhir.dstu2.model.Conformance.ConformanceRestSecurityCertificateComponent();
  copyElement(src,tgt);
  tgt.setType(src.getType());
  tgt.setBlob(src.getBlob());
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Conformance.ConformanceRestSecurityCertificateComponent convertConformanceRestSecurityCertificateComponent(org.hl7.fhir.dstu3.model.Conformance.ConformanceRestSecurityCertificateComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Conformance.ConformanceRestSecurityCertificateComponent tgt=new org.hl7.fhir.dstu2.model.Conformance.ConformanceRestSecurityCertificateComponent();
  copyElement(src,tgt);
  tgt.setType(src.getType());
  tgt.setBlob(src.getBlob());
  return tgt;
}
Program: 23672
Project: 23672
Buggy source:
public org.hl7.fhir.dstu2.model.Conformance.ConformanceRestSecurityComponent convertConformanceRestSecurityComponent(org.hl7.fhir.dstu3.model.Conformance.ConformanceRestSecurityComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Conformance.ConformanceRestSecurityComponent tgt=new org.hl7.fhir.dstu2.model.Conformance.ConformanceRestSecurityComponent();
  copyElement(src,tgt);
  tgt.setCors(src.getCors());
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getService())   tgt.addService(convertCodeableConcept(t));
  tgt.setDescription(src.getDescription());
  for (  org.hl7.fhir.dstu3.model.Conformance.ConformanceRestSecurityCertificateComponent t : src.getCertificate())   tgt.addCertificate(convertConformanceRestSecurityCertificateComponent(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Conformance.ConformanceRestSecurityComponent convertConformanceRestSecurityComponent(org.hl7.fhir.dstu3.model.Conformance.ConformanceRestSecurityComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Conformance.ConformanceRestSecurityComponent tgt=new org.hl7.fhir.dstu2.model.Conformance.ConformanceRestSecurityComponent();
  copyElement(src,tgt);
  tgt.setCors(src.getCors());
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getService())   tgt.addService(convertCodeableConcept(t));
  tgt.setDescription(src.getDescription());
  for (  org.hl7.fhir.dstu3.model.Conformance.ConformanceRestSecurityCertificateComponent t : src.getCertificate())   tgt.addCertificate(convertConformanceRestSecurityCertificateComponent(t));
  return tgt;
}
Program: 23673
Project: 23673
Buggy source:
public org.hl7.fhir.dstu2.model.SampledData convertSampledData(org.hl7.fhir.dstu3.model.SampledData src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.SampledData tgt=new org.hl7.fhir.dstu2.model.SampledData();
  copyElement(src,tgt);
  tgt.setOrigin(convertSimpleQuantity(src.getOrigin()));
  tgt.setPeriod(src.getPeriod());
  tgt.setFactor(src.getFactor());
  tgt.setLowerLimit(src.getLowerLimit());
  tgt.setUpperLimit(src.getUpperLimit());
  tgt.setDimensions(src.getDimensions());
  tgt.setData(src.getData());
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.SampledData convertSampledData(org.hl7.fhir.dstu3.model.SampledData src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.SampledData tgt=new org.hl7.fhir.dstu2.model.SampledData();
  copyElement(src,tgt);
  tgt.setOrigin(convertSimpleQuantity(src.getOrigin()));
  tgt.setPeriod(src.getPeriod());
  tgt.setFactor(src.getFactor());
  tgt.setLowerLimit(src.getLowerLimit());
  tgt.setUpperLimit(src.getUpperLimit());
  tgt.setDimensions(src.getDimensions());
  tgt.setData(src.getData());
  return tgt;
}
Program: 23674
Project: 23674
Buggy source:
public org.hl7.fhir.dstu2.model.ImagingStudy.ImagingStudySeriesComponent convertImagingStudySeriesComponent(org.hl7.fhir.dstu3.model.ImagingStudy.ImagingStudySeriesComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.ImagingStudy.ImagingStudySeriesComponent tgt=new org.hl7.fhir.dstu2.model.ImagingStudy.ImagingStudySeriesComponent();
  copyElement(src,tgt);
  tgt.setUid(src.getUid());
  tgt.setNumber(src.getNumber());
  tgt.setModality(convertCoding(src.getModality()));
  tgt.setDescription(src.getDescription());
  tgt.setNumberOfInstances(src.getNumberOfInstances());
  tgt.setAvailability(convertInstanceAvailability(src.getAvailability()));
  tgt.setBodySite(convertCoding(src.getBodySite()));
  tgt.setLaterality(convertCoding(src.getLaterality()));
  tgt.setStarted(src.getStarted());
  for (  org.hl7.fhir.dstu3.model.ImagingStudy.ImagingStudySeriesInstanceComponent t : src.getInstance())   tgt.addInstance(convertImagingStudySeriesInstanceComponent(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.ImagingStudy.ImagingStudySeriesComponent convertImagingStudySeriesComponent(org.hl7.fhir.dstu3.model.ImagingStudy.ImagingStudySeriesComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.ImagingStudy.ImagingStudySeriesComponent tgt=new org.hl7.fhir.dstu2.model.ImagingStudy.ImagingStudySeriesComponent();
  copyElement(src,tgt);
  tgt.setUid(src.getUid());
  tgt.setNumber(src.getNumber());
  tgt.setModality(convertCoding(src.getModality()));
  tgt.setDescription(src.getDescription());
  tgt.setNumberOfInstances(src.getNumberOfInstances());
  tgt.setAvailability(convertInstanceAvailability(src.getAvailability()));
  tgt.setBodySite(convertCoding(src.getBodySite()));
  tgt.setLaterality(convertCoding(src.getLaterality()));
  tgt.setStarted(src.getStarted());
  for (  org.hl7.fhir.dstu3.model.ImagingStudy.ImagingStudySeriesInstanceComponent t : src.getInstance())   tgt.addInstance(convertImagingStudySeriesInstanceComponent(t));
  return tgt;
}
Program: 23675
Project: 23675
Buggy source:
public org.hl7.fhir.dstu2.model.Ratio convertRatio(org.hl7.fhir.dstu3.model.Ratio src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Ratio tgt=new org.hl7.fhir.dstu2.model.Ratio();
  copyElement(src,tgt);
  tgt.setNumerator(convertQuantity(src.getNumerator()));
  tgt.setDenominator(convertQuantity(src.getDenominator()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Ratio convertRatio(org.hl7.fhir.dstu3.model.Ratio src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Ratio tgt=new org.hl7.fhir.dstu2.model.Ratio();
  copyElement(src,tgt);
  tgt.setNumerator(convertQuantity(src.getNumerator()));
  tgt.setDenominator(convertQuantity(src.getDenominator()));
  return tgt;
}
Program: 23676
Project: 23676
Buggy source:
public org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageResourceComponent convertImplementationGuidePackageResourceComponent(org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageResourceComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageResourceComponent tgt=new org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageResourceComponent();
  copyElement(src,tgt);
  if (src.getExample())   tgt.setPurpose(org.hl7.fhir.dstu2.model.ImplementationGuide.GuideResourcePurpose.EXAMPLE);
  tgt.setName(src.getName());
  tgt.setDescription(src.getDescription());
  tgt.setAcronym(src.getAcronym());
  tgt.setSource(convertType(src.getSource()));
  tgt.setExampleFor(convertReference(src.getExampleFor()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageResourceComponent convertImplementationGuidePackageResourceComponent(org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePackageResourceComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageResourceComponent tgt=new org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePackageResourceComponent();
  copyElement(src,tgt);
  if (src.getExample())   tgt.setPurpose(org.hl7.fhir.dstu2.model.ImplementationGuide.GuideResourcePurpose.EXAMPLE);
  tgt.setName(src.getName());
  tgt.setDescription(src.getDescription());
  tgt.setAcronym(src.getAcronym());
  tgt.setSource(convertType(src.getSource()));
  tgt.setExampleFor(convertReference(src.getExampleFor()));
  return tgt;
}
Program: 23677
Project: 23677
Buggy source:
public org.hl7.fhir.dstu2.model.Provenance.ProvenanceAgentComponent convertProvenanceAgentComponent(org.hl7.fhir.dstu3.model.Provenance.ProvenanceAgentComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Provenance.ProvenanceAgentComponent tgt=new org.hl7.fhir.dstu2.model.Provenance.ProvenanceAgentComponent();
  copyElement(src,tgt);
  tgt.setRole(convertCoding(src.getRole()));
  tgt.setActor(convertReference(src.getActor()));
  tgt.setUserId(convertIdentifier(src.getUserId()));
  for (  org.hl7.fhir.dstu3.model.Provenance.ProvenanceAgentRelatedAgentComponent t : src.getRelatedAgent())   tgt.addRelatedAgent(convertProvenanceAgentRelatedAgentComponent(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Provenance.ProvenanceAgentComponent convertProvenanceAgentComponent(org.hl7.fhir.dstu3.model.Provenance.ProvenanceAgentComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Provenance.ProvenanceAgentComponent tgt=new org.hl7.fhir.dstu2.model.Provenance.ProvenanceAgentComponent();
  copyElement(src,tgt);
  tgt.setRole(convertCoding(src.getRole()));
  tgt.setActor(convertReference(src.getActor()));
  tgt.setUserId(convertIdentifier(src.getUserId()));
  for (  org.hl7.fhir.dstu3.model.Provenance.ProvenanceAgentRelatedAgentComponent t : src.getRelatedAgent())   tgt.addRelatedAgent(convertProvenanceAgentRelatedAgentComponent(t));
  return tgt;
}
Program: 23678
Project: 23678
Buggy source:
public org.hl7.fhir.dstu2.model.Parameters convertParameters(org.hl7.fhir.dstu3.model.Parameters src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Parameters tgt=new org.hl7.fhir.dstu2.model.Parameters();
  copyResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent t : src.getParameter())   tgt.addParameter(convertParametersParameterComponent(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Parameters convertParameters(org.hl7.fhir.dstu3.model.Parameters src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Parameters tgt=new org.hl7.fhir.dstu2.model.Parameters();
  copyResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent t : src.getParameter())   tgt.addParameter(convertParametersParameterComponent(t));
  return tgt;
}