gt: 		if (this.getSiteCodeTreatment() != null)
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.core.cds.domain.objects;
  
  /**
   * 
   * @author Barbara Worwood
   * Generated.
   */
  
  
  public class CDSOutpatient extends ims.domain.DomainObject implements ims.domain.SystemInformationRetainer, java.io.Serializable {
  	public static final int CLASSID = 1104100000;
  	private static final long serialVersionUID = 1104100000L;
  	public static final String CLASSVERSION = "${ClassVersion}";
  
  	@Override
  	public boolean shouldCapQuery()
  	{
  		return false;
  	}
  	@Override
  	public boolean canNeverBeAudited()
  	{
  		return true;
  	}
  
  	/** CDS Applicable DateTime */
  	private java.util.Date cDSApplicableDate;
  	/** CDS Sender Organisation Code */
  	private String cDSSenderOrgCode;
  	/** Unique Booking Reference Number */
  	private String uBRN;
  	/** Patient Pathway Identifier */
  	private String pathwayIdentifier;
  	/** Organisation Code (Patient Pathway Identifier Issuer) */
  	private String pathwayOrgCode;
  	/** Referral To Treatment Status */
  	private String referralToTreatmentStatus;
  	/** Referral to Treatment Period Start Date */
  	private java.util.Date rTTStartDate;
  	/** Referral to Treatment Period End Date */
  	private java.util.Date rTTEndDate;
  	/** Lead Care Activity Indicator */
  	private String leadCareActInd;
  	/** Local Patient Identifier */
  	private String localPatientIdentifier;
  	/** Organisation Code for Patient Identifier */
  	private String patIdOrgCode;
  	/** NHS Number */
  	private String nHSNumber;
  	/** NHS Number Status Indicator - 01, 02 or 07 */
  	private String nHSNumberStatusInd;
  	/** Patient Name */
  	private String patientName;
  	/** Patient Usual Address */
  	private String patientAddress;
  	/** Postcode of usual address */
  	private String postCode;
  	/** Organisation Code (PCT of residence) */
  	private String pCTOrgCode;
  	/** Person Birth Date */
  	private java.util.Date dateOfBirth;
  	/** Person Gender Current */
  	private String personGender;
  	/** Carer Support Indicator */
  	private String carerSupportInd;
  	/** Ethnic Category */
  	private String ethnicCategory;
  	/** Consultant Code */
  	private String consultantCode;
  	/** Main Specialty Code */
  	private String specialtyCode;
  	/** Treatment Function Code */
  	private String treatmentFuncCode;
  	/** ICD Diagnosis Group
  	  * Collection of ims.core.cds.domain.objects.CDSDiagnosisDetails.
  	  */
  	private java.util.List iCDDiagGroup;
  	/** READ Diagnosis Group */
  	private ims.core.cds.domain.objects.CDSDiagnosisDetails readDiagGroup;
  	/** Attendance Identifier */
  	private String attendanceIdentifier;
  	/** Administrative Category */
  	private String adminCategory;
  	/** Attended or Did not Attend */
  	private String attendedOrDNA;
  	/** First Attendance */
  	private String firstAttendance;
  	/** Medical Staff Type Seeing Patient */
  	private String medStaffType;
  	/** Operation Status (per attendance) */
  	private String operationStatus;
  	/** Outcome of Attendance */
  	private String attendOutcome;
  	/** Appointment Date */
  	private java.util.Date apptDate;
  	/** Age at CDS Activity Date */
  	private Integer age;
  	/** Earliest Reasonable Offer Date */
  	private java.util.Date earliestOfferDate;
  	/** Commissioning Serial Number */
  	private String serialNumber;
  	/** NHS Service Agreement Line Number */
  	private String nHSServiceAgreeNum;
  	/** Provider Reference Number */
  	private String providerRefNum;
  	/** Commissioner Reference Number */
  	private String commissionerRefNum;
  	/** Organisation Code of Provider */
  	private String orgCodeProvider;
  	/** Organisation Code of Commissioner */
  	private String orgCodeCommissioner;
  	/** OPCS Procedure Group
  	  * Collection of ims.core.cds.domain.objects.CDSProcedureDetails.
  	  */
  	private java.util.List oPCSProcedure;
  	/** READ Procedure Group */
  	private ims.core.cds.domain.objects.CDSProcedureDetails rEADProcedure;
  	/** Location Class */
  	private String locationClass;
  	/** Site Code of Treatment */
  	private String siteCodeTreatment;
  	/** General Medical Practitioner (Specified) */
  	private String gPCode;
  	/** General Medical Practice Code (Patient Registration) */
  	private String practiceCode;
  	/** Priority Type */
  	private String priorityType;
  	/** Service Type Requested */
  	private String serviceTypeReq;
  	/** Source of Referral for Outpatients */
  	private String referralSource;
  	/** Referral Request Received Date */
  	private java.util.Date referralReceivedDate;
  	/** Referrer Code */
  	private String referrerCode;
  	/** Referring Organisation Code */
  	private String orgCodeReferrer;
  	/** Last DNA or Patient Cancelled Date */
  	private java.util.Date lastDNACancelDate;
  	/** Healthcare Resource Group Code */
  	private String resourceGrpCode;
  	/** Healthcare Resource GRoup Code - Version Number */
  	private String resourceGPVersion;
  	/** ProcedureSchemaInUse */
  	private String procedureScheme;
  	/** HRG Dominant Grouping Variable - Procedure */
  	private String hrgDominantGrouping;
  	/** Link to ApptId that created this record */
  	private Integer appointmentId;
  	/** SystemInformation */
  	private ims.domain.SystemInformation systemInformation = new ims.domain.SystemInformation();
      public CDSOutpatient (Integer id, int ver)
      {
      	super(id, ver);
      }
      public CDSOutpatient ()
      {
      	super();
      }
      public CDSOutpatient (Integer id, int ver, Boolean includeRecord)
      {
      	super(id, ver, includeRecord);
      }
  	public Class getRealDomainClass()
  	{
  		return ims.core.cds.domain.objects.CDSOutpatient.class;
  	}
  
  
  	public java.util.Date getCDSApplicableDate() {
  		return cDSApplicableDate;
  	}
  	public void setCDSApplicableDate(java.util.Date cDSApplicableDate) {
  		this.cDSApplicableDate = cDSApplicableDate;
  	}
  
  	public String getCDSSenderOrgCode() {
  		return cDSSenderOrgCode;
  	}
  	public void setCDSSenderOrgCode(String cDSSenderOrgCode) {
  		if ( null != cDSSenderOrgCode && cDSSenderOrgCode.length() > 5 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for cDSSenderOrgCode. Tried to set value: "+
  				cDSSenderOrgCode);
  		}
  		this.cDSSenderOrgCode = cDSSenderOrgCode;
  	}
  
  	public String getUBRN() {
  		return uBRN;
  	}
  	public void setUBRN(String uBRN) {
  		if ( null != uBRN && uBRN.length() > 12 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for uBRN. Tried to set value: "+
  				uBRN);
  		}
  		this.uBRN = uBRN;
  	}
  
  	public String getPathwayIdentifier() {
  		return pathwayIdentifier;
  	}
  	public void setPathwayIdentifier(String pathwayIdentifier) {
  		if ( null != pathwayIdentifier && pathwayIdentifier.length() > 20 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for pathwayIdentifier. Tried to set value: "+
  				pathwayIdentifier);
  		}
  		this.pathwayIdentifier = pathwayIdentifier;
  	}
  
  	public String getPathwayOrgCode() {
  		return pathwayOrgCode;
  	}
  	public void setPathwayOrgCode(String pathwayOrgCode) {
  		if ( null != pathwayOrgCode && pathwayOrgCode.length() > 3 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for pathwayOrgCode. Tried to set value: "+
  				pathwayOrgCode);
  		}
  		this.pathwayOrgCode = pathwayOrgCode;
  	}
  
  	public String getReferralToTreatmentStatus() {
  		return referralToTreatmentStatus;
  	}
  	public void setReferralToTreatmentStatus(String referralToTreatmentStatus) {
  		if ( null != referralToTreatmentStatus && referralToTreatmentStatus.length() > 2 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for referralToTreatmentStatus. Tried to set value: "+
  				referralToTreatmentStatus);
  		}
  		this.referralToTreatmentStatus = referralToTreatmentStatus;
  	}
  
  	public java.util.Date getRTTStartDate() {
  		return rTTStartDate;
  	}
  	public void setRTTStartDate(java.util.Date rTTStartDate) {
  		this.rTTStartDate = rTTStartDate;
  	}
  
  	public java.util.Date getRTTEndDate() {
  		return rTTEndDate;
  	}
  	public void setRTTEndDate(java.util.Date rTTEndDate) {
  		this.rTTEndDate = rTTEndDate;
  	}
  
  	public String getLeadCareActInd() {
  		return leadCareActInd;
  	}
  	public void setLeadCareActInd(String leadCareActInd) {
  		if ( null != leadCareActInd && leadCareActInd.length() > 2 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for leadCareActInd. Tried to set value: "+
  				leadCareActInd);
  		}
  		this.leadCareActInd = leadCareActInd;
  	}
  
  	public String getLocalPatientIdentifier() {
  		return localPatientIdentifier;
  	}
  	public void setLocalPatientIdentifier(String localPatientIdentifier) {
  		if ( null != localPatientIdentifier && localPatientIdentifier.length() > 10 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for localPatientIdentifier. Tried to set value: "+
  				localPatientIdentifier);
  		}
  		this.localPatientIdentifier = localPatientIdentifier;
  	}
  
  	public String getPatIdOrgCode() {
  		return patIdOrgCode;
  	}
  	public void setPatIdOrgCode(String patIdOrgCode) {
  		if ( null != patIdOrgCode && patIdOrgCode.length() > 5 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for patIdOrgCode. Tried to set value: "+
  				patIdOrgCode);
  		}
  		this.patIdOrgCode = patIdOrgCode;
  	}
  
  	public String getNHSNumber() {
  		return nHSNumber;
  	}
  	public void setNHSNumber(String nHSNumber) {
  		if ( null != nHSNumber && nHSNumber.length() > 17 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for nHSNumber. Tried to set value: "+
  				nHSNumber);
  		}
  		this.nHSNumber = nHSNumber;
  	}
  
  	public String getNHSNumberStatusInd() {
  		return nHSNumberStatusInd;
  	}
  	public void setNHSNumberStatusInd(String nHSNumberStatusInd) {
  		if ( null != nHSNumberStatusInd && nHSNumberStatusInd.length() > 2 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for nHSNumberStatusInd. Tried to set value: "+
  				nHSNumberStatusInd);
  		}
  		this.nHSNumberStatusInd = nHSNumberStatusInd;
  	}
  
  	public String getPatientName() {
  		return patientName;
  	}
  	public void setPatientName(String patientName) {
  		if ( null != patientName && patientName.length() > 70 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for patientName. Tried to set value: "+
  				patientName);
  		}
  		this.patientName = patientName;
  	}
  
  	public String getPatientAddress() {
  		return patientAddress;
  	}
  	public void setPatientAddress(String patientAddress) {
  		if ( null != patientAddress && patientAddress.length() > 175 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for patientAddress. Tried to set value: "+
  				patientAddress);
  		}
  		this.patientAddress = patientAddress;
  	}
  
  	public String getPostCode() {
  		return postCode;
  	}
  	public void setPostCode(String postCode) {
  		if ( null != postCode && postCode.length() > 8 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for postCode. Tried to set value: "+
  				postCode);
  		}
  		this.postCode = postCode;
  	}
  
  	public String getPCTOrgCode() {
  		return pCTOrgCode;
  	}
  	public void setPCTOrgCode(String pCTOrgCode) {
  		if ( null != pCTOrgCode && pCTOrgCode.length() > 3 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for pCTOrgCode. Tried to set value: "+
  				pCTOrgCode);
  		}
  		this.pCTOrgCode = pCTOrgCode;
  	}
  
  	public java.util.Date getDateOfBirth() {
  		return dateOfBirth;
  	}
  	public void setDateOfBirth(java.util.Date dateOfBirth) {
  		this.dateOfBirth = dateOfBirth;
  	}
  
  	public String getPersonGender() {
  		return personGender;
  	}
  	public void setPersonGender(String personGender) {
  		if ( null != personGender && personGender.length() > 1 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for personGender. Tried to set value: "+
  				personGender);
  		}
  		this.personGender = personGender;
  	}
  
  	public String getCarerSupportInd() {
  		return carerSupportInd;
  	}
  	public void setCarerSupportInd(String carerSupportInd) {
  		if ( null != carerSupportInd && carerSupportInd.length() > 2 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for carerSupportInd. Tried to set value: "+
  				carerSupportInd);
  		}
  		this.carerSupportInd = carerSupportInd;
  	}
  
  	public String getEthnicCategory() {
  		return ethnicCategory;
  	}
  	public void setEthnicCategory(String ethnicCategory) {
  		if ( null != ethnicCategory && ethnicCategory.length() > 2 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for ethnicCategory. Tried to set value: "+
  				ethnicCategory);
  		}
  		this.ethnicCategory = ethnicCategory;
  	}
  
  	public String getConsultantCode() {
  		return consultantCode;
  	}
  	public void setConsultantCode(String consultantCode) {
  		if ( null != consultantCode && consultantCode.length() > 8 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for consultantCode. Tried to set value: "+
  				consultantCode);
  		}
  		this.consultantCode = consultantCode;
  	}
  
  	public String getSpecialtyCode() {
  		return specialtyCode;
  	}
  	public void setSpecialtyCode(String specialtyCode) {
  		if ( null != specialtyCode && specialtyCode.length() > 3 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for specialtyCode. Tried to set value: "+
  				specialtyCode);
  		}
  		this.specialtyCode = specialtyCode;
  	}
  
  	public String getTreatmentFuncCode() {
  		return treatmentFuncCode;
  	}
  	public void setTreatmentFuncCode(String treatmentFuncCode) {
  		if ( null != treatmentFuncCode && treatmentFuncCode.length() > 3 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for treatmentFuncCode. Tried to set value: "+
  				treatmentFuncCode);
  		}
  		this.treatmentFuncCode = treatmentFuncCode;
  	}
  
  	public java.util.List getICDDiagGroup() {
  		if ( null == iCDDiagGroup ) {
  			iCDDiagGroup = new java.util.ArrayList();
  		}
  		return iCDDiagGroup;
  	}
  	public void setICDDiagGroup(java.util.List paramValue) {
  		this.iCDDiagGroup = paramValue;
  	}
  
  	public ims.core.cds.domain.objects.CDSDiagnosisDetails getReadDiagGroup() {
  		return readDiagGroup;
  	}
  	public void setReadDiagGroup(ims.core.cds.domain.objects.CDSDiagnosisDetails readDiagGroup) {
  		this.readDiagGroup = readDiagGroup;
  	}
  
  	public String getAttendanceIdentifier() {
  		return attendanceIdentifier;
  	}
  	public void setAttendanceIdentifier(String attendanceIdentifier) {
  		if ( null != attendanceIdentifier && attendanceIdentifier.length() > 12 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for attendanceIdentifier. Tried to set value: "+
  				attendanceIdentifier);
  		}
  		this.attendanceIdentifier = attendanceIdentifier;
  	}
  
  	public String getAdminCategory() {
  		return adminCategory;
  	}
  	public void setAdminCategory(String adminCategory) {
  		if ( null != adminCategory && adminCategory.length() > 2 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for adminCategory. Tried to set value: "+
  				adminCategory);
  		}
  		this.adminCategory = adminCategory;
  	}
  
  	public String getAttendedOrDNA() {
  		return attendedOrDNA;
  	}
  	public void setAttendedOrDNA(String attendedOrDNA) {
  		if ( null != attendedOrDNA && attendedOrDNA.length() > 1 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for attendedOrDNA. Tried to set value: "+
  				attendedOrDNA);
  		}
  		this.attendedOrDNA = attendedOrDNA;
  	}
  
  	public String getFirstAttendance() {
  		return firstAttendance;
  	}
  	public void setFirstAttendance(String firstAttendance) {
  		if ( null != firstAttendance && firstAttendance.length() > 1 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for firstAttendance. Tried to set value: "+
  				firstAttendance);
  		}
  		this.firstAttendance = firstAttendance;
  	}
  
  	public String getMedStaffType() {
  		return medStaffType;
  	}
  	public void setMedStaffType(String medStaffType) {
  		if ( null != medStaffType && medStaffType.length() > 2 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for medStaffType. Tried to set value: "+
  				medStaffType);
  		}
  		this.medStaffType = medStaffType;
  	}
  
  	public String getOperationStatus() {
  		return operationStatus;
  	}
  	public void setOperationStatus(String operationStatus) {
  		if ( null != operationStatus && operationStatus.length() > 1 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for operationStatus. Tried to set value: "+
  				operationStatus);
  		}
  		this.operationStatus = operationStatus;
  	}
  
  	public String getAttendOutcome() {
  		return attendOutcome;
  	}
  	public void setAttendOutcome(String attendOutcome) {
  		if ( null != attendOutcome && attendOutcome.length() > 1 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for attendOutcome. Tried to set value: "+
  				attendOutcome);
  		}
  		this.attendOutcome = attendOutcome;
  	}
  
  	public java.util.Date getApptDate() {
  		return apptDate;
  	}
  	public void setApptDate(java.util.Date apptDate) {
  		this.apptDate = apptDate;
  	}
  
  	public Integer getAge() {
  		return age;
  	}
  	public void setAge(Integer age) {
  		this.age = age;
  	}
  
  	public java.util.Date getEarliestOfferDate() {
  		return earliestOfferDate;
  	}
  	public void setEarliestOfferDate(java.util.Date earliestOfferDate) {
  		this.earliestOfferDate = earliestOfferDate;
  	}
  
  	public String getSerialNumber() {
  		return serialNumber;
  	}
  	public void setSerialNumber(String serialNumber) {
  		if ( null != serialNumber && serialNumber.length() > 6 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for serialNumber. Tried to set value: "+
  				serialNumber);
  		}
  		this.serialNumber = serialNumber;
  	}
  
  	public String getNHSServiceAgreeNum() {
  		return nHSServiceAgreeNum;
  	}
  	public void setNHSServiceAgreeNum(String nHSServiceAgreeNum) {
  		if ( null != nHSServiceAgreeNum && nHSServiceAgreeNum.length() > 10 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for nHSServiceAgreeNum. Tried to set value: "+
  				nHSServiceAgreeNum);
  		}
  		this.nHSServiceAgreeNum = nHSServiceAgreeNum;
  	}
  
  	public String getProviderRefNum() {
  		return providerRefNum;
  	}
  	public void setProviderRefNum(String providerRefNum) {
  		if ( null != providerRefNum && providerRefNum.length() > 17 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for providerRefNum. Tried to set value: "+
  				providerRefNum);
  		}
  		this.providerRefNum = providerRefNum;
  	}
  
  	public String getCommissionerRefNum() {
  		return commissionerRefNum;
  	}
  	public void setCommissionerRefNum(String commissionerRefNum) {
  		if ( null != commissionerRefNum && commissionerRefNum.length() > 17 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for commissionerRefNum. Tried to set value: "+
  				commissionerRefNum);
  		}
  		this.commissionerRefNum = commissionerRefNum;
  	}
  
  	public String getOrgCodeProvider() {
  		return orgCodeProvider;
  	}
  	public void setOrgCodeProvider(String orgCodeProvider) {
  		if ( null != orgCodeProvider && orgCodeProvider.length() > 5 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for orgCodeProvider. Tried to set value: "+
  				orgCodeProvider);
  		}
  		this.orgCodeProvider = orgCodeProvider;
  	}
  
  	public String getOrgCodeCommissioner() {
  		return orgCodeCommissioner;
  	}
  	public void setOrgCodeCommissioner(String orgCodeCommissioner) {
  		if ( null != orgCodeCommissioner && orgCodeCommissioner.length() > 5 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for orgCodeCommissioner. Tried to set value: "+
  				orgCodeCommissioner);
  		}
  		this.orgCodeCommissioner = orgCodeCommissioner;
  	}
  
  	public java.util.List getOPCSProcedure() {
  		if ( null == oPCSProcedure ) {
  			oPCSProcedure = new java.util.ArrayList();
  		}
  		return oPCSProcedure;
  	}
  	public void setOPCSProcedure(java.util.List paramValue) {
  		this.oPCSProcedure = paramValue;
  	}
  
  	public ims.core.cds.domain.objects.CDSProcedureDetails getREADProcedure() {
  		return rEADProcedure;
  	}
  	public void setREADProcedure(ims.core.cds.domain.objects.CDSProcedureDetails rEADProcedure) {
  		this.rEADProcedure = rEADProcedure;
  	}
  
  	public String getLocationClass() {
  		return locationClass;
  	}
  	public void setLocationClass(String locationClass) {
  		if ( null != locationClass && locationClass.length() > 2 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for locationClass. Tried to set value: "+
  				locationClass);
  		}
  		this.locationClass = locationClass;
  	}
  
  	public String getSiteCodeTreatment() {
  		return siteCodeTreatment;
  	}
  	public void setSiteCodeTreatment(String siteCodeTreatment) {
  		if ( null != siteCodeTreatment && siteCodeTreatment.length() > 5 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for siteCodeTreatment. Tried to set value: "+
  				siteCodeTreatment);
  		}
  		this.siteCodeTreatment = siteCodeTreatment;
  	}
  
  	public String getGPCode() {
  		return gPCode;
  	}
  	public void setGPCode(String gPCode) {
  		if ( null != gPCode && gPCode.length() > 8 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for gPCode. Tried to set value: "+
  				gPCode);
  		}
  		this.gPCode = gPCode;
  	}
  
  	public String getPracticeCode() {
  		return practiceCode;
  	}
  	public void setPracticeCode(String practiceCode) {
  		if ( null != practiceCode && practiceCode.length() > 6 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for practiceCode. Tried to set value: "+
  				practiceCode);
  		}
  		this.practiceCode = practiceCode;
  	}
  
  	public String getPriorityType() {
  		return priorityType;
  	}
  	public void setPriorityType(String priorityType) {
  		if ( null != priorityType && priorityType.length() > 1 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for priorityType. Tried to set value: "+
  				priorityType);
  		}
  		this.priorityType = priorityType;
  	}
  
  	public String getServiceTypeReq() {
  		return serviceTypeReq;
  	}
  	public void setServiceTypeReq(String serviceTypeReq) {
  		if ( null != serviceTypeReq && serviceTypeReq.length() > 1 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for serviceTypeReq. Tried to set value: "+
  				serviceTypeReq);
  		}
  		this.serviceTypeReq = serviceTypeReq;
  	}
  
  	public String getReferralSource() {
  		return referralSource;
  	}
  	public void setReferralSource(String referralSource) {
  		if ( null != referralSource && referralSource.length() > 2 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for referralSource. Tried to set value: "+
  				referralSource);
  		}
  		this.referralSource = referralSource;
  	}
  
  	public java.util.Date getReferralReceivedDate() {
  		return referralReceivedDate;
  	}
  	public void setReferralReceivedDate(java.util.Date referralReceivedDate) {
  		this.referralReceivedDate = referralReceivedDate;
  	}
  
  	public String getReferrerCode() {
  		return referrerCode;
  	}
  	public void setReferrerCode(String referrerCode) {
  		if ( null != referrerCode && referrerCode.length() > 8 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for referrerCode. Tried to set value: "+
  				referrerCode);
  		}
  		this.referrerCode = referrerCode;
  	}
  
  	public String getOrgCodeReferrer() {
  		return orgCodeReferrer;
  	}
  	public void setOrgCodeReferrer(String orgCodeReferrer) {
  		if ( null != orgCodeReferrer && orgCodeReferrer.length() > 6 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for orgCodeReferrer. Tried to set value: "+
  				orgCodeReferrer);
  		}
  		this.orgCodeReferrer = orgCodeReferrer;
  	}
  
  	public java.util.Date getLastDNACancelDate() {
  		return lastDNACancelDate;
  	}
  	public void setLastDNACancelDate(java.util.Date lastDNACancelDate) {
  		this.lastDNACancelDate = lastDNACancelDate;
  	}
  
  	public String getResourceGrpCode() {
  		return resourceGrpCode;
  	}
  	public void setResourceGrpCode(String resourceGrpCode) {
  		if ( null != resourceGrpCode && resourceGrpCode.length() > 3 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for resourceGrpCode. Tried to set value: "+
  				resourceGrpCode);
  		}
  		this.resourceGrpCode = resourceGrpCode;
  	}
  
  	public String getResourceGPVersion() {
  		return resourceGPVersion;
  	}
  	public void setResourceGPVersion(String resourceGPVersion) {
  		if ( null != resourceGPVersion && resourceGPVersion.length() > 3 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for resourceGPVersion. Tried to set value: "+
  				resourceGPVersion);
  		}
  		this.resourceGPVersion = resourceGPVersion;
  	}
  
  	public String getProcedureScheme() {
  		return procedureScheme;
  	}
  	public void setProcedureScheme(String procedureScheme) {
  		if ( null != procedureScheme && procedureScheme.length() > 2 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for procedureScheme. Tried to set value: "+
  				procedureScheme);
  		}
  		this.procedureScheme = procedureScheme;
  	}
  
  	public String getHrgDominantGrouping() {
  		return hrgDominantGrouping;
  	}
  	public void setHrgDominantGrouping(String hrgDominantGrouping) {
  		if ( null != hrgDominantGrouping && hrgDominantGrouping.length() > 4 ) {
  			throw new ims.domain.exceptions.DomainRuntimeException("MaxLength ($MaxLength) exceeded for hrgDominantGrouping. Tried to set value: "+
  				hrgDominantGrouping);
  		}
  		this.hrgDominantGrouping = hrgDominantGrouping;
  	}
  
  	public Integer getAppointmentId() {
  		return appointmentId;
  	}
  	public static CDSOutpatient getCDSOutpatientFromAppointmentId(ims.domain.ILightweightDomainFactory factory, Integer val)
  	{
  		String hql = "from CDSOutpatient c where c.appointmentId = :appointmentId";		
  		java.util.List l = factory.find(hql, new String[]{"appointmentId"}, new Object[]{val});
  		if (l == null || l.size() == 0) return null;
  		if (l.size() > 1) throw new ims.domain.exceptions.DomainRuntimeException("Non-unique get call. CDSOutpatient.appointmentId = " + val + " returned " + l.size() + " records. " );
  		return (CDSOutpatient)l.get(0);
  	}
  	public void setAppointmentId(Integer appointmentId) {
  		this.appointmentId = appointmentId;
  	}
  
  	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*cDSApplicableDate* :");
  		auditStr.append(cDSApplicableDate);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*cDSSenderOrgCode* :");
  		auditStr.append(cDSSenderOrgCode);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*uBRN* :");
  		auditStr.append(uBRN);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*pathwayIdentifier* :");
  		auditStr.append(pathwayIdentifier);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*pathwayOrgCode* :");
  		auditStr.append(pathwayOrgCode);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*referralToTreatmentStatus* :");
  		auditStr.append(referralToTreatmentStatus);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*rTTStartDate* :");
  		auditStr.append(rTTStartDate);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*rTTEndDate* :");
  		auditStr.append(rTTEndDate);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*leadCareActInd* :");
  		auditStr.append(leadCareActInd);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*localPatientIdentifier* :");
  		auditStr.append(localPatientIdentifier);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*patIdOrgCode* :");
  		auditStr.append(patIdOrgCode);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*nHSNumber* :");
  		auditStr.append(nHSNumber);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*nHSNumberStatusInd* :");
  		auditStr.append(nHSNumberStatusInd);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*patientName* :");
  		auditStr.append(patientName);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*patientAddress* :");
  		auditStr.append(patientAddress);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*postCode* :");
  		auditStr.append(postCode);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*pCTOrgCode* :");
  		auditStr.append(pCTOrgCode);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*dateOfBirth* :");
  		auditStr.append(dateOfBirth);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*personGender* :");
  		auditStr.append(personGender);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*carerSupportInd* :");
  		auditStr.append(carerSupportInd);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*ethnicCategory* :");
  		auditStr.append(ethnicCategory);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*consultantCode* :");
  		auditStr.append(consultantCode);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*specialtyCode* :");
  		auditStr.append(specialtyCode);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*treatmentFuncCode* :");
  		auditStr.append(treatmentFuncCode);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*iCDDiagGroup* :");
  		if (iCDDiagGroup != null)
  		{
  		int i25=0;
  		for (i25=0; i25<iCDDiagGroup.size(); i25++)
  		{
  			if (i25 > 0)
  				auditStr.append(",");
  			ims.core.cds.domain.objects.CDSDiagnosisDetails obj = (ims.core.cds.domain.objects.CDSDiagnosisDetails)iCDDiagGroup.get(i25);
  		    if (obj != null)
  			{
  				if (i25 == 0)
  				{
  				auditStr.append(toShortClassName(obj));
  				auditStr.append("[");
  				}
  		        auditStr.append(obj.getId());
  			}
  		}
  		if (i25 > 0)
  			auditStr.append("] " + i25);
  		}
  	    auditStr.append("; ");
  		auditStr.append("\r\n*readDiagGroup* :");
  		if (readDiagGroup != null)
  		{
  			auditStr.append(toShortClassName(readDiagGroup));
  				
  		    auditStr.append(readDiagGroup.getId());
  		}
  	    auditStr.append("; ");
  		auditStr.append("\r\n*attendanceIdentifier* :");
  		auditStr.append(attendanceIdentifier);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*adminCategory* :");
  		auditStr.append(adminCategory);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*attendedOrDNA* :");
  		auditStr.append(attendedOrDNA);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*firstAttendance* :");
  		auditStr.append(firstAttendance);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*medStaffType* :");
  		auditStr.append(medStaffType);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*operationStatus* :");
  		auditStr.append(operationStatus);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*attendOutcome* :");
  		auditStr.append(attendOutcome);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*apptDate* :");
  		auditStr.append(apptDate);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*age* :");
  		auditStr.append(age);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*earliestOfferDate* :");
  		auditStr.append(earliestOfferDate);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*serialNumber* :");
  		auditStr.append(serialNumber);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*nHSServiceAgreeNum* :");
  		auditStr.append(nHSServiceAgreeNum);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*providerRefNum* :");
  		auditStr.append(providerRefNum);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*commissionerRefNum* :");
  		auditStr.append(commissionerRefNum);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*orgCodeProvider* :");
  		auditStr.append(orgCodeProvider);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*orgCodeCommissioner* :");
  		auditStr.append(orgCodeCommissioner);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*oPCSProcedure* :");
  		if (oPCSProcedure != null)
  		{
  		int i43=0;
  		for (i43=0; i43<oPCSProcedure.size(); i43++)
  		{
  			if (i43 > 0)
  				auditStr.append(",");
  			ims.core.cds.domain.objects.CDSProcedureDetails obj = (ims.core.cds.domain.objects.CDSProcedureDetails)oPCSProcedure.get(i43);
  		    if (obj != null)
  			{
  				if (i43 == 0)
  				{
  				auditStr.append(toShortClassName(obj));
  				auditStr.append("[");
  				}
  		        auditStr.append(obj.getId());
  			}
  		}
  		if (i43 > 0)
  			auditStr.append("] " + i43);
  		}
  	    auditStr.append("; ");
  		auditStr.append("\r\n*rEADProcedure* :");
  		if (rEADProcedure != null)
  		{
  			auditStr.append(toShortClassName(rEADProcedure));
  				
  		    auditStr.append(rEADProcedure.getId());
  		}
  	    auditStr.append("; ");
  		auditStr.append("\r\n*locationClass* :");
  		auditStr.append(locationClass);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*siteCodeTreatment* :");
  		auditStr.append(siteCodeTreatment);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*gPCode* :");
  		auditStr.append(gPCode);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*practiceCode* :");
  		auditStr.append(practiceCode);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*priorityType* :");
  		auditStr.append(priorityType);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*serviceTypeReq* :");
  		auditStr.append(serviceTypeReq);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*referralSource* :");
  		auditStr.append(referralSource);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*referralReceivedDate* :");
  		auditStr.append(referralReceivedDate);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*referrerCode* :");
  		auditStr.append(referrerCode);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*orgCodeReferrer* :");
  		auditStr.append(orgCodeReferrer);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*lastDNACancelDate* :");
  		auditStr.append(lastDNACancelDate);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*resourceGrpCode* :");
  		auditStr.append(resourceGrpCode);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*resourceGPVersion* :");
  		auditStr.append(resourceGPVersion);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*procedureScheme* :");
  		auditStr.append(procedureScheme);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*hrgDominantGrouping* :");
  		auditStr.append(hrgDominantGrouping);
  	    auditStr.append("; ");
  		auditStr.append("\r\n*appointmentId* :");
  		auditStr.append(appointmentId);
  	    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 = "CDSOutpatient";
  		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)
  	{
  		StringBuffer sb = new StringBuffer();
  		if (this.getCDSApplicableDate() != null)
  		{
  			sb.append("<cDSApplicableDate>");
  			sb.append(new ims.framework.utils.DateTime(this.getCDSApplicableDate()).toString(ims.framework.utils.DateTimeFormat.MILLI));
  			sb.append("</cDSApplicableDate>");		
  		}
  		if (this.getCDSSenderOrgCode() != null)
  		{
  			sb.append("<cDSSenderOrgCode>");
  			sb.append(ims.framework.utils.StringUtils.encodeXML(this.getCDSSenderOrgCode().toString()));
  			sb.append("</cDSSenderOrgCode>");		
  		}
  		if (this.getUBRN() != null)
  		{
  			sb.append("<uBRN>");
  			sb.append(ims.framework.utils.StringUtils.encodeXML(this.getUBRN().toString()));
  			sb.append("</uBRN>");		
  		}
  		if (this.getPathwayIdentifier() != null)
  		{
  			sb.append("<pathwayIdentifier>");
  			sb.append(ims.framework.utils.StringUtils.encodeXML(this.getPathwayIdentifier().toString()));
  			sb.append("</pathwayIdentifier>");		
  		}
  		if (this.getPathwayOrgCode() != null)
  		{
  			sb.append("<pathwayOrgCode>");
  			sb.append(ims.framework.utils.StringUtils.encodeXML(this.getPathwayOrgCode().toString()));
  			sb.append("</pathwayOrgCode>");		
  		}
  		if (this.getReferralToTreatmentStatus() != null)
  		{
  			sb.append("<referralToTreatmentStatus>");
  			sb.append(ims.framework.utils.StringUtils.encodeXML(this.getReferralToTreatmentStatus().toString()));
  			sb.append("</referralToTreatmentStatus>");		
  		}
  		if (this.getRTTStartDate() != null)
  		{
  			sb.append("<rTTStartDate>");
  			sb.append(new ims.framework.utils.DateTime(this.getRTTStartDate()).toString(ims.framework.utils.DateTimeFormat.MILLI));
  			sb.append("</rTTStartDate>");		
  		}
  		if (this.getRTTEndDate() != null)
  		{
  			sb.append("<rTTEndDate>");
  			sb.append(new ims.framework.utils.DateTime(this.getRTTEndDate()).toString(ims.framework.utils.DateTimeFormat.MILLI));
  			sb.append("</rTTEndDate>");		
  		}
  		if (this.getLeadCareActInd() != null)
  		{
  			sb.append("<leadCareActInd>");
  			sb.append(ims.framework.utils.StringUtils.encodeXML(this.getLeadCareActInd().toString()));
  			sb.append("</leadCareActInd>");		
  		}
  		if (this.getLocalPatientIdentifier() != null)
  		{
  			sb.append("<localPatientIdentifier>");
  			sb.append(ims.framework.utils.StringUtils.encodeXML(this.getLocalPatientIdentifier().toString()));
  			sb.append("</localPatientIdentifier>");		
  		}
  		if (this.getPatIdOrgCode() != null)
  		{
  			sb.append("<patIdOrgCode>");
  			sb.append(ims.framework.utils.StringUtils.encodeXML(this.getPatIdOrgCode().toString()));
  			sb.append("</patIdOrgCode>");		
  		}
  		if (this.getNHSNumber() != null)
  		{
  			sb.append("<nHSNumber>");
  			sb.append(ims.framework.utils.StringUtils.encodeXML(this.getNHSNumber().toString()));
  			sb.append("</nHSNumber>");		
  		}
  		if (this.getNHSNumberStatusInd() != null)
  		{
  			sb.append("<nHSNumberStatusInd>");
  			sb.append(ims.framework.utils.StringUtils.encodeXML(this.getNHSNumberStatusInd().toString()));
  			sb.append("</nHSNumberStatusInd>");		
  		}
  		if (this.getPatientName() != null)
  		{
  			sb.append("<patientName>");
  			sb.append(ims.framework.utils.StringUtils.encodeXML(this.getPatientName().toString()));
  			sb.append("</patientName>");		
  		}
  		if (this.getPatientAddress() != null)
  		{
  			sb.append("<patientAddress>");
  			sb.append(ims.framework.utils.StringUtils.encodeXML(this.getPatientAddress().toString()));
  			sb.append("</patientAddress>");		
  		}
  		if (this.getPostCode() != null)
  		{
  			sb.append("<postCode>");
  			sb.append(ims.framework.utils.StringUtils.encodeXML(this.getPostCode().toString()));
  			sb.append("</postCode>");		
  		}
  		if (this.getPCTOrgCode() != null)
  		{
  			sb.append("<pCTOrgCode>");
  			sb.append(ims.framework.utils.StringUtils.encodeXML(this.getPCTOrgCode().toString()));
  			sb.append("</pCTOrgCode>");		
  		}
  		if (this.getDateOfBirth() != null)
  		{
  			sb.append("<dateOfBirth>");
  			sb.append(new ims.framework.utils.DateTime(this.getDateOfBirth()).toString(ims.framework.utils.DateTimeFormat.MILLI));
  			sb.append("</dateOfBirth>");		
  		}
  		if (this.getPersonGender() != null)
  		{
  			sb.append("<personGender>");
  			sb.append(ims.framework.utils.StringUtils.encodeXML(this.getPersonGender().toString()));
  			sb.append("</personGender>");		
  		}
  		if (this.getCarerSupportInd() != null)
  		{
  			sb.append("<carerSupportInd>");
  			sb.append(ims.framework.utils.StringUtils.encodeXML(this.getCarerSupportInd().toString()));
  			sb.append("</carerSupportInd>");		
  		}
  		if (this.getEthnicCategory() != null)
  		{
  			sb.append("<ethnicCategory>");
  			sb.append(ims.framework.utils.StringUtils.encodeXML(this.getEthnicCategory().toString()));
  			sb.append("</ethnicCategory>");		
  		}
  		if (this.getConsultantCode() != null)
  		{
  			sb.append("<consultantCode>");
  			sb.append(ims.framework.utils.StringUtils.encodeXML(this.getConsultantCode().toString()));
  			sb.append("</consultantCode>");		
  		}
  		if (this.getSpecialtyCode() != null)
  		{
  			sb.append("<specialtyCode>");
  			sb.append(ims.framework.utils.StringUtils.encodeXML(this.getSpecialtyCode().toString()));
  			sb.append("</specialtyCode>");		
  		}
  		if (this.getTreatmentFuncCode() != null)
  		{
  			sb.append("<treatmentFuncCode>");
  			sb.append(ims.framework.utils.StringUtils.encodeXML(this.getTreatmentFuncCode().toString()));
  			sb.append("</treatmentFuncCode>");		
  		}
  		if (this.getICDDiagGroup() != null)
  		{
  			if (this.getICDDiagGroup().size() > 0 )
  			{
  			sb.append("<iCDDiagGroup>");
  			sb.append(ims.domain.DomainObject.toXMLString(this.getICDDiagGroup(), domMap));
  			sb.append("</iCDDiagGroup>");		
  			}
  		}
  		if (this.getReadDiagGroup() != null)
  		{
  			sb.append("<readDiagGroup>");
  			sb.append(this.getReadDiagGroup().toXMLString(domMap)); 	
  			sb.append("</readDiagGroup>");		
  		}
  		if (this.getAttendanceIdentifier() != null)
  		{
  			sb.append("<attendanceIdentifier>");
  			sb.append(ims.framework.utils.StringUtils.encodeXML(this.getAttendanceIdentifier().toString()));
  			sb.append("</attendanceIdentifier>");		
  		}
  		if (this.getAdminCategory() != null)
  		{
  			sb.append("<adminCategory>");
  			sb.append(ims.framework.utils.StringUtils.encodeXML(this.getAdminCategory().toString()));
  			sb.append("</adminCategory>");		
  		}
  		if (this.getAttendedOrDNA() != null)
  		{
  			sb.append("<attendedOrDNA>");
  			sb.append(ims.framework.utils.StringUtils.encodeXML(this.getAttendedOrDNA().toString()));
  			sb.append("</attendedOrDNA>");		
  		}
  		if (this.getFirstAttendance() != null)
  		{
  			sb.append("<firstAttendance>");
  			sb.append(ims.framework.utils.StringUtils.encodeXML(this.getFirstAttendance().toString()));
  			sb.append("</firstAttendance>");		
  		}
  		if (this.getMedStaffType() != null)
  		{
  			sb.append("<medStaffType>");
  			sb.append(ims.framework.utils.StringUtils.encodeXML(this.getMedStaffType().toString()));
  			sb.append("</medStaffType>");		
  		}
  		if (this.getOperationStatus() != null)
  		{
  			sb.append("<operationStatus>");
  			sb.append(ims.framework.utils.StringUtils.encodeXML(this.getOperationStatus().toString()));
  			sb.append("</operationStatus>");		
  		}
  		if (this.getAttendOutcome() != null)
  		{
  			sb.append("<attendOutcome>");
  			sb.append(ims.framework.utils.StringUtils.encodeXML(this.getAttendOutcome().toString()));
  			sb.append("</attendOutcome>");		
  		}
  		if (this.getApptDate() != null)
  		{
  			sb.append("<apptDate>");
  			sb.append(new ims.framework.utils.DateTime(this.getApptDate()).toString(ims.framework.utils.DateTimeFormat.MILLI));
  			sb.append("</apptDate>");		
  		}
  		if (this.getAge() != null)
  		{
  			sb.append("<age>");
  			sb.append(ims.framework.utils.StringUtils.encodeXML(this.getAge().toString()));
  			sb.append("</age>");		
  		}
  		if (this.getEarliestOfferDate() != null)
  		{
  			sb.append("<earliestOfferDate>");
  			sb.append(new ims.framework.utils.DateTime(this.getEarliestOfferDate()).toString(ims.framework.utils.DateTimeFormat.MILLI));
  			sb.append("</earliestOfferDate>");		
  		}
  		if (this.getSerialNumber() != null)
  		{
  			sb.append("<serialNumber>");
  			sb.append(ims.framework.utils.StringUtils.encodeXML(this.getSerialNumber().toString()));
  			sb.append("</serialNumber>");		
  		}
  		if (this.getNHSServiceAgreeNum() != null)
  		{
  			sb.append("<nHSServiceAgreeNum>");
  			sb.append(ims.framework.utils.StringUtils.encodeXML(this.getNHSServiceAgreeNum().toString()));
  			sb.append("</nHSServiceAgreeNum>");		
  		}
  		if (this.getProviderRefNum() != null)
  		{
  			sb.append("<providerRefNum>");
  			sb.append(ims.framework.utils.StringUtils.encodeXML(this.getProviderRefNum().toString()));
  			sb.append("</providerRefNum>");		
  		}
  		if (this.getCommissionerRefNum() != null)
  		{
  			sb.append("<commissionerRefNum>");
  			sb.append(ims.framework.utils.StringUtils.encodeXML(this.getCommissionerRefNum().toString()));
  			sb.append("</commissionerRefNum>");		
  		}
  		if (this.getOrgCodeProvider() != null)
  		{
  			sb.append("<orgCodeProvider>");
  			sb.append(ims.framework.utils.StringUtils.encodeXML(this.getOrgCodeProvider().toString()));
  			sb.append("</orgCodeProvider>");		
  		}
  		if (this.getOrgCodeCommissioner() != null)
  		{
  			sb.append("<orgCodeCommissioner>");
  			sb.append(ims.framework.utils.StringUtils.encodeXML(this.getOrgCodeCommissioner().toString()));
  			sb.append("</orgCodeCommissioner>");		
  		}
  		if (this.getOPCSProcedure() != null)
  		{
  			if (this.getOPCSProcedure().size() > 0 )
  			{
  			sb.append("<oPCSProcedure>");
  			sb.append(ims.domain.DomainObject.toXMLString(this.getOPCSProcedure(), domMap));
  			sb.append("</oPCSProcedure>");		
  			}
  		}
  		if (this.getREADProcedure() != null)
  		{
  			sb.append("<rEADProcedure>");
  			sb.append(this.getREADProcedure().toXMLString(domMap)); 	
  			sb.append("</rEADProcedure>");		
  		}
  		if (this.getLocationClass() != null)
  		{
  			sb.append("<locationClass>");
  			sb.append(ims.framework.utils.StringUtils.encodeXML(this.getLocationClass().toString()));
  			sb.append("</locationClass>");		
  		}
  