Program: 23554
Project: 23554
Buggy source:
public org.hl7.fhir.dstu2.model.DiagnosticReport convertDiagnosticReport(org.hl7.fhir.dstu3.model.DiagnosticReport src) throws FHIRException {
  if (src == null)   return null;
  org.hl7.fhir.dstu2.model.DiagnosticReport tgt=new org.hl7.fhir.dstu2.model.DiagnosticReport();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setStatus(convertDiagnosticReportStatus(src.getStatus()));
  tgt.setCategory(convertCodeableConcept(src.getCategory()));
  tgt.setCode(convertCodeableConcept(src.getCode()));
  tgt.setSubject(convertReference(src.getSubject()));
  tgt.setEncounter(convertReference(src.getEncounter()));
  tgt.setEffective(convertType(src.getEffective()));
  tgt.setIssued(src.getIssued());
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getRequest())   tgt.addRequest(convertReference(t));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getSpecimen())   tgt.addSpecimen(convertReference(t));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getResult())   tgt.addResult(convertReference(t));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getImagingStudy())   tgt.addImagingStudy(convertReference(t));
  for (  org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportImageComponent t : src.getImage())   tgt.addImage(convertDiagnosticReportImageComponent(t));
  tgt.setConclusion(src.getConclusion());
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCodedDiagnosis())   tgt.addCodedDiagnosis(convertCodeableConcept(t));
  for (  org.hl7.fhir.dstu3.model.Attachment t : src.getPresentedForm())   tgt.addPresentedForm(convertAttachment(t));
  return tgt;
}

Fixed version (ground truth):
public org.hl7.fhir.dstu2.model.DiagnosticReport convertDiagnosticReport(org.hl7.fhir.dstu3.model.DiagnosticReport src) throws FHIRException {
  if (src == null || src.isEmpty())   return null;
  org.hl7.fhir.dstu2.model.DiagnosticReport tgt=new org.hl7.fhir.dstu2.model.DiagnosticReport();
  copyDomainResource(src,tgt);
  for (  org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())   tgt.addIdentifier(convertIdentifier(t));
  tgt.setStatus(convertDiagnosticReportStatus(src.getStatus()));
  tgt.setCategory(convertCodeableConcept(src.getCategory()));
  tgt.setCode(convertCodeableConcept(src.getCode()));
  tgt.setSubject(convertReference(src.getSubject()));
  tgt.setEncounter(convertReference(src.getEncounter()));
  tgt.setEffective(convertType(src.getEffective()));
  tgt.setIssued(src.getIssued());
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getRequest())   tgt.addRequest(convertReference(t));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getSpecimen())   tgt.addSpecimen(convertReference(t));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getResult())   tgt.addResult(convertReference(t));
  for (  org.hl7.fhir.dstu3.model.Reference t : src.getImagingStudy())   tgt.addImagingStudy(convertReference(t));
  for (  org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportImageComponent t : src.getImage())   tgt.addImage(convertDiagnosticReportImageComponent(t));
  tgt.setConclusion(src.getConclusion());
  for (  org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCodedDiagnosis())   tgt.addCodedDiagnosis(convertCodeableConcept(t));
  for (  org.hl7.fhir.dstu3.model.Attachment t : src.getPresentedForm())   tgt.addPresentedForm(convertAttachment(t));
  return tgt;
}