gt: 		StringBuffer sb = new StringBuffer();
context: //#############################################################################
  //#                                                                           #
  //#  Copyright (C) <2015>  <IMS MAXIMS>                                       #
  //#                                                                           #
  //#  This program is free software: you can redistribute it and/or modify     #
  //#  it under the terms of the GNU Affero General Public License as           #
  //#  published by the Free Software Foundation, either version 3 of the       #
  //#  License, or (at your option) any later version.                          # 
  //#                                                                           #
  //#  This program is distributed in the hope that it will be useful,          #
  //#  but WITHOUT ANY WARRANTY; without even the implied warranty of           #
  //#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            #
  //#  GNU Affero General Public License for more details.                      #
  //#                                                                           #
  //#  You should have received a copy of the GNU Affero General Public License #
  //#  along with this program.  If not, see <http://www.gnu.org/licenses/>.    #
  //#                                                                           #
  //#  IMS MAXIMS provides absolutely NO GUARANTEE OF THE CLINICAL SAFTEY of    #
  //#  this program.  Users of this software do so entirely at their own risk.  #
  //#  IMS MAXIMS only ensures the Clinical Safety of unaltered run-time        #
  //#  software that it builds, deploys and maintains.                          #
  //#                                                                           #
  //#############################################################################
  //#EOH
  /*
   * This code was generated
   * Copyright (C) 1995-2004 IMS MAXIMS plc. All rights reserved.
   * IMS Development Environment (version 1.80 build 5589.25814)
   * WARNING: DO NOT MODIFY the content of this file
   * Generated: 12/10/2015, 13:28
   *
   */
  package ims.clinical.domain.objects;
  
  /**
   * 
   * @author Kevin O'Carroll
   * Generated.
   */
  
  
  public class PresentAbsentHistoryProblems extends ims.domain.DomainObject implements ims.domain.SystemInformationRetainer, java.io.Serializable {
  	public static final int CLASSID = 1072100044;
  	private static final long serialVersionUID = 1072100044L;
  	public static final String CLASSVERSION = "${ClassVersion}";
  
  	@Override
  	public boolean shouldCapQuery()
  	{
  		return true;
  	}
  
  	/** Clinical Contact */
  	private ims.core.admin.domain.objects.ClinicalContact clinicalContact;
  	/** PresentProblems
  	  * Collection of ims.core.clinical.domain.objects.PatientProblem.
  	  */
  	private java.util.Set presentProblems;
  	/** AbsentProblems
  	  * Collection of ims.clinical.domain.objects.AbsentPresentingProblems.
  	  */
  	private java.util.Set absentProblems;
  	/** HistoryPresentingProblem */
  	private String historyPresentingProblem;
  	/** AuthoringInformation */
  	private ims.core.clinical.domain.objects.AuthoringInformation authoringInformation;
  	/** Care Context */
  	private ims.core.admin.domain.objects.CareContext careContext;
  	/** SystemInformation */
  	private ims.domain.SystemInformation systemInformation = new ims.domain.SystemInformation();
      public PresentAbsentHistoryProblems (Integer id, int ver)
      {
      	super(id, ver);
      }
      public PresentAbsentHistoryProblems ()
      {
      	super();
      }
      public PresentAbsentHistoryProblems (Integer id, int ver, Boolean includeRecord)
      {
      	super(id, ver, includeRecord);
      }
  	public Class getRealDomainClass()
  	{
  		return ims.clinical.domain.objects.PresentAbsentHistoryProblems.class;
  	}
  
  
  	public ims.core.admin.domain.objects.ClinicalContact getClinicalContact() {
  		return clinicalContact;
  	}
  	public void setClinicalContact(ims.core.admin.domain.objects.ClinicalContact clinicalContact) {
  		this.clinicalContact = clinicalContact;
  	}
  
  	public java.util.Set getPresentProblems() {
  		if ( null == presentProblems ) {
  			presentProblems = new java.util.HashSet();
  		}
  		return presentProblems;
  	}
  	public void setPresentProblems(java.util.Set paramValue) {
  		this.presentProblems = paramValue;
  	}
  
  	public java.util.Set getAbsentProblems() {
  		if ( null == absentProblems ) {
  			absentProblems = new java.util.HashSet();
  		}
  		return absentProblems;
  	}
  	public void setAbsentProblems(java.util.Set paramValue) {
  		this.absentProblems = paramValue;
  	}
  
  	public String getHistoryPresentingProblem() {
  		return historyPresentingProblem;
  	}
  	public void setHistoryPresentingProblem(String historyPresentingProblem) {
  		this.historyPresentingProblem = historyPresentingProblem;
  	}
  
  	public ims.core.clinical.domain.objects.AuthoringInformation getAuthoringInformation() {
  		return authoringInformation;
  	}
  	public void setAuthoringInformation(ims.core.clinical.domain.objects.AuthoringInformation authoringInformation) {
  		this.authoringInformation = authoringInformation;
  	}
  
  	public ims.core.admin.domain.objects.CareContext getCareContext() {
  		return careContext;
  	}
  	public void setCareContext(ims.core.admin.domain.objects.CareContext careContext) {
  		this.careContext = careContext;
  	}
  
  	public ims.domain.SystemInformation getSystemInformation() {
  		if (systemInformation == null) systemInformation = new ims.domain.SystemInformation();
  		return systemInformation;
  	}
  
  
  	/**
  	 * isConfigurationObject
  	 * Taken from the Usage property of the business object, this method will return
  	 * a boolean indicating whether this is a configuration object or not
  	 * Configuration = true, Instantiation = false
  	 */
  	public static boolean isConfigurationObject()
  	{
  		if ( "Instantiation".equals("Configuration") )
  			return true;
  		else
  			return false;
  	}
  
  
  
  
  
  	public int getClassId() {
  		return CLASSID;
  	}
  
  	public String getClassVersion()
  	{
  		return CLASSVERSION;
  	}
  
  	public String toAuditString()
  	{
  		StringBuffer auditStr = new StringBuffer();
  		
  		auditStr.append("\r\n*clinicalContact* :");
  		if (clinicalContact != null)
  		{
  			auditStr.append(toShortClassName(clinicalContact));
  				
  		    auditStr.append(clinicalContact.getId());
  		}
  	    auditStr.append("; ");
  		auditStr.append("\r\n*presentProblems* :");
  		if (presentProblems != null)
  		{
  			java.util.Iterator it2 = presentProblems.iterator();
  			int i2=0;
  			while (it2.hasNext())
  			{
  				if (i2 > 0)
  					auditStr.append(",");
  				ims.core.clinical.domain.objects.PatientProblem obj = (ims.core.clinical.domain.objects.PatientProblem)it2.next();
  		if (obj != null)
  		{
  		   if (i2 == 0)
  		   {
  			auditStr.append(toShortClassName(obj));
  			auditStr.append("[");
  		   }
  		
  		   auditStr.append(obj.getId());
  		}
  			i2++;
  		}
  		if (i2 > 0)
  			auditStr.append("] " + i2);
  		}
  	    auditStr.append("; ");
  		auditStr.append("\r\n*absentProblems* :");
  		if (absentProblems != null)
  		{
  			java.util.Iterator it3 = absentProblems.iterator();
  			int i3=0;
  			while (it3.hasNext())
  			{
  				if (i3 > 0)
  					auditStr.append(",");
  				ims.clinical.domain.objects.AbsentPresentingProblems obj = (ims.clinical.domain.objects.AbsentPresentingProblems)it3.next();
  		if (obj != null)
  		{
  		   if (i3 == 0)
  		   {
  			auditStr.append(toShortClassName(obj));
  			auditStr.append("[");
  		   }
  		
  		   auditStr.append(obj.getId());
  		}
  			i3++;
  		}
  		if (i3 > 0)
  			auditStr.append("] " + i3);
  		}
  	    auditStr.append("; ");
  		auditStr.append("\r\n*historyPresentingProblem* :");
  		auditStr.append(historyPresentingProblem);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*authoringInformation* :");
  		if (authoringInformation != null)
  		{
  			auditStr.append(toShortClassName(authoringInformation));
  				
  		    auditStr.append(authoringInformation.toString());
  		}
  	    auditStr.append("; ");
  		auditStr.append("\r\n*careContext* :");
  		if (careContext != null)
  		{
  			auditStr.append(toShortClassName(careContext));
  				
  		    auditStr.append(careContext.getId());
  		}
  	    auditStr.append("; ");
  		return auditStr.toString();
  	}
  	
  	public String toXMLString()
  	{
  		return toXMLString(new java.util.HashMap());
  	}
  	
  	public String toXMLString(java.util.HashMap domMap)
  	{
  		StringBuffer sb = new StringBuffer();
  		sb.append("<class type=\"" + this.getClass().getName() + "\" ");		
  		sb.append(" id=\"" + this.getId() + "\""); 
  		sb.append(" source=\"" + ims.configuration.EnvironmentConfig.getImportExportSourceName() + "\" ");
  		sb.append(" classVersion=\"" + this.getClassVersion() + "\" ");
  		sb.append(" component=\"" + this.getIsComponentClass() + "\" >");
  		
  		if (domMap.get(this) == null)
  		{
  			domMap.put(this, this);
  			sb.append(this.fieldsToXMLString(domMap));
  		}
  		sb.append("</class>");
  		
  		String keyClassName = "PresentAbsentHistoryProblems";
  		String externalSource = ims.configuration.EnvironmentConfig.getImportExportSourceName();
  		ims.configuration.ImportedObject impObj = (ims.configuration.ImportedObject)domMap.get(keyClassName + "_" + externalSource + "_" + this.getId());
  		if (impObj == null)
  		{
      		impObj = new ims.configuration.ImportedObject();
      		impObj.setExternalId(this.getId());
      		impObj.setExternalSource(externalSource);
      		impObj.setDomainObject(this);
  			impObj.setLocalId(this.getId()); 
      		impObj.setClassName(keyClassName); 
  			domMap.put(keyClassName + "_" + externalSource + "_" + this.getId(), impObj);
  		}
  		
  		return sb.toString();
  	}
  
  	public String fieldsToXMLString(java.util.HashMap domMap)
  	{
  