gt: 			IReportField[] fields = new IReportField[144];
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 by Barbara Worwood using IMS Development Environment (version 1.80 build 5589.25814)
  // Copyright (C) 1995-2015 IMS MAXIMS. All rights reserved.
  // WARNING: DO NOT MODIFY the content of this file
  
  package ims.RefMan.forms.newonwardreferral;
  
  import ims.framework.*;
  import ims.framework.controls.*;
  import ims.framework.enumerations.*;
  import ims.framework.utils.RuntimeAnchoring;
  
  public class GenForm extends FormBridge
  {
  	private static final long serialVersionUID = 1L;
  
  	public boolean canProvideData(IReportSeed[] reportSeeds)
  	{
  		return new ReportDataProvider(reportSeeds, this.getFormReportFields()).canProvideData();
  	}
  	public boolean hasData(IReportSeed[] reportSeeds)
  	{
  		return new ReportDataProvider(reportSeeds, this.getFormReportFields()).hasData();
  	}
  	public IReportField[] getData(IReportSeed[] reportSeeds)
  	{
  		return getData(reportSeeds, false);
  	}
  	public IReportField[] getData(IReportSeed[] reportSeeds, boolean excludeNulls)
  	{
  		return new ReportDataProvider(reportSeeds, this.getFormReportFields(), excludeNulls).getData();
  	}
  	public static class cmbOnwardreferralReasonComboBox extends ComboBoxBridge
  	{
  		private static final long serialVersionUID = 1L;
  		
  		public void newRow(ims.RefMan.vo.lookups.OnwardReferralReason value, String text)
  		{
  			super.control.newRow(value, text);
  		}
  		public void newRow(ims.RefMan.vo.lookups.OnwardReferralReason value, String text, ims.framework.utils.Image image)
  		{
  			super.control.newRow(value, text, image);
  		}
  		public void newRow(ims.RefMan.vo.lookups.OnwardReferralReason value, String text, ims.framework.utils.Color textColor)
  		{
  			super.control.newRow(value, text, textColor);
  		}
  		public void newRow(ims.RefMan.vo.lookups.OnwardReferralReason value, String text, ims.framework.utils.Image image, ims.framework.utils.Color textColor)
  		{
  			super.control.newRow(value, text, image, textColor);
  		}
  		public boolean removeRow(ims.RefMan.vo.lookups.OnwardReferralReason value)
  		{
  			return super.control.removeRow(value);
  		}
  		public ims.RefMan.vo.lookups.OnwardReferralReason getValue()
  		{
  			return (ims.RefMan.vo.lookups.OnwardReferralReason)super.control.getValue();
  		}
  		public void setValue(ims.RefMan.vo.lookups.OnwardReferralReason value)
  		{
  			super.control.setValue(value);
  		}
  	}
  	public static class cmbOnwardReferralOrganisationComboBox extends ComboBoxBridge
  	{
  		private static final long serialVersionUID = 1L;
  		
  		public void newRow(ims.core.vo.OrgLiteVo value, String text)
  		{
  			super.control.newRow(value, text);
  		}
  		public void newRow(ims.core.vo.OrgLiteVo value, String text, ims.framework.utils.Image image)
  		{
  			super.control.newRow(value, text, image);
  		}
  		public void newRow(ims.core.vo.OrgLiteVo value, String text, ims.framework.utils.Color textColor)
  		{
  			super.control.newRow(value, text, textColor);
  		}
  		public void newRow(ims.core.vo.OrgLiteVo value, String text, ims.framework.utils.Image image, ims.framework.utils.Color textColor)
  		{
  			super.control.newRow(value, text, image, textColor);
  		}
  		public boolean removeRow(ims.core.vo.OrgLiteVo value)
  		{
  			return super.control.removeRow(value);
  		}
  		public ims.core.vo.OrgLiteVo getValue()
  		{
  			return (ims.core.vo.OrgLiteVo)super.control.getValue();
  		}
  		public void setValue(ims.core.vo.OrgLiteVo value)
  		{
  			super.control.setValue(value);
  		}
  	}
  	private void validateContext(ims.framework.Context context)
  	{
  		if(context == null)
  			return;
  		if(!context.isValidContextType(ims.RefMan.vo.CatsReferralRefVo.class))
  			throw new ims.framework.exceptions.CodingRuntimeException("The type 'ims.RefMan.vo.CatsReferralRefVo' of the global context variable 'RefMan.CatsReferral' is not supported.");
  	}
  	private void validateMandatoryContext(Context context)
  	{
  		if(new ims.framework.ContextVariable("RefMan.CatsReferral", "_cvp_RefMan.CatsReferral").getValueIsNull(context))
  			throw new ims.framework.exceptions.FormMandatoryContextMissingException("The required context data 'RefMan.CatsReferral' is not available.");
  	}
  	public boolean supportsRecordedInError()
  	{
  		return false;
  	}
  	public ims.vo.ValueObject getRecordedInErrorVo()
  	{
  		return null;
  	}
  	protected void setContext(FormLoader loader, Form form, ims.framework.interfaces.IAppForm appForm, UIFactory factory, Context context) throws Exception
  	{
  		setContext(loader, form, appForm, factory, context, Boolean.FALSE, new Integer(0), null, null, new Integer(0));
  	}
  	protected void setContext(FormLoader loader, Form form, ims.framework.interfaces.IAppForm appForm, UIFactory factory, Context context, Boolean skipContextValidation) throws Exception
  	{
  		setContext(loader, form, appForm, factory, context, skipContextValidation, new Integer(0), null, null, new Integer(0));
  	}
  	protected void setContext(FormLoader loader, Form form, ims.framework.interfaces.IAppForm appForm, UIFactory factory, ims.framework.Context context, Boolean skipContextValidation, Integer startControlID, ims.framework.utils.SizeInfo runtimeSize, ims.framework.Control control, Integer startTabIndex) throws Exception
  	{
  		if(loader == null); // this is to avoid eclipse warning only.
  		if(factory == null); // this is to avoid eclipse warning only.
  		if(runtimeSize == null); // this is to avoid eclipse warning only.
  		if(appForm == null)
  			throw new RuntimeException("Invalid application form");
  		if(startControlID == null)
  			throw new RuntimeException("Invalid startControlID");
  		if(control == null); // this is to avoid eclipse warning only.
  		if(startTabIndex == null)
  			throw new RuntimeException("Invalid startTabIndex");
  		this.context = context;
  		this.componentIdentifier = startControlID.toString();
  		this.formInfo = form.getFormInfo();
  		this.globalContext = new GlobalContext(context);
  	
  		if(skipContextValidation == null || !skipContextValidation.booleanValue())
  		{
  			validateContext(context);
  			validateMandatoryContext(context);
  		}
  	
  		super.setContext(form);
  
  		ims.framework.utils.SizeInfo designSize = new ims.framework.utils.SizeInfo(440, 224);
  		if(runtimeSize == null)
  			runtimeSize = designSize;
  		form.setWidth(runtimeSize.getWidth());
  		form.setHeight(runtimeSize.getHeight());
  		super.setGlobalContext(ContextBridgeFlyweightFactory.getInstance().create(GlobalContextBridge.class, context, false));
  
  
  		// Label Controls
  		RuntimeAnchoring anchoringHelper1 = new RuntimeAnchoring(designSize, runtimeSize, 16, 114, 148, 17, ims.framework.enumerations.ControlAnchoring.TOPLEFT);
  		super.addControl(factory.getControl(Label.class, new Object[] { control, new Integer(startControlID.intValue() + 1000), new Integer(anchoringHelper1.getX()), new Integer(anchoringHelper1.getY()), new Integer(anchoringHelper1.getWidth()), new Integer(anchoringHelper1.getHeight()), ControlState.UNKNOWN, ControlState.UNKNOWN, ims.framework.enumerations.ControlAnchoring.TOPLEFT, "Onward Referral Reason:", new Integer(1), null, new Integer(0)}));
  		RuntimeAnchoring anchoringHelper2 = new RuntimeAnchoring(designSize, runtimeSize, 16, 90, 175, 17, ims.framework.enumerations.ControlAnchoring.TOPLEFT);
  		super.addControl(factory.getControl(Label.class, new Object[] { control, new Integer(startControlID.intValue() + 1001), new Integer(anchoringHelper2.getX()), new Integer(anchoringHelper2.getY()), new Integer(anchoringHelper2.getWidth()), new Integer(anchoringHelper2.getHeight()), ControlState.UNKNOWN, ControlState.UNKNOWN, ims.framework.enumerations.ControlAnchoring.TOPLEFT, "Onward Referral Instructions:", new Integer(1), null, new Integer(0)}));
  		RuntimeAnchoring anchoringHelper3 = new RuntimeAnchoring(designSize, runtimeSize, 16, 66, 179, 17, ims.framework.enumerations.ControlAnchoring.TOPLEFT);
  		super.addControl(factory.getControl(Label.class, new Object[] { control, new Integer(startControlID.intValue() + 1002), new Integer(anchoringHelper3.getX()), new Integer(anchoringHelper3.getY()), new Integer(anchoringHelper3.getWidth()), new Integer(anchoringHelper3.getHeight()), ControlState.UNKNOWN, ControlState.UNKNOWN, ims.framework.enumerations.ControlAnchoring.TOPLEFT, "Onward Referral Organisation:", new Integer(1), null, new Integer(0)}));
  		RuntimeAnchoring anchoringHelper4 = new RuntimeAnchoring(designSize, runtimeSize, 16, 42, 95, 17, ims.framework.enumerations.ControlAnchoring.TOPLEFT);
  		super.addControl(factory.getControl(Label.class, new Object[] { control, new Integer(startControlID.intValue() + 1003), new Integer(anchoringHelper4.getX()), new Integer(anchoringHelper4.getY()), new Integer(anchoringHelper4.getWidth()), new Integer(anchoringHelper4.getHeight()), ControlState.UNKNOWN, ControlState.UNKNOWN, ims.framework.enumerations.ControlAnchoring.TOPLEFT, "Discharge Date:", new Integer(1), null, new Integer(0)}));
  
  		// Button Controls
  		RuntimeAnchoring anchoringHelper5 = new RuntimeAnchoring(designSize, runtimeSize, 349, 184, 75, 23, ims.framework.enumerations.ControlAnchoring.BOTTOMRIGHT);
  		super.addControl(factory.getControl(Button.class, new Object[] { control, new Integer(startControlID.intValue() + 1004), new Integer(anchoringHelper5.getX()), new Integer(anchoringHelper5.getY()), new Integer(anchoringHelper5.getWidth()), new Integer(anchoringHelper5.getHeight()), new Integer(startTabIndex.intValue() + 6), ControlState.UNKNOWN, ControlState.UNKNOWN, ims.framework.enumerations.ControlAnchoring.BOTTOMRIGHT, "Cancel", Boolean.FALSE, null, Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, null, ims.framework.utils.Color.Default, ims.framework.utils.Color.Default }));
  		RuntimeAnchoring anchoringHelper6 = new RuntimeAnchoring(designSize, runtimeSize, 272, 184, 75, 23, ims.framework.enumerations.ControlAnchoring.BOTTOMRIGHT);
  		super.addControl(factory.getControl(Button.class, new Object[] { control, new Integer(startControlID.intValue() + 1005), new Integer(anchoringHelper6.getX()), new Integer(anchoringHelper6.getY()), new Integer(anchoringHelper6.getWidth()), new Integer(anchoringHelper6.getHeight()), new Integer(startTabIndex.intValue() + 5), ControlState.UNKNOWN, ControlState.UNKNOWN, ims.framework.enumerations.ControlAnchoring.BOTTOMRIGHT, "Save", Boolean.FALSE, null, Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, null, ims.framework.utils.Color.Default, ims.framework.utils.Color.Default }));
  
  		// TextBox Controls
  		RuntimeAnchoring anchoringHelper7 = new RuntimeAnchoring(designSize, runtimeSize, 200, 88, 224, 21, ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT);
  		super.addControl(factory.getControl(TextBox.class, new Object[] { control, new Integer(startControlID.intValue() + 1006), new Integer(anchoringHelper7.getX()), new Integer(anchoringHelper7.getY()), new Integer(anchoringHelper7.getWidth()), new Integer(anchoringHelper7.getHeight()), new Integer(startTabIndex.intValue() + 3), ControlState.DISABLED, ControlState.ENABLED, ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT,Boolean.FALSE, new Integer(3000), Boolean.TRUE, Boolean.FALSE, null, null, Boolean.TRUE, ims.framework.enumerations.CharacterCasing.NORMAL, ims.framework.enumerations.TextTrimming.NONE, "", ""}));
  
  		// Date Controls
  		RuntimeAnchoring anchoringHelper8 = new RuntimeAnchoring(designSize, runtimeSize, 200, 40, 224, 20, ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT);
  		super.addControl(factory.getControl(DateControl.class, new Object[] { control, new Integer(startControlID.intValue() + 1007), new Integer(anchoringHelper8.getX()), new Integer(anchoringHelper8.getY()), new Integer(anchoringHelper8.getWidth()), new Integer(anchoringHelper8.getHeight()), new Integer(startTabIndex.intValue() + 1), ControlState.DISABLED, ControlState.ENABLED, ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT,Boolean.TRUE, null, Boolean.FALSE, null, Boolean.TRUE, null}));
  
  		// ComboBox Controls
  		RuntimeAnchoring anchoringHelper9 = new RuntimeAnchoring(designSize, runtimeSize, 200, 112, 224, 21, ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT);
  		ComboBox m_cmbOnwardreferralReasonTemp = (ComboBox)factory.getControl(ComboBox.class, new Object[] { control, new Integer(startControlID.intValue() + 1008), new Integer(anchoringHelper9.getX()), new Integer(anchoringHelper9.getY()), new Integer(anchoringHelper9.getWidth()), new Integer(anchoringHelper9.getHeight()), new Integer(startTabIndex.intValue() + 4), ControlState.DISABLED, ControlState.ENABLED,ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT ,Boolean.TRUE, Boolean.FALSE, SortOrder.NONE, Boolean.FALSE, new Integer(1), null, Boolean.TRUE, new Integer(-1)});
  		addControl(m_cmbOnwardreferralReasonTemp);
  		cmbOnwardreferralReasonComboBox cmbOnwardreferralReason = (cmbOnwardreferralReasonComboBox)ComboBoxFlyweightFactory.getInstance().createComboBoxBridge(cmbOnwardreferralReasonComboBox.class, m_cmbOnwardreferralReasonTemp);
  		super.addComboBox(cmbOnwardreferralReason);
  		RuntimeAnchoring anchoringHelper10 = new RuntimeAnchoring(designSize, runtimeSize, 200, 64, 224, 21, ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT);
  		ComboBox m_cmbOnwardReferralOrganisationTemp = (ComboBox)factory.getControl(ComboBox.class, new Object[] { control, new Integer(startControlID.intValue() + 1009), new Integer(anchoringHelper10.getX()), new Integer(anchoringHelper10.getY()), new Integer(anchoringHelper10.getWidth()), new Integer(anchoringHelper10.getHeight()), new Integer(startTabIndex.intValue() + 2), ControlState.DISABLED, ControlState.ENABLED,ims.framework.enumerations.ControlAnchoring.TOPLEFTRIGHT ,Boolean.TRUE, Boolean.FALSE, SortOrder.NONE, Boolean.FALSE, new Integer(1), null, Boolean.FALSE, new Integer(-1)});
  		addControl(m_cmbOnwardReferralOrganisationTemp);
  		cmbOnwardReferralOrganisationComboBox cmbOnwardReferralOrganisation = (cmbOnwardReferralOrganisationComboBox)ComboBoxFlyweightFactory.getInstance().createComboBoxBridge(cmbOnwardReferralOrganisationComboBox.class, m_cmbOnwardReferralOrganisationTemp);
  		super.addComboBox(cmbOnwardReferralOrganisation);
  	}
  
  
  	public Button btnCancel()
  	{
  		return (Button)super.getControl(4);
  	}
  	public Button btnSave()
  	{
  		return (Button)super.getControl(5);
  	}
  	public TextBox txtOnwardReferralInstructions()
  	{
  		return (TextBox)super.getControl(6);
  	}
  	public DateControl dteDischargeDate()
  	{
  		return (DateControl)super.getControl(7);
  	}
  	public cmbOnwardreferralReasonComboBox cmbOnwardreferralReason()
  	{
  		return (cmbOnwardreferralReasonComboBox)super.getComboBox(0);
  	}
  	public cmbOnwardReferralOrganisationComboBox cmbOnwardReferralOrganisation()
  	{
  		return (cmbOnwardReferralOrganisationComboBox)super.getComboBox(1);
  	}
  	public GlobalContext getGlobalContext()
  	{
  		return this.globalContext;
  	}
  	public static class GlobalContextBridge extends ContextBridge
  	{
  		private static final long serialVersionUID = 1L;
  	}
  	private IReportField[] getFormReportFields()
  	{
  		if(this.context == null)
  			return null;
  		if(this.reportFields == null)
  			this.reportFields = new ReportFields(this.context, this.formInfo, this.componentIdentifier).getReportFields();
  		return this.reportFields;
  	}
  	private class ReportFields
  	{
  		public ReportFields(Context context, ims.framework.FormInfo formInfo, String componentIdentifier)
  		{
  			this.context = context;
  			this.formInfo = formInfo;
  			this.componentIdentifier = componentIdentifier;
  		}
  		public IReportField[] getReportFields()
  		{
  			String prefix = formInfo.getLocalVariablesPrefix();
  