/FileExtraction/Java_unseen/IMS-MAXIMS_openMAXIMS/Source Library/openmaxims_workspace/ValueObjects/src/ims/clinical/vo/lookups/TTAStatus.java
//#############################################################################
//#                                                                           #
//#  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.clinical.vo.lookups;

import ims.framework.cn.data.TreeNode;
import java.util.ArrayList;
import ims.framework.utils.Image;
import ims.framework.utils.Color;

public class TTAStatus extends ims.vo.LookupInstVo implements TreeNode
{
	private static final long serialVersionUID = 1L;

	public TTAStatus()
	{
		super();
	}
	public TTAStatus(int id)
	{
		super(id, "", true);
	}
	public TTAStatus(int id, String text, boolean active)
	{
		super(id, text, active, null, null, null);
	}
	public TTAStatus(int id, String text, boolean active, TTAStatus parent, Image image)
	{
		super(id, text, active, parent, image);
	}
	public TTAStatus(int id, String text, boolean active, TTAStatus parent, Image image, Color color)
	{
		super(id, text, active, parent, image, color);
	}
	public TTAStatus(int id, String text, boolean active, TTAStatus parent, Image image, Color color, int order)
	{
		super(id, text, active, parent, image, color, order);
	}
	public static TTAStatus buildLookup(ims.vo.LookupInstanceBean bean)
	{
		return new TTAStatus(bean.getId(), bean.getText(), bean.isActive());
	}
	public String toString()
	{
		if(getText() != null)
			return getText();
		return "";
	}
	public TreeNode getParentNode()
	{
		return (TTAStatus)super.getParentInstance();
	}
	public TTAStatus getParent()
	{
		return (TTAStatus)super.getParentInstance();
	}
	public void setParent(TTAStatus parent)
	{
		super.setParentInstance(parent);
	}
	public TreeNode[] getChildren()
	{
		ArrayList children = super.getChildInstances();
		TTAStatus[] typedChildren = new TTAStatus[children.size()];
		for (int i = 0; i < children.size(); i++)
		{
			typedChildren[i] = (TTAStatus)children.get(i);
		}
		return typedChildren;
	}
	public int addChild(TreeNode child)
	{
		if (child instanceof TTAStatus)
		{
			super.addChild((TTAStatus)child);
		}
		return super.getChildInstances().size();
	}
	public int removeChild(TreeNode child)
	{
		if (child instanceof TTAStatus)
		{
			super.removeChild((TTAStatus)child);
		}
		return super.getChildInstances().size();
	}
	public Image getExpandedImage()
	{
		return super.getImage();
	}
	public Image getCollapsedImage()
	{
		return super.getImage();
	}
	public static ims.framework.IItemCollection getNegativeInstancesAsIItemCollection()
	{
		TTAStatusCollection result = new TTAStatusCollection();
		result.add(DRAFT);
		result.add(SUBMITTED);
		result.add(APPROVED);
		result.add(REJECTED);
		result.add(RESUBMITTED);
		result.add(SUSPENDED);
		result.add(TTA_DOCKET_PRINTED);
		result.add(AWAITING_DISPENSING);
		result.add(AWAITING_FINAL_CHECKS);
		result.add(COMPLETED);
		result.add(NOT_REQUIRED);
		return result;
	}
	public static TTAStatus[] getNegativeInstances()
	{
		TTAStatus[] instances = new TTAStatus[11];
		instances[0] = DRAFT;
		instances[1] = SUBMITTED;
		instances[2] = APPROVED;
		instances[3] = REJECTED;
		instances[4] = RESUBMITTED;
		instances[5] = SUSPENDED;
		instances[6] = TTA_DOCKET_PRINTED;
		instances[7] = AWAITING_DISPENSING;
		instances[8] = AWAITING_FINAL_CHECKS;
		instances[9] = COMPLETED;
		instances[10] = NOT_REQUIRED;
		return instances;
	}
	public static String[] getNegativeInstanceNames()
	{
		String[] negativeInstances = new String[11];
		negativeInstances[0] = "DRAFT";
		negativeInstances[1] = "SUBMITTED";
		negativeInstances[2] = "APPROVED";
		negativeInstances[3] = "REJECTED";
		negativeInstances[4] = "RESUBMITTED";
		negativeInstances[5] = "SUSPENDED";
		negativeInstances[6] = "TTA_DOCKET_PRINTED";
		negativeInstances[7] = "AWAITING_DISPENSING";
		negativeInstances[8] = "AWAITING_FINAL_CHECKS";
		negativeInstances[9] = "COMPLETED";
		negativeInstances[10] = "NOT_REQUIRED";
		return negativeInstances;
	}
	public static TTAStatus getNegativeInstance(String name)
	{
		if(name == null)
			return null;
		String[] negativeInstances = getNegativeInstanceNames();
		for (int i = 0; i < negativeInstances.length; i++)
		{
			if(negativeInstances[i].equals(name))
				return getNegativeInstances()[i];
		}
		return null;
	}
	public static TTAStatus getNegativeInstance(Integer id)
	{
		if(id == null)
			return null;
		TTAStatus[] negativeInstances = getNegativeInstances();
		for (int i = 0; i < negativeInstances.length; i++)
		{
			if(negativeInstances[i].getID() == id)
				return negativeInstances[i];
		}
		return null;
	}
	public int getTypeId()
	{
		return TYPE_ID;
	}
	public static final int TYPE_ID = 1231111;
	public static final TTAStatus DRAFT = new TTAStatus(-2066, "Draft", true, null, null, Color.Default);
	public static final TTAStatus SUBMITTED = new TTAStatus(-2067, "Submitted", true, null, null, Color.Default);
	public static final TTAStatus APPROVED = new TTAStatus(-2068, "Approved", true, null, null, Color.Default);
	public static final TTAStatus REJECTED = new TTAStatus(-2069, "Rejected", true, null, null, Color.Default);
	public static final TTAStatus RESUBMITTED = new TTAStatus(-2076, "Re-Submitted", true, null, null, Color.Default);
	public static final TTAStatus SUSPENDED = new TTAStatus(-2071, "Suspended", true, null, null, Color.Default);
	public static final TTAStatus TTA_DOCKET_PRINTED = new TTAStatus(-2072, "TTA Docket Printed", true, null, null, Color.Default);
	public static final TTAStatus AWAITING_DISPENSING = new TTAStatus(-2073, "Awaiting Dispensing", true, null, null, Color.Default);
	public static final TTAStatus AWAITING_FINAL_CHECKS = new TTAStatus(-2074, "Awaiting Final Checks", true, null, null, Color.Default);
	public static final TTAStatus COMPLETED = new TTAStatus(-2075, "Completed", true, null, null, Color.Default);
	public static final TTAStatus NOT_REQUIRED = new TTAStatus(-2084, "Not Required", true, null, null, Color.Default);
}
