nus-yam/ex-repair huggingface dataset:
Program: 23586
Project: 23586
Buggy source:
public org.hl7.fhir.dstu2.model.ProcedureRequest convertProcedureRequest(org.hl7.fhir.dstu3.model.ProcedureRequest src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.ProcedureRequest tgt=new org.hl7.fhir.dstu2.model.ProcedureRequest();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setSubject(convertReference(src.getSubject()));
  tgt.setCode(convertCodeableConcept(src.getCode()));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getBodySite())   tgt.addBodySite(convertCodeableConcept(t));
  tgt.setReason(convertType(src.getReason()));
  tgt.setScheduled(convertType(src.getScheduled()));
  tgt.setEncounter(convertReference(src.getEncounter()));
  tgt.setPerformer(convertReference(src.getPerformer()));
  tgt.setStatus(convertProcedureRequestStatus(src.getStatus()));
  for (  org.hl7.fhir.dstu3.model.Annotation t : src.getNotes())   tgt.addNotes(convertAnnotation(t));
  tgt.setAsNeeded(convertType(src.getAsNeeded()));
  tgt.setOrderedOn(src.getOrderedOn());
  tgt.setOrderer(convertReference(src.getOrderer()));
  tgt.setPriority(convertProcedureRequestPriority(src.getPriority()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.ProcedureRequest convertProcedureRequest(org.hl7.fhir.dstu3.model.ProcedureRequest src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.ProcedureRequest tgt=new org.hl7.fhir.dstu2.model.ProcedureRequest();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setSubject(convertReference(src.getSubject()));
  tgt.setCode(convertCodeableConcept(src.getCode()));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getBodySite())   tgt.addBodySite(convertCodeableConcept(t));
  tgt.setReason(convertType(src.getReason()));
  tgt.setScheduled(convertType(src.getScheduled()));
  tgt.setEncounter(convertReference(src.getEncounter()));
  tgt.setPerformer(convertReference(src.getPerformer()));
  tgt.setStatus(convertProcedureRequestStatus(src.getStatus()));
  for (  org.hl7.fhir.dstu3.model.Annotation t : src.getNotes())   tgt.addNotes(convertAnnotation(t));
  tgt.setAsNeeded(convertType(src.getAsNeeded()));
  tgt.setOrderedOn(src.getOrderedOn());
  tgt.setOrderer(convertReference(src.getOrderer()));
  tgt.setPriority(convertProcedureRequestPriority(src.getPriority()));
  return tgt;
}
Program: 23587
Project: 23587
Buggy source:
public org.hl7.fhir.dstu2.model.ValueSet.ConceptSetComponent convertConceptSetComponent(org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.ValueSet.ConceptSetComponent tgt=new org.hl7.fhir.dstu2.model.ValueSet.ConceptSetComponent();
  copyElement(src,tgt);
  tgt.setSystem(src.getSystem());
  tgt.setVersion(src.getVersion());
  for (  org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceComponent t : src.getConcept())   tgt.addConcept(convertConceptReferenceComponent(t));
  for (  org.hl7.fhir.dstu3.model.ValueSet.ConceptSetFilterComponent t : src.getFilter())   tgt.addFilter(convertConceptSetFilterComponent(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.ValueSet.ConceptSetComponent convertConceptSetComponent(org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.ValueSet.ConceptSetComponent tgt=new org.hl7.fhir.dstu2.model.ValueSet.ConceptSetComponent();
  copyElement(src,tgt);
  tgt.setSystem(src.getSystem());
  tgt.setVersion(src.getVersion());
  for (  org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceComponent t : src.getConcept())   tgt.addConcept(convertConceptReferenceComponent(t));
  for (  org.hl7.fhir.dstu3.model.ValueSet.ConceptSetFilterComponent t : src.getFilter())   tgt.addFilter(convertConceptSetFilterComponent(t));
  return tgt;
}
Program: 23588
Project: 23588
Buggy source:
public org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectDetailComponent convertAuditEventEntityDetailComponent(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityDetailComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectDetailComponent tgt=new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectDetailComponent();
  copyElement(src,tgt);
  tgt.setType(src.getType());
  tgt.setValue(src.getValue());
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectDetailComponent convertAuditEventEntityDetailComponent(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityDetailComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectDetailComponent tgt=new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectDetailComponent();
  copyElement(src,tgt);
  tgt.setType(src.getType());
  tgt.setValue(src.getValue());
  return tgt;
}
Program: 23589
Project: 23589
Buggy source:
public org.hl7.fhir.dstu2.model.Substance.SubstanceIngredientComponent convertSubstanceIngredientComponent(org.hl7.fhir.dstu3.model.Substance.SubstanceIngredientComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Substance.SubstanceIngredientComponent tgt=new org.hl7.fhir.dstu2.model.Substance.SubstanceIngredientComponent();
  copyElement(src,tgt);
  tgt.setQuantity(convertRatio(src.getQuantity()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Substance.SubstanceIngredientComponent convertSubstanceIngredientComponent(org.hl7.fhir.dstu3.model.Substance.SubstanceIngredientComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Substance.SubstanceIngredientComponent tgt=new org.hl7.fhir.dstu2.model.Substance.SubstanceIngredientComponent();
  copyElement(src,tgt);
  tgt.setQuantity(convertRatio(src.getQuantity()));
  return tgt;
}
Program: 23590
Project: 23590
Buggy source:
public org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePageComponent convertImplementationGuidePageComponent(org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePageComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePageComponent tgt=new org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePageComponent();
  copyElement(src,tgt);
  tgt.setSource(src.getSource());
  tgt.setName(src.getTitle());
  tgt.setKind(convertGuidePageKind(src.getKind()));
  for (  org.hl7.fhir.dstu3.model.CodeType t : src.getType())   tgt.addType(t.getValue());
  for (  org.hl7.fhir.dstu3.model.StringType t : src.getPackage())   tgt.addPackage(t.getValue());
  tgt.setFormat(src.getFormat());
  for (  org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePageComponent t : src.getPage())   tgt.addPage(convertImplementationGuidePageComponent(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePageComponent convertImplementationGuidePageComponent(org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePageComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePageComponent tgt=new org.hl7.fhir.dstu2.model.ImplementationGuide.ImplementationGuidePageComponent();
  copyElement(src,tgt);
  tgt.setSource(src.getSource());
  tgt.setName(src.getTitle());
  tgt.setKind(convertGuidePageKind(src.getKind()));
  for (  org.hl7.fhir.dstu3.model.CodeType t : src.getType())   tgt.addType(t.getValue());
  for (  org.hl7.fhir.dstu3.model.StringType t : src.getPackage())   tgt.addPackage(t.getValue());
  tgt.setFormat(src.getFormat());
  for (  org.hl7.fhir.dstu3.model.ImplementationGuide.ImplementationGuidePageComponent t : src.getPage())   tgt.addPage(convertImplementationGuidePageComponent(t));
  return tgt;
}
Program: 23591
Project: 23591
Buggy source:
public org.hl7.fhir.dstu2.model.SearchParameter convertSearchParameter(org.hl7.fhir.dstu3.model.SearchParameter src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.SearchParameter tgt=new org.hl7.fhir.dstu2.model.SearchParameter();
  copyDomainResource(src,tgt);
  tgt.setUrl(src.getUrl());
  tgt.setName(src.getName());
  tgt.setStatus(convertConformanceResourceStatus(src.getStatus()));
  tgt.setExperimental(src.getExperimental());
  tgt.setDate(src.getDate());
  tgt.setPublisher(src.getPublisher());
  for (  org.hl7.fhir.dstu3.model.SearchParameter.SearchParameterContactComponent t : src.getContact())   tgt.addContact(convertSearchParameterContactComponent(t));
  tgt.setRequirements(src.getRequirements());
  tgt.setCode(src.getCode());
  tgt.setBase(src.getBase());
  tgt.setType(convertSearchParamType(src.getType()));
  tgt.setDescription(src.getDescription());
  org.hl7.fhir.dstu2.utils.ToolingExtensions.setStringExtension(tgt,ToolingExtensions.EXT_EXPRESSION,src.getExpression());
  tgt.setXpath(src.getXpath());
  tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage()));
  for (  org.hl7.fhir.dstu3.model.CodeType t : src.getTarget())   tgt.addTarget(t.getValue());
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.SearchParameter convertSearchParameter(org.hl7.fhir.dstu3.model.SearchParameter src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.SearchParameter tgt=new org.hl7.fhir.dstu2.model.SearchParameter();
  copyDomainResource(src,tgt);
  tgt.setUrl(src.getUrl());
  tgt.setName(src.getName());
  tgt.setStatus(convertConformanceResourceStatus(src.getStatus()));
  tgt.setExperimental(src.getExperimental());
  tgt.setDate(src.getDate());
  tgt.setPublisher(src.getPublisher());
  for (  org.hl7.fhir.dstu3.model.SearchParameter.SearchParameterContactComponent t : src.getContact())   tgt.addContact(convertSearchParameterContactComponent(t));
  tgt.setRequirements(src.getRequirements());
  tgt.setCode(src.getCode());
  tgt.setBase(src.getBase());
  tgt.setType(convertSearchParamType(src.getType()));
  tgt.setDescription(src.getDescription());
  org.hl7.fhir.dstu2.utils.ToolingExtensions.setStringExtension(tgt,ToolingExtensions.EXT_EXPRESSION,src.getExpression());
  tgt.setXpath(src.getXpath());
  tgt.setXpathUsage(convertXPathUsageType(src.getXpathUsage()));
  for (  org.hl7.fhir.dstu3.model.CodeType t : src.getTarget())   tgt.addTarget(t.getValue());
  return tgt;
}
Program: 23592
Project: 23592
Buggy source:
public org.hl7.fhir.dstu2.model.Extension convertExtension(org.hl7.fhir.dstu3.model.Extension src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Extension tgt=new org.hl7.fhir.dstu2.model.Extension();
  copyElement(src,tgt);
  tgt.setUrl(src.getUrl());
  tgt.setValue(convertType(src.getValue()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Extension convertExtension(org.hl7.fhir.dstu3.model.Extension src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Extension tgt=new org.hl7.fhir.dstu2.model.Extension();
  copyElement(src,tgt);
  tgt.setUrl(src.getUrl());
  tgt.setValue(convertType(src.getValue()));
  return tgt;
}
Program: 23593
Project: 23593
Buggy source:
public org.hl7.fhir.dstu2.model.ConceptMap convertConceptMap(org.hl7.fhir.dstu3.model.ConceptMap src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.ConceptMap tgt=new org.hl7.fhir.dstu2.model.ConceptMap();
  copyDomainResource(src,tgt);
  tgt.setUrl(src.getUrl());
  tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
  tgt.setVersion(src.getVersion());
  tgt.setName(src.getName());
  tgt.setStatus(convertConformanceResourceStatus(src.getStatus()));
  tgt.setExperimental(src.getExperimental());
  tgt.setPublisher(src.getPublisher());
  for (  org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapContactComponent t : src.getContact())   tgt.addContact(convertConceptMapContactComponent(t));
  tgt.setDate(src.getDate());
  tgt.setDescription(src.getDescription());
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getUseContext())   tgt.addUseContext(convertCodeableConcept(t));
  tgt.setRequirements(src.getRequirements());
  tgt.setCopyright(src.getCopyright());
  tgt.setSource(convertType(src.getSource()));
  tgt.setTarget(convertType(src.getTarget()));
  for (  org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupComponent g : src.getGroup())   for (  org.hl7.fhir.dstu3.model.ConceptMap.SourceElementComponent t : g.getElement())   tgt.addElement(convertSourceElementComponent(t,g));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.ConceptMap convertConceptMap(org.hl7.fhir.dstu3.model.ConceptMap src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.ConceptMap tgt=new org.hl7.fhir.dstu2.model.ConceptMap();
  copyDomainResource(src,tgt);
  tgt.setUrl(src.getUrl());
  tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
  tgt.setVersion(src.getVersion());
  tgt.setName(src.getName());
  tgt.setStatus(convertConformanceResourceStatus(src.getStatus()));
  tgt.setExperimental(src.getExperimental());
  tgt.setPublisher(src.getPublisher());
  for (  org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapContactComponent t : src.getContact())   tgt.addContact(convertConceptMapContactComponent(t));
  tgt.setDate(src.getDate());
  tgt.setDescription(src.getDescription());
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getUseContext())   tgt.addUseContext(convertCodeableConcept(t));
  tgt.setRequirements(src.getRequirements());
  tgt.setCopyright(src.getCopyright());
  tgt.setSource(convertType(src.getSource()));
  tgt.setTarget(convertType(src.getTarget()));
  for (  org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupComponent g : src.getGroup())   for (  org.hl7.fhir.dstu3.model.ConceptMap.SourceElementComponent t : g.getElement())   tgt.addElement(convertSourceElementComponent(t,g));
  return tgt;
}
Program: 23594
Project: 23594
Buggy source:
public org.hl7.fhir.dstu2.model.Conformance.ResourceInteractionComponent convertResourceInteractionComponent(org.hl7.fhir.dstu3.model.Conformance.ResourceInteractionComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Conformance.ResourceInteractionComponent tgt=new org.hl7.fhir.dstu2.model.Conformance.ResourceInteractionComponent();
  copyElement(src,tgt);
  tgt.setCode(convertTypeRestfulInteraction(src.getCode()));
  tgt.setDocumentation(src.getDocumentation());
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Conformance.ResourceInteractionComponent convertResourceInteractionComponent(org.hl7.fhir.dstu3.model.Conformance.ResourceInteractionComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Conformance.ResourceInteractionComponent tgt=new org.hl7.fhir.dstu2.model.Conformance.ResourceInteractionComponent();
  copyElement(src,tgt);
  tgt.setCode(convertTypeRestfulInteraction(src.getCode()));
  tgt.setDocumentation(src.getDocumentation());
  return tgt;
}
Program: 23596
Project: 23596
Buggy source:
public org.hl7.fhir.dstu2.model.Immunization.ImmunizationVaccinationProtocolComponent convertImmunizationVaccinationProtocolComponent(org.hl7.fhir.dstu3.model.Immunization.ImmunizationVaccinationProtocolComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Immunization.ImmunizationVaccinationProtocolComponent tgt=new org.hl7.fhir.dstu2.model.Immunization.ImmunizationVaccinationProtocolComponent();
  copyElement(src,tgt);
  tgt.setDoseSequence(src.getDoseSequence());
  tgt.setDescription(src.getDescription());
  tgt.setAuthority(convertReference(src.getAuthority()));
  tgt.setSeries(src.getSeries());
  tgt.setSeriesDoses(src.getSeriesDoses());
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getTargetDisease())   tgt.addTargetDisease(convertCodeableConcept(t));
  tgt.setDoseStatus(convertCodeableConcept(src.getDoseStatus()));
  tgt.setDoseStatusReason(convertCodeableConcept(src.getDoseStatusReason()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Immunization.ImmunizationVaccinationProtocolComponent convertImmunizationVaccinationProtocolComponent(org.hl7.fhir.dstu3.model.Immunization.ImmunizationVaccinationProtocolComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Immunization.ImmunizationVaccinationProtocolComponent tgt=new org.hl7.fhir.dstu2.model.Immunization.ImmunizationVaccinationProtocolComponent();
  copyElement(src,tgt);
  tgt.setDoseSequence(src.getDoseSequence());
  tgt.setDescription(src.getDescription());
  tgt.setAuthority(convertReference(src.getAuthority()));
  tgt.setSeries(src.getSeries());
  tgt.setSeriesDoses(src.getSeriesDoses());
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getTargetDisease())   tgt.addTargetDisease(convertCodeableConcept(t));
  tgt.setDoseStatus(convertCodeableConcept(src.getDoseStatus()));
  tgt.setDoseStatusReason(convertCodeableConcept(src.getDoseStatusReason()));
  return tgt;
}
Program: 23597
Project: 23597
Buggy source:
public org.hl7.fhir.dstu2.model.Location.LocationPositionComponent convertLocationPositionComponent(org.hl7.fhir.dstu3.model.Location.LocationPositionComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Location.LocationPositionComponent tgt=new org.hl7.fhir.dstu2.model.Location.LocationPositionComponent();
  copyElement(src,tgt);
  tgt.setLongitude(src.getLongitude());
  tgt.setLatitude(src.getLatitude());
  tgt.setAltitude(src.getAltitude());
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Location.LocationPositionComponent convertLocationPositionComponent(org.hl7.fhir.dstu3.model.Location.LocationPositionComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Location.LocationPositionComponent tgt=new org.hl7.fhir.dstu2.model.Location.LocationPositionComponent();
  copyElement(src,tgt);
  tgt.setLongitude(src.getLongitude());
  tgt.setLatitude(src.getLatitude());
  tgt.setAltitude(src.getAltitude());
  return tgt;
}
Program: 23598
Project: 23598
Buggy source:
public org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemComponent convertQuestionnaireResponseGroupComponent(org.hl7.fhir.dstu2.model.QuestionnaireResponse.GroupComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemComponent tgt=new org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemComponent();
  copyElement(src,tgt);
  tgt.setLinkId(src.getLinkId());
  tgt.setText(src.getText());
  tgt.setSubject(convertReference(src.getSubject()));
  for (  org.hl7.fhir.dstu2.model.QuestionnaireResponse.GroupComponent t : src.getGroup())   tgt.addItem(convertQuestionnaireResponseGroupComponent(t));
  for (  org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionComponent t : src.getQuestion())   tgt.addItem(convertQuestionnaireResponseQuestionComponent(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemComponent convertQuestionnaireResponseGroupComponent(org.hl7.fhir.dstu2.model.QuestionnaireResponse.GroupComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemComponent tgt=new org.hl7.fhir.dstu3.model.QuestionnaireResponse.QuestionnaireResponseItemComponent();
  copyElement(src,tgt);
  tgt.setLinkId(src.getLinkId());
  tgt.setText(src.getText());
  tgt.setSubject(convertReference(src.getSubject()));
  for (  org.hl7.fhir.dstu2.model.QuestionnaireResponse.GroupComponent t : src.getGroup())   tgt.addItem(convertQuestionnaireResponseGroupComponent(t));
  for (  org.hl7.fhir.dstu2.model.QuestionnaireResponse.QuestionComponent t : src.getQuestion())   tgt.addItem(convertQuestionnaireResponseQuestionComponent(t));
  return tgt;
}
Program: 23599
Project: 23599
Buggy source:
public org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionContactComponent convertStructureDefinitionContactComponent(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionContactComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionContactComponent tgt=new org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionContactComponent();
  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.StructureDefinition.StructureDefinitionContactComponent convertStructureDefinitionContactComponent(org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionContactComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionContactComponent tgt=new org.hl7.fhir.dstu2.model.StructureDefinition.StructureDefinitionContactComponent();
  copyElement(src,tgt);
  tgt.setName(src.getName());
  for (  org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom())   tgt.addTelecom(convertContactPoint(t));
  return tgt;
}
Program: 23600
Project: 23600
Buggy source:
public org.hl7.fhir.dstu2.model.EnrollmentRequest convertEnrollmentRequest(org.hl7.fhir.dstu3.model.EnrollmentRequest src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.EnrollmentRequest tgt=new org.hl7.fhir.dstu2.model.EnrollmentRequest();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setRuleset(convertCoding(src.getRuleset()));
  tgt.setOriginalRuleset(convertCoding(src.getOriginalRuleset()));
  tgt.setCreated(src.getCreated());
  tgt.setCoverage(convertReference(src.getCoverage()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.EnrollmentRequest convertEnrollmentRequest(org.hl7.fhir.dstu3.model.EnrollmentRequest src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.EnrollmentRequest tgt=new org.hl7.fhir.dstu2.model.EnrollmentRequest();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setRuleset(convertCoding(src.getRuleset()));
  tgt.setOriginalRuleset(convertCoding(src.getOriginalRuleset()));
  tgt.setCreated(src.getCreated());
  tgt.setCoverage(convertReference(src.getCoverage()));
  return tgt;
}
Program: 23601
Project: 23601
Buggy source:
public org.hl7.fhir.dstu2.model.AllergyIntolerance.AllergyIntoleranceReactionComponent convertAllergyIntoleranceReactionComponent(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceReactionComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.AllergyIntolerance.AllergyIntoleranceReactionComponent tgt=new org.hl7.fhir.dstu2.model.AllergyIntolerance.AllergyIntoleranceReactionComponent();
  copyElement(src,tgt);
  tgt.setSubstance(convertCodeableConcept(src.getSubstance()));
  tgt.setCertainty(convertAllergyIntoleranceCertainty(src.getCertainty()));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getManifestation())   tgt.addManifestation(convertCodeableConcept(t));
  tgt.setDescription(src.getDescription());
  tgt.setOnset(src.getOnset());
  tgt.setSeverity(convertAllergyIntoleranceSeverity(src.getSeverity()));
  tgt.setExposureRoute(convertCodeableConcept(src.getExposureRoute()));
  for (  org.hl7.fhir.dstu3.model.Annotation t : src.getNote())   tgt.setNote(convertAnnotation(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.AllergyIntolerance.AllergyIntoleranceReactionComponent convertAllergyIntoleranceReactionComponent(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceReactionComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.AllergyIntolerance.AllergyIntoleranceReactionComponent tgt=new org.hl7.fhir.dstu2.model.AllergyIntolerance.AllergyIntoleranceReactionComponent();
  copyElement(src,tgt);
  tgt.setSubstance(convertCodeableConcept(src.getSubstance()));
  tgt.setCertainty(convertAllergyIntoleranceCertainty(src.getCertainty()));
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getManifestation())   tgt.addManifestation(convertCodeableConcept(t));
  tgt.setDescription(src.getDescription());
  tgt.setOnset(src.getOnset());
  tgt.setSeverity(convertAllergyIntoleranceSeverity(src.getSeverity()));
  tgt.setExposureRoute(convertCodeableConcept(src.getExposureRoute()));
  for (  org.hl7.fhir.dstu3.model.Annotation t : src.getNote())   tgt.setNote(convertAnnotation(t));
  return tgt;
}
Program: 23603
Project: 23603
Buggy source:
public org.hl7.fhir.dstu2.model.Person.PersonLinkComponent convertPersonLinkComponent(org.hl7.fhir.dstu3.model.Person.PersonLinkComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Person.PersonLinkComponent tgt=new org.hl7.fhir.dstu2.model.Person.PersonLinkComponent();
  copyElement(src,tgt);
  tgt.setTarget(convertReference(src.getTarget()));
  tgt.setAssurance(convertIdentityAssuranceLevel(src.getAssurance()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Person.PersonLinkComponent convertPersonLinkComponent(org.hl7.fhir.dstu3.model.Person.PersonLinkComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Person.PersonLinkComponent tgt=new org.hl7.fhir.dstu2.model.Person.PersonLinkComponent();
  copyElement(src,tgt);
  tgt.setTarget(convertReference(src.getTarget()));
  tgt.setAssurance(convertIdentityAssuranceLevel(src.getAssurance()));
  return tgt;
}
Program: 23606
Project: 23606
Buggy source:
public org.hl7.fhir.dstu2.model.Conformance.ConformanceRestOperationComponent convertConformanceRestOperationComponent(org.hl7.fhir.dstu3.model.Conformance.ConformanceRestOperationComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Conformance.ConformanceRestOperationComponent tgt=new org.hl7.fhir.dstu2.model.Conformance.ConformanceRestOperationComponent();
  copyElement(src,tgt);
  tgt.setName(src.getName());
  tgt.setDefinition(convertReference(src.getDefinition()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Conformance.ConformanceRestOperationComponent convertConformanceRestOperationComponent(org.hl7.fhir.dstu3.model.Conformance.ConformanceRestOperationComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Conformance.ConformanceRestOperationComponent tgt=new org.hl7.fhir.dstu2.model.Conformance.ConformanceRestOperationComponent();
  copyElement(src,tgt);
  tgt.setName(src.getName());
  tgt.setDefinition(convertReference(src.getDefinition()));
  return tgt;
}
Program: 23607
Project: 23607
Buggy source:
public org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseDosageInstructionComponent convertMedicationDispenseDosageInstructionComponent(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseDosageInstructionComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseDosageInstructionComponent tgt=new org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseDosageInstructionComponent();
  copyElement(src,tgt);
  tgt.setText(src.getText());
  tgt.setTiming(convertTiming(src.getTiming()));
  tgt.setAsNeeded(convertType(src.getAsNeeded()));
  tgt.setSite(convertType(src.getSite()));
  tgt.setRoute(convertCodeableConcept(src.getRoute()));
  tgt.setMethod(convertCodeableConcept(src.getMethod()));
  tgt.setDose(convertType(src.getDose()));
  tgt.setRate(convertType(src.getRate()));
  tgt.setMaxDosePerPeriod(convertRatio(src.getMaxDosePerPeriod()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseDosageInstructionComponent convertMedicationDispenseDosageInstructionComponent(org.hl7.fhir.dstu3.model.MedicationDispense.MedicationDispenseDosageInstructionComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseDosageInstructionComponent tgt=new org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseDosageInstructionComponent();
  copyElement(src,tgt);
  tgt.setText(src.getText());
  tgt.setTiming(convertTiming(src.getTiming()));
  tgt.setAsNeeded(convertType(src.getAsNeeded()));
  tgt.setSite(convertType(src.getSite()));
  tgt.setRoute(convertCodeableConcept(src.getRoute()));
  tgt.setMethod(convertCodeableConcept(src.getMethod()));
  tgt.setDose(convertType(src.getDose()));
  tgt.setRate(convertType(src.getRate()));
  tgt.setMaxDosePerPeriod(convertRatio(src.getMaxDosePerPeriod()));
  return tgt;
}
Program: 23608
Project: 23608
Buggy source:
public org.hl7.fhir.dstu2.model.PaymentNotice convertPaymentNotice(org.hl7.fhir.dstu3.model.PaymentNotice src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.PaymentNotice tgt=new org.hl7.fhir.dstu2.model.PaymentNotice();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setRuleset(convertCoding(src.getRuleset()));
  tgt.setOriginalRuleset(convertCoding(src.getOriginalRuleset()));
  tgt.setCreated(src.getCreated());
  if (src.hasTargetReference())   tgt.setTarget((org.hl7.fhir.dstu2.model.Reference)convertType(src.getTarget()));
  if (src.hasProviderReference())   tgt.setProvider((org.hl7.fhir.dstu2.model.Reference)convertType(src.getProvider()));
  if (src.hasOrganizationReference())   tgt.setOrganization((org.hl7.fhir.dstu2.model.Reference)convertType(src.getOrganization()));
  if (src.hasResponseReference())   tgt.setResponse((org.hl7.fhir.dstu2.model.Reference)convertType(src.getResponse()));
  tgt.setPaymentStatus(convertCoding(src.getPaymentStatus()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.PaymentNotice convertPaymentNotice(org.hl7.fhir.dstu3.model.PaymentNotice src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.PaymentNotice tgt=new org.hl7.fhir.dstu2.model.PaymentNotice();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setRuleset(convertCoding(src.getRuleset()));
  tgt.setOriginalRuleset(convertCoding(src.getOriginalRuleset()));
  tgt.setCreated(src.getCreated());
  if (src.hasTargetReference())   tgt.setTarget((org.hl7.fhir.dstu2.model.Reference)convertType(src.getTarget()));
  if (src.hasProviderReference())   tgt.setProvider((org.hl7.fhir.dstu2.model.Reference)convertType(src.getProvider()));
  if (src.hasOrganizationReference())   tgt.setOrganization((org.hl7.fhir.dstu2.model.Reference)convertType(src.getOrganization()));
  if (src.hasResponseReference())   tgt.setResponse((org.hl7.fhir.dstu2.model.Reference)convertType(src.getResponse()));
  tgt.setPaymentStatus(convertCoding(src.getPaymentStatus()));
  return tgt;
}
Program: 23609
Project: 23609
Buggy source:
public org.hl7.fhir.dstu2.model.PaymentReconciliation.DetailsComponent convertDetailsComponent(org.hl7.fhir.dstu3.model.PaymentReconciliation.DetailsComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.PaymentReconciliation.DetailsComponent tgt=new org.hl7.fhir.dstu2.model.PaymentReconciliation.DetailsComponent();
  copyElement(src,tgt);
  tgt.setType(convertCoding(src.getType()));
  if (src.hasRequestReference())   tgt.setRequest((org.hl7.fhir.dstu2.model.Reference)convertType(src.getRequest()));
  if (src.hasResponseReference())   tgt.setResponce((org.hl7.fhir.dstu2.model.Reference)convertType(src.getResponse()));
  if (src.hasSubmitterReference())   tgt.setSubmitter((org.hl7.fhir.dstu2.model.Reference)convertType(src.getSubmitter()));
  if (src.hasPayeeReference())   tgt.setPayee((org.hl7.fhir.dstu2.model.Reference)convertType(src.getPayee()));
  tgt.setDate(src.getDate());
  tgt.setAmount(convertMoney(src.getAmount()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.PaymentReconciliation.DetailsComponent convertDetailsComponent(org.hl7.fhir.dstu3.model.PaymentReconciliation.DetailsComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.PaymentReconciliation.DetailsComponent tgt=new org.hl7.fhir.dstu2.model.PaymentReconciliation.DetailsComponent();
  copyElement(src,tgt);
  tgt.setType(convertCoding(src.getType()));
  if (src.hasRequestReference())   tgt.setRequest((org.hl7.fhir.dstu2.model.Reference)convertType(src.getRequest()));
  if (src.hasResponseReference())   tgt.setResponce((org.hl7.fhir.dstu2.model.Reference)convertType(src.getResponse()));
  if (src.hasSubmitterReference())   tgt.setSubmitter((org.hl7.fhir.dstu2.model.Reference)convertType(src.getSubmitter()));
  if (src.hasPayeeReference())   tgt.setPayee((org.hl7.fhir.dstu2.model.Reference)convertType(src.getPayee()));
  tgt.setDate(src.getDate());
  tgt.setAmount(convertMoney(src.getAmount()));
  return tgt;
}
Program: 23610
Project: 23610
Buggy source:
public org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionComponent convertValueSetExpansionComponent(org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionComponent tgt=new org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionComponent();
  copyElement(src,tgt);
  tgt.setIdentifier(src.getIdentifier());
  tgt.setTimestamp(src.getTimestamp());
  tgt.setTotal(src.getTotal());
  tgt.setOffset(src.getOffset());
  for (  org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter())   tgt.addParameter(convertValueSetExpansionParameterComponent(t));
  for (  org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains())   tgt.addContains(convertValueSetExpansionContainsComponent(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionComponent convertValueSetExpansionComponent(org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionComponent tgt=new org.hl7.fhir.dstu2.model.ValueSet.ValueSetExpansionComponent();
  copyElement(src,tgt);
  tgt.setIdentifier(src.getIdentifier());
  tgt.setTimestamp(src.getTimestamp());
  tgt.setTotal(src.getTotal());
  tgt.setOffset(src.getOffset());
  for (  org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionParameterComponent t : src.getParameter())   tgt.addParameter(convertValueSetExpansionParameterComponent(t));
  for (  org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionContainsComponent t : src.getContains())   tgt.addContains(convertValueSetExpansionContainsComponent(t));
  return tgt;
}
Program: 23611
Project: 23611
Buggy source:
public org.hl7.fhir.dstu2.model.Group.GroupCharacteristicComponent convertGroupCharacteristicComponent(org.hl7.fhir.dstu3.model.Group.GroupCharacteristicComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Group.GroupCharacteristicComponent tgt=new org.hl7.fhir.dstu2.model.Group.GroupCharacteristicComponent();
  copyElement(src,tgt);
  tgt.setCode(convertCodeableConcept(src.getCode()));
  tgt.setValue(convertType(src.getValue()));
  tgt.setExclude(src.getExclude());
  tgt.setPeriod(convertPeriod(src.getPeriod()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Group.GroupCharacteristicComponent convertGroupCharacteristicComponent(org.hl7.fhir.dstu3.model.Group.GroupCharacteristicComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Group.GroupCharacteristicComponent tgt=new org.hl7.fhir.dstu2.model.Group.GroupCharacteristicComponent();
  copyElement(src,tgt);
  tgt.setCode(convertCodeableConcept(src.getCode()));
  tgt.setValue(convertType(src.getValue()));
  tgt.setExclude(src.getExclude());
  tgt.setPeriod(convertPeriod(src.getPeriod()));
  return tgt;
}
Program: 23612
Project: 23612
Buggy source:
public org.hl7.fhir.dstu2.model.MessageHeader convertMessageHeader(org.hl7.fhir.dstu3.model.MessageHeader src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.MessageHeader tgt=new org.hl7.fhir.dstu2.model.MessageHeader();
  copyDomainResource(src,tgt);
  tgt.setTimestamp(src.getTimestamp());
  tgt.setEvent(convertCoding(src.getEvent()));
  tgt.setResponse(convertMessageHeaderResponseComponent(src.getResponse()));
  tgt.setSource(convertMessageSourceComponent(src.getSource()));
  for (  org.hl7.fhir.dstu3.model.MessageHeader.MessageDestinationComponent t : src.getDestination())   tgt.addDestination(convertMessageDestinationComponent(t));
  tgt.setEnterer(convertReference(src.getEnterer()));
  tgt.setAuthor(convertReference(src.getAuthor()));
  tgt.setReceiver(convertReference(src.getReceiver()));
  tgt.setResponsible(convertReference(src.getResponsible()));
  tgt.setReason(convertCodeableConcept(src.getReason()));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getData())   tgt.addData(convertReference(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.MessageHeader convertMessageHeader(org.hl7.fhir.dstu3.model.MessageHeader src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.MessageHeader tgt=new org.hl7.fhir.dstu2.model.MessageHeader();
  copyDomainResource(src,tgt);
  tgt.setTimestamp(src.getTimestamp());
  tgt.setEvent(convertCoding(src.getEvent()));
  tgt.setResponse(convertMessageHeaderResponseComponent(src.getResponse()));
  tgt.setSource(convertMessageSourceComponent(src.getSource()));
  for (  org.hl7.fhir.dstu3.model.MessageHeader.MessageDestinationComponent t : src.getDestination())   tgt.addDestination(convertMessageDestinationComponent(t));
  tgt.setEnterer(convertReference(src.getEnterer()));
  tgt.setAuthor(convertReference(src.getAuthor()));
  tgt.setReceiver(convertReference(src.getReceiver()));
  tgt.setResponsible(convertReference(src.getResponsible()));
  tgt.setReason(convertCodeableConcept(src.getReason()));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getData())   tgt.addData(convertReference(t));
  return tgt;
}
Program: 23613
Project: 23613
Buggy source:
public org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionInvestigationsComponent convertClinicalImpressionInvestigationsComponent(org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionInvestigationsComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionInvestigationsComponent tgt=new org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionInvestigationsComponent();
  copyElement(src,tgt);
  tgt.setCode(convertCodeableConcept(src.getCode()));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getItem())   tgt.addItem(convertReference(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionInvestigationsComponent convertClinicalImpressionInvestigationsComponent(org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionInvestigationsComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionInvestigationsComponent tgt=new org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionInvestigationsComponent();
  copyElement(src,tgt);
  tgt.setCode(convertCodeableConcept(src.getCode()));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getItem())   tgt.addItem(convertReference(t));
  return tgt;
}
Program: 23614
Project: 23614
Buggy source:
public org.hl7.fhir.dstu2.model.MessageHeader.MessageHeaderResponseComponent convertMessageHeaderResponseComponent(org.hl7.fhir.dstu3.model.MessageHeader.MessageHeaderResponseComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.MessageHeader.MessageHeaderResponseComponent tgt=new org.hl7.fhir.dstu2.model.MessageHeader.MessageHeaderResponseComponent();
  copyElement(src,tgt);
  tgt.setIdentifier(src.getIdentifier());
  tgt.setCode(convertResponseType(src.getCode()));
  tgt.setDetails(convertReference(src.getDetails()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.MessageHeader.MessageHeaderResponseComponent convertMessageHeaderResponseComponent(org.hl7.fhir.dstu3.model.MessageHeader.MessageHeaderResponseComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.MessageHeader.MessageHeaderResponseComponent tgt=new org.hl7.fhir.dstu2.model.MessageHeader.MessageHeaderResponseComponent();
  copyElement(src,tgt);
  tgt.setIdentifier(src.getIdentifier());
  tgt.setCode(convertResponseType(src.getCode()));
  tgt.setDetails(convertReference(src.getDetails()));
  return tgt;
}
Program: 23615
Project: 23615
Buggy source:
public org.hl7.fhir.dstu2.model.Specimen.SpecimenCollectionComponent convertSpecimenCollectionComponent(org.hl7.fhir.dstu3.model.Specimen.SpecimenCollectionComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Specimen.SpecimenCollectionComponent tgt=new org.hl7.fhir.dstu2.model.Specimen.SpecimenCollectionComponent();
  copyElement(src,tgt);
  tgt.setCollector(convertReference(src.getCollector()));
  tgt.setCollected(convertType(src.getCollected()));
  tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
  tgt.setMethod(convertCodeableConcept(src.getMethod()));
  tgt.setBodySite(convertCodeableConcept(src.getBodySite()));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Specimen.SpecimenCollectionComponent convertSpecimenCollectionComponent(org.hl7.fhir.dstu3.model.Specimen.SpecimenCollectionComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Specimen.SpecimenCollectionComponent tgt=new org.hl7.fhir.dstu2.model.Specimen.SpecimenCollectionComponent();
  copyElement(src,tgt);
  tgt.setCollector(convertReference(src.getCollector()));
  tgt.setCollected(convertType(src.getCollected()));
  tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
  tgt.setMethod(convertCodeableConcept(src.getMethod()));
  tgt.setBodySite(convertCodeableConcept(src.getBodySite()));
  return tgt;
}
Program: 23616
Project: 23616
Buggy source:
public org.hl7.fhir.dstu2.model.ImagingStudy convertImagingStudy(org.hl7.fhir.dstu3.model.ImagingStudy src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.ImagingStudy tgt=new org.hl7.fhir.dstu2.model.ImagingStudy();
  copyDomainResource(src,tgt);
  tgt.setUid(src.getUid());
  tgt.setAccession(convertIdentifier(src.getAccession()));
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setAvailability(convertInstanceAvailability(src.getAvailability()));
  for (  org.hl7.fhir.dstu3.model.Coding t : src.getModalityList())   tgt.addModalityList(convertCoding(t));
  tgt.setPatient(convertReference(src.getPatient()));
  tgt.setStarted(src.getStarted());
  tgt.setReferrer(convertReference(src.getReferrer()));
  tgt.setInterpreter(convertReference(src.getInterpreter()));
  tgt.setNumberOfSeries(src.getNumberOfSeries());
  tgt.setNumberOfInstances(src.getNumberOfInstances());
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getProcedure())   tgt.addProcedure(convertReference(t));
  tgt.setDescription(src.getDescription());
  for (  org.hl7.fhir.dstu3.model.ImagingStudy.ImagingStudySeriesComponent t : src.getSeries())   tgt.addSeries(convertImagingStudySeriesComponent(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.ImagingStudy convertImagingStudy(org.hl7.fhir.dstu3.model.ImagingStudy src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.ImagingStudy tgt=new org.hl7.fhir.dstu2.model.ImagingStudy();
  copyDomainResource(src,tgt);
  tgt.setUid(src.getUid());
  tgt.setAccession(convertIdentifier(src.getAccession()));
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setAvailability(convertInstanceAvailability(src.getAvailability()));
  for (  org.hl7.fhir.dstu3.model.Coding t : src.getModalityList())   tgt.addModalityList(convertCoding(t));
  tgt.setPatient(convertReference(src.getPatient()));
  tgt.setStarted(src.getStarted());
  tgt.setReferrer(convertReference(src.getReferrer()));
  tgt.setInterpreter(convertReference(src.getInterpreter()));
  tgt.setNumberOfSeries(src.getNumberOfSeries());
  tgt.setNumberOfInstances(src.getNumberOfInstances());
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getProcedure())   tgt.addProcedure(convertReference(t));
  tgt.setDescription(src.getDescription());
  for (  org.hl7.fhir.dstu3.model.ImagingStudy.ImagingStudySeriesComponent t : src.getSeries())   tgt.addSeries(convertImagingStudySeriesComponent(t));
  return tgt;
}
Program: 23617
Project: 23617
Buggy source:
public org.hl7.fhir.dstu2.model.Patient.PatientCommunicationComponent convertPatientCommunicationComponent(org.hl7.fhir.dstu3.model.Patient.PatientCommunicationComponent src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.Patient.PatientCommunicationComponent tgt=new org.hl7.fhir.dstu2.model.Patient.PatientCommunicationComponent();
  copyElement(src,tgt);
  tgt.setLanguage(convertCodeableConcept(src.getLanguage()));
  tgt.setPreferred(src.getPreferred());
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.Patient.PatientCommunicationComponent convertPatientCommunicationComponent(org.hl7.fhir.dstu3.model.Patient.PatientCommunicationComponent src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.Patient.PatientCommunicationComponent tgt=new org.hl7.fhir.dstu2.model.Patient.PatientCommunicationComponent();
  copyElement(src,tgt);
  tgt.setLanguage(convertCodeableConcept(src.getLanguage()));
  tgt.setPreferred(src.getPreferred());
  return tgt;
}
Program: 23618
Project: 23618
Buggy source:
public org.hl7.fhir.dstu2.model.OperationOutcome convertOperationOutcome(org.hl7.fhir.dstu3.model.OperationOutcome src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.OperationOutcome tgt=new org.hl7.fhir.dstu2.model.OperationOutcome();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue())   tgt.addIssue(convertOperationOutcomeIssueComponent(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.OperationOutcome convertOperationOutcome(org.hl7.fhir.dstu3.model.OperationOutcome src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.OperationOutcome tgt=new org.hl7.fhir.dstu2.model.OperationOutcome();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.OperationOutcome.OperationOutcomeIssueComponent t : src.getIssue())   tgt.addIssue(convertOperationOutcomeIssueComponent(t));
  return tgt;
}