public DataObject simplifyReferenceTerm(ConceptReferenceTerm term) throws Exception {

    List<Object> propertyNamesAndValues = new ArrayList<Object>();

    if (term == null
        || StringUtils.isBlank(term.getCode())
        || StringUtils.isEmpty(term.getCode())) {

      propertyNamesAndValues.add("termCode");
      propertyNamesAndValues.add("");
      propertyNamesAndValues.add("termId");
      propertyNamesAndValues.add("");
      propertyNamesAndValues.add("termName");
      propertyNamesAndValues.add("No Snomed CT Reference Terms Mapped To This Concept");

    } else {

      propertyNamesAndValues.add("termCode");
      propertyNamesAndValues.add((term.getCode()));
      propertyNamesAndValues.add("termId");
      propertyNamesAndValues.add((term.getId()));

      if (term.getName() != null) {
        propertyNamesAndValues.add("termName");
        propertyNamesAndValues.add(term.getName());
      }
    }
    DataObject dataObject = DataObject.create(propertyNamesAndValues);
    return dataObject;
  }
  private DataObject simplifyMapping(List<DataObject> conceptString, DataObject refTermString) {

    List<Object> propertyNamesAndValues = new ArrayList<Object>();

    propertyNamesAndValues.add("mappedRefTerm");
    propertyNamesAndValues.add(refTermString);

    propertyNamesAndValues.add("mappedConcept");
    propertyNamesAndValues.add(conceptString);

    DataObject dataObject = DataObject.create(propertyNamesAndValues);

    return dataObject;
  }
  private DataObject simplifyAncestors(List<String> parents, List<String> children, String term)
      throws Exception {
    List<Object> propertyNamesAndValues = new ArrayList<Object>();

    propertyNamesAndValues.add("parents");
    propertyNamesAndValues.add(parents);
    propertyNamesAndValues.add("children");
    propertyNamesAndValues.add(children);
    propertyNamesAndValues.add("term");
    propertyNamesAndValues.add(term);

    DataObject dataObject = DataObject.create(propertyNamesAndValues);

    return dataObject;
  }
  public DataObject simplifyConcept(Concept concept, Locale locale) throws Exception {

    List<Object> propertyNamesAndValues = new ArrayList<Object>();
    ConceptName preferredName = concept.getPreferredName(locale);

    propertyNamesAndValues.add("conceptId");
    propertyNamesAndValues.add(Integer.toString((concept.getConceptId())));

    if (preferredName != null && preferredName.getName() != null) {
      propertyNamesAndValues.add("conceptName");
      propertyNamesAndValues.add(preferredName.getName());
    } else if (preferredName == null && concept.getName() != null) {
      propertyNamesAndValues.add("conceptName");
      propertyNamesAndValues.add(concept.getName().getName());
    }
    DataObject dataObject = DataObject.create(propertyNamesAndValues);
    return dataObject;
  }