Program: 144247
Project: 144247
Buggy source:
public ClinicalDocument buildPhysicalExamSection(ClinicalDocument cd){
  Section section=CDAFactory.eINSTANCE.createSection();
  PhysicalExamSection ccs=new PhysicalExamSection();
  section.getTemplateIds().add(buildTemplateID(ccs.getParentTemplateId(),null,null));
  section.getTemplateIds().add(buildTemplateID(ccs.getTemplateid(),null,null));
  section.setCode(buildCodeCE(ccs.getCode(),ccs.getCodeSystem(),ccs.getSectionName(),ccs.getCodeSystemName()));
  section.setTitle(buildTitle(ccs.getSectionDescription()));
  StrucDocText text=CDAFactory.eINSTANCE.createStrucDocText();
  text.addText("String_Node_Str");
  section.setText(text);
  Section OptionalSecs=CDAFactory.eINSTANCE.createSection();
  OptionalSecs=buildCodedVitalSignsSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildGeneralAppearanceSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildVisibleImplantedMedicalDevicesSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildIntegumentarySystemSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildHeadSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildOptionalEyesSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildEarNoseMouthThroatSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildEarsSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildNoseSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildMouthThroatTeethSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildNeckSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildEndocrineSystemSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildThoraxLungsSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildThoraxLungsSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildBreastSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildHeartSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildRespiratorySystemSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildAbdomenSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildLymphaticSystemSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildVesselsSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildMusculoskeletalSystemSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildNeurologicSystemSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildGenitaliaSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildRectumSection();
  section.addSection(OptionalSecs);
  cd.addSection(section);
  return cd;
}

Fixed version (ground truth):
public ClinicalDocument buildPhysicalExamSection(ClinicalDocument cd){
  Section section=CDAFactory.eINSTANCE.createSection();
  PhysicalExamSection ccs=new PhysicalExamSection();
  section.getTemplateIds().add(buildTemplateID(ccs.getParentTemplateId(),null,null));
  section.getTemplateIds().add(buildTemplateID(ccs.getTemplateid(),null,null));
  section.setCode(buildCodeCE(ccs.getCode(),ccs.getCodeSystem(),ccs.getSectionName(),ccs.getCodeSystemName()));
  section.setTitle(buildTitle(ccs.getSectionDescription()));
  StrucDocText text=CDAFactory.eINSTANCE.createStrucDocText();
  text.addText("String_Node_Str");
  section.setText(text);
  Section OptionalSecs=CDAFactory.eINSTANCE.createSection();
  OptionalSecs=buildCodedVitalSignsSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildGeneralAppearanceSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildVisibleImplantedMedicalDevicesSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildIntegumentarySystemSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildHeadSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildOptionalEyesSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildEarNoseMouthThroatSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildEarsSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildNoseSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildMouthThroatTeethSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildNeckSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildEndocrineSystemSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildThoraxLungsSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildChestWallSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildBreastSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildHeartSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildRespiratorySystemSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildAbdomenSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildLymphaticSystemSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildVesselsSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildMusculoskeletalSystemSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildNeurologicSystemSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildGenitaliaSection();
  section.addSection(OptionalSecs);
  OptionalSecs=buildRectumSection();
  section.addSection(OptionalSecs);
  cd.addSection(section);
  return cd;
}